#arma3_scripting

1 messages ยท Page 293 of 1

distant egret
#

last released one

little eagle
#

And what did you do?

distant egret
#

[_group, _target, _range, 7, "MOVE", "SAFE", "YELLOW", "LIMITED", "COLUMN"] call CBA_fnc_taskPatrol;

#

_target = spawnpos of group. All worked in previous version.

little eagle
#

_target is a position 2d array?

distant egret
#

using CBA_fnc_getPos

#

so guessing 3d

little eagle
#

sorry, can you paste the full code?

distant egret
#

well it's a function i just created,


_target = _target call CBA_fnc_getPos;

[_group, _target, _range, 7, "MOVE", "SAFE", "YELLOW", "LIMITED", "COLUMN"] call CBA_fnc_taskPatrol;```
little eagle
#

And that function is called with what parameters?

distant egret
#

[group this ,group this,250]

#

via editor

little eagle
#
[group this, group this call CBA_fnc_getPos, 200, 7, "MOVE", "SAFE", "YELLOW", "LIMITED", "COLUMN"] call CBA_fnc_taskPatrol; 
#

I put this in the init box and it works

distant egret
#

ok... let me try again.

#

k, just tried it local (was on dedicated server before) and it seemed to work, ill investigate why it didn't work on the server.

little eagle
#

If you supply a position array to CBA_fnc_taskPatrol, it has to be a 3D position.

#

Dunno why, to me it should handle both

#

["_position",[],[[],objNull,grpNull,locationNull],3],

#

The 3 means 3d array

distant egret
#

Yea, I'm guessing my server admin that updated the repo fucked it up.

little eagle
#

There was a bug with CBA_fnc_getPos. It would report the array reference instead of a copy.

#

So bad code that relies on the array reference will be broken now

#

Dunno if that is what's happening here.

distant egret
#

Seems to work now.. idk what happened but it works now. Thx for the help anyway.

oak marten
#

How can I do that when a civilian die mission is fail or hint a message?

halcyon crypt
#

possibly

oak marten
#

I know, but any civilian, not specific !alive my_civilian, neither civilian not present (all civilian not present)

tough abyss
oak marten
#

for example, 50 civilian, 1 civilian die and then mission fail or you see a message: "a civilian die"

tough abyss
#

just use

addmissioneventhandler ["Entitykilled","_this call your_fnc"];

to call your_fnc which contains the code for bis_fnc_endMission

oak marten
#

entitykilled is a specific unit?

#

its more as any of civilian killed then trigger on

tough abyss
#

No its triggered if any unit is killed. but it's calling the function and inside the function you can use if(side (_this select 0) == civilian) then {code}

oak marten
#

what mean select 0?

tough abyss
#

wait I PM u

oak marten
#

Thanks @tough abyss for your help!

tough abyss
#

๐Ÿ™‚ de nada

oak marten
#

๐Ÿ˜ฎ

peak plover
#

I need ideas for civilian ai script. Anyone got any good pointers / examples?

#

I think it should also include animals and probobly run on the server (hc manages normal ai). Probobly best to just spawn them around the players ?

slim apex
#

In what aspects? Do you want the AI to act like normal civilians? Or rebelious civilians?

peak plover
#

See that's a great idea. Thanks

slim apex
#

Glad i could help? ๐Ÿ˜„

tough abyss
#

lol

peak plover
#

They should probobly be open to rebellion, also they are kind of more like an ambient feature, which is supposed to distract the players. So the players would not shoot on sight and be cautious.

slim apex
#

So, sort of like a Takistan Milsim sorta thing?

peak plover
#

Yeah, it's for "Insurgency"

slim apex
#

Like, where people could be armed, but not everyone?

#

Ah, ok

peak plover
#

I need a bunch of ideas and features, maybe some good examples, before i start working on it

slim apex
#

Where is it based?

peak plover
#

Currently chernarus, but I want to have Tanoa(vanilla) and Takistan as well

#

Once all the features have been completed.

slim apex
#

Cherno, you could have some sort of russian-ish millitary style, so some AI are equiped with some russian made pistols etc, or AKs

#

These ideas are if you're doing modded btw

peak plover
#

The military combatants are already there, just need some cool civilians / animals

slim apex
#

Taki, AI with suicide vests, AKs and random spawning IEDs (I know that doesn't really sit in with AI, but it could look like the AI placed them?)

#

Are you doing hostile vehicles at all?

peak plover
#

Yeah

slim apex
#

You could find a mod for a "Home-Made Pickup with a PKP" and do a small spawning rate for those? ๐Ÿ˜›

#

I'm not really sure tbh, but those are some basic ideas

peak plover
#

Yeah for taki IED's and suicide vests sound good

safe forum
#

how I can delete variable, that added via setVariable?

slim apex
#

Set it as blank? Or if you've got a true/false variable, set it to true/false by using setVariable again

indigo snow
#

setting a variable to nil "deletes" it for most uses

safe forum
#

I use allVariables and I want to delete variable from this array

#

in A3 setVariable broadcast nil value

slim apex
#

I've never worked with allVariables before, so i can't really help you there. Sorry ๐Ÿ˜ฆ

meager granite
#

missionNamespace setVariable ["something", nil];

#

Or whatever namespace you used allVariables on

safe forum
#

I set variable on object

tough abyss
#

i don't think you can delete it from the allVariables array as it deals like a diagnostic output. As Sa-Matra mentioned, you can set variables to nil and they won't be in the array afaik. If you want to be safe, put allvariables into battleye-filters

safe forum
#

I'll try, thanks

meager granite
#

same thing

#

_unit setVariable ["something", nil]

slim apex
#

Couldn't you do this setVariable?

#

Or would that not work?

tough abyss
#

if i understood right, he just wants a variable to be invisible in the allVariables-Array but not delete its value

cedar kindle
#

then it wouldn't be a variable ๐Ÿ˜„

#

you can't modify that array

plucky beacon
#

I'm having this weird glitch only on dedicated servers, I play the mission and it runs the failure condition, I select the same mission again right after and it fails immediately at the start. Is it not reinitalizing variables?

slim apex
#

Hmm, that's weird. Try going to the server admins topic? That could help

meager granite
#

what variables?

plucky beacon
#
    if(!MissionActive) exitWith {};
    if (EndScreen) exitWith {};
    EndScreen = true;
    publicVariable "EndScreen";
    playMusic "Failure";
    sleep 2;
    Command sideRadio "MissionFailed";
    ["Command", "Mission failed, bring it next time!"] call BIS_fnc_showSubtitle;
    sleep 1;
    ["End2",False,True,False] call BIS_fnc_endMission;

I tried to circumvent the issue with a boolean, but it looks like it's somehow being saved

#

called from here

private _BluforAliveCount = {alive _x} count _this;
private _displayCount = _BluforAliveCount - 1;
[[_displayCount],"GUI\update_blufor.sqf"] remoteExec ["execVM",0,false];

if(_displayCount == 1) exitWith
{
    [[],"LastMan.sqf"] remoteExec ["execVM",0,false];
};

if(_displayCount < 1) exitWith
{
    [[],"BluforFailure.sqf"] remoteExec ["execVM",0,false];
};
tender fossil
#

Hey

#

Is it allowed to offer paid scripting job and/or stake of a game studio here?

plucky beacon
#
BluforPlayers = [];

BluforPlayers = allUnits select {side group _x == west};

BluforPlayers call missionStarter_fnc_remainBlufor;

which starts from here

#

and yess I know allUnits doesn't inclead dead ones

#

but I could possibly use the function for something else

#

@tender fossil I think BI forums has their own hiring scripters thing so I'm pretty sure ti's allowed

tender fossil
#

It does nowadays? Wait, I need to check that out lol

plucky beacon
tender fossil
#

Yeah found that out, thanks for the tip! I have totally missed it ๐Ÿ˜ƒ @plucky beacon

plucky beacon
#

no prob

tender fossil
#

Well anyways, I'm looking for experienced and advanced scripter with possible full time job with decent pay and/or stake of company ๐Ÿ˜ƒ

#

Especially familiarity with Arma UIs is needed

jade abyss
#

write that stuff in the forums...

tender fossil
#

Yeah, I will ๐Ÿ˜ƒ

plucky beacon
#

so many smilies

tender fossil
#

^^

tender fossil
#

@tough abyss No, we had to quit because of real life happenings. Our scripter can't continue due to his health, and I was thinking about trying once more with new team and this time funding from the start unlike earlier

#

Eg. my dad and grandpa committed suicide and scripter lost his mother (father had died earlier) and we also both fell sick, but I've recovered now, so I got that going for me

#

@tough abyss

#

So just gotta stand up and try again

#

Yeah, I'm doing quite well now and Arma keeps bringing joy to me, hopefully to others too in future (by us) ๐Ÿ˜ƒ

plucky beacon
#

shit got real at suicide

little eagle
#

DriftingNitro is the smiley police

plucky beacon
#

one is fine, twice is a coincidence, three times is "OMFG stahp nobody smiles that much wtf you think you're doing"

little eagle
#

So you keep count?

plucky beacon
#

only within a short timespan

little eagle
#

Tbh I don't even notice anymore.

#

Some of them are cool, but generally they're just annoying.

#

I really like this one:
๐Ÿค”

plucky beacon
#

It kind is a big glaring yellow circle in the middle of a gray landscape

#

๐Ÿ‘Œ

little eagle
#

I like gray landscapes.

#

Oh and this one:

#

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

plucky beacon
#

๐Ÿš• ๐Ÿ˜Œ ๐Ÿผ โ˜• ๐Ÿ‡ฌ ๐Ÿ‡ฆ ๐Ÿ‡พ

#

they're dumb

#

but the kids these days

#

Hopefully emojis aren't implemented into arma

little eagle
#

ใƒ„ is

plucky beacon
#

at least it still qualifies as text

jade abyss
#

I like some of them

little eagle
#

I knew who placed these reactions without checking.

jade abyss
#

๐Ÿ˜‰

oblique spoke
#

hahaha

little eagle
#

:turd:

plucky beacon
#

๐Ÿ’ฉ

jade abyss
#

: poop:

plucky beacon
#

wait why is your poop diffrent from my poop

little eagle
#

Biology

jade abyss
#

because: I am the best.

little eagle
#

My poop is the best. It will make your head spin.

plucky beacon
#

๐Ÿ‡ฉ ๐Ÿ‡บ ๐Ÿ‡ฒ ๐Ÿ‡ง

jade abyss
#

๐Ÿ‡ง ๐Ÿ‡ด ๐Ÿ‡ท ๐Ÿ‡ฎ ๐Ÿ‡ณ ๐Ÿ‡ฌ

#

Okay, back 2 scirpting, too much spamming again^^

plucky beacon
#

dangit

jade abyss
#

I demand a SpamChannel

plucky beacon
#

I was going to do one maor

jade abyss
#

@lavish ocean Can we (i) get a SpamChannel? ๐Ÿ˜

plucky beacon
#

give him a spam channel

little eagle
#

๐Ÿ‡ธ ๐Ÿ‡ผ ๐Ÿ‡ช ๐Ÿ‡ฆ ๐Ÿ‡ท ๐Ÿ‡ผ ๐Ÿ‡ด ๐Ÿ‡ท ๐Ÿ‡ฉ ๐Ÿ‡ซ ๐Ÿ‡ฎ ๐Ÿ‡ฑ ๐Ÿ‡น ๐Ÿ‡ช ๐Ÿ‡ท

plucky beacon
#

that only he and mods can access

jade abyss
#

oh my

little eagle
#

Only blue names

plucky beacon
#

do vets have a special channel of their own?

little eagle
#

You're out, Drifting

plucky beacon
#

I know

#

I haven't contributed my young adult life to the arma community yet

jade abyss
#

Nope, no special Channel.

plucky beacon
#

heck if I know what actually qualifies someone to be a vet anyway

#

besides making something really popular

rancid ruin
#

step 1: don't be a scrub. step 2: don't be a scrub for a really long time

plucky beacon
#

lucky for me I don't take baths

little eagle
#

oneoh is a scrub

jade abyss
#

I am no Bush, wth?

plucky beacon
#

savage

peak plover
#

{_x setpos [random 10000,random 10000, 0]}count allUnits;

#

Crashed my game

#

Why

jade abyss
#

You deserved it.
(didn't for me)

#

P.S.
0,0072 ms

little eagle
#

Dscha is a hack, don't trust him.

peak plover
#

Looking at BRM insurgency, looks like somone placed down 800 markers and has a line that spawns a trigger on every one of them

#

Why can't I have the determination to do this :S

#

Anyway, what were the civilians like in the arma 2 insurgency?

jade abyss
#

sush @little eagle sush

stray kindle
#

@peak plover say bye to performance ๐Ÿ‘‹

open vigil
#

Dwarden did hint at a Veterans only /VIP, "5. for now this server is only for public chats, VIP/private channels maybe later (as separate server)"

turbid thunder
#

@peak plover "Count" allUnits?

jade abyss
#

a bit faster then forEach

peak plover
#

{systemChat str _x;true}count [1,2,3];

#

Count does not only count the array

#

You can also use it to do stuff with the array, or add conditions

peak plover
#

{x > 1}count [1,2,3]; //2

#

Yup. Speed is everything

jade abyss
#

BUT:
Read also the "Make it fast." part ๐Ÿ˜‰

peak plover
#

Excessive cleverness is doing something in a really clever way when actually you could have done it in a much more straightforward but slightly less optimal manner.

jade abyss
#

The whole quote.

tough abyss
#

Can someone help me with this script

#

I have it working

#

But the chars ร…ร†ร˜ is just a space

#

Is there any way to make the game display them

#

Letters*

#

Nwm solved it myself ๐Ÿ˜ƒ

tough abyss
halcyon crypt
#

replace player with _x ๐Ÿ˜ƒ

#

player will always be the client that the code is running on ^^

#

while _x will be an element in playableunits

tough abyss
#

And this code will run at all time right?

#

When the server is up

halcyon crypt
#

it will run once and only when in SP

tough abyss
#

SP?

halcyon crypt
#

single player

tough abyss
#

What if i want it to run at all times on a server

#

?

halcyon crypt
#
if (isMultiplayer) then {
    while { true } do {
        { removeAllWeapons _x } forEach playableUnits;
        sleep 0.1;
     };
};
#

something like that

cedar kindle
#

the code block for forEach is on the wrong side

halcyon crypt
#

for the lazy ๐Ÿ˜›

cedar kindle
#

in the padtrbin*

#

pastebin

jade abyss
#

*count

tough abyss
#

Dident you say it only worked in SP?

halcyon crypt
#

yes because you had if (!isMultiplayer) exitWith {}

jade abyss
#

Where did you copied that code from?

tough abyss
#

I dident

#

I jut wanted to try

#

Just*

jade abyss
#

Then why did you use ! ?

tough abyss
#

Cause i saw the ! in another script

halcyon crypt
#

[11:30 AM] Dscha: *count
any reason why you'd go for count instead of forEach?

tough abyss
#

And thought i neede to have it

jade abyss
#

Why not Marcel?
He doesn't need the _forEachIndex and count is a bit faster.

halcyon crypt
#

because forEach is more intuitive and the 0.00001ms performance difference is meh ๐Ÿ˜„

tough abyss
#

Thanks anyway

jade abyss
#

0.00001ms is 0.00001ms
(5 bucks are 5 bucks, if you know what i mean ๐Ÿ˜„ )

halcyon crypt
#

hehe

dusk sage
#

Make it work then worry ๐Ÿ˜›

#

Room for error with count

jade abyss
#

You think "count" would be a problem? XD

dusk sage
#

If you blindly use it, yes

#

There isn't many situations you could just stick count in place of forEach and not expect errors

#

And if you're asking basic questions, it's probably going to happen ๐Ÿ˜›

jade abyss
#

There isn't many situations you could just stick count in place of forEach and not expect errors

Erm, wut? oO Any case where you don't need _forEachIndex = count can be used without any probs

dusk sage
#

No

jade abyss
#

Wich not?

dusk sage
#

It must return nothing/boolean

#

Which unless you read the docs closely, will probably throw people off

jade abyss
#

Just gimme an example what you mean.

dusk sage
#

Sec, on mobile

jade abyss
#

yepyep, take your time.

dusk sage
#
{ 
    arr pushBack _x;
} count arr2;
#

For example that will error

jade abyss
#

Ah, got ya. true.

dusk sage
#

I mean sure it's better, but best to not cause more problems if you're just getting the basics ๐Ÿ˜ƒ

jade abyss
#

(e.g. if you doesn't even know what ! does^^)

dusk sage
#

Heck, I've been stung by it enough times, I stick a true at the end of all my count loops unless it's obvious (too lazy to check returns on the wiki Most of the time)

#

๐Ÿ˜„

jade abyss
#

btw.: Result would be [1] in the example above, when arr2 = [1,2,3] ๐Ÿ˜„

#

false also works at the end

dusk sage
#

Yes but

#

True is one less character

#

๐Ÿคฃ

jade abyss
#

kldfsgretbreuitgbrfaeg ae

#

rly? ๐Ÿ˜„

dusk sage
#

You talk to me about micro optimisation

#

Save the bytes

#

I keep telling commy they are going extinct

#

!!

jade abyss
#

Commy is going extinct?

#

๐Ÿ˜„

#

Commy is a MacroMasochist.

dusk sage
#

We need to spam the chat, or he'll comment on count vs forEach

jade abyss
#

@little eagle Oi, MacroMasochist

#

๐Ÿ˜„

dusk sage
#

๐Ÿ˜„

nocturne bluff
#

Using count instead of for each is dumb and you should feel baf

turbid thunder
#

"Micro optimisation" more like Nano Optimisation :D

#

But good to know that count can execute code. Thought it could only be supplied with an array and an optional condition

#

Idea. Lets use forEach to count stuff

nocturne bluff
#

Alteast that would more vaild then using count to loop over items :>

still forum
#

Also as I recently found out true is a function call. So you are swapping the variable assignment from forEach for a function call. If that get's fixed someday count may even have a higher benefit that it does now

peak plover
#

My script is slow as is, some people just aren't rich enough to afford forEach in it's simplicity.
๐Ÿ›ซ ๐Ÿฌ ...sometimes compromises have to be made

halcyon crypt
#

if your script is "slow" I doubt you should be looking at forEach vs count ... ๐Ÿ˜

peak plover
#

Yeah, it's probobly distance

#

It's just nearObjects does not return units in vehicles, and I'm not sure if it's even faster if I check all the nearObjects and then ask it some questions ๐Ÿ˜ฆ

tough abyss
#

hey just a simple dumb question - how do i detect in an if-case if a player has disconnected to terminate the script

peak plover
#

(_player in allPlayers)

tough abyss
#

oh so simple - thanks nigel

prime valve
#

Hey guys, is it possible to hide / turn on//off a reflector inside an object ? Like I have a spotlight with a reflector, and I want to make it blink at a certain time via script, is that possible ?

peak plover
#

What's a reflector?

prime valve
#

This is a light declared in the config under the aggregateReflectors array

#

It's a spotlight defined with memory points

peak plover
#

Maybe this will help youi

prime valve
#

Nope

#

Sadly

peak plover
little eagle
#

Good thing I only get pinged for very important things.

plucky beacon
#

I think i tagged dscha once

halcyon crypt
#

๐Ÿ˜ฎ

tough abyss
#

does OnPlayerDisconnect EH also trigger if a player looses connection or presses alt+f4?

#

๐Ÿ‘ ty

little eagle
#

Does anyone use that one? I thought HandleDisconnect is better in all regards since it actually passes the old player object.

tough abyss
#

We're using HandleDisconnect, just had this commandname in mind

plush cargo
#

Sooo, I have drawline3d and drawicon3d working perfectly fine, but when I switch the camera, the lines stay but the icon dissapears.

#

creating after switching to the custom camera results in line showing up and icon not

little eagle
#

Doesn't sound like it's working perfectly fine then.

plush cargo
#

agreed

#

Ahhhh doesnt work when showHud false

little eagle
#

Sorry for not being of any help.

plush cargo
#

when in doubt, read the wiki again

peak plover
#
private ["_var1","_var2","_var3","_var4","_var5"];
_var1 = 0;
_var2 = 0;
_var3 = 0;
_var4 = 0;
_var5 = 0;

is 0.001ms slower than

private _var1 = 0;
private _var2 = 0;
private _var3 = 0;
private _var4 = 0;
private _var5 = 0;
little eagle
#

The first one also contains redundant information.

peak plover
#

private ["_var1"]; //nil

little eagle
#

Yes, the private command has no return value.

peak plover
#

What's redundant ?

#
private _var1 = 0; 
private _var2 = 0; 
private _var3 = 0; 
private _var4 = 0; 
private _var5 = 0; 
_var1 = 1; 
_var2 = 1; 
_var3 = 1; 
_var4 = 1; 
_var5 = 1;

0.0039 ms

private ["_var1","_var2","_var3","_var4","_var5"]; 
_var1 = 0; 
_var2 = 0; 
_var3 = 0; 
_var4 = 0; 
_var5 = 0;
_var1 = 1; 
_var2 = 1; 
_var3 = 1; 
_var4 = 1; 
_var5 = 1;

0.0052 ms

little eagle
#

Duplicate information that is copy pasted. The variable names

peak plover
#

Please elaborate

little eagle
#

Let's say you have this:

private ["_var1","_var2"]; 
_var1 = 0; 
_var2 = 0; 
#

And you want to add _var3

#

You have to write down _var3 two times

peak plover
#

Yes

little eagle
#
private _var1 = 0; 
private _var2 = 0; 
#

Here you have to write down _var3 only once.

peak plover
#

Yes, I guess that's where the extra speed comes from

little eagle
#

It comes from not having to iterate through an array of strings. Avoiding redundancy on the other hand improves maintainability of the code.

#

So the keyword is better on both fronts.

peak plover
#

It's just I've been using private for the longest time and I doubt the reality of my own excistance after acquiring the thruth.

willow basin
#

Sure, the variables are initialized only once by doing private _xyz = 0;

little eagle
#

There is no initialization of variables in SQF. private sets the variables home scope.

#

The only performance difference is from having one less command that iterates through an array of strings. That's all.

halcyon crypt
#

I wonder what made BI go with the private array thing in the first place

#

it's just weird

little eagle
#

SQF doesn't use any keywords besides = (asignement) and private. They probably wanted to avoid keywords for simplicity of the language.

halcyon crypt
#

I guess

peak plover
#

Interesting

willow basin
#

Sure but by telling him private ["_xyz"] SQF reserves the variable _xyz for the currents scope and you do that in once step together with the value assigment by using private _xyz = 0 rather than in 2 steps. Or am I totally wrong?

halcyon crypt
#

must be their interpretation of non-programmer friendly ๐Ÿ˜›

little eagle
#

Two steps, sure. But there is no "initialization" internally. The overhead is from doing one additional command (C++ function call) and the input validation (is "_xyz" a SQF string?).

#

And creating the array in case of private ARRAY vs. private STRING.

#

I personally don't mind the performance difference, but I can't stand the redundancy. Pain in the ass when changing variable names (oops, forgot to change the private array at the function top).

willow basin
#

Yea, I also personally prefer setting the access modifier on the first variable initialization / assigment.

peak plover
#

What's the "-" equivalent to append

little eagle
#

deleteAt find

#

_array deleteAt (_array find _element);

peak plover
#

redundancy comes to play again

little eagle
#

Yeah, but there is no alternative here.

#
#define POP(arr,var) (arr deleteAt (arr find var))

POP(_array,_element);
halcyon crypt
#

that's not what a pop's supposed to do though

vague hull
#

depends

little eagle
#

Isn't it the reverse of pushBack?

halcyon crypt
#

pop removes the last item of an array

little eagle
#

Ok, name it differently then

halcyon crypt
#

or, is supposed to ๐Ÿ˜„

peak plover
#

prepend = {
    params ["_array","_element"];
    _array deleteAt (_array find _element);
};
[_array,_element] call prepend;
halcyon crypt
#

that does something completely different than what the name suggests

peak plover
#

But yeah,

array2 = ["gear","crap","pos"]; array2 deleteAt (array2 find array2)

//0.002 ms

array2 = ["gear","crap","pos"]; array2 = array2 - array2

//0.0022 ms

little eagle
#

that looks wrong

peak plover
#

Hmm, you are right

little eagle
#

always

peak plover
#
array2 = ["gear","crap","pos"]; array2 deleteAt (array2 find "crap")

//0.0018 ms

array2 = ["gear","crap","pos"]; array2 = array2 - ["crap"]

0.0022 ms

little eagle
#

The second one cannot be used if you rely on pointers, but removes all duplicate "crap" from the array.

#

The first one does only remove one "crap".

#

(the first one)

peak plover
#

Hmm, that's true. Can't get rid of all the crap with that one

little eagle
#
#define POP_RAND(array) (array deleteAt floor random count array)
#

Found this in CBA

cedar kindle
#

useful ๐Ÿค”

little eagle
#

Oh, I wrote it apparently.

#

It's only in one function, cuel

cedar kindle
#

heh yea I'd imagine it's not used often ๐Ÿ˜›

little eagle
#

Alzheimer

plucky beacon
#

That reminds me, does ace have something that generates documentation for functions?

little eagle
#

You mean the function header?

plucky beacon
#

Well ya they all have headers, but do you use anything to write pages of documentation in webpage format

#

Like something that reads the headers

little eagle
#

Like 98% of the ACE functions are for internal use only.

plucky beacon
#

Hmm

little eagle
#

CBA has it.

#

Don't think the ACE header is compatible with the script though.

plucky beacon
#

Cba had their own thing?

little eagle
#

I think it's this one.

polar folio
#

anyway to hide the action menu through script? like not deactivate but put it on hide mode like in the background. i was thinking of quickly adding, removing and executing an action wiht "hideOnUse" true but was wondering, if there is a cleaner way

slim apex
#
this removeAction 0;
#

I think that could work

#

Well

#

You'd have to get the actionIDs

#

๐Ÿ˜ƒ

polar folio
#

that is just to remove an action

slim apex
#

You could remove each individual action?

#

Wait

#

NVM

#

IGNORE ME XD

polar folio
#

k. will do ๐Ÿ˜„

#

np. thx for trying to help

slim apex
#

Np ๐Ÿ˜ƒ

plucky beacon
#

3 smilies but used across two users, counter checks out

peak plover
#

is there any significent performance differance between createVehicle and createUnit ?

little eagle
#

Pointless question, since both commands do entirely different things.

peak plover
#

In theory I can createVehicle a unit as well

rotund cypress
#

the master hpp for all arma dialogs should be placed in ui_f right? I can't find it.

peak plover
#

I removed private ["var]; when unccessary or replaced with private var = value;

#

improved script speed 30%

#

before, took me around 1 second to run the script, now takes me 0.7 seconds

little eagle
#

You should've just put a spawn before it.

halcyon crypt
#

that sounds a bit too good to be true

rotund cypress
#

Hey guys, anyone knows where the master file for all arma dialogs are located? I remember it should be a config.cpp somewhere but cant actually find it

little eagle
#

ui_f

rotund cypress
#

Thas my ui_f

little eagle
#

config.bin

rotund cypress
#

Looks pretty weird to me ๐Ÿ˜ฆ @little eagle

peak plover
#

use CfgConvert to gain access

jade abyss
#
commy2 - Today at 2:56 PM
Good thing I only get pinged for very important things.```
@little eagle Yeah, correct.
little eagle
#

๐Ÿ‡ซ ๐Ÿ‡บ

oblique spoke
#

๐Ÿ˜†

jade abyss
#

๐Ÿ‡ธ ๐Ÿ‡ท ๐Ÿ‡พ ๐Ÿ˜‚

rotund cypress
#

ah alright thanks @peak plover

sharp jay
#

Hello, is there a way to disable placing map markers in certain channels, but not disable said text channels?

rotund cypress
#

You could remove the marker if in said channel

#

I believe

#

Make a loop

#

Or maybe use onDraw EVH

#

Check if a marker is placed, then check if in currentChannel

sharp jay
#

I saw disableChannels

#

would that possibly work?

rotund cypress
#

Yes

#

You could disable the channel completely

sharp jay
#

but then i could not send chat..

rotund cypress
#

Exactly

sharp jay
#

yeah, might actually want to disable chat completely...

rotund cypress
#

Im making something for you right now

#

actually gotta change something

#

Will set the text of the marker to ""

#

so no text

#

if not in a channel that are not in the _blacklistedArray

#

so sidechat would be 1 command would be 6 global would be 0

#

All the channel numbers can be found on the BIS Wiki

#

@sharp jay

sharp jay
#

Thank you so much

#

I would just put this in init.sqf?

rotund cypress
#

yes

#

or spawn it

#

from init

#

but doesnt matter

sharp jay
#

thanks

rotund cypress
#

or you can make a function and set postInit = 1

#

class handleMapMarkerPlaced { postInit = 1; };

#

Let me know if it works

sharp jay
#

i will just try to put it in init

rotund cypress
#

sure

#

Btw guys, is it possible to use a binarized file on a mp mission that I made myself and would it have any benefits?

#

Like a config file

little eagle
#

You cannot disable the side chat or the side and global chat for the admin

rotund cypress
#

Wut? @little eagle

#

No one said that

#

Or?

little eagle
#

I said it.

rotund cypress
#

Alright, I don't think that is what he wants though

little eagle
#

I don't know. Just stating facts.

rotund cypress
#

Ye

#

@little eagle Do you know about my question I had?

little eagle
#

yeah, might actually want to disable chat completely...

rotund cypress
#

ah

#

Btw guys, is it possible to use a binarized file on a mp mission that I made myself and would it have any benefits? @little eagle

little eagle
#

Cannot disable chat completely. You need that to log in etc.

#

No idea.

rotund cypress
#

Alright

little eagle
#

Specify "binarized file"

rotund cypress
#

Like a binarized cfgfunctions

little eagle
#

The only config you can use in a mission is the description.ext aka. mission config.

rotund cypress
#

ah okey

#

so you cant actually binarize cfgfunctions?

little eagle
#

You can binarize config.cpp's

rotund cypress
#

Alright

little eagle
#

And inside them can be a CfgFunctions class.

#

Afterwards you have a config.bin

#

None of these can be used in a mission.

rotund cypress
#

On an extension they can though right?

little eagle
#

I don't think the description.ext is actually binarized in a packed .pbo mission, but I'm not sure.

rotund cypress
#

alright

little eagle
#

Extensions can do anything, but you won't get the game to recognize a CfgFunctions class that is inside a mission, but not in the description.ext without memory editing.

rotund cypress
#

aalright

little eagle
#

Also, you cannot use extensions inside missions either.

#

Thank god, lol.

rotund cypress
#

no but you can use them as a extension

#

like the life extension

little eagle
#

Arma requires good GPU, perfect game to distribute some bitcoin miners.

rotund cypress
#

hhaha wut?

little eagle
#

Forget about it.

sharp jay
#

arma is not that gpu heavy

little eagle
#

Even better. They won't even notice.

peak plover
#

New?

plucky beacon
#

is it possible to spawn a module during the mission

peak plover
#

Yes

plucky beacon
#

is it just a vehicle with the module classname?

peak plover
#

For example the time multiplier module

#
    _center = createCenter sideLogic;
    _group = createGroup _center;

    _module = _group createUnit ["ModuleTimeMultiplier_F", [0,0,0],[],0.5,"NONE"];
    _module setVariable ["TimeMultiplier", mission_time_accel];

plucky beacon
#

iiiinteresting

little eagle
#

createCenter is not needed in A3

peak plover
#

perfect

jade abyss
#

_group = createGroup West; <- Enough

little eagle
#

It's a legacy command. Center is automatically created for you.

plucky beacon
#

is the first paramter in brackets the name of the module?

peak plover
#

Curator implies zeus

plucky beacon
#

ya that was just sort of a side note, it's got no documentation in game or out

#

must be int he file itself

peak plover
#

You can click the config button in the editor

plucky beacon
#

but anyway, is the first parameter in brackets the variable name?

peak plover
#

And scroll thorugh them until you find your module

plucky beacon
#

I did that

#

it's empty

#

have to look at function viewer not config

jade abyss
#

P:\a3\modules_f_curator\Curator\Functions\fn_moduleCurator.sqf

plucky beacon
#
module = _group createUnit ["moduleCurator_f", [0,0,0],[],0.5,"NONE"]; 
player assignCurator module;

well this does what I want, and the setvariable are the parameters of the module itself I'm assuming

peak plover
#

Try looking at MCC, I know they've done this before

plucky beacon
#

thats what I thought too

#

oh

#

nothing I guess

#

don't even know how it worked

#

shit you don't even need to create a module

#

assigning a curator makes a module already

#

wait what no

#

only if there is already an unassigned zeus module

#

hm

#

not sure if this is even worth the effort atm, I don't even need it I was just curious

#

more or less I was thinking of a backup script I would paste in the debu anyway

#

so that really wouldn't ahve been the issue

#

I think commy psoted that too

#

thanks

#

in zeus?

#

i don't think zeus can change module attributes?

#

assignCurator does that thouhgh

#

wait hang on

#

I'm talking about changing attributes of the module to include all unofficialaddons

rotund cypress
#

If I want to make a tree view

#

What ctrl would I use?

jade abyss
#

"TV"

rotund cypress
#

Yes

#

But what ctrl

#

Like a list would be a listbox

#

Like class

#

For the dialog

jade abyss
#

Erm, yes.

rotund cypress
#

?

jade abyss
#

Cmon... 5s Google search ๐Ÿ˜„

rotund cypress
#

Actually been looking like crazy, didn't find that but sorry ๐Ÿ˜‰

rotund cypress
#

lul

#

Dscha I thought you were out of the scripting game?

jade abyss
#

Yeah, i thought the same. It's like an drug addiction. You know its not good for you and your health, but you always come back for a quick kick in the nuts.

rotund cypress
#

SOOO TRUE

jade abyss
#

+Mostly just playing around.

rotund cypress
#

What you said is true though

#

I'm not sure how that is possible though

split coral
#

Yeah, time is the mission time not uitime, and the game is paused when its unfocused. Unless you start it with -nopause, or play MP.

velvet merlin
#

does XEH also overwrite the new EH subclasses?

class CAManBase: Man { class EventHandlers: EventHandlers { class XXX { init = "..."; fired = "..."; reloaded = "..."; }; }; };

#

its does for the normal EH without the subclasses

#

@little eagle bux suggested to ask you as you wrote the new system

tough abyss
#

*each, Sry german t9

jade abyss
#

@tough abyss
It animates the door, just as it would, when you use the actionMenu entry "Open/Close Door"

tough abyss
#

Okay guess it has To do with animationphase

jade abyss
#

Line 13/14 -> (quick and dirty example)

        if( (_CTarget animationSourcePhase _Target +"_Source") >= 0.5 )then { _CTarget animateSource [_Target +"_Source",0];}
        else                                                                { _CTarget animateSource [_Target +"_Source",1];};

->
*EDIT

//in KeyHandler (keyDown EH) _Shift = _this select 2;
if( _Shift )then    { _CTarget animateSource [_Target +"_Source",((_CTarget animationSourcePhase _Target +"_Source") - 0.25)];}
else                { _CTarget animateSource [_Target +"_Source",((_CTarget animationSourcePhase _Target +"_Source") + 0.25)];};```
tough abyss
#

Thanks, i will take a look at it asap. ๐Ÿ™

jade abyss
#

*Edited

tough abyss
#

I will bind it To the mousewheel, would be easier to use i guess ๐Ÿ˜

jade abyss
#

Is there are mouseWheel EH?

#

(not sure, tbh)

tough abyss
#

Trial and error ๐Ÿ‘

jade abyss
#

If so: Add 2 different ones:
One to open/Close Door fully and one for Steps

#

*updated PasteBin

civic maple
#

Does the activation script in a trigger run on every client, or only once?

jade abyss
#

hu?

tough abyss
#

it runs on every client if you do not restrict it with player in thislist i guess

civic maple
#

ok, thank you

jade abyss
#

iirc Trigger are local now

tough abyss
#

they are? cool didn't know that ๐Ÿ˜„

jade abyss
#

ah, wait

civic maple
#

kk, I'm doing it in the editor

#

but I'll just check if ((vehicle player) in thisList) then {...};

jade abyss
#

Remember: Check was "only" every 0.5s

civic maple
#

yeah, I had problems with that on a different occasion :P

dusk sage
#

only just noticed the code in the description on this channel is broken ๐Ÿ˜„

tough abyss
#

๐Ÿ™€

tough abyss
jade abyss
#

๐Ÿ‘

nocturne bluff
#

@tough abyss you can disable the pausing, but it only happens in SP missions anyway.. (-noPause)

velvet merlin
#

does one still have to script dispersion for rockets (infantry launched or from vehicles) (aka random offset) or does dispersion from cfgAmmo work for it by now?

tawdry cave
#

accuracy

halcyon crypt
#

you're talking about different things I think

velvet merlin
#

yep

#

fire a rocket in Arma = always flies straight from the tube

#

while in reality in helos they have a dispersion on purpose to hit an area

#

similar for infantry launchers - in reality many factors influence how exactly the vector turns out to be the rocket leaves the tube

tough abyss
#

Does anyone know why this script snippet doesn't work properly? It just ejects one player (the one who called the function) instead of all passengers.

_heli = vehicle player;
{ 
 if((assignedVehicleRole _x) isEqualTo ["cargo"]) then 
 { 
  _x action ["GetOut", _heli]; 
 }; 
} foreach (crew _heli);
safe forum
#

Hi all. I'm trying to make own extension and I have 1 problem: arma doesn't see my dll from @mod folder, but from root directory it works fine. Why?

willow basin
#

Tried to disable BattlEye?

safe forum
#

disabled

tough abyss
#

i see, thanks quik

tough abyss
#

@safe forum Statically link your extension

#

If you dll is dynamically linked the other dlls need to be in system or arma3 root directory.

bleak schooner
#

How can I pass a local variable from a vehicle to a script?
I have _ lights = false; in my vehicle init and __shine = _vehicle getVariable ["lights", ["Not set", var]] select 1; in my script but it doesn't work

meager granite
#

Your local variable ceases to exist as soon as init code ends

#

You probably wanted entity variable (setVariable)

#

keep in mind that init field executes for each client separately and each new player that joins

bleak schooner
#

What I want to do is have a variable for each vehicle if the emergency lights are on or off. A scirpt should check if the lights are allready on and if yes delete the lights

#

Any idea how to do this?

still forum
#

just setVariable on the vehicle when the lights are created ?

oak marten
#

I write this in init of specific unit:

FiredH = this addEventHandler [["fired", ffaa_armas_c90], {EHScrtp = _this execVM "c90_fired.sqf"}]

*ffaa_armas_c90 = weapon class name.

c90_fired.sqf

c90_used=true;

In game editor trigger with condition:

c90_used;

some one know what is wrong with script?

plucky beacon
#

are arma 2 handlers the same as arma 3?

#

or maybe it's for Arma 2

rotund cypress
#

Hey guys, I'm trying to make a tree view list with players, I have this ```sqf
private _topCategory = _ctrlTree tvAdd [[], "CATEGORIES"];
private _playerCategory = _ctrlTree tvAdd [[_topCategory], "PLAYERS"];

    // -- List Player categories
    private _factions = [ "BLUFOR", "INDEPENDENT", "OPFOR", "CIVILIAN" ];
    {
        private _treeFactionCategories = _ctrlTree tvAdd [[_playerCategory,0], _x];
    } forEach _factions;

    {
        private _playerAdded = switch side _x do {
            case west: {
                _ctrlTree tvAdd [[_treeFactionCategories, 0], name _x];
            };
            case civilian: {
                _ctrlTree tvAdd [[_treeFactionCategories, 3], name _x];
            };
            case independent: {
                _ctrlTree tvAdd [[_treeFactionCategories, 1], name _x];
            };
            case east: {
                _ctrlTree tvAdd [[_treeFactionCategories, 2], name _x];
            };
        };
    } forEach allPlayers;
#

It doesnt show any players

#

Gives this error 23:34:51 Error in expression <name _x]; }; case civilian: { _ctrlTree tvAdd [[_treeFactionCategories, 3], name> 23:34:51 Error position: <tvAdd [[_treeFactionCategories, 3], name> 23:34:51 Error Type Any, expected Number

little eagle
#

@velvet merlin

does XEH also overwrite the new EH subclasses?
No, it uses it's own class.

rotund cypress
#

I'm not sure if I should use _forEachIndex or not, but when I tried that it only gave me problems.

little eagle
#

You should use side group _x

rotund cypress
#

Why?

little eagle
#

It's funny how no one seems to use side group _unit even though it matters, yet everyone seems to use units group _unit where it's pointless.

#

side OBJECT reports SIDE_ENEMEY for renegades and SIDE_FRIENDLY for captives.

rotund cypress
#

So you mean private _playerAdded = switch side group _x do {?

#

I don't see how that matters in this case

little eagle
#

It matters because

side OBJECT reports SIDE_ENEMEY for renegades and SIDE_FRIENDLY for captives.

rotund cypress
#

What does that mean?

little eagle
#

side player // west
player setCaptive true;
side player // side_firendly

#

player addRating -3000;
side player // side_enemy

rotund cypress
#

OKey but I have it set to a very high rating

#

And in this case it does not help my problem

little eagle
#

Syntax:
control tvAdd [pathParent, text]
Parameters:
control: Control
[pathParent, text]: Array
pathParent: Array - Tree View Path of parent item or [] if no parent exists
text: String

rotund cypress
#

I believe that is what im doing

little eagle
#

looks to me like the pathParent is wrong

rotund cypress
#

What should it be, I can't wrap my head around it?

little eagle
#

Probably _treeFactionCategories being undefined

rotund cypress
#

It's being defined though

#

private _treeFactionCategories = _ctrlTree tvAdd [[_playerCategory,0], _x];

little eagle
#

It says any, expected number

#

and the other number is hard coded 3

#

So it's undefined or a different type

#

diag_log

#

diag_log [_treeFactionCategories];

#

if you use this ^ array version, it will log undefined variables too

rotund cypress
#

it logs to any

#

but i dont see how that is possible

#

since it adds the faction categories to the tree view

little eagle
#

shrug

rotund cypress
#

?

#

Like it's being defined here { private _treeFactionCategories = _ctrlTree tvAdd [[_playerCategory,0], _x]; } forEach _factions;

#

ok i think i now, it's in another scope so that might be why

#

i dont know if foreach is treated like another scope

little eagle
#

It is.

rotund cypress
#

then ye thats my problem lul

little eagle
#

Code is weird anyway. You only save the last return value?

#

You can do this:

rotund cypress
#

Wut?

little eagle
#
        private _treeFactionCategories = {
            _ctrlTree tvAdd [[_playerCategory,0], _x];
        } forEach _factions;
#

eye cancer warning.

rotund cypress
#

Ye i did that now ๐Ÿ˜ƒ

#

Didnt know if it would work though

little eagle
#

But that stores only the last return value of tvAdd. Is that correct?

rotund cypress
#

Since its foreach after

little eagle
#

forEach returns the return value of the last iteration.

rotund cypress
#

Im new to tree view

#

so its stuff like that im trying to figure out

little eagle
#

I never used it.

rotund cypress
#

very few seems to have used it lol

#

i dont think this is correct to do this

#

it returned 3

#

could always store in pubvar but that is aids i guess

little eagle
#

?

rotund cypress
#

public variable

little eagle
#

ui is a local thing.

rotund cypress
#

you mean it will give me errors for storing in missionNamespace?

rotund cypress
#

Anyone got any thoughts of what I could use?

bitter magnet
#

is this still bad coding in arma3: sqf waitUntil { count _trigger < 1; };

rotund cypress
#

_trigger isEqualTo []?

bitter magnet
#

no I mean waituntil without any sleep.

rotund cypress
#

Well I don't think that will have a big impact

#

Run a performance test in debug console

jade abyss
#
waitUntil {
    count _trigger < 1;
    sleep 0.5;
};```
bitter magnet
#

many years ago Killswitch teached me that waituntils need sleep especially if the check is not "time sensitive" so to speak. I just wanted to double check if something has changed since those days or is the above code just some newbie making mistakes.

jade abyss
#

nah, nothing changed.

bitter magnet
#

cool.

#

thanks.

jade abyss
#

But: I am not sure, if waitUntil checked every frame or not. gimme a sec

#

Quoting Kju:
By default the cycle time for the condition check is per frame.
So yeah, add a sleep to it Snake (unless you rly rly rly rly rly rly rly rly rly rly need it)

plucky beacon
#

that's a lot of checks

plush cargo
#

@rotund cypress currently messing with RscTree. Heres the code im using atm and the one I used in my marker filter.

#
SRTS_fnc_CommandRefresh =
{
    SRTS_currentGroups = [];
    {
        if (side _x == side player) then
        {
            SRTS_currentGroups pushBack _x;
        };
    }forEach allGroups;
    _tree = ((findDisplay 77000) displayCtrl (77200));
    {
        _name = groupId _x;
        _trunk = _tree tvAdd [[],_name];
        _tree tvSetData [ [_trunk], _name];
        _units = units _x;
        _count = count _units;
        for "_i" from 0 to (_count -1) do
        {
            _branch = _tree tvAdd [[_trunk],name (_units select _i)];
            _tree tvSetData [ [_trunk,_branch],name (_units select _i)];
        };
    } forEach SRTS_currentGroups;
};
rotund cypress
#

Aah nice, i got it all figured out but thanks!

#

Its weird that so few people seem to use treeview

plush cargo
#

It's a headache for sure. Gives the opportunity for a lot of stuff to be going on inside one control

jade abyss
#

If you paste Code:
```sqf
CODE
```

#

@plush cargo

plush cargo
#

๐Ÿค”

#

np

jade abyss
#

That means: You can edit your text now and change it. Its a pita to read code like that in Discord.

plucky beacon
#

... still awaiting edit

plush cargo
#

there you go buddy, read in style

jade abyss
#

perfect =}

plucky beacon
#

๐Ÿ‘Œ

velvet merlin
#

@little eagle so it causes double execution if you have

  1. class UNIT: XXX { class EH: ... { class SUB { fired = "stuff"; }; }; };
    and
  2. class Extended_Fired_EH { class UNIT { MY_TAG = "stuff"; }; };
    right?
#

this means you are only to use XEH now:

  1. if you need any of the advanced features it has over BI EHs
  2. if you are fine to force a XEH dep
    correct?
tough abyss
nocturne bluff
#

@velvet merlin make the BI code go fired ="if(CBA not loaded) then do shit)"

#

ez peasy

#
isClass(configFile >> "CfgPatches" >> "acre_main") then {
// do acre2 stuff 
};
velvet merlin
#

yes ofc. its easy to work around it.my question is to learn if XEH still handles it by itself or no more

tough abyss
#

Is there a way to make BIS_fnc_infoText last longer?
It says only 3 seconds.

split coral
#

It doesn't take time as a parameter, but you could make a copy of the function and change it.

civic maple
#

Does anyone have an idea how to place a number of units at random positions in a building?

still forum
#

You'd have to copy the function and increase the sleeps. It's in functions_f.pbo in GUI\fn_infoText.sqf

split coral
#

Yeah there's sleep 2; near the end, before //fade away section

tough abyss
#

oh ok, thanks!

civic maple
#

oh, interesting

split coral
#

You don't have to extract the game files to get the function. You can just open the functions viewer and copy paste the code.

little eagle
#

@velvet merlin I can't really follow the logic of why you would do that, but yeah, it would fire the event twice.

#

I think.

#

The old configs are annoying to work with. I consider them deprecated and just use CBA_fnc_addClassEventHandler

velvet merlin
#

well so far we have passive CBA support (not required) - yet with the subclass system instead EH, the XEH defs seem no longer needed (unless as said one needs/wants additional features provided by XEH)

little eagle
#

If you already use the subclasses, then there is no reason to use XEH.

tough abyss
#

I'm using BIS_fnc_typeText with an integer custom position of the text (not the left,center,right variables)

#

When positioning the text on my screen it looks great, but when someone else tries it on his own PC it goes off the screen border.

#

Is there anything to do with that?

little eagle
#

Buy a bigger monitor.

tough abyss
#

For real?

little eagle
#

Idk, use a shorter text?

tough abyss
#

it doesn't matter, I position the text till it perfectly fits my screen...

little eagle
#

How?

tough abyss
#
 [  
  ["South To The Takistani Border","<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t><br/>"],  
  ["DD/MM/YY","<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t><br/>"],  
  ["HH:MM","<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t>", 50]  
 ] , *0.96, 0.75*, "<t align = 'center' shadow = '1' size = '1.0'>%1</t>" 
] spawn BIS_fnc_typeText;```
#

those between the * sets the pos

jade abyss
#

iirc: The SIZE you choose depends on choosen the UI-Size of the client (very small, small, normal, mole, blind person)

little eagle
#

Probably. Ui is bad enough, the function probably doesn't account for it.

jade abyss
#

Try it with: size = '(0.03 * safezoneH)'instead of size = '0.7'

#

(test around with the numbers. +Welcome to the world of UI

tough abyss
#

the default UI size is normal?

jade abyss
#

um, yes?

little eagle
#

I think it's SMALL actually

jade abyss
#

(or however its beeing called, just check in your settings what you got and ask other what they have)

#

Not sure, tbh.

#

I have mine since... erm... ever... on Very Small

tough abyss
#

Mine was small for ever lol normal seems very big

little eagle
#

Might also depend on resolution. It also changes when you change resolution.

tough abyss
#

right

#

well I checked with a few friends and they all have different sizes and it depends on the resolutions

jade abyss
#

๐Ÿ˜‰

tough abyss
#

I asked: Is there a way to make BIS_fnc_infoText last longer? It says only 3 seconds

Dedmen said: You'd have to copy the function and increase the sleeps. It's in functions_f.pbo in GUI\fn_infoText.sqf @anden3 https://community.bistudio.com/wiki/buildingPos may help

Then Greenfist said: Yeah there's sleep 2; near the end, before //fade away section

#

I did those, but where do I place the function in my mission?

peak plover
#

I'm having some nice gains optimizing scripts with params, pushback and private

#

Anything else that might help out with performance ?

#
[1, 2, 3] call { 
 params ["_one", "_two", "_three"]; 
};

// 0.003 ms

[1, 2, 3] call { 
    private _one = _this select 0; 
    private _two = _this select 1; 
    private _three = _this select 2; 
};

//0.0034 ms

[1, 2, 3] call { 
 private ["_one", "_two", "_three"]; 
 _one = _this select 0; 
 _two = _this select 1; 
 _three = _this select 2; 
};

//0.0045 ms

#

High speed, Low drag

little eagle
#

Eh, not by much.

#

It's worth it for the readability imo. Also params handles out of bounds, default values, type validation, passing single elements not in arrays.

#

That's where the benefit comes from mainly.

peak plover
#

It's really useful

#

I think that if I do this and everything else that's possible

#

I can in the end, result in a lot faster script

tender fossil
#

What are the best sources to learn UI creation and handling in Arma considering that I'm total newb with them?

little eagle
#

The wiki

peak plover
#

There's one that's even better

#

Click on this link to find out what it is:

#

And ofcourse the wiki is 100% required

split coral
#

I think that Moricky's example is a bit too complicated to start with.

bleak schooner
#

This is the code in my description.ext

class CfgSounds
{
class Siren
{
name = "Siren";
sound[] = {"\Siren.ogg", 30.0, 1};
titles[] = {};
};
};

polar folio
#

try this

#

titles[] = {1, ""};

#

don't ask me why. just from a working example

bleak schooner
#

Nope doesn't work

polar folio
#

did you resave the mission to make sure the changes registered? gotta do that when doing stuff in the description.ext

bleak schooner
#

No I didn't, it works now

#

tanks

peak plover
#

@split coral Use Moricky's example to see how a specific part of it is made. Then remake the part. For example, start by making a background

plucky beacon
#

@bleak schooner
```sqf
code here

tough abyss
still forum
#

Why are you getting _slider but not using it? I had Problems myself with the sliderSetRange syntax you use. Try the other one where you use _slider
And I think you can get _display in _this in the onLoad event

tough abyss
#

Something like this?

#
_dialog = _this select 0;
 _slider = _dialog displayCtrl 80003;
sliderSetRange [_slider, 0, 10];
sliderSetPosition [_slider, 5];
#

Or this: ```SQF
_dialog = _this select 0;
_slider = _dialog displayCtrl 80003;
_slider sliderSetRange [1, 10];
sliderSetPosition [_slider, 5];

#

The following works: ```SQF
NEV_fnc_onLoad = {
_dialog = _this select 0;
_slider = _dialog displayCtrl 80003;
_slider sliderSetRange [1, 10];
_slider sliderSetPosition 5;
}

#

Thank you for your help, @still forum!

velvet merlin
#

@little eagle ty

#

how does one grab all terrain objects (at mission start) the most performance friendly way these days (dynamically regardless of loaded terrain)

civic maple
#

k

open vigil
#

@slim yacht does it have anything to do with Arma scripting?

rancid ruin
#

it's a common side effect of arma scripting yes

split coral
#

@velvet merlin I'm guessing nearestTerrainObjects without the distance sorting

rotund cypress
#

Hey what differs closeDisplay with closeDialog, tried closeDisplay without any luck. Wiki is a bit shady on it...

still forum
#

Well.. Dialogs and Displays are two different things...

velvet merlin
#

@Greenfist#3021 ty

#

@tough abyss it is to add setVar and addEH to certain buildings

meager granite
#

Dialogs are displays

#

Anyway, closeDialog closes active dialog, closeDisplay can close any display, be it dialog or any other open display.

#

Closure doesn't happen instantly though, only on next simulation of the display, so if you have 2 dialogs, closing inactive one will simply set to to be closed as soon as it becomes active.

#

@rotund cypress

plucky beacon
#

This mission end on mission start bug is my worst nightmare

#

I've been able to reproduce it at least. Run mission through, mission ends, load mission again on server (without restarting server) and the mission fails as soon as we get in game (sometimes only some players and not others).

peak plover
#

kju, you could just do it during the "briefing", performance loss would be unoticable, and I doubt you can make a script that takes longer than 5 seconds

#

What do you use for tasks/ending?

plucky beacon
#

It's a remote exec globally to a script that runs a song then ends it

#

And the remote exec runs once, called from the server when a timer runs out

#

Maybe i should remote exec to clients only

peak plover
#

Can you share the exact line?

plucky beacon
meager granite
#

I guess it just resumes the last mission which is supposed to instantly end?

plucky beacon
#

but hooow I disabled saving

#

if the mission ends on server does it end for all players too?

#

would disabling serialization do anything?

peak plover
#

@plucky beacon did you check your and the server logs?

plucky beacon
#

uhhh

#

well theres your problem

jade abyss
#

138MB? gj

plucky beacon
#

I'm downloading it from the server now

#

because I can't exactly clipboard that

#
16:07:53 File GUI\dialogs.hpp, line 314: '/RscTitles/NitroInfo/controls/structuredText.w': Missing ';' at the end of line
16:07:53 File GUI\dialogs.hpp, line 315: '/RscTitles/NitroInfo/controls/structuredText.h': Missing ';' at the end of line
16:07:53 File GUI\dialogs.hpp, line 314: '/RscTitles/NitroInfo/controls/structuredText.w': Missing ';' at the end of line
16:07:53 File GUI\dialogs.hpp, line 315: '/RscTitles/NitroInfo/controls/structuredText.h': Missing ';' at the end of line
16:07:53 File GUI\dialogs.hpp, line 314: '/RscTitles/NitroInfo/controls/structuredText.w': Missing ';' at the end of line
16:07:53 File GUI\dialogs.hpp, line 315: '/RscTitles/NitroInfo/controls/structuredText.h': Missing ';' at the end of line
16:07:54 File GUI\dialogs.hpp, line 314: '/RscTitles/NitroInfo/controls/structuredText.w': Missing ';' at the end of line
16:07:54 File GUI\dialogs.hpp, line 315: '/RscTitles/NitroInfo/controls/structuredText.h': Missing ';' at the end of line
16:07:54 File GUI\dialogs.hpp, line 314: '/RscTitles/NitroInfo/controls/structuredText.w': Missing ';' at the end of line
16:07:54 File GUI\dialogs.hpp, line 315: '/RscTitles/NitroInfo/controls/structuredText.h': Missing ';' at the end of line
16:07:54 File GUI\dialogs.hpp, line 314: '/RscTitles/NitroInfo/controls/structuredText.w': Missing ';' at the end of line
16:07:54 File GUI\dialogs.hpp, line 315: '/RscTitles/NitroInfo/controls/structuredText.h': Missing ';' at the end of line

all these errors only show up sometimes

#
15:59:12   Error position: <_setText ctrlSetText format["%1",[(Timer>
15:59:12   Error Undefined variable in expression: _settext
15:59:12 File mpmissions\__cur_mp.Bozcaada\timer.sqf, line 35
15:59:12 Error in expression <lapsed_time = serverTime - _start_time;
_setText ctrlSetText format["%1",[(Timer>

this repeats constantly

#

this is what the file is mostly

#

this one was definately one of those failures too

#

All these hpp errors only show up on the second load

#

or more specifically, every other

plush cargo
#

@tough abyss - been a while but pretty sure this works

_fnc_WeightInfo = 
{
    _uni = uniform player;
    _vest = vest player;
    _weightBarCbo = ((findDisplay 1501) displayCtrl (27));
    _maxWeight = getNumber(configFile >> "cfgVehicles" >> (backpack player)>> "maximumLoad");
    _container = [_uni,_vest];
    {
        _uniWeight = getText(configFile >> "cfgWeapons" >> _x>> "ItemInfo" >> "containerClass");
        _weight = toArray _uniWeight;
        _count = count _weight;
        _numtotal = "";    
    for "_i" from 6 to (_count-1) do
    {
        _num = _weight select _i;
        _str = toString [_num];
        _numtotal = _numtotal + _str;
    };
    _number = parseNumber _numtotal;
    _maxWeight = _maxWeight + _number;    
    }forEach [_uni,_vest];
    _plrLoad = (loadUniform player) + (loadVest player) + (loadBackpack player);
    _loadFull = _plrLoad * 100;
    if (_loadFull > 0) then 
    {
        _barPercent = _loadFull / _maxWeight;
        _weightBarCbo progressSetPosition _barPercent;
    } else 
    {_weightBarCbo progressSetPosition 0;};
};
plush cargo
#

hes saying it's different units of measurement between loadX and getContainerMaxLoad

#

i believe i ran into that problem when i wrote this

#

but this _uniWeight = getText(configFile >> "cfgWeapons" >> _x>> "ItemInfo" >> "containerClass");

#

returns a string "supply40" or supply60

#

iirc

#

that number is the same units that loadvest uses

jade abyss
#

Search for LoadAbs in this Discord, we had a Convo about loadAbs a few days/weeks ago. Can't remember what the result was

bleak schooner
#

I have the following script to attach emergency lights to my vehicle. This works, but in MP other people can't see the lights. Anybody knows what the issue might be?

meager granite
#

@tough abyss loadAbs player returns in points, not percent of possible load

tough abyss
#

@bleak schooner local effect if I had to guess.

#

Are you running it on server?

chilly hull
#

Anyone know the name of the mempoint for the turret of a technical?

plucky beacon
#

that sounds more like a modeling question

plucky beacon
#

how would I script a trigger, so that if any player leaves the area, only that player is teleported back to a location.

subtle ore
#

Hey everyone, had a question regarding a piece of code I'm trying to get working. What it's supposed to do is create persistency over disconnect and connection for loadouts of players

#
onPlayerConnected     "profileNamespace getVariable 'PlayerLoadout' call {player setUnitLoadout _this};";
plucky beacon
#

you can reference the old unit

subtle ore
#

Oh wow. This makes my headaches clear up a bit.

plucky beacon
#

๐Ÿ‘Œ

#

When you find a script that solves your problem just right

subtle ore
#

Ah yes.

#

wouldn't I have to use this locally thought 'profileNamespace' or could I do : with profileNamespace do { } ; in some fashion or another?

plucky beacon
#

Im not familiar with profilenamespace

jade abyss
#

imho you should use missionNameSpace.

#

(Think about it as a Temp Storage, wich gets cleared after you leave the Server/Mission)

subtle ore
#

I was originally going to try uiNamespace, but ran into too many problems. I guess if you could give me an example?

subtle ore
#

Well. That's exactly what I'm doing now is using the HandleDisconnect event handler. Still ran into the same issues.

#
HandleConnect = addMissionEventHandler["HandleDisconnect",{
with profileNamespace do {
profileNamespace setVariable ['PlayerLoadout', getUnitLoadout player];
    };
}];
#

that's what I have setup there. Then in the initPlayerLocal : profileNamespace getVariable "PlayerLoadout" call {player setUnitLoadout _this};

plucky beacon
#

Dscha did you see my earlier question?

subtle ore
#

I have this all assbackwards though. Handle Disconnect would be for each player disconnecting, I presume this is entirely ran on the server side of things.

jade abyss
#

handleDisconnect EH MUST be assigned on the Server, just4Info.

#

@plucky beacon erm

#

That?
how would I script a trigger, so that if any player leaves the area, only that player is teleported back to a location.

subtle ore
#

yeah, it's ran on the server.

jade abyss
dusk sage
#

@subtle ore

with profileNamespace do {
profileNamespace setVariable ['PlayerLoadout', getUnitLoadout player];
    };
}];
#

no need to do that

#
with profileNamespace do {
    PlayerLoadout =  getUnitLoadout player;
};
#

Is what you'd use the with for

subtle ore
#

@dusk sage Oh god, I must be blind. yes, this works I suppose. But I guess there is still a locality issue. since I'm using it in combination with the handle disconnect event handler.

dusk sage
#

Just stick with profileNamespace setVariable ['PlayerLoadout', getUnitLoadout player];, ignore with entirely

#

You don't want to be using player. Their old object is passed into the event for you

subtle ore
#

Ah, yes. I thought I had replaced that. Letme take a swing at that

#

Sweet! That works.

thick oar
#

Random question:

Would the variable "this" ever exist in uiNamespace?

little eagle
#

If you define it there, otherwise no.

thick oar
#

Ah cool. Thx!

jade abyss
#

You sure? Isn't it a protected Var?

little eagle
#

No.

#

But it probably should be.

thick oar
#

This is truly weird.

little eagle
#

How so?

thick oar
#

"This" is this weird inbetween thing. For example in userActions conditions and statements. This and _this coexist in the same thing, while it should be _this select 0 and select 1 to follow the EH convention of passed arguments.

#

But it predates .sqf, so no wonder.

little eagle
#

Cannot use local variables in the init box.

thick oar
#

Exactly.

little eagle
#

So they use a global one.

#

The init box is really weird.

#

It's very inconsistent in what you can and what you can't do.

jade abyss
#

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

little eagle
#

I should rewrite it and make a new one using 3den attributes for CBA or something.

#

One where you can use locals and it doesn't complain about return values.

thick oar
#

Oh yes. The complaining about having to have return for [] spawn is annoying

little eagle
#

Sounds fun, I'll probably do that then.

velvet merlin
#

any better suggestions that this get all houses of any terrain in a performance friendly way?

_terrainCenterPosition set [2,0];
_distance = worldSize;
_allHouses = nearestTerrainObjects [_terrainCenterPosition,["HOUSE"],_distance,false];```
thick oar
#

centerPosition is not the center. it's just the default position for the editor window to start with. Well, pre-3den.

#

I.e Chernogorsk on Chernarus.

#

Calc the center using worldSize / 2?

velvet merlin
#

yeah i know its not reliable. i guess your suggestion is the right one indeed

thick oar
#

Also, the nearest* commands are all circles. so you have the problem of approximating the area of a square using only circles. Fun math to be had: the answer: you can't cover 100% without overlap ^^

velvet merlin
#

this is why i keep worldSize and not 50%

#

its too much but i guess it should really matter

jade abyss
#

QuickQ: Whats your plan with those Houses?

velvet merlin
#

custom damage handling

jade abyss
#

Setting a Var on those?

thick oar
#

I used a system once to scan the entire map for specific objects, such as all lighthouses or chruches for landmarks.

velvet merlin
#

setVar yes but more importantly handleDamage

thick oar
#

Had to use the approximation method as a full worldSize coverage just broke the game.

#

In the end I settled for a precalced database and decided against runtime parsing.

velvet merlin
#

well you still had to use the old nearest* commands, or already test with nearestTerrainObjects?

thick oar
#

No, that was old school style NearestObject with empty array as filter ๐Ÿ˜„

jade abyss
#

setVar with Island Objects could create some Probs (e.g.: Clients didn't received the Var, when the Building was too far away)

velvet merlin
#

well terrain objects should be local to the server, no?

jade abyss
#

NearestObjects with House_F Filter, or? (don't think there is an more "friendly" way)

thick oar
#

Oh @little eagle : while you are already fixing the editor. Can we please have

_var ++; ?

velvet merlin
#

its not class based filters Dscha

jade abyss
#

Will the Vars be transmitted over the net?

#

meh, crap.

#

wait, pm

little eagle
#

I don't think I can add stuff like ++ without access to the source code.

thick oar
#

Once can dream...

little eagle
#

But only once.

thick oar
#

Saving it up for something really great.

little eagle
#

A million more wishes please.

thick oar
#

There's always a clause for that one.

pliant stream
#

sure you can add new operators without source code but it's a bit trickier, probably rather fragile, and not necessarily in line with bis' preferences. probably not ++/-- though because of reasons

meager granite
#
_dir = random 359;
little eagle
#

What's wrong with [359-360[ degree?

pliant stream
#

heh was about to comment on how your brackets were the wrong way around

little eagle
#

Puh. Dunno why I always mix these up.

pliant stream
#

also you should use a comma like so [359,360[ :p

little eagle
#

What is this, math class?

pliant stream
#

it is now

little eagle
#

random 1
[0,1[

pliant stream
#

personally i prefer the [0,1) notation though

little eagle
#

I think that is what they taught me a long time ago, but all Physics books use [[

jade abyss
#

QuickQ: Was it possible to start an .rtm directly from Script?

little eagle
#

Animation?

jade abyss
#

nvm, doing it another way. No need for rtm stuff anymore.

little eagle
#

I think it would be simpler to just remove the code validation of the normal init box

#

And obviously make it bigger...

tough abyss
little eagle
#

@tough abyss Use the binary syntax of sliderSetPosition

#

CONTROL sliderSetPosition blah

tough abyss
#

@little eagle I already do, look at the last post.

little eagle
#

What's the problem then?

tough abyss
#

Finding a more efficient way of doing it, if there is one.

little eagle
#

I don't see what and how.

tough abyss
#

Hey, is there any way to limit a vehicle speed without using a loop/setvelocity combination?

jade abyss
#

Not rly, no.

tough abyss
#

ps: a non-AI vehicle

little eagle
#

no

tough abyss
#

hmm :/ should be a new feature command^^

little eagle
#

Too bad no one knows how PhysX works.

jade abyss
#

The fkn Uberhandbreak should be disabled first, before we anything else -.-
(Or at least get a command for it -.-)

little eagle
#

Or fix flip tanks.

jade abyss
#

or removing PhysX at all.

little eagle
#

I approve.

jade abyss
#

(wich would fix alot of probs ๐Ÿ˜„ )

little eagle
#

Sure would.

jade abyss
#

I mean... whats the sense of beeing able to push other Cars away, but have a 90% chance of blowing up, because the PosUpdate is "not so good" and it ends up with flying/exploding/glitching/mating Vehicles ๐Ÿ˜ฆ

little eagle
#

What's the point if you flip on head.

jade abyss
#

The other could unflip you by punching you

little eagle
#

๐Ÿ‘Š

jade abyss
austere granite
#

How to make a vehicle stop within 1m and have insane throttle down on helos? Simply jump out! ๐Ÿ˜„

jade abyss
#

How to transform a Tank into a FlyingFortress:
Simply just get in and drive a few meter over obstacles.

austere granite
#

allMissionObjects "Ruins" doesnt show event thought its obviously a ruin type

austere granite
jade abyss
#

Is it a placed Object?

austere granite
#

Yep

#

I needed editor placed objects specifically, otherwise i'd just use nearObjects ๐Ÿ˜ฆ

jade abyss
#

sucks to be you then ๐Ÿ˜„

#

(starting Arma atm)

austere granite
#

I guess maybe doing array subtraction with nearestTerrainObjects could work... but it would also be nice if the command just worked 100% ๐Ÿ˜„

jade abyss
#

wich model is it (ifa, right?)

austere granite
#

yea but the same thing applies to vanilla stuff

#

Was testing with the military cargo house ruins, same thing. Didn't actually try destroyed buildlings turned into ruins

regal ore
#

Hey guys, I got a problem with spehres. I've placed bunch of them (as a spawnpoints) but some just randomly move themselfs. Always on the same spot. I cheked that theres nothing in their init and placement radius is 0. Has anyaone else had this probelm?

jade abyss
#

Have you checked, if that particular object is in the allMissionObkject Array? @Adanteh#0761

austere granite
#

Nope, haven't yet. Wasn't too important right now so kinda skipped past it

jade abyss
#

allMissionObjects ""

#

Yep, i knew it:

#

Place a intact Building -> cursorObject setDamage 1 -> allMissionObjects "ruins": [5c5beb00# 10: cargo_house_v2_ruins_f.p3d]

#

@austere granite

austere granite
#

I wonder how that works on JIP too ๐Ÿ˜„

jade abyss
#

Should

austere granite
#

If the destroyed object will then show up as Ruins or not