#arma3_scripting

1 messages ยท Page 462 of 1

fringe yoke
#

I'd like to be able to run code when they do

fringe yoke
#

I just found that CBA has one as you posted that

still forum
#

what's it called?

fringe yoke
still forum
#

Should replace my crap self-made implementation by the proper CBA one then ๐Ÿ˜„

#

Although no.. I need to know who deleted the marker :/

#

the CBA one just retrieves all markers every frame and checks if anything changed

fringe yoke
#

Does anyone here know how I could find out what the pending module is for a curator?

#

If they select a rifleman from the Create window on the right hand side, can I know they have that selected before they place the unit, or a module, prop, etc.

runic rose
#

@inner swallow setObjectTextureGlobal is (according to the wiki), persistent and JIP compatible, since the F3 loadout script is only ran local to the unit there's no need to use remoteExec - The global command does this all for you. If you were to use 'setObjectTexture' then yes, you would need to use remoteExec.

errant jasper
#

@runic rose , yes but something strange is definitely going on. I have used setObjectTexture, the local variant on CBA init event handlers without problems. But yesterday, on a dedicated server, I had both a setObjectTexture globally applied through init box, and a setObjectTextureGlobal on another unit applied from only server. Neither worked when joining on mission start, unless I spawned a delay, but it worked fine for JIPs.

runic rose
#

Yeah I don't claim to understand it fully. All I can say is that I haven't had any problems when using a delay so I've continued to use that method.

inner swallow
#

Yeah, but what I meant was, at the point you're putting a delay, does it matter if you do it like that or via remoteExec?

#

Since they're both equally reliable

#

(delay + global command Vs no delay but local command + RE with JIP set to true)

runic rose
#

I would expect them both to work, but who really knows without testing. ๐Ÿ˜„

fossil yew
#

Do you know if it's possible to remove the camera in jets completely?

inner swallow
#

Probably via config?

#

@ LSD well, they both work, since I know the RE method works, and you know that the delay method works ๐Ÿ˜„

minor lance
#

any way to move the pistol and ammo to vest via script? witout removing and readding it?

still forum
#

no

unborn ether
#

Is there any way to deliberately check the call time of extension via callExtension?

still forum
#

diag_codePerformance?

#

diag_tickTime

#

what do you mean by deliberately

unborn ether
#

Well arma does that when time is taking more than 2000ms, so just was interested on how to make it by my own.

still forum
#

diag_tickTime before and after the extension call

#

precision will be limited though

wary vine
winter rose
#

you may have to work with safezone and all related stuff

wary vine
#

safezone is used

halcyon crypt
#

if you want the ui to scale with the resolution then use safezone

#

if you want the ui to be the same on all resolutions (as in, smaller on higher resolutions), don't use safezone

#

in A2 anyway ๐Ÿ˜›

#

a before and after screenshot would be useful though

#

if you use safezone you'll have to use it pretty much everywhere

#

x,y,w,h

#

on all controls

wary vine
#

i have done that

#

and its still borked

halcyon crypt
#

I guess the text controls don't scale properly or something

wary vine
#

seems like it

halcyon crypt
#

you should be able to scale font size with safezone as well

wary vine
#

have done that too

#

xD

halcyon crypt
#

hmmmm

wary vine
#

this is why its weird.

#

even my ctrlSetPositions

#

inside scripts are safezones

halcyon crypt
#

can you make a screenshot of it where it's good?

wary vine
#

even better xD

halcyon crypt
#

ok so I guess the edit box is too small for it to contain the text

#

making it get this weird offset

wary vine
#

i created the dialog with small interface

#

he is using normal

halcyon crypt
#

can you post the config?

wary vine
#

umm

#

i can pm you

halcyon crypt
#

sure

late gull
#

yup, it's me again ๐Ÿ˜„

#

someone tell me, the hell i'm doing wrong here

player addAction ["<t color='#00BFFF'> -- Use Earplugs</t>", {
  5 fadeSound 0.5;
  earPlugsOn = true;
}, nil, 0, true, true, "", {!earPlugsOn}, -1, false, "", ""];
cosmic lichen
#

What's not working?

late gull
#
19:09:33 Error in expression <Sound.sqf [SNDC_fnc_FadeSound]"
player addAction [" <t color='#00BFFF'> -- Use >
19:09:33   Error position: <addAction [" <t color='#00BFFF'> -- Use >
19:09:33   Error Type code, expected String
19:09:33 File functions\fn_FadeSound.sqf [SNDC_fnc_FadeSound], line 1
cosmic lichen
#

Well then use "code" instead of {code} maybe then works

late gull
#

ahh dam, it's that?

cosmic lichen
#

Also, make sure earPlugsOn is defined at the begin of the mission, otherwise the condition will fail because the variable doesn't contain a bool but is nil

#

@late gull Dunno, test it

late gull
#

yes, it is defined to false at start

cosmic lichen
#

Good

late gull
#

yes, makes sense what u said, the error it's pointing a bad place

#

yep, thx, the error gone

#

just now showing, but no error xD

winter dune
#

are there any other ways of storing an array as a text datatype inside a db?

still forum
#

Many, way more complicated ways yeah

#

wouldn't recommend

winter dune
#

so the easiest one is text, right?

still forum
#

yeah

#

text can have many different variants though.

winter dune
#

I was searching on w3school and encountered also json

still forum
#

But depends on what you have available. I have a json serializer that I would use

#

json is text

winter dune
#

I'll take the easy road then

slim bobcat
#

can someone point me in the right direction in adding virtual arsenal to wasteland server

still forum
slim bobcat
#

tried that

still forum
#

That IS the way to add virtual arsenal.

#

If it doesn't work then you can give up

slim bobcat
#

but where with in mission file

still forum
#

wherever you need it ยฏ_(ใƒ„)_/ยฏ

slim bobcat
#

yeah thats the bit im stuck on lol

still forum
#

if you want it on a box. Then use the init script of that box

#

If you don't know where you want it then I don't know either

slim bobcat
#

na just as a gear load

#

out

still forum
#

yeah. Arsenal is usually used to load gear..

slim bobcat
#

indeed but its so when you respawn you can enter the virtual arsenal not a box as such

still forum
#

yeah...

#

So you want it on a box then?

#

or any other vehicle?

slim bobcat
#

i tried in the init.sqf that broke stuff lol

still forum
#

If you can't or don't want to tell me where exactly you want it.. I can't help you

slim bobcat
#

so i want it as respawn load out

still forum
#

you want it to open when the player respawns? Once?

slim bobcat
#

i think ccg had it on there wasteland server

#

yes

#

rip ccg

still forum
#
player addEventHandler ["Respawn", {
    ["Open", [true] ] call BIS_fnc_arsenal;
}];

There. Add that to the end of your init script. If you also want it to open when the player joins for the first time then

player addEventHandler ["Respawn", {
    ["Open", [true] ] call BIS_fnc_arsenal;
}];
["Open", [true] ] call BIS_fnc_arsenal;
slim bobcat
#

cool man will try it

peak plover
#

I made a loot spawning system that creates loot around players. https://i.imgur.com/6MUexsI.jpg
It uses a loot table where I can define amount of certain item to spawn. It also caches the loot, so if
I drop an item in the pile and leave and come back it creates the same ones.

There's no way to get attachments off guns and items out of vests/bags, right?
Any other things I should add to this?

still forum
#

There's no way to get attachments off guns and items out of vests/bags, right? correct

#

and items out of vests/bags incorrect.

peak plover
#

๐Ÿค”

peak plover
#

Ohhhhh

still forum
#

you can use these to get the container of the vest/bag and then use the normal cargo commands

peak plover
#

Danke

#

That's hella nice

peak plover
#

I can probably

#

Make attachments work

#

But I need to remake inventory

#

for that

#

If I take the gun apart, that can work

slim bobcat
#

@still forum

#

#11 "Logic" 3:14 [3744,7949,8]

still forum
#

@slim bobcat

#

#123 "Tree" 12:142 [1337,1242,1]

slim bobcat
#

so i guess !="Logic" 3:16 [3745,7947," on line 11 but the wasteland filters are confusing lol

still forum
#

No idea what that's supposed to be

late gull
#

guys, how i do escape characters? i want to escape % inside format[] not working with %

slim bobcat
#

i got a createvehicle restriction #11

#

28.05.2018 19:15:49: morg morgan morgason (127.0.0.1:2322) 554ec544eb97590b2e96e18bfe0934ce - #11 "Logic" 3:14 [3744,7949,8]

still forum
#

"scape"?

#

you mean "escape"?

late gull
#

escape

#

yeah

slim bobcat
#

normally 11 is like line 13 on most filters

still forum
late gull
still forum
#

format should only replace %<number>

slim bobcat
#

the code you gave me for the init works but i get kicked

still forum
#

so as long as you don't have a number it should be fine

slim bobcat
#

kk

late gull
#

it's a number

#
systemChat format["Sound Volume: %1\%", (soundVolume*100)];
slim bobcat
#

// Set everything to 1 if you are using Zeus
// Warning: 128-char limit between double-quotes

// Vehicles

5 "^[BOI]_(?!\d)(T_)?(APC|Heli|(Life)?Boat|LSV|MBT|MRAP|Plane|Quadbike|SDV|Truck|U[AG]V|VTOL)(_|$)" !"_UAV_(AI|01|06)(_|$)" // Allows quadcopter
5 "^[BOI]_(?!\d)(T_)?([HG]MG|Mortar|static_A[AT])_" !"_(weapon|support)_" // Allows disassembly

// Ammo boxes

5 "^Box_" !="Logic\" 3:16 [3745,7947,"
5 "^[CBOI]G?_(T_)?supplyCrate_"
5 "^([BOI]_)?CargoNet_"
5 "^B_Slingload_"

// Civilian & guerilla stuff

5 "^C_" !"_UAV_(AI|01|06)(_|$)" // Comment this line if you need to allow civilian units
// 5 "^C_(IDAP_)?(Hatchback|Heli|Offroad|Plane|Quadbike|(Rubber)?Boat|Scooter|SUV|UGV|Van)(_|$)" // Uncomment this line if line above is commented

5 "^[BOI]_[CG]_" // Comment this line if you need to allow guerilla units
// 5 "^[BOI]_[CG]_(Boat|Heli|Mortar|Offroad|Plane|Quadbike|Van)_" // Uncomment this line if line above is commented

5 "^B_(CTRG|GEN)_" // Comment this line if you need to allow CTRG or gendarmerie units
// 5 "^B_(CTRG|GEN)_(LSV|Heli|Offroad|Van)_" // Uncomment this line if line above is commented

// Buildings & objects

5 "^Land_" !"^Land_(BakedBeans|BarrelEmpty|BottlePlastic|Can(ister(Fuel|Oil))?|CashDesk|Ground_sheet|Money|Sleeping_bag|Suitcase|TentDome)_" !"^Land_(Rope|Tablet)_" !"_(dam|ruins)_F$"

// Game logic (comment these if it causes problems with some addons)

5 "^Lightning"
5 "^Logic"
5 "^Module"

// VR entities (blue/red/green/purple ghosts)

5 "^[CBOI]_Soldier_VR_"
still forum
#

no it's not a number

slim bobcat
#

lol that was alot lol

still forum
#

You posted %

#

that doesn't have a number after it

#

format should only replace the first %1

late gull
#

right, but it's not showing up

still forum
#

the % at the end is not showing up in the output?

late gull
#

yep

still forum
#

How about %%%%?

late gull
still forum
#

or just move the end % outside of the format if it's at the end anyway

late gull
#

how i do that? just + "%" ?

still forum
#

yes

late gull
#

oki, thx, but there should be a way

#

to do that in format direclty

#

or just adding %2, "%" xD

#

not pretty, but maybe work

tough abyss
#

I think I'm having issues passing vars from a trigger to an array; I'm trying to get this statement pass an array for use inside a while loop.

_trg setTriggerStatements ["{typeOf _x == ""CargoNet_01_box_f""} count thislist > 0", "_objinside = thisList", ""];

to be used by this line;

_cnt = "CargoNet_01_box_f" countType _objinside;

I've declared the array & count, what am I missing?

still forum
#

local variables are local.

#

Your script is

_objinside = thisList
late gull
#

is that working with double double quitation?

still forum
#

at the end of the script _objinside goes out of scope and disappears

#

yes that is working.

tough abyss
#

understood

late gull
#

ok

tough abyss
#

yes you have to double quote it like that

still forum
#

no you don't HAVE to

#

you can just use single quotes

tough abyss
#

how else can you escape the code?

#

it was giving me errors with single quotes

late gull
#

" 'asd' "

still forum
#

you can make your _objinside a global variable. Or use setVariable to set the variable directly onto the trigger and grab it out of there again

tough abyss
#

ohh setVariable might be useful, can I setVariable inside a if the trigger was made before the loop?

still forum
#

you have to actually

#

if what you are implying is otherwise passing local variables into the trigger statements

#

which you can't

tough abyss
#

no im drawing from the trigger

late gull
#

not working

tough abyss
#

here, I'll make a quick pastebin of my script

#

only 37 lines

still forum
#

use braces.

tough abyss
still forum
#

(systemChat format["Sound Volume: %1", (soundVolume*100)]) + "%"; That is what you are doing.

#

which yeah.. obviously doesn't work

tough abyss
#

I've been working on that for days and cant seem to get the variables i want in the right places. It either runs forever or gives errors lol. im so bad

late gull
#

nope, still not working like that

still forum
#

like what?

late gull
#

you solution

#

but i get it

#
systemChat format["Sound Volume: %1%2", (soundVolume*100), "%"];
#

this work -.-

still forum
#

So.. You mean the thing that I said "which obviously doesn't work" doesn't work for you? wow.

late gull
#

-.-

#

my english man xD

#

don't judge me

still forum
#

Deja'vu :u

#

wtf

#

Just got a total Deja'vu ๐Ÿ˜„

tough abyss
#

LOL

still forum
#

I'm sure I dreamed about exactly this half a year or so ago ^^

late gull
#

๐Ÿคท

#

u did not xD

still forum
#

But my brain tells me I did ._.

late gull
#

u brain it's lying ๐Ÿ”ซ

#

well, anyway worked with this second "param"

tough abyss
#

I would totally post a meme here, but this is scripting help :L

slim bobcat
#

grrrrr be filters

inner swallow
#

eh?

gleaming oyster
#

Battleye filters have been the save for a lot of public servers from what I've observed

fringe yoke
#

Does anyone here know how I could find out what the pending module is for a curator?
If they select a rifleman from the Create window on the right hand side, can I know they have that selected before they place the unit, or a module, prop, etc.

winter rose
#

Try looking at Curator event handlers maybe?

fringe yoke
#

I wasn't able to find one that would do this sadly

still forum
#

It could be a normal UI control that you can access via script

#

just check every frame what's currently selected

#

That's my only idea

fringe yoke
#

Yeah, that's what I was thinking earlier. I just have 0 experience finding the control IDs. That's why I asked yesterday how to go about doing that. Was really hoping I had just missed an event handler that did this.

still forum
#

you look in config viewer and experiment around till it works

fringe yoke
#
private _tree = (findDisplay 312) displayCtrl 270;
private _class = _tree tvData (tvCurSel _tree)

This was able to get me the class of the currently selected blufor unit, thanks @still forum

finite jackal
#

Lets say I have an array
[1000,1000,1000]
and I wanted to add another array to it of [500,500,500]
to make it return
[1500,1500,1500]

What would be the script command to do such operation?

cosmic lichen
#

vectorAdd

finite jackal
#

Thanks, that was my initial thought, just didnt know what it meant by 3D vectors

cosmic lichen
#

a vector is an array with numbers, 2D means 2 number 3D 3 numbers and so on

still forum
#

3 dimensional

#

XYZ. is 3 dimensions

#

meaning it won't add like.. arrays of 5 numbers together

#

๐Ÿ‘€

cosmic lichen
#

yes, as long as they are of equal size

still forum
finite jackal
#

so 2 arrays of any (same) size can be added with vectorAdd

cosmic lichen
#

Actually, can Vector add 5D vectors and 2D vectors? The description say 3D

still forum
#

So is that true or not?

cosmic lichen
#

gonna test

#

It should add any size as long as they are equal

still forum
#

It could. But we are still talking about Arma here

cosmic lichen
#

Programmer was probably lazy

#

But then again larger 3D is irrelevant for arma, but 2D should work at least

#

Alright, only 3D

#

What a pity

finite jackal
#

Not that I need it, but is there a solution to addition of arrays larger than 3

still forum
#
_vector1 = [100,100,100,100];
_vector2 = [50,50,50,50];
_vectorAdded = _vector1 apply {_x + (_vector2 select _forEachIndex)}

Not sure if apply has forEachIndex?

cosmic lichen
#

Isn't there an easier solution?

#

Seems like such a basic thing

still forum
#

That solution isn't easy? ^^

#

I would do essentially the same on c++ side

#

Well. Combined with some SSE magic for specific array sizes ^^

meager heart
#

@late gull better option for your "Earplugs" thingy with setUserActionText

private _id = player addAction ["Earplugs", {
    params ["_target", "_caller", "_id"];
    if (soundVolume isEqualTo 1) then {
        2 fadeSound 0.15;
        _caller setUserActionText [_id, "Remove earplugs"];
    } else {
        2 fadeSound 1;
        _caller setUserActionText [_id, "Earplugs"];
    };
}, [], -1, false, true, "", "_target isEqualTo vehicle _this"];
late gull
#

hmm thx, already done one xD

#

but btw, where _caller comes from?

#

it's a kind of magic var?

meager heart
#

caller (_this select 1): Object - the unit that activated the action

late gull
#

oki, thx will read it at bed :p

meager heart
#

btw new addAction page looks ๐Ÿ‘Œ

gleaming oyster
#

@meager heart
how about

isNull objectParent _target 

versus

_target isEqualTo vehicle _this
meager heart
#

try it ๐Ÿ˜€

gleaming cedar
#

Guys

#

How to make AI switch to launcher

gleaming oyster
winter rose
#

by having an enemy tank in front of it ๐Ÿ˜„

gleaming oyster
gleaming cedar
#

doesnt work

#

tried all of that

#

every forum says something different

winter rose
#

what's your goal?

gleaming cedar
#

switch to launcher, then shoot on target

#

player1r fireAtTarget [boat1l,"launch_NLAW_F"];

#

I have this

#

Now when I play it

winter rose
#

put a tank, AI will do the rest?

gleaming cedar
#

Player1r doesnt have launcher in hand

#

No

#

its on an island

gleaming oyster
#

Yes it does work, obviously your execution or syntax is incorrect

gleaming cedar
#

๐Ÿ˜ฆ

winter rose
#

it's muzzlename, not weapon name. Are you sure launch_NLAW_F is muzzle?

gleaming oyster
#

No, it's not a muzzle

gleaming cedar
#

let me try different name

gleaming oyster
#

should be under cfgWeapons entry

winter rose
#

nvm, doesn't have muzzles here

#

muzzles[] = {"this"}; ?

gleaming oyster
#

think so

winter rose
gleaming cedar
#

nope not working

#

I just want AI shoot on a boat when there is a trigger

#

Anyone has an idea

#

How to switch to launcer/

winter rose
#

weaponState returns on PCML:
["launch_NLAW_F","launch_NLAW_F","Single","NLAW_F",1]
(weapon, muzzle, firemode, magazine, ammoCount)

#
joe1 doFire car; // works on an empty MRAP
#

@gleaming cedar even works on an empty friendly boat

#

also that ^^

joe1 fire "launch_NLAW_F"; // will shot straight without aiming or thinking
meager heart
#
0 spawn {
    private _shooter = createGroup playerSide createUnit ["B_soldier_LAT_F", player modelToWorld [0,20,0], [], 0, "NONE"];
    private _target = createGroup east createUnit ["O_pilot_F", player modelToWorld [0,100,0], [], 0, "NONE"];
    _shooter doWatch _target;
    waitUntil {[objNull, "VIEW"] checkVisibility [eyePos _shooter, aimPos _target] > 0.5};
    _shooter fire secondaryWeapon _shooter;
};
```into the console ^
#

btw he always misses, just tried that few times lol

#

even if that checkVisibility 1 ๐Ÿ˜„

winter rose
#

use doFire, fire only shoots, no target required ^^

meager heart
#

with doFire he will fire with primary

#

or task is to make him just fire ?

#

also maybe laser target will fix his accuracy

little eagle
#

@meager heart

private _vDirView = eyePos _shooter vectorFromTo getPosWorld _target;
private _vDirWeapon = _shooter weaponDirection secondaryWeapon _shooter;

acos (_vDirView vectorDotProduct _vDirWeapon) < 5

Less than 5 degree between the view and the weapon direction.

meager heart
#

hax

little eagle
#

How so?

meager heart
#

_target have no chances ๐Ÿ˜„

little eagle
#

Never had any.

meager heart
#

you are to brutal man ๐Ÿ˜€

little eagle
#

I have this script that makes pos1 fire a missile at pos2 and always misses by x degree, i.e. 10.

unborn ether
#

Is there any actual way to force a vehicle drive by its own, like when you put a brick on a gas pedal?

meager heart
#

yeah saw that, commy

little eagle
#

like when you put a brick on a gas pedal?
No.

unborn ether
#

Dammit, I know I can use something like addForce or setVelocity but I want it to respect vehicle properties.

meager heart
#

addForce will work like push

little eagle
#

You can't, Demellion sadly.

#

addForce will just make it fling around, not spin the wheels.

unborn ether
#

I remember some day in Arma 2, where you could hold shift and drive forward to eject straight after, it acted like i just described

#

๐Ÿ˜ญ

little eagle
#

Too advanced for PhysX.

#

I'd just script the missile. Not make an ai actually fire one. It's not like anyone will notice the difference, and with script one can actually aim.

unborn ether
#

Ok, what about manually forcing "CarForward" inputs on driver keyboard, just no idea about that too.

little eagle
#

If I write "you can't", then you can't.

meager heart
#

also maybe something possible with invisible agent ๐Ÿค”

#

(never tried)

little eagle
#

This is a waste of time, but I guess everyone has to make the experience themself.

unborn ether
#

Well i believe commy pretty much, since I lack of any ideas on that too because of the same reasons: you can't

meager heart
#

i'm checking for addons in mission from description.ext (enabled/not enabled) and depends on that #include different inventory configs, question is, how to make it selectable via mission params and have this check by default at the same time ? ๐Ÿค”

#
#define RHS_LOADED      __EVAL(isClass(configFile >> "cfgPatches" >> "rhsusf_main"))
#ifndef RHS_LOADED
    #include "cfgInventoryDefault.hpp"
#else
    #include "cfgInventory.hpp"
#endif 
#

with #undef ? and define it again ?

little eagle
#

That's not how you use __EVAL. __EVAL is always placed after =.

#

If what you wrote were possible, there would be no need for x_compat_ace addons etc.

unborn ether
#

I think its __EXEC you to have there?

meager heart
#

If what you wrote was possible
that possible, i mean it works ๐Ÿ˜€

little eagle
#

Pardon?

meager heart
#

hmmm... it works ?

little eagle
#

What you wrote? No, that's broken on three different levels.

meager heart
#

what difference in this

RHS_LOADED = __EVAL(isClass(configFile >> "cfgPatches" >> "rhsusf_main"))
vs
#define RHS_LOADED __EVAL(isClass(configFile >> "cfgPatches" >> "rhsusf_main"))
little eagle
#

The first one works, though is kind of pointless, while the second one is just broken.

#

The other issue with your original macros is, that include is evaluated first when preprocessing the file, regardless of any ifdefs.

#

And that ifdef check wheter or not a macro is defined. Not if it evaluates to a boolean - those don't exist at preprocessing time anyway.

#

Doesn't seem like you understand the preprocessor.

meager heart
#

#define - define keyword and assign definition to it, correct ?

little eagle
#

Yeah, potentially with arguments.

meager heart
#

well... maybe i missed something... still don't get what the problem there

little eagle
#

What you're doing doesn't work, because none of what you assume how it works, actually works like that.

#

__EVAL only works for assigning a config entry.

#

And it's so limited that it currently only works for STRING and NUMBER, not even ARRAY.

#

ifdef and infdef check if a macro is defined, not wheter or not it would be true or false.

#

And the conditional include doesn't work together with the #include command, though I'm not entirely sure for the technical reason atm.

meager heart
#

that why i'm asking about how to mix it with params, where you have to define it

little eagle
#

What you're attempting to do is not possible.

#

commy2: If what you wrote were possible, there would be no need for x_compat_ace addons etc.

meager heart
#

well... roger that, ty

#

cries

little eagle
#

Why tho? Just make all configs and adjust your scripts accordingly instead.

#

Not like you're losing anything. The people that would've reason to be sad are the one writing the mods.

meager heart
#

yeah sure, that is np at all, was just looking for ez way... ๐Ÿ˜€

little eagle
#

"The westward road seems easiest. Therefore it must be shunned."

tough abyss
#

//Hints time every frame after BIS_variable is assigned ["itemAdd", ["uniqueId", { hint str time; }, nil, nil, { !isNil { BIS_variable } }]] call BIS_fnc_loop;

little eagle
#

Arbitrary global variable.

meager heart
#

just found out, that i have couple new reflexes after tonks release, i can really fast close popup messages with random errors and whenever vscode is opened, i do instant last rpt check... even if that wasn't needed or logs disabled...

peak plover
#

What do you mean

meager heart
#

do you know that popup message (afaik that is bis_fnc_guiMessage) with errors like No entry 'bin\config.bin/... ? when you have to press close button ? that is the first thing what i have to do in one mission... i just keep practicing, some addons outdated after tonks and i think i will have time to master that skill even more. ๐Ÿ˜„

somber cosmos
#

Anyone know how to get gravity to not exist or turn you into a solid rocket booster when you put a Gatling gun on a static mg using addWeaponTurret?

#

Btw I'm new to the scripting scene so dumb it down for me maybe? :/

winter rose
#

Kim Jong Un, rockets, hmmโ€ฆ ๐Ÿค”

#

no gravity setting, reality for you.
setVelocity exists though. What do you want to accomplish?

somber cosmos
#

Like when you fire the Gatling gun it sends you to space

#

Don't want that to happen xD

#

I just want it to stay where it has been placed

winter rose
#

what gatling gun?

somber cosmos
#

When you add it onto a vehicle or emplacement using addWeaponTurret

#

I put it on a static mg

winter rose
#

you could create an empty helipad, place it where you want the gatling to be then in its init field do

if (isServer) then { myMG attachTo [this, [0,0,0]];
meager heart
#

also setMass maybe

winter rose
#

also please provide all useful information about what you do; which "gatling", which MG, what script command, how who why?

somber cosmos
#

Yeah new to this stuff but I can't remember of the top of my head but it was one of them raised static turrets that you assemble like it's from ikea

#

I put the a 10 Gatling gun on it using addWeaponTurret

#

What's the purpose of that empty helipad?

winter rose
#

addWeaponTurret + "Gatling_30mm_Plane_CAS_01_F" , right?

somber cosmos
#

Yeah

#

That's it

#

I'm not st home so I could get the command

winter rose
#

addWeapon alone may work though, as there is only one turret

#

the empty helipad would be an invisible lock point, attachTo would make it immovable

somber cosmos
#

Oh right

#

Ok

#

So in the turret init would I write this attachTo helipad?

winter rose
#

โ†‘ faster with setMass
https://community.bistudio.com/wiki/setMass

"argument must be local" means you should execute it on server if the turret is empty

or simply put in the init field

if (local this) then { this setMass 10000; };
meager heart
#

or just 1 for lols ๐Ÿ˜„

#

(for the mortar)

winter rose
#

does negative work? ๐Ÿ‘€

meager heart
#

hmm... never tried

#

lemme...

winter rose
#

please!

meager heart
#

nope ๐Ÿ˜€

#

1 < the lowest

winter rose
#

not even 0, or 0.001? ๐Ÿ˜ข

meager heart
winter rose
#

weeeeeeeee

meager heart
#

so anything* > 0

late gull
#

guys, how to say "wait until this var is defined"

#

i'm using SQF waitUntil { !isNull myVar }:

strong shard
#

waitUntil {!isNil โ€œmyVarโ€}

late gull
#

but the var it's a boolean and then it says that it's wrong

#

umm ok, will try like that

strong shard
#

Or waitUntil {!isNil {namespace getVariable โ€œmyVarโ€}}

late gull
#

btw, i'm defining this var in client side

#

but i want hook this var to server, i'm using publicVariableServer "myVar"

#

it's that correct?

strong shard
#

If you wait for remote var, you can use addPublicVariableEventHandler

late gull
#

will check it out, thx

tough abyss
#

G'day boys, just wondering if you can tell me how to add a texture to a button for a dialog, been searching the interwebs left right and center. Ta.

strong shard
tough abyss
#

Hey mate, I have actually tried that already, however my configuration must be wrong. Mind if I send you the code?

strong shard
#

@tough abyss i canโ€™t check it now

tough abyss
still forum
#

@meager heart the addAction page is not new. It didn't get remade ^^ Only the warning messages have a new style if you mean that. And that's everywhere on biki.

meager heart
#

looks really nice

#

also params... finally

winter rose
#

he he

gleaming cedar
#

`[]spawn {
while {true} do {

car1 fireAtTarget [boat1m,"LMG_Minigun_Transport"];

sleep 0.4;

car1 fireAtTarget [boat1m,"LMG_Minigun_Transport"];

sleep 0.4;

car1 fireAtTarget [boat1m,"LMG_Minigun_Transport"];

sleep 0.4;
car1 fireAtTarget [boat1m,"LMG_Minigun_Transport"];

sleep 0.4;

};
};`

#

What am I doing wrong here

#

car1 is the car the person is hooting from

#

Boat1m is the boat that needs to be shot

#

The person in car1 shoots but it doesnt aim on the target

inner swallow
#

Use two sets of ``` so we can read it properly

winter rose
#

doFire?

gleaming cedar
#

It does fire

#

But it doesnt aim

#

This exact same script worked in another mission to

winter rose
#

so something else breaks it ยฏ_(ใƒ„)_/ยฏ

gleaming cedar
#

I assume so I am going to check that other mission

still forum
#

I'm 100% sure that someone told you yesterday why that happens and how to fix it

#

when you asked the exact same question yesterday

gleaming cedar
#

No

winter rose
#

try in an empty editor ; if it works there, then something else breaks it (or maybe shooter doesn't knowsAbout the target

gleaming cedar
#

I asked how to switch to launcer

still forum
#

Okey sorry.

#

You asked exactly that on sunday.

#

Just looked it up

gleaming cedar
#

Yes I used the same script from sunday

still forum
#

But the stuff that the others told you will fix it. Is not in your script

gleaming cedar
#

o

#

I got it now sorry yeah i see

#

i forgot

gleaming cedar
#

Still not working

#

even with do watch

#

I am so sick of arma

still forum
#

doWatch?

#

Others told you to use doTarget

peak plover
#

Mite I add, never use while {true} do {}
Always add an exit condition

gleaming cedar
#

I am tired of this arma coding stuff i am gonne use unit capture

#

but i am the most tired of stupid installers installing anti virus software which is crashing arma

winter rose
#

โ€ฆโ€ฆโ€ฆ

#

โ€ฆโ€ฆโ€ฆ?

still forum
#

๐Ÿ‘

gleaming cedar
#

@winter rose My life in one sentence

fringe yoke
#

Kind of an niche question, I am replacing the text of a control that has a black and white image by default. I am trying to change it to a color image, but they are displayed in gray scale. Any one know how I could get it to display in color?

still forum
#

is your paa in multiple of 2 format?

fringe yoke
#

yes

#

It displays properly else where, just not on these controls

still forum
#

have you tried naming with with _co.paa ?

#

Oh.

#

Never heard of that ^^

fringe yoke
#

Using the exact same path for the mod.cpp logo, it's color in the menu, black and white on the controls ๐Ÿ˜’

#

๐Ÿคฆ

_control ctrlSetTextColor [1, 1, 1, 1];

Have to do that for each control

little eagle
#

Maybe the control class has a different color set in config, @fringe yoke ?

fringe yoke
#

That's what I eventually found yeah

little eagle
#

Ah :~)

late gull
#

anyone know here to find sound clases like "Alarm" ?

gleaming oyster
#

CfgSounds

#

config viewer

late gull
#

ok, let me see

cosmic lichen
#

Anyone knows how I can retrieve a full list of arma 3 functions ingame, with categories etc?

#

Nevermind, it was too obvious...CfgFunctions

little eagle
#

Why did you even assume something like this existed while not knowing about CfgFunctions?

peak plover
#

Anyone ever made a zombie script here?

#

Or any ideas how to make zombies in a decent way?

#

Issues I've seen with the ones out there right now are like, they walk through walls and are stupid and fail at navigating buildings. Would there be a way of getting around that?

unborn ether
#

Trolling level: 0 bytes

still forum
#

ah crap XD

#

The guy that makes the Linter wanted this half a year or so ago.. I know it's a little late... But I just got back into the mood to dev on my debugger. If anyone has contact to him give him this pls.

cosmic lichen
#

@little eagle I know about CfgFunctions, but didn't think of it.

little eagle
#

Brainfart.

peak plover
#

Can agents be transferred ownership wise ok?

#

From client to client

gleaming oyster
#

Eh. Just recreating it? I don't se why not? Or are you talking about setOwner ??

peak plover
#

setOwner

gleaming oyster
#

according to the wiki it seems like it may just be from server to client. Not sure tho

#

this command should not be used to transfer ownership of units with AI (agentsare an exception to this rule). Using command in an unintended way will display an on-screen warning and log a message to .rptย 

peak plover
#

Yeh it's a server only command

gleaming oyster
#

I guess agents are an exceptio

#

so you should be okay

sullen willow
#

Say I wanted a sound to play when a player dies on my server, what would I do? I've been playing around with onPlayerKilled and I can't seem to get it to work.

little eagle
#

Any player or the local player?

sullen willow
#

Local would mean it would only play to the character killed, correct?

little eagle
#

The local player is the avatar you're controlling yourself on your machine.

#

Remote players would be those playing on the same server as you.

#
// initPlayerLocal.sqf
params ["_unit"];

_unit addEventHandler ["Killed", {
    params ["_unit"];

    private _name = name _unit;

    [_name, {
        params ["_name"];

        playSound "Alarm";
        systemChat format ["%1 died!", _name];
    }] remoteExec ["call"];
}];
#

This is what I'd do... probably.

sullen willow
#

I will give that a try and report back

#

That didn't seem to do anything

little eagle
#

Don't see why. You probably made a mistake.

sullen willow
#

I just copypasta'd that into initPlayerLocal.sqf

little eagle
#

In the editor?

gleaming oyster
#

event script. initPlayerLocal doesn't exist as a field in eden

sullen willow
#

In the mission file

gleaming oyster
#

only init

little eagle
#

Well, you need to save the mission and start it in MP as well.

#

Also, idk anything about that mission. Maybe it has things disabled or a script error in a previous script preventing this one from being executed. Hard to tell.

#

There's RPT files for this.

unreal rain
#

Someone wanted to see me I heard

#

Nvm seems he got removed

little eagle
#

Maybe typo.

wary vine
#

anyone else had issues with text not scaling correctly with interface size ?

little eagle
#

size and sizeEx config entry, depending on STRING vs. TEXT.

wary vine
#

I have tried safeZone but doesnt seem to work for me.

little eagle
#

What exactly is the problem?

thorn saffron
#

I'm fixing up Drongos Artillery script and one of the issues is script making the gunner fire before he aims the gun. The thing is there is a sleep that was supposed to let him enough time to aim the gun, but there are instances when the sleep time is not enough. So instead of a waiting for a specified amount of time I would rather check if the gunner is looking at a specified point in space.
Currently the script tells the gunner to aim at a specific point using this code:

(gunner _tube) doWatch [_x,_y,_z];```
Now I would need a waituntil or something similar that checks if the gunner is actually aiming/watching that specific point in space, if not then wait a second then check again.
#

However I'm not exactly sure how to check if the gunner is looking at that point in space.

#

I would like to note that the [_x,_y,_z]; position is actually working perfectly fine, and once the gunner does manage aim the gun properly at it the shells fall where they are supposed to.

frail ledge
#

You could do something like this.

_aimPos = [_x,_y,_z];
waitUntil {
    _wepDir = _tube weaponDirection (currentWeapon _tube);
    _azimuth = (_wepDir # 0) atan2 (_wepDir # 1);
    if (_azimuth < 0) then
    {
        _azimuth = _azimuth + 360;
    };
    _elevation    = acos (_wepDir # 2);

    (((round _azimuth) == (round (_tube getDir _aimPos))) && (_elevation < 45))
};

It waits until the gun is pointing in the right direction (horizontally) and has more than a 45ยฐ vertical aim. You could try to work out what the correct elevation needs to be and use that instead of the hard 45.

thorn saffron
#

Never mind, the script does not work with MLRS artillery for some reason. I think I will pass on fixing it.
Incidentally, does anyone know any good addon that lets you call in artillery and air support from using any assets placed in the mission?

peak plover
#

There waas that post killzonekid made

#

Where he showed how he can script a join into a different server.

#

Wouldn't it be cool if there was a scripted matchmaking system or a join with friends?

gleaming oyster
#

need steam api extension, but I guess it would be possible.

meager heart
#

ESL Versus 5v5 competitive Altis life ยฉ

#

Sponsored by KECAL (or how that skype version was called in laws of war ๐Ÿ˜„)

peak plover
#

@gleaming oyster Why steam?

#

Nah not for 5v5. Just I think it would be nice to be able to join a server with multiple people at once (party leader chooses server or match making)

gleaming oyster
#

nvmnd. Misread

meager heart
#

maybe it would be nice option to have for the new guys, but afaik your "party with friends platform" is team speak atm (maybe discord in a future) ๐Ÿคท

#

just as "extra option", sure it sounds nice

peak plover
#

mhm

#

Yeah, I wouldn't wanna go and try to join a public server with my friends if it's nearly full

#

What if someone can't get in. Has to wait for like 10 minutes

#

And people just wanna get in and play the game

covert inlet
#

anyone know a way to set the direction/elevation of an empty artillery vehicles turret on mission start?

tough abyss
#

Dimensions are also valid.

still forum
#

Just link the images normally please.

peak plover
#

I sear

#

swear

#

I've seen like 3 people do the same thiong

tough abyss
#

I didn't think it would obscure the hyperlink aha. My bad.

still forum
#

the button on bottom right is wrong?
I'd say use pixelGrid.. I don't do UI stuff... ^^

tough abyss
#

Yes the texture is not appearing, all button functions work, and call the correct things, however the blue button does not appear in game.

winter rose
#

is the button clickable and no texture is on it, or just no button at all like it never existed?

tough abyss
#

Button is clickable, however there is no texture

#

I have tried making it a background control, still no hope

#

May I post the code for the button?

still forum
#

try leaving colorText and background color out of the button config

tough abyss
#

That is what my control class looks like

#

@still forum Thanks I will try that now

still forum
#

Yep.. colorText[] = {0,0,0,0}; you are setting it to invisible

#

that might be it

tough abyss
#

That is for the button though isn't it? if it isn't transparent then it will cover where the texture should be?

covert inlet
#

@peak plover thanks

still forum
#

I guess the texture is also made transparent. Thus the button is invisible

tough abyss
#

Thats the wierd thing, because the screen has the same characteristics, and is visible, so i just copied the same properties to the button picture, assuming it would work

still forum
#

or maybe the button is behind the screen

tough abyss
#

Hmm Ill remove the screen and see

#

^^ without screen^^

#

Woah ok... I think I have found a breakthrough...

#

^^ replaced the directory to another texture to suss it out^^

#

Ahh wow I am so confused rn

#

FIXED, the bit-depth was invalid. yikes

outer fjord
#

Is it possible to add the engineer/medic skill to a unit why in mission via script?

still forum
#

yes

late gull
#

guys, any place wher i get info about those settings:

sceneComplexity=40000;
shadowZDistance=100;
viewDistance=1000;
preferredObjectViewDistance=800;
terrainGrid=25;
volumeCD=10;
volumeFX=10;
volumeSpeech=10;
volumeVoN=10;
vonRecThreshold=0.029999999;
still forum
#

If biki then biki else common sense else no

#

Like.. All besides sceneComplexity are clear to me.

#

Well and terrainGrid. I know what it is but not the possible values. But I have seen them on biki before

late gull
#

but, it i set those to the server, iex: viewDistance= 1k the player will have only 1k of vd? no matter his own config?

#

or how it does work?

still forum
#

I think the server only defines the max

#

And most of these settings don't apply to server at all

late gull
#

that's why i'm looking for infos, there is nothing about those in the wiki

peak plover
#

Is there a way to edit player camera?

#

Or perhaps can intercept edit player camera?

still forum
#

define "edit"

#

you can spawn a second camera. And move it along

peak plover
#

change first person camera fov with a script

still forum
#

oof...

peak plover
#

Or move the third person camera extcampos

still forum
#

I don't know a way.... A easy battleye proof way to do that.

peak plover
#

But can in theory intercept do that? ๐Ÿค”

still forum
#

in theory a extension can do that

#

in theory a extension could turn Arma into Battlefield 5 running on a quantum computer

peak plover
#

It's quite stupid 'tho. I can set my FOV in the profile file to like 30 and literally every scope and even ironsights are equivalent to normal sniper scopes

tough abyss
#

I thought I had fixed it, but the texture still won't show :/ anyone have ideas?

meager heart
#

sceneComplexity < that is max number of the polygons in the scene mixed with object details ? (never saw any official info about it)

peak plover
#

๐ŸŽ

meager heart
#

thank you ๐Ÿ˜„

verbal otter
#

is possible to set interface size with script?

winter rose
#

Nay

still forum
#

Yes.. Theoretically. But no you almost definetly don't want to do that

winter rose
#

whoever gets close to my UI settings gets the hose again!

#

no touch ๐Ÿ‘€

verbal otter
#

thanks

frail ledge
#

Setting it to 0 seems to work....

gleaming oyster
#
call Bis_fnc_recompile 
``` @frail ledge
#

Change a line and call

little eagle
#

1: compile, 0 (default): compileFinal (copy from ui namespace)

#

The flag has a poor name. It actually just disables the functions cache.

gleaming oyster
#

Huh..

frail ledge
#

0 is acting like 1. And if I dont put this flag in my description then I can recompile whatever I want

little eagle
#

From initFunctions.sqf:

//--- Allow recompile in dev version, in the editor and when description.ext contains 'allowFunctionsRecompile = 1;'
_compileFinal =
    //--- Dev version
    !cheatsEnabled
    &&
    //--- Editor mission
    ((uinamespace getvariable ["gui_displays",[]]) find (finddisplay 26) != 1)
    &&
    //--- Manual toggle
    getnumber (missionconfigfile >> "allowFunctionsRecompile") == 0;
#

0 is not acting like 1.

#

Maybe 0 is acting like you imagined 1 would act, but they certainly are different.

frail ledge
#

surely by default I should not be allowed to recompile functions. Isn't that what the security feature is?

#

shouldn't the 0 in the code you posted be 1?

#

and when description.ext contains 'allowFunctionsRecompile = 1;'

#

"allowFunctionsRecompile") == 0;

little eagle
#

It's not a security feature. The functions cache is always protected from recompiling. This just controls whether you copy the protected values from the cache generated at game boot, or recompile them every mission start, which takes a long ass time.

astral tendon
#

Does the Hit event handle returns a _source when its a other player and MPHit fire 2 times on the host pc and the people that did the causedBy?

finite jackal
winter rose
#

Isn't it an icon, instead of a marker?

meager heart
#

โ†‘ ui_f_data\Map\VehicleIcons\iconParachute_ca.paa โ† there

unborn ether
#

Oh, so #particlesource cant recieve a setVariable

outer fjord
#

Anybody working on a dynamic repair script with the new tank parts? ๐Ÿ˜„

willow rover
#

Is there a simple way to get the clients SystemTime?

winter rose
#

time maybe?

#

nay, sync'ed on JIP.

gleaming oyster
#

@winter rose Come on wiki man.
Returns time elapsed since mission started (in seconds). The value is different on each client. If you need unified time, use serverTime.

winter rose
#

I read it, but I also read from serverTime

#

I had hoped it didn't JIP, and time would have been a good workaround

@willow rover you could store serverTime locally on start/connect, then substract it from serverTime when you want to know.

willow rover
#

okay

little eagle
#

What is "system time" supposed to be? The time of day? Then the answer is not without a all extension.

still forum
#

@winter rose read... clients SystemTime

#

systemTime != time/serverTime

winter rose
#

Oh.

#

So no ( :

still forum
#

Btw I heard lots of people complain about SQF scheduler race conditions that it could suspend in the middle of a statement. It actually can't. Scheduled scripts only suspend at end of statement.

#

meaning missionNamespace setVariable ["var", player getVariable "var2"] is race condition free

errant jasper
#

I never really believed that (the scheduler stops mid statement). Though still plenty of possibilities for race conditions between statements.

vague hull
#

would wrapping everthingy in a "call { .. };" prevent suspension then? ๐Ÿค”

#

maybe this is what they referred to if the answer is no

errant jasper
#

No, not at all. isNil {...} will though.

#
_unit call {
    private _damage = damage _unit  +  (...Cool computation);
    _unit setDamage _damage;
};```
#

^ Race condition if not run in unscheduled

still forum
#

no. Because there are multiple statements inside the call

peak plover
#

If it does the first line and then another script edits damage, it will race

still forum
#

but for example

_unit setDamage  damage _unit  +  (...Cool computation);

won't. Unless cool computation is a function call or smth

peak plover
#

Ohh really?

#

so it goes until ; or the next scope?

still forum
#

yeah

#

What SQF Assembly calls "NewExpression" instruction

still forum
#

I wanted to try if I can make SQF faster by replacing the vtable based interpreter by a switch statement based one...
Literally.. All my scripts run 2x as fast now. I only changed 10 lines in the interpreter... BI.. pls.

still forum
little oxide
#

Need to test with heavy script @still forum

#

?

still forum
#

no

#

just whatever script

#

it only optimizes the instructions not the commands. So stuff like nearestObjects will still be slow.
So the bigger your script is the bigger the impact I'd say

little eagle
#

@still forum

Btw I heard lots of people complain about SQF scheduler race conditions that it could suspend in the middle of a statement. It actually can't. Scheduled scripts only suspend at end of statement.
The solution is clear:

#

Mass replace every semi colon with a comma.

#

Does comma end a statement as far as the scheduler is concerned?

still forum
#

nope

#

if you are building an array then no

little eagle
#

Well, mass replace it is then.

still forum
#

but it pushes the return values onto the stack so you have to be careful not to cause a stack overflow

little eagle
#

whoop whoop

still forum
#

Don't start a MP mission with that fastScript mod... Or I think editorPreview might be bad too.
I think I broke something and waitUntil is now executing in unscheduled...

little eagle
#

You didn't break anything, you fixed it.

#

Always knew the scheduler is why sqf is so slow, thanks for confirming it, kappa

still forum
#

I didn't confirm that though ^^

little eagle
#

Last word.

digital hollow
#

; > .,

still forum
#

my scheduler specific optimization only got a about 10% speed increase

#

Which is also a simple 2 line fix btw...

little eagle
#

You could've instead also invented another non standard script language for the game tho.

pine leaf
#

Hey guys so i have a question?

I'm working on a tanoa server and i noticed that the repair script isn't working when i try repair the vehicle when it is damaged, like for example the vehicle repair wont allow you to click it.

Does anyone know how to fix it?

peak plover
#

@still forum I can gib a go

pine leaf
#

and the unflip is also playing up as it only wants to work with some people

gleaming oyster
#

@pine leaf Give context. What repair script?? Clicking on the vehicle? None of what you have said makes sense to those who are not insiders

pine leaf
#

So when I click windows key a interaction menu pops up saying if I want to repair or unflip

lone glade
#

we can't help you without seeing the code

gleaming oyster
#

Oh god. So it's lifer code. ๐Ÿ™„

#

But you now have had two questions asked, but nothing to show for. Post the code please.

peak plover
gleaming oyster
#

@peak plover Just hire someone to do MORE LIFE?

#

It's like an endless line of crap that gets shoveled out every week

lone glade
#

there's no money to make in there and only endless amounts of pain

peak plover
#

@still forum My game froze with that.

#

I tried loading a mission

still forum
#

yeah. That's what I said not to do before ^^

peak plover
#

ohh. Didn't see

still forum
#

I don't know why yet.. I think I moved a waitUntil into unscheduled

peak plover
#

uhh

#

okay

orchid saffron
#

Have PiP stopped working on dialogs or something?

still forum
#

@peak plover any results? Editor debug console?

#

I got the freeze once but can't reproduce it anymore

hollow lantern
#

Is there any resource for A3's CfgIdentities? In particular I would like to ge the Identity of Solomon Maru so I can use it in a Mission

errant jasper
#

Open ingame config viewer and look through CfgIdentities.

peak plover
#

I can try again. But I didn't see any improvements when doing the test scenario in singleplayer (infantry)

#

all my slow scripts are in a mission

#

So I gotta load that

hollow lantern
#

Thanks @errant jasper seems that I missed it while I was searching the viewer

#

found it now

still forum
#

you probably won't feel the improvement. But you can measure it

peak plover
#

Yeah I was using the brofiler

still forum
#

brofiler makes the script slower again ^^

peak plover
#

ohh wait

#

I guess I'll try then

#

But U said u could reload a mission/

still forum
#

yeah. Works fine for me now ๐Ÿ˜„

#

Maybe I fixed it by accident and my newer build is just working

peak plover
#

yeh, i crash on mission load

still forum
#

Only real change is compatability with the scriptProfiler. It would crash before.

peak plover
#

I've got a good script to test with a lot of iterations

#

v1
Result:
7839 ms

none
Result:
7914 ms
#

I'll try the updated one too

lone glade
#

O.O

#

that's 8s mate

still forum
#

I only optimize instructons. Slow script commands are still slow

peak plover
#

This has tons of loops

still forum
#

with

sqrt (0.5334 * 1452.22 + sin(521*212) - cos(2351)) * sqrt (0.5334 * 1452.22 + sin(521*212) - cos(2351))

I got 2x speed

gleaming oyster
#

๐Ÿ‘

peak plover
#

๐Ÿ˜ฎ

#

insane

#

I'll test that too now

#
Result:
0.0039 ms

Cycles:
10000/10000

Code:
sqrt (0.5334 * 1452.22 + sin(521*212) - cos(2351)) * sqrt (0.5334 * 1452.22 + sin(521*212) - cos(2351)) 

gleaming oyster
#

jesus christ...

still forum
#

Depends on memory speed and CPU cache size.. So could be that your's are so good that the impact is too low

#

wow.. 0.0039.. With vanilla Arma that one is 0.015ms for me ๐Ÿ˜„

gleaming oyster
#

Vanilla, Modded. Why would that make a difference if you're comparing script speeds that don't need the mod as a resource?

still forum
#

Because the mod is a new VM interpreter

gleaming oyster
#

Ay

peak plover
#

I'll try another one

#

probably cpu bound ๐Ÿคท

gleaming oyster
#

wut ur cpu nugel

peak plover
#

4770k

unborn ether
#

Is there anything opposite to BIS_fnc_timeToString?

errant jasper
#
(_timeText splitString ':') apply {parseNumber _x} params [["_hour", 0], ["_minute", 0], ["_seconds", 0], ["_millis", 0]];```
unborn ether
#

Thanks but just was asking for BIS_ similar ๐Ÿ˜„

peak plover
#
Result:
1032 ms

Cycles:
1/10000

Code:
 _buildings = missionNamespace getVariable ['ten_buildings',nil];
if (isNil '_buildings') exitWith {}; 
{private _b = _x;({_x distance _b < 100} count _buildings) > 0} count _buildings

mod

Result:
1161 ms

Cycles:
1/10000

Code:
 _buildings = missionNamespace getVariable ['ten_buildings',nil];
if (isNil '_buildings') exitWith {}; 
{private _b = _x;({_x distance _b < 100} count _buildings) > 0} count _buildings
#

๐Ÿค”

#

Wha

#

I don't get it

#

I guess it helps if calculating somethingg ?:

still forum
#

as I said. commands aren't faster. Only instructions are. The cheaper and the more cheap commands the bigger the impact

#

But if your CPU already has the vtables in it's cache the impact will be close to 0. I guess your CPU is just better than mine and already does the optimum

#

Wow.. That's a weird screenshot

peak plover
#

๐Ÿ˜ฎ

lone glade
#

@still forum try ace arsenal loadout screen, the verifyLoadout func uses a shitload of expensive instructions

peak plover
#

I can try loading a mission with the newer version

lone glade
#

and by a shitload I mean a SHITLOAD

still forum
#

there are no "expensive instructions" atleast not at the point where I optimize

#

calling the instructions function takes the same time for all instructions

lone glade
#

I wonder if profiling that func still crashes brofiler

#

it would spit out a 600MB file then crash whenever I tried to open it ๐Ÿ˜„

still forum
#

If that was before the duplicate string fix then that shouldn't crash anymore

lone glade
#

I don't have that version ^

late gull
#

guys, how do you limit arsenal items?

#

like, i want only Unsung items in arsenal

#

but i wont write one by one all of them

unborn ether
#

@late gull You can use configs to determine them by DLC, types, parents... etc.

late gull
#

can u show me a example or something?

unborn ether
#

It has a condition attached to it.

gleaming oyster
#
'yourCondition' configClasses(configFile >> "CfgWeapons");
unborn ether
#

so you can use get(Text|Array|Number) along with it.

late gull
#

hmm ok, will try it

gleaming oyster
#
'isClass _x && count getArray(_x >> "arraySometung") > 0)" configClasses(configFile >> "CfgWeapons");
meager heart
#

like, i want only Unsung items in arsenal
but i wont write one by one all of them
BIS_fnc_addVirtualBackpackCargo BIS_fnc_addVirtualItemCargo BIS_fnc_addVirtualMagazineCargo BIS_fnc_addVirtualWeaponCargo

late gull
#

yes, but those u need add one on one xD

meager heart
#

yes but >but i wont write one by one all of them ๐Ÿ˜€

#

you changed your plans ?

late gull
#

yes, getting these array in some way

gleaming oyster
#

We just explained this

#
_listOfWeapons = "yourConditionCheckUnsungModHere" configClasses(configFile >> "CfgWeapons") apply {configName _x};
late gull
#

souds great, but no idea how to filter that, the condition

#

how i do check that it's from unsung mod

#

i'm reading the whole weapon descriptin and i can't find something that show it's from unsung

#

or i dont know

unborn ether
#

You have _x magic var in a codition which represents current config according to a parent config.

#

In case mudnut stated it will lookup for every CfgWeapons sub-classes

late gull
#
configfile >> "CfgWeapons" >> "uns_20mm_Cannon_m24A1"
#

idk if u sayin the same

#

but should i look for every weapon that start's from uns_ ?

unborn ether
#

Yes.

late gull
#

ok, great, so there is a function like "startWith" ? xD

unborn ether
#

Or you can determine that by Author or whatever (cant remember if classes has an author entry in CfgWeapons)

#

startWith?

late gull
#

not author there

gleaming oyster
#

๐Ÿคท

unborn ether
#

I think he wants to find class names starting with uns_

late gull
#

mm i think inherits not going to work

#

his parent it's directly cfgWeapons

unborn ether
#

Which is simply:

"(_x find 'uns_') > -1 " configClasses(configFile >> "CfgWeapons") apply {configName _x};
late gull
#

or atleast that's what i see

gleaming oyster
#
_listOfWeapons = "(configName _x) find 'uns_'  != -1" configClasses(configFile >> "CfgWeapons") apply {configName _x};

?

#

Hmmm

unborn ether
#

oh yeah configName _x since apply goes afterwards.

gleaming oyster
#

๐Ÿ‘

late gull
#

u done that for me

#

i want to learn xD

#

apply {configName _x}

#

๐Ÿคท not understanding what is that doing

unborn ether
#

Well its pretty much described in wiki

#
[2,4,8] apply {_x * 2}; // [4,8,16]
late gull
#

yeah, i surely, but it's hard sometimes when u dont speak English xD

#

but i think i get it

#

i think it's like: "if that condition are meet so take the config name _x" and _x contains the examined class

#

or something like that

unborn ether
#

If to explain it more explicitly:

private _UNSWeaponClasses = "(configName _x) find 'uns_'  != -1" configClasses(configFile >> "CfgWeapons");
private _UNSWeaponClassnames = _UNSWeaponClasses apply {configName _x};
late gull
#

thx

#

it's that case sensitive?

hollow thistle
late gull
#

hmm it is

little eagle
#
_haystack findIf {_x == _needle}
late gull
#

guys and where do i get

BIS_fnc_addVirtualBackpackCargo
BIS_fnc_addVirtualItemCargo
#

BackPackCargo and ItemCargo

#

ther is not cfg for those

still forum
#

no cfg?

#

items are weapons. and backpacks are vehicles

late gull
#

oki, i mean CfgBackPackCargo or CfgItemCargo :p

lone glade
#

that doesn't exist

unborn ether
#

Did anybody tried using serverCommand called #restartserver? Is it reliable?

inner swallow
unborn ether
#

Because serverCommand is a scripted command.

tame portal
#

@unborn ether Yeah should work

hollow lantern
#

what would be the best way to disable some UAV AI's? In particular the ones from the Jet DLC's carrier the CIWS. Should I use disableAI or is there any better way? I have named them all and want to disable them and enable them manually

inner swallow
#

ah

#

aebian that's probably the best way i think

hollow lantern
#

ok thanks

hollow lantern
#

hmm tried with ```sqf
RIM7LB disableAI "AUTOTARGET"; RIM7LB disableAI "TARGET"; RIM7LB setCombatMode "BLUE";
RIM7RF disableAI "AUTOTARGET"; RIM7RF disableAI "TARGET"; RIM7RF setCombatMode "BLUE";

PhalanxRF disableAI "AUTOTARGET"; PhalanxRF disableAI "TARGET"; PhalanxRF setCombatMode "BLUE"; 
PhalanxLM disableAI "AUTOTARGET"; PhalanxLM disableAI "TARGET"; PhalanxLM setCombatMode "BLUE"; 
PhalanxCB disableAI "AUTOTARGET"; PhalanxCB disableAI "TARGET"; PhalanxCB setCombatMode "BLUE"; 

RIM116LF disableAI "AUTOTARGET"; RIM116LF disableAI "TARGET"; RIM116LF setCombatMode "BLUE"; 
RIM116RB disableAI "AUTOTARGET"; RIM116RB disableAI "TARGET"; RIM116RB setCombatMode "BLUE"; ``` but the CIWS are still shooting. Should I really use ``disableAI "ALL"`` ?
icy light
#

Hello all! I have a question thats probably an easy one. In arma you can set keybinds to Use Actions. How would I code something to where when a user clicks on their Use Action 4 it does something? Like for example systemChat "You clicked use action 4!". Also, is this possible to do with a server side mod and not have the client be required to install anything?

#

*Better worded as: When a user presses their Use Action 4 button.

wheat geyser
#

Hey, has anyone any experience in regard to smooth camera movement using the UI Event Handler "MouseMoved"? The latter returns [<display>, <horizontal angular change (>0, if mouse moved rightwards)>, <vertical angular change (>0, if mouse moved downwards)>], which yields (those angles seem to be in degrees) [0,0,-1] and [-1,0,0] as rotational axes when using Euler's angles or Hamilton Number's (Quaternionic Transformation), which should transform the Camera's vectorDir and vectorUp according to User Mouse Input respectively. But this only works when looking at the horizontal/vertical Mouse Movement independently.
Because for whatever reason vectorDir and vectorUp seem to have redundant information to some degree. So vectorUp needs to be rotated horizontally, too, if Roll (Principal axes) isn't wished for (which makes it less easy, but makes somewhat sense). OK! No it get's a little ridiculous, because vectorDir alone doesn't seem to allow to set an objects Pitch (because setVectorDir ignores z-Values) it is, however, required to set the correct z-Value for vectorDir when wanting to alter an object's Pitch by setVectorUp, which is, obviously, neither reasonable nor makes it things any easier.
Has anybody here ever made any usefull things with setVectorDirAndUp and other commands of that ilk? Does the angle between vectorDir and vectorUp always have to be 90ยฐ? I'm kinda lost on this, because the maths aren't trivial when dealing with Quaternions (while they are avoiding any gimbal locks) and I don't know how A2 is handling those vectors.

meager heart
umbral fiber
#

Can I execute a script while in the editor to place objects?

icy light
#

Ok so how would you change the background color of something to red in gui editor? currently [-1,-1,-1,-1]

#

and also what on earth is active color?

meager heart
#

Ok so how would you change the background color of something to red in gui editor? currently [-1,-1,-1,-1]
[R,G,B,A] - Red, Green, Blue, Alpha aka transparency ๐Ÿ˜€
[1,0,0,1] < ๐Ÿ”ด

icy light
#

ahh ok ty

meager heart
#

and also what on earth is active color?
that is active color

#

(you will get it, just keep digging ๐Ÿ˜„)

icy light
#

one more thing please

#

when i save the gui, where does it put the exported file?

meager heart
#

@icy light

icy light
#

ty!

tough abyss
#

does this remoteExec look wrong to anyone? I'm trying to make the say3D do this so I can get away with a random sfx.

[[_obj_eff,_StoneSFX, 500] remoteExec ["say3D"]];  //trying to make this
_emit say3D ["_StoneSFX", 500]; //do this but with the _StoneSFX
meager heart
#
[<object>, [<soundName>, <maxDistance>, <soundPitch>]] remoteExec ["say3D"];
[<object>, [<soundName>, <maxDistance>]] remoteExec ["say3D"];
[<object>, <soundName>] remoteExec ["say3D"];
#

@tough abyss

tough abyss
#

TY gonna try that

meager heart
#

glhf

little eagle
#

@wheat geyser There is no MouseMoved eventhandler. There is MouseMoving though. MouseMoving does not report any angles, it reports cartesian coordinates.
vectorDir and vectorUp are not redundant, but they are always perpendicular. I made lots of useful things with setVectorDirAndUp. Yes, these vectors always have to be perpendicular. There're no quaternions in the game.
You sound confused.

#

Using it to draw a scripted mildot reticle to help creating weapon optic reticles.

tough abyss
#

G'day, so... sqf { _x ctrlSetFade 1;//true _x ctrlCommit 2; } forEach
Seems to fade out of defined dialogs, however if I would want to fade in a certain button, image etc. what would I change?

vague hull
#

1 to 0

little eagle
#

Replace _x with the CONTROL you want to fade.

tough abyss
#

wiki: _ctrl ctrlSetFade 1; // hides the control

#

wow I am blind, sorry lol

little eagle
#

What you posted before is a loop, that does this "forEach" things. I guess things is an array of all controls of your display.

tough abyss
#

Yes, I have an array of controls that are defined with _display

little eagle
#

Use setFade/commit on every one of them you want to hide or unhide.

#

It may get a bit wonky with controls groups controls, but otherwise it's pretty straight forward.

tough abyss
#

Hmm I think I am interpreting the function very wrong... I'd like to clarify something

#
{
    _x ctrlSetFade 0;//true
    _x ctrlCommit 2;
} forEach [_BACKGROUND, _KEYCHAIN];```
#

My interpretation is that it will fade in these controls

little eagle
#

This will unhide the background and keychain in 2 seconds.

#

My interpretation is that it will fade in these controls
Yes.

tough abyss
#

Fading in control buttons doesn't seem to work, it only works with textures, yes?

#

I would need to ctrlShow the buttons

little eagle
#

I never heard that it wouldn't work with every type of control.

tough abyss
#

Actually I just realised it kind of makes sense why, especially if you have transparent button, then there is no point

little eagle
#

You hid the wrong control?

#

I'm not sure fading a (transparent) button would disable it. You can use ctrlEnable false to disable the button instead.

#

Though I have recently learned that fading a map control disables it's draw eventhandler. So there's that.

still forum
tough abyss
#

fading in vs, fading out must be different functions when applied to controls, because it only hides the controls by fading them

little eagle
#

Transition delay is defined by ctrlCommit.

tough abyss
#

yep and that is fine, but All controls are shown regardless of being asked to being faded in, so it's as if they are fading in even though they begin 100% visible

#

^^ Not in general, this is just a problem I am having

little eagle
#

Independent from Arma, I generally hate fading ui. It just slows me down using the ui as I'm waiting for pointless fading.

#

Even if the fading is very fast, it's just pointless. UI has to be functional.

tough abyss
#

True that, but depending on what you're making I think this view of yours could change

little eagle
#

No, my views never change, because it's convenient to live that way. JK, but fading ui will always suck, because it objectively sucks.

tough abyss
#

can I PM you a video of what I made? Maybe you could better understand where I am coming from

little eagle
#

Sure, but you'll have to wait 10 hours for me to check it out, because I g2g now.

tough abyss
#

No worries, catch you soon then

still forum
#

@little eagle Just imagine! Fading settings menu! How splendid it would be

little eagle
#

๐Ÿ’ฉ

tough abyss
#

is A3DC still being updated? it lacks like 50 control attributes

#

Let's say for example, my onLoad of a dialog executes this function. That is supposed to show a background, then after 1 second, a button fades in.

#

Would this be accurate: ```sqf
_display = findDisplay blahblah dialog; //whole dialog file

_screenBackground = displayCtrl 1;
_screenButtonImage = display Ctrl 2;

}
ctrlShow [_x, true];
} forEach [_screenBackground];

uiSleep 1;

{
_x ctrlSetFade 0;
_x ctrlCommit 1;
} forEach [_screenButtonImage];```

unborn ether
#

Christ ๐Ÿ‘€

tough abyss
#

?

still forum
#

you have a syntax error. It won't work

#

but other than that.. And the missing privates it looks... still bullshit as the forEach is useless.. But other than that.... I guess.. It could be okey

tough abyss
#

In my script, there are lots of displays, and the forEach is long. I purposely chose to only include one in there to save you the cancer.

#

Yea my bad I typed that fast af

still forum
#

As a tip then. If there are more but you just deliberately make it shorter. Show that you made it shorter like [_screenBackground, ...]

tough abyss
#

Makes sense, will do. Cheers brother

#

Can you please take a look at my function? Doesn't seem to be working accurately, would be much appreciated

verbal otter
#

i'm try'ing make waitUntil {} in cicle, but getting error - suspending not allowed in this context

#
for "_i" from 0 to 10 step 1 do {
    _loading_pb ctrlSetPosition [0,0,0,0.01];    
    _loading_pb ctrlCommit 0;
    _loading_pb ctrlSetPosition [0.282,0.5544,0.428788,0.01];
    _loading_pb ctrlCommit _time;
            
    waitUntil {ctrlCommitted _loading_pb};
};
meager heart
#

๐Ÿ™„

still forum
#

Well. I guess.. Suspending is not allowed in that context....

#

you'll have to use spawn.. Which is looots of fun with dialog/control type variables

tough abyss
#

fading in controls replaces the need to ctrlShow them right?

still forum
#

I'd say no

#

fading controls their alpha. ctrlShow controls their "enabled"

tough abyss
#

I'm trying to open a dialog, showing the frame, waiting one second, then fading in the controls. But nothing works.

#

can i send you the script

still forum
#

I don't do UI scripting. So if it's a problem with the used UI commands I probably can't help you

tough abyss
still forum
#

I don't understand..
you are using control ctrlSetFade x but then again ctrlShow [idc, x]

#

why are you mixing variants?

tough abyss
#

the ctrlShow [_x, true] just enables the buttons, not the images

#

I realise I should probably use ctrlEnable instead

still forum
#

yeah.. But why are you using the IDC variant instead of the control one? While you already use the control variant elsewhere

tough abyss
#

oh shit

#

i see what you mean

#

wow thanks for that haha, ill reconfigure some things

verbal otter
#

@still forum ty

tough abyss
#

Wait a minute, the control variants arent defined for the buttons

#

only for the images

still forum
#

what?

#

no..

#

control is control.. whatever is behind that

tough abyss
#

did you mean that it should be forEach [_settings instead of forEach [4234234 for example?

still forum
#

yes

#

controls instead of IDC's

tough abyss
#

you wouldn't believe me if i told u....

#

this whole time onLoad has been empty "";

#

fuck

#

my

#

lif

#

I'm actually speechless

verbal otter
#

@tough abyss you trying something like this?

#
{_x ctrlShow false;} forEach [ctrl1,ctrl2,ctrl3...];
tough abyss
#

do I need to hide the controls prior to fading them in? Or can I just fade them in?

#

So I can just _x ctrlShow false; everything on dialog open, and then just fade in the controls needed?

verbal otter
#

@tough abyss ```sqf
{
_x ctrlShow false;
} forEach [_backgroundIMAGE,_borderScreenIMAGE,_whiteBackgroundIMAGE,_batteryInfoIMAGE,_keyChainIMAGE,_messagesIMAGE,_gangIMAGE,_playerInventoryIMAGE,_licensesIMAGE,_adminIMAGE,_syncIMAGE...];

#

something like this sqf _allCtrls = allControls findDisplay 16999; {_x ctrlShow false;} forEach _allCtrls;

#

you need fadeOut?

#

or fadeIn

#

fadeIn: sqf _allCtrls = allControls findDisplay 16999; {_x ctrlSetFade 1; ctrlCommit 0;} forEach _allCtrls; {_x ctrlSetFade 0; ctrlCommit 3;} forEach _allCtrls;

#

not needed to hide

#

@tough abyss

tough abyss
#

oh I see, so if you fade them in, then it replaces the ctrlShow function

verbal otter
#

yes

#

not needed to ctrlShow

tough abyss
#

wouldn't you need a sleep between fading out and in?

#

oh wait it does the first function first

#

nvm

#

hmm I used your code but every control just shows up anyway with no fade

verbal otter
#

hmm

#

i think sleep needed

#

try sleep 1; between 2 and 3 lines

tough abyss
#
_allCtrls = allControls findDisplay 16999;


{
    _x ctrlSetFade 1;
    _x ctrlCommit 0;
} forEach _allCtrls;

sleep 1;
 
{
    _x ctrlSetFade 1;
    _x ctrlCommit 3;
} forEach _allCtrls;
verbal otter
#

yes

tough abyss
#

oh I think the second sqf _x ctrlSetFade 1; needs to be sqf _x ctrlSetFade 0;

#

since it is fading in

#

i now realise you said that in the first place

#

lmao

dry egret
#

anybody know what command used in laws of war for opening the ann webpage?

tough abyss
#

hmm still opens every control without fade

#

Even if I literally just have sqf _allCtrls = allControls findDisplay 16999; {_x ctrlShow false;} forEach _allCtrls; nothing hides

#

and the function is being executed, because I am getting the hint

#

display number 16999 is also correct

winter rose
#

systemChat str (findDisplay 1699);
systemChat str _allCtrls;

โ†‘ debug pls ^_^