#arma3_scripting

1 messages ยท Page 410 of 1

jade abyss
#

Not you

#

talking to dedfur

subtle ore
#

mom always said don't talk to the furries dscha

#

Man I can't type today

jade abyss
#

today?

subtle ore
#

Everyday?

jade abyss
#

๐ŸŒ

subtle ore
peak plover
#

๐Ÿ˜‚

subtle ore
#

Tester Upgrade Lvl 0 - Discord Nitro

jade abyss
still forum
#

H

thorn saffron
#

Do you think it would be possible to configure the Arsenal so it reads the content of a box and allows you to equip only the stuff that is in the box and with item number limited to what was inside the source box.

lone glade
#

which one

still forum
#

Everything is possible

thorn saffron
#

@lone glade I mean the virtual arsenal

lone glade
#

go cry in a corner ๐Ÿ˜ญ

thorn saffron
#

and yeah everything is possible if you know how to code

jade abyss
#

Yeah, get in that corner birch

still forum
#

Yeah! You Tree!

jade abyss
#

Yeah!

still forum
#

Answer is.. Vanilla Arsenal: Have fun I won't get into this shit again.
ACE Arsenal: yeah easy.. here's how...

thorn saffron
#

oh ACE got its own arsenal?

lone glade
#

๐Ÿ˜ญ

#

please, someone, shoot me

subtle ore
#

Done

still forum
#

shoots @lone glade and he now has to go to bed and ignore all further messages because he is dead

thorn saffron
#

I gues you could say he is a... @still forum now ๐Ÿ˜Ž
YEAAAAAAAHHHH

still forum
#

Not bad. Gotta say

jade abyss
subtle ore
river meteor
#

What is the best practice way to run an sqf script when a ui button is pressed?

lone glade
#

event

#

how else would you ever do it?

thorn saffron
#

I'm kind of surprised that the ACE's arsenal does not have an option to read items from a box it is called from

lone glade
#

why would it?

#

virtual items != items

#

if you had to stock "real" items to access them... server framerate would hang itself

thorn saffron
#

@lone glade The only issue I have with the ACE's Arsenal is the small font, I have the UI set to normal, but the font is kinda hard for me eyes

lone glade
#

which one?

#

all of them?

#

You can change the panel font size in cba settings
I fixed font scaling on the next version on lower resolutions.

warm gorge
#
private _vehicle = DS_cursorTarget;

_vehicle allowDamage false;

private _pos = ASLToATL (getPosASL _vehicle);
_pos set [2,(_pos select 2) + 1];

_vehicle setPosATL _pos;

private _posAGLS = getPos _vehicle;
private _vector = if(surfaceIsWater _posAGLS)then {[0,0,1]} else {surfaceNormal _posAGLS};

if(local _vehicle)then {
    _vehicle setVectorUp _vector;
} else {
    [_vehicle,_vector] remoteExecCall ["DS_fnc_setVectorUp",_vehicle];
};

sleep 1;

_vehicle allowDamage true;

For some reason this vehicle unflip script is causing vehicles to be positioned underground sometimes. After some testing, it seems that the setPosATL is the cause because if I use getPos and setPos instead, it works fine. But I can't use setPos because this needs to work at different heights such as on vehicles and over water on bridges.

rotund cypress
#

For the love of someone, why sleep in an unflip script? Please ๐Ÿ˜‰ @warm gorge

warm gorge
#

Why not?

snow raft
#

^

jade abyss
#

@rotund cypress For example, when the obj. is on another surface or is clipping around.

#

Better choice would still be a check for the speed of the Veh

rotund cypress
#

Yeah exactly @jade abyss having a sleep for that is hope scripting.

#

if (velocity _obj...) or if (speed _obj ...)

dusk sage
#

We'd die without sleep so

#

You need it

rotund cypress
#

What?

dusk sage
#

You'll literally die without sleep

#

So you need sleep

rotund cypress
#

Why would you die?

dusk sage
#

Good to have random sleeps here and there just to make sure you know

rotund cypress
#

What a meme

#

๐Ÿ™ˆ

dusk sage
#

It's possible that given enough time, sleep deprivation can kill you

#

^ use sleep !

rotund cypress
#

Ahahahahah

#

Either way @warm gorge I'd advice you to not use it, and instead of why not, ask yourself "why do I need it?". Hope scripting is really bad and can cause major harm. A.k.a. kill babies.

#

Better to actually prevent the real problem from happening instead.

warm gorge
#

Im confused. That sleep is only in there to add a slight delay before the vehicle's god mode is removed so its not pointless

rotund cypress
#

Why would it make it useless?

#

As long as you run all that unscheduled, damage wont be allowed again until all is finished

#

Its really poor to just throw random numbers in order to "hopefully" fix something.

#

If the client is under heavy load, different executions will happen.

#

Even switching it to waitUntil {speed _obj < 0.1} would be better.

#

However, if you fix the real problem, you wont even have to do that.

#

This is something that doesn't have to be ran in a scheduled environment.

warm gorge
#

The only reason its scheduled is because theres a BIS_fnc_guiMessage at the top

#

I could change that I guess tho

rotund cypress
#

Alright, that is fair enough

#

If you need it use it, but don't use a sleep.

#

I am curious though.

#

That sleep is only in there to add a slight delay before the vehicle's god mode is removed so its not pointless

#

What did you mean with that? ^ Why would it be pointless if there is not a sleep?

warm gorge
#

Im not too sure to be honest now that I think of it

rotund cypress
#

Like, the script will go in the order you tell it to go in when you program it.

#

Unless you have some breakTo spaghetti stuff.

#
do thing....
_obj allowDamage true;```
warm gorge
#
private _vehicle = DS_cursorTarget;

_vehicle allowDamage false;
player allowDamage false;

private _posAGLS = getPos _vehicle;
private _vector = if(surfaceIsWater _posAGLS)then {[0,0,1]} else {surfaceNormal _posAGLS};

if(local _vehicle)then {
    _vehicle setVectorUp _vector;
} else {
    [_vehicle,_vector] remoteExecCall ["DS_fnc_setVectorUp",_vehicle];
};

private _pos = ASLToATL (getPosASL _vehicle);
_pos set [2,(_pos select 2) + 2];

_vehicle setPosATL _pos;

_vehicle allowDamage true;
player allowDamage true;

This seems to have resolved the problem, basically I just moved the setVectorUp before the setPosATL and changed the offset for the z axis.

rotund cypress
#

If you look at my snippet

#

do thing... will do things before it allows damage again

#

And there you go

#

However, I would advice you to maybe make a condition to check speed or velocity

warm gorge
#

Whys that? How do you suggest implementing that

dusk sage
#

Flipping the car is bad while moving

rotund cypress
#

if (speed _veh > 0) then { ... };

#

Or even exitWith

warm gorge
#

Ah yep I know what you mean

rotund cypress
#

or breakOut

#

Whatever floats your goat

#

Then you run into a problem if someone gets in and drives away while you are unflipping it.

#

However if you are doing a progress bar or something, just check a condition while that is working.

warm gorge
#

Cheers for the help

rotund cypress
#

np

stable wave
#

Is ctrlAddEventHandler stackable?

lone glade
#

yes

unborn ether
#

@rotund cypress Always add a short uiSleep in any waitUntil you use. It is a huge performance destroyer

waitUntil {uiSleep 0.1; true}
rotund cypress
#

Lol

#

No

lone glade
#

@still forum we found how to fix unscheduled loops perf /s

rotund cypress
#

@unborn ether it is absolutely not needed unless you are using a waitUntil for a longer period of time, which you should NEVER do.

#

The ultimate use of waitUntil is for only a few seconds max.

lone glade
#

??? absolutely not

unborn ether
#

Well i've seens tons of popular frameworks do it in a while style

lone glade
#

it's the length / cost of the condition block

rotund cypress
#

^

#

And also @unborn ether I don't know why you would tell me such a thing at random like you just did? ๐Ÿค”

unborn ether
#

@rotund cypress Because I cry with blood when i see waitUntil without any sleeps

rotund cypress
#

Well stop crying.

lone glade
#

also in reference to exitWith / breakOut, use exitWith whenever you need it (not whenever you feel like it) and breakOut only in very specific use cases

rotund cypress
#

breakOut in then form is faster than exitWith.

#

But I agree.

lone glade
#

doesn't matter, not the same usage

rotund cypress
#

Also @unborn ether if you are not doing something that takes a lot of performance and that aren't going to be there for long, why would you sleep it??

#

Well, the difference is that exitWith exits the current scope you are in and breakOut exists the scope you pass. Not a big difference, however, a big use case difference @lone glade

unborn ether
#

@rotund cypress Well tell that to the developers of the frameworks such as Epoch, A3PL, Exile and infiSTAR

rotund cypress
#

As sometimes you have to use breakOut instead of exitWith.

#

A3PL developers, what a joke ๐Ÿ˜‚

unborn ether
#

Ok, call him a Tonic with some dudes.

rotund cypress
#

call him a tonic?

unborn ether
#

Arma 3 Project Life (A3PL) is a child of a Tonic

rotund cypress
#

Tonics code ๐Ÿ˜‚ ๐Ÿ˜‚

#

Have you seen the state of it?

#

Either way, not going to insult these other guys, but just go look at their code and you will see for yourself.

unborn ether
#

Well 2 years ago I was willing to start new framework of his basis.

#

That was a huge mistake. Tonic code left is currently 3%

#

By my Git stats

rotund cypress
#

Well, I have made my own life framework from completely scratch, using nothing of his work and it was not built on top of his. Just finished it a couple of days ago in fact.

#

This was something I regret doing since it took so much time, but using Tonics shite was not an option.

unborn ether
#

Well initially it was just for a few weeks, just to do yet another life server.

#

Never knew that could escalate so quick.

rotund cypress
#

I am not sure I follow what you are saying.

unborn ether
#

Im saying is that Tonic is having a nice ideas, but he is really bad coder, since what i've seen in a progress of scratching every of his base scripts.

rotund cypress
#

He is a bad coder.

#

Nothing new.

#

However, using his framework, rewriting a few scripts; that is not making your own framework if that is what you tried to say.

#

And tonic not adding sleeps to his waitUntil blocks was not the thing that made him a bad coder ๐Ÿ˜‚

#

If you just make good optimized code, you will not have to add sleeps at all.

unborn ether
#

You should probably read what i've posted before.

rotund cypress
#

I did.

unborn ether
#

I just gave you an example of why you should put sleeps in waituntils.

#

Because you can't be a good coder if you don't put mind in every line you do.

#

Its like coding a script with 100 of global variables saying it is good.

#

Its all in your mind.

rotund cypress
#

Thats why I told you, if you think from the beginning and make performance optimized code, you will not have to use "sleeps" to hide the fact that you are having really bad performance code that takes time to execute.

#

Afterall, I rarely use scheduled environment regardless, unless I have to.

unborn ether
#

You don't have any idea, do you?

for "_x" from 0 to 50 do {
    0 spawn {waitUntil {}};
};
#

Use that and tell me how your FPS dies

rotund cypress
#

๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚

#

Why would anyone ever do that?

#

You are spawning 50 threads with a waitUntil in it

jade abyss
#

and? Thats nothing

unborn ether
#

And it cuts your CPU cycles in a half at least.

#

Thats an example for you to understand, where you are wrong in your statements

rotund cypress
#

Yeah, but look - if you don't spawn 50 threads you are fine

unborn ether
#

waitUntil is bad at is core, so no relativity to your well optimized code outside or not

rotund cypress
#

Thats why you should avoid using scheduled environments unless you really need to

jade abyss
#

๐Ÿคฆ

lone glade
#

just keep watching dscha

unborn ether
#

The only what i'm seeing from him is facepalms actually ๐Ÿ˜„

rotund cypress
#

Step 1 - Avoid scheduled environment
Step 2 - Don't use waitUntil unless you really need to
Step 3 - Don't run code in waitUntil block that takes a lot of time to execute

unborn ether
#

Dude, you do understand a difference beetween application of the code and its practical result?

#

I didn't say you should apply 50 waitUntils

#

I just showed you that is bad to use it at all

edgy dune
unborn ether
#

Its just like saying using == instead of isEqualTo

edgy dune
#

^^^ objects?

rotund cypress
#

Yes

lone glade
#

that's..... a completely different thing ....

rotund cypress
#

Either way, I didn't say don't use it, I said, only use it if you have to

jade abyss
#

just keep watching alganthe

lone glade
#

one is case sensitive and the other isn't, one supports more types too....

jade abyss
#

sshhhh

unborn ether
#

๐Ÿ˜„

edgy dune
#

is scheduled environment in a EH okay?

rotund cypress
#

Ffs, you don't think I know the difference between isEqualTo and ==???

unborn ether
#

The thing is isEqualTo is 3x faster that == while evaluation is 80% done the way it was intended with ==

jade abyss
#

๐Ÿฟ want also some? @lone glade

rotund cypress
#

I know isEqualTo is faster

lone glade
#

yeah, pass me some

jade abyss
#

can't add the fkn emote... -.- Discord's beeing a birch again

edgy dune
#

I think they disabled them on this channel

#

emote

rotund cypress
#

I've even asked @jade abyss before why he didn't use isEqualTo over == when he didn't compare two strings.

#

If you just use the search function

#

His answer was that == is more readable or some shit

jade abyss
#

No, Namenai

#

dafuq you asked me?

unborn ether
#

Readable? Well at this point of using operators its slacking

edgy dune
#

oh I asked

jade abyss
#

dafork you saying?

rotund cypress
#

Haha

#

If you can be bothered, just use the search function.

edgy dune
rotund cypress
#

Should be there

jade abyss
#

Stop spreading your nonsense

edgy dune
#

T_T i cire and trie

unborn ether
#

@jade abyss Use links to understand whom you talking to please

jade abyss
#

@edgy dune I doubt it, since the Anim is triggered by the Engine (same reason why you can anim the steeringwheel with it)

rotund cypress
#

Either way, never told anyone that you should use isEqualTo for comparing strings or == if you are not comparing strings.

unborn ether
#

Why would i ever use == if isEqualTo is faster anyways?

jade abyss
#

@unborn ether Follow the Convo and don't tell me what to do, am i clear on that?

unborn ether
#

What the fudge are talking about?

rotund cypress
#

Never said or asked why you would.

lone glade
#

.... BECAUSE ONE IS FUCKING CASE INSENSITIVE jesus

jade abyss
#

ppssshhhttt alganthe

rotund cypress
#

Well yeah, in that use-case yes.

edgy dune
#

aww shit i see,how about like say this one f-18 mod where the engine afterburner effect started only when the player selected the afterburner on the scroll menu

unborn ether
#

@jade abyss Are you a god or what? Go make jokes somewhere else dude.

jade abyss
#

lol

#

Yeah, i am god

lone glade
#

dscha confirmed god

jade abyss
#

๐Ÿ˜„

lone glade
#

we're all fucked

jade abyss
#

Kinda, yeah

#

Where's the lube

rotund cypress
#

Can't find his tag, but BoGuu can confirm I know the use-case for isEqualTo and == jesus

edgy dune
#

if(lube) then {lube};

rotund cypress
#

Not understanding why you trying to dig shit on me, jesus.

jade abyss
#

if(!lube)then{tears};

unborn ether
#

@rotund cypress I don't give a fudge about functional part dude, i care about its 3.6x (wiki) faster than ==

rotund cypress
#

Well, if you just do a performance check you'll see.

#

You don't need the wiki for that.

unborn ether
#

Pfff

#

Ok, fudge the wiki, its for downies ๐Ÿ˜„

rotund cypress
#

And to get back on track, if you are checking this for a couple of seconds

waitUntil {missionNamespace getVariable ["flag", false]}
peak plover
#

Isequto is more powerful

unborn ether
#

Im out dude, thats not even funny anymore)

rotund cypress
#

Why would you use a sleep

edgy dune
#

ohh 3.6x eh

#

fancy

meager heart
#

whose kung fu is better ? ๐Ÿค”

lone glade
#

jesus of nazareth vs dscha

#

who would win?

rotund cypress
#

Yeah, one more use-case for isEqualTo is that you can check if (array isEqualTo []) @peak plover

#

You cannot do that with ==

#

And much faster than doing if (count array > 0)

peak plover
#

I always do that

#

Exactly

lone glade
#

isEqualTo takes all types, == doesn't but it's case insensitive

edgy dune
#

It is slightly faster than ==, especially when comparing Strings nooo u lied to me noooo-"lord vader"

peak plover
#

I love iseequalto

jade abyss
#

@lone glade Me

#

I would "nail it"

peak plover
#

I gotta admit sth

#

I use scheduled for most of my scripts

jade abyss
#

oh noes

rotund cypress
#

@unborn ether 0.0013 ms is the time it takes to check a boolean with getVariable command in mns. I wouldn't say that unless you are stupid with your coding, you absolutely do not need a sleep there.

cedar kindle
#

one day you will see the truth

#

and elevate to a higher place

peak plover
#

I've got an idea for oneachframe that will only do 1 script at a time for me

jade abyss
#

In here? Doubt it

peak plover
#

It's like a scheduler for my scrupts

lone glade
#

cuel, stop changing your avatar, BRING BACK THE CHICK

#

but even shittier nigel

#

I like it

cedar kindle
#

;0

jade abyss
#

Still better than that snail with a butthole in it's face.

lone glade
#

Y WANA FITE M8?

jade abyss
#

get ova hear!

lone glade
#

gun fuck u up

jade abyss
#

Wait, you were french, right?

lone glade
#

I am still french

jade abyss
#

If so: nvm, no threat anyway

lone glade
#

don't know where the "were" comes from ๐Ÿ˜„

jade abyss
#

๐Ÿ˜‚

lone glade
#

or.... did I get exiled ?

jade abyss
#

Oh, prep for more ๐Ÿฟ

lone glade
#

wait a second, THIS ISN'T FRANCE!
THIS IS A GULAG!

jade abyss
#

Nah, just wave your โฌœ -flag ๐Ÿ˜„

lone glade
#

you mean my undies on a stick

unborn ether
#

@rotund cypress Dude, you are dumb not me, and leave that tone to yourself, since you've just checked a result of one cycle with getVariable without considering how much frames it takes. Its like comparing onEachFrame single cycle to some EVH schedule

rotund cypress
#

No its not one cycle.

jade abyss
#

@unborn ether You can stop insulting ppl now, or the fun will be over soon.

rotund cypress
#

It's 10000 @unborn ether

lone glade
#

over 9 000 frames?

unborn ether
#

@jade abyss You telling me that? I was discussing some stuff and you both guys startled somethign over here

jade abyss
#

Did i insult anyone? No, so you better watch your tone.

#

Calm down, and everything will be fine.

lone glade
#

yes, you hurt my snail feelings

jade abyss
#

You're an alganthe, you don't count ๐Ÿ˜›

unborn ether
#

Oh god guys, you are scripting gods, im just out ok. Follow the Convo and don't tell me what to do.

#

Jezus

rotund cypress
#

Don't know you are saying I am dumb @unborn ether ๐Ÿ™ˆ I never told you such a thing.

#

lol

#

๐Ÿ˜‚

unborn ether
#

I wouldn't say that unless you are stupid with your coding
Talk of the dude which doesn't really know how attachTo works with objects

lone glade
#

oh?

unborn ether
#

So just lets stop

rotund cypress
#

What?

lone glade
#

did I miss something?

rotund cypress
#

I don't know how attachTo works?

#

๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚

meager heart
#

Guys just stop that ping pong conversation which is going nowhere... .Dscha kung fu is better, he won

rotund cypress
#

Also I was speaking in general, not saying you are dumb.

lone glade
#

ITS CALLED TABLE TENNIS

jade abyss
#

@meager heart I didn't even fought^^

#

I am just sitting here, laughing and watching the chat

meager heart
#

๐Ÿ˜€

rotund cypress
#

Someone been impersonating my name asking how attachTo works? Anyone? ๐Ÿ™ˆ

meager heart
#

same here

jade abyss
#

here, get some

lone glade
#

armaDrama โ„ข never gets old.

unborn ether
#

SimZor: Also, does anyone know what display 12 is?
Its kinda strange not to know that basic stuff being a experienced coder. Didn't even scrolled up to where you've been talking about ambientAnim

lone glade
#

basic stuff?

#

you remember displays by heart now?

rotund cypress
#

Display 12, its as easy to check the configs...

#

I just cba to go into them if someone here already knows

#

Like cmon dude

#

Stop trying to dig up shit that you don't have.

unborn ether
#

Stop pretending to be a cool dude and harrass people on argumented critics.

jade abyss
#

dudes, stop, i can't take it anymore ๐Ÿ˜‚ my belly hurts

rotund cypress
#

Hahaa

lone glade
#

ad hominems are flying round' here.

unborn ether
#

Ok, just stay the same dudes, ok ๐Ÿ˜„

#

Never reconsider what people saying anything. Im out seriously ๐Ÿ˜„

jade abyss
#

2nd time now ๐Ÿฟ

rotund cypress
#

Doubt it, you've told us a lot of times.

lone glade
#

you're the one telling us isEqualTo has to be used over == completely ignoring the difference between the two and that putting uiSleep in a waitUntil block will give you perf boosts

rotund cypress
#

Oh so you were not actually telling me that lol @lone glade

#

Thought you were directing that at me.

#

Hahah lol

lone glade
#

๐Ÿฟ

barren magnet
#

@jade abyss ๐Ÿฟ

#

Why would you not use isEqualTo over ==โ„ข ?

lone glade
#

case insensitivity

jade abyss
#

PERFORMANCE!! DDUUUDDDEEEEEE

barren magnet
#

And don't tell me it's less typing

jade abyss
#

๐Ÿ˜‚

barren magnet
#

What is case sensitive and what not ?

jade abyss
#

Yes.

lone glade
#

isEqualTo: case sensible
==: isn't

rotund cypress
#

ffs

barren magnet
#

@jade abyss answering questions that can not be answered with yes or no with yes since 2001

jade abyss
#

Yep, i perfected it.

lone glade
#

maybe

jade abyss
#

Also:
isEqualTo = Can compare Arrays
== = not

barren magnet
#

Tbh then iseqalto ยฉ is the better choice then

lone glade
#

depending on the use case*

barren magnet
#

Not really

unborn ether
#

Pfff

jade abyss
#

@Arkensor#0120 BUT ZE OVERHEAD!!!111oneone

#

ZE OVERHEADDDDDD

#

(Yes, i find that funny)

lone glade
#

not having to use toLower / toUpper helps...

unborn ether
#

case sensitivity vs full stack typization compability

#

Well ๐Ÿฟ

barren magnet
#

But I reads zat ze iseqalto command is faster

rotund cypress
#

I guess you will just toUpper all your strings so you can always use isEqualTo yes? @unborn ether

#

๐Ÿฟ

lone glade
#

thus negating the perf advantage of isEqualTo, noice

rotund cypress
#

๐Ÿ˜‚

barren magnet
#

I don't see a reason why you would compare something incasesensitive

lone glade
#

strings

rotund cypress
#

Well, mistakes can happen @barren magnet

lone glade
#

the answer is strings returned from config / commands, shit is inconsistent as fuck

tough abyss
#

config names is perfect example
people tend to mix cases when doing configs

rotund cypress
#

^

#

But config names doesn't matter

#

Not case sensitive

lone glade
#

....

barren magnet
#

"Dscha likes cookies" IS NOT "DsChA likes CoOKies"

lone glade
#

maybe

jade abyss
#

Yerp, fluff

tough abyss
#

depends on the code i.e niarms & exile both had/have issues with different cases for confignames

barren magnet
#

Thus expecting it to be the same is very bad coding style

unborn ether
#

Tell me the points where you really need a string case sensitivty. And how you gonna do this in ==

private _someCode = selectRandom [{true},"true"];
if (_someCode isEqualType '') then {call compile _someCode};
if (_someCode isEqualType {}) then {call _someCode};
lone glade
#

nah, it's entirely on the inconsistency of commands that return classnames / configNames

tough abyss
#

Nope, its just people using isEqualTo everywhere ๐Ÿ˜›

rotund cypress
#

Yeah I mean, you should be consistent

unborn ether
#

๐Ÿฟ

lone glade
#

OH BOI

#

CALL COMPILE

barren magnet
#

If you want something case insensitive make it tolower

rotund cypress
#

๐Ÿ˜‚

lone glade
#

and you speak of optimization?

#

my sides

rotund cypress
#

CALL COMPILE KILLS BABIES

unborn ether
#

Okay

cedar kindle
#

@barren magnet but then you negate the performance gain from using isEqualTo

unborn ether
#

So you have nothing to say just for that?

#

dudes..

#

seriosuly

lone glade
#

Several people are typing...

barren magnet
#

Call compile "str tolower a isEqualTo str tolower b"

#

There you go, use that

cedar kindle
#

or use == without toLower

rotund cypress
#

@jade abyss my belly hurts now too ๐Ÿ˜„

peak plover
#

call <code>

#

why compile it?

#

Why would you have your code in a string?

unborn ether
#

try calling a string, dummy

lone glade
#
{mycode} foreach array

why would anyone ever use count?

barren magnet
#

This is not a serious discussion @nigel#4210

rotund cypress
#

calling people "dummies" is not nice mr @unborn ether

#

I don't think insults are allowed in this Discord.

lone glade
#

I think that's called projection

jade abyss
#

@unborn ether Haven't you said that you are out? ๐Ÿค”

unborn ether
#

@rotund cypress Stop avoiding the questiongs then, afterwards you've insulted me dude

rotund cypress
#

Did you ask me a question?

#

Ask on

unborn ether
#

Do that with == im waiting

rotund cypress
#

I will answer.

#

What was your question?

unborn ether
#

You're done ๐Ÿ˜„

barren magnet
#

Yes SimZor you always insult me

rotund cypress
#

๐Ÿ˜ข

unborn ether
#

gonna continue shouting something irrelevant?

barren magnet
#

shouts something irrelevant

rotund cypress
#

What was your question about ==?

#

Im curious. I will answer.

unborn ether
#

@rotund cypress Can you perform the same code i've posted using == or typeName without expanding that code for no reasons?

rotund cypress
#

Not sure what you mean...

cedar kindle
#

i donโ€™t see how thatโ€™s relevant tbh

lone glade
#

Do you lack basic reading comprehension or are you ignoring what I write

peak plover
#

Typename in most cases can be substituded with isEqualType

lone glade
#

D.I.F.F.E.R.E.N.T U.S.E C.A.S.E.S

jade abyss
#

I guess he ignores, since... yeah... you know... admitting some stuff

rotund cypress
#

Obviously you cannot use == @unborn ether

#

That is a complete different thing

#

== is not even remotely similar to isEqualType

peak plover
#

typename not ==

rotund cypress
#

Well with typeName you would have to use == as well

peak plover
#

no you don't

rotund cypress
#

typeName "" == STRING

peak plover
#

in or isEqualTo ๐Ÿคท

rotund cypress
#

So yes, you would have to

cedar kindle
#

typeName is deprecated anyway with isEqualType

rotund cypress
#

Exactly

unborn ether
#

So you bascily cant

rotund cypress
#

So not sure why its relevant

lone glade
#

_myArray = [0,1,2,3] apply {_x = 0}; can you do that with select? i'm waiting.

cedar kindle
#

itโ€™s still not relevant to the discussion

peak plover
#

Yea

lone glade
#

WITHOUT EXPANDING THE CODE NIGEL

#

SHHH

#

see? my argument wins

unborn ether
#

๐Ÿ˜„

rotund cypress
#

Okay let me ask you a question Mr "optimizer" do you know the difference between count and foreach?

#

@unborn ether

unborn ether
#

No i dont ๐Ÿฟ

peak plover
#
_myArray = [0,1,2,3] select {_x = 0;true};
```not even sure you need true ๐Ÿ˜
lone glade
#

one has more letters

#

and no nigel

rotund cypress
#

No you dont

#

@peak plover

meager heart
#

btw do you guys like trains ?

peak plover
#

does that not work?

rotund cypress
#

no

lone glade
#

nah.

meager heart
#

k

unborn ether
#

Guys how to return a player unit, anybody?

lone glade
#

player ?

peak plover
#

allPlayers

jade abyss
#

AllUnits

unborn ether
#

๐Ÿ˜ƒ thanks gonna not it

lone glade
#

oh wait

peak plover
#

allUnits select {isPlayer _x}

lone glade
#

we had a competition to find the worst way to do that didn't we

jade abyss
#

๐Ÿ˜‚

unborn ether
#

๐Ÿ˜„

jade abyss
#

@lone glade Yep

unborn ether
#
private _array = [];
{_array pushBack _x} forEach _array;

Profit

peak plover
#

altis life way

(allMissionObjects '') select {isPlayer _x} 
unborn ether
#

NOO

#

thats lame

#

dude

#

wait

lone glade
#

profit what?

rotund cypress
#

omg this is ridiculous

lone glade
#

that's not proper recursion

rotund cypress
#

this conversation is making me fucking nauseous

lone glade
#
a = { call a};
call a;

is

#

aka how to disconnect players the hard way ๐Ÿ˜„

rotund cypress
#

hahah

#

or

peak plover
#
private _array = [];
{_array pushBack _x} forEach _array;

foreach never does anythingbecause _array has 0 elements

#

Fucking fail

barren magnet
#

Actually that is quite genius

unborn ether
#
private _objects = nearestObjects [[0,0,0], ["Man"], 25000];
private _player = objNull;
{
    if (_x isEqualTo player) then { // Why exitwith?
        _player = _x;
    };
} forEach _objects;
#

Nicely optimized

barren magnet
#

Ayyyy

rotund cypress
#

Running this in unscheduled should disconnect as well for "_i" from 0 to 1 step 0 do {}

jade abyss
#

if (_x == player)

#

!!!

unborn ether
#

@jade abyss SORRY

lone glade
#

why 25 000?
nearestObjects [[worldSize / 2, worldSize / 2,0], ["Man"], worlSize];

#

go big or go home

unborn ether
#

@jade abyss I admit im bad

jade abyss
#

At least

barren magnet
#

@lone glade XD

lone glade
#

also man returns bunnies and snakes

#

just FYI

#

basic knowledge for experienced scripters like you said earlier about display 12

rotund cypress
#
disconnectFunc = {
    if (canSuspend) throw "Suspension not allowed";
    for "_i" from 0 to 1 step 0 do {};
}```
lone glade
#

will error out

peak plover
#

throw?

unborn ether
#

{_x closeDisplay 0} forEach allDisplays

peak plover
#

eek

lone glade
#

throw needs to be in a try catch block

rotund cypress
#

๐Ÿคฆ

unborn ether
#

Next gen disconnection ๐Ÿ˜„

rotund cypress
#

it will only error if suspension is allowed @lone glade

lone glade
#

we already when through this didn't we

#

throw needs to be in a try catch block otherwise it'll throw "unhandled error"

rotund cypress
#

WHen that throw happens yes

#

If condition is true

#

Otherwise its fine.

lone glade
#

you're saying that if the line isn't evaluated it won't error out

rotund cypress
#

Exactly

lone glade
#

which technically is true, but it doesn't mean it works

rotund cypress
#

Thats how a throw should and does work

lone glade
#

you'll notice it appears as a syntax error and get logged

rotund cypress
#

If its something you think will happen, then you try / catch it, else just leave it.

#

No it does not

edgy dune
#

can u force a jet exhaust animation?

rotund cypress
#

@lone glade trust me, i use this in my mission everywhere every day

#

It does not error if condition is not evaluated to true

peak plover
#

Jet exhaust is that not a particle effect?

rotund cypress
#

Regardless being in a try catch block or not

barren magnet
#

There are far more funny ways to disconnect people

rotund cypress
#

@unborn ether here he goes again

barren magnet
#

Do you even setpos loop to 1e25 ?

rotund cypress
#

hhahahah

#

nice way me mate

#

wouldn't be surprised if that would crash server though

barren magnet
#

Many people are typing

unborn ether
#
onEachFrame {player setDir (random 360)};

Disconnects well, from your own body

jade abyss
#

@barren magnet Do you remember old Tonics way to forceCrash player? Was it setVelocity Something?

lone glade
#

god ol' recursion never fails

unborn ether
#

@jade abyss #include with bare words

lone glade
#

nah, that crashes the mission / everyone that tries to load it....

rotund cypress
#

That wont work to crash btw @unborn ether

barren magnet
#

Was the setpos [Nein, Nein, Nein];

jade abyss
#

Nah

#

Wait, lemme search

lone glade
#

bad syntax for prepro commands -> insta crash

edgy dune
#

oh particel effect eh

#

lemme search about that

barren magnet
#

I think we should make this one for Arma: ioccc.org

jade abyss
#

vehicle player setVelocity[1e10,1e14,1e18]; //It's a surprise. ๐Ÿ˜„

#

found it

peak plover
#

@lone glade does that happen with -nologs?

lone glade
#

yes

barren magnet
#

Ah okay

lone glade
#

it's the engine that can't handle the error

jade abyss
#

Very very old one

#

No clue if that one still works. Anyone got Arma open atm?

unborn ether
#

I love Tonic ๐Ÿฟ

jade abyss
#

pff, that birch

peak plover
#

Works

barren magnet
#

It works

jade abyss
#

works = Crash?

peak plover
#

Yeah

barren magnet
#

Don't need to boot up arma for that

unborn ether
#

Well sure its out of bounds i think

jade abyss
#

huehuehue

rotund cypress
#

Didn't you say you made a script that damaged all wheels cause he was so fat? @jade abyss

jade abyss
#

Yep

#

I still got it somewhere

little eagle
#

CTD:

_a = {call _a}; isNil _a;
peak plover
#

lol

barren magnet
#

Enters a vehicle: Hint you are too fat boi

jade abyss
#

Exactly

#

wait, leme search

lone glade
#

increase the vehicle mass to an extreme degree

barren magnet
#

Set velocity randomly to the left or right

lone glade
#

nah, better

#

addTorque

rotund cypress
#

Does the addTorque command actually work?

#

Isnt there some bug with it

lone glade
#

ofc

#

it works fine

jade abyss
#

He always did, iirc

lone glade
#

it only works on physX enabled vehicles / objects since it's an impulse tho

jade abyss
#

iirc it didn't worked with "Men", only with PhysX Obj.

unborn ether
#

@rotund cypress There is, this bug is called PhysX

lone glade
#

200-500 on the Z axis -> feels like someone is tugging on the wheel to move right

#

it's hilarious

#

aka how to make people hit trees and make them think they did it

jade abyss
rotund cypress
#

GNU code style? ๐Ÿ™ˆ @jade abyss

barren magnet
#

Ok so we agree that isEqualTo is in any way better than == ?! Fine ๐Ÿฟ

unborn ether
#

no EVH used, ouch

lone glade
#

@little eagle read from the start, it's worth it.

jade abyss
#

Not enough Macro's in it, to be interesting for him ๐Ÿ˜„

barren magnet
#

Ahahahaha

#

#define a lol

rotund cypress
#

He meant the conversation I think

barren magnet
#

a

jade abyss
#

No shit, Sherlock @rotund cypress

lone glade
#

what triggers me isn't the while true nor the two waitUntil in succession, ITS THE BRACKETS

unborn ether
#

#define tonic "fattie"
#include "fat.sqf"

lone glade
#

GOD DAMN

rotund cypress
#

brackets are fine

#

except for the 4 spaces on second line

#

and no spaces triggers me

unborn ether
#

You just know nothing of folding

barren magnet
#

USE TABS INSTEAD

rotund cypress
#

Allman brace style is gud

unborn ether
#

8 spaces is the best

#

no

lone glade
#

๐Ÿคฆ

unborn ether
#

7 spaces

#

I dream of day with 7.5 spaces

barren magnet
#

3 spaces

rotund cypress
#

get out

barren magnet
#

Nearly looks correct but isnt

jade abyss
#

1 Space is enough, let's get to the mars.

barren magnet
#

Or one tab + 3 spaces

lone glade
#

64KB of memory is enough

unborn ether
#

Actually 4 tabs is the best ๐Ÿฟ

lone glade
#

doesn't matter if you have a proper editor anyways

jade abyss
#

btw. haven't you said you wanted to leave @unborn ether ?

unborn ether
#

notepad.exe

lone glade
#

he can't

jade abyss
#

Oh

lone glade
#

he joined the cool bois club

unborn ether
#

@jade abyss This particular convo, not like discord kek

jade abyss
#

meh

#

Yet, you still continued ๐Ÿค”

unborn ether
#

Lies, you liar ๐Ÿ˜„

jade abyss
#

yeah.... no.

unborn ether
#

haeY

barren magnet
#

@jade abyss Make discord great again. Let's build a wall around @unborn ether

rotund cypress
#

waitUntil {uiSleep 1; false};

#

optimized ^

unborn ether
#

Like im gonna even continue

rotund cypress
#

pls dont

jade abyss
#

@barren magnet Too much effort. Just dig a hole and push him in

barren magnet
#

Agreed

#

starts digging

jade abyss
#

The we go and steal the Fluff

#

"dogging" ๐Ÿ˜‚

unborn ether
#

dogging

#

nice

barren magnet
#

XD

unborn ether
#

Teach me

rotund cypress
barren magnet
#

Fk

#

@rotund cypress good doge

rotund cypress
#

indeed

#

just realised ive wasted all morning writing in this discord

#

fml

unborn ether
#

All as planned

barren magnet
#

Go and wรถrk wรถrk @rotund cypress

rotund cypress
#

Should do.

unborn ether
#

twรถrk

barren magnet
#

Nein!

rotund cypress
#

None of that @unborn ether

#

NSFW

jade abyss
#
if()then
{
};```
>
```sqf
if()then{};```
rotund cypress
#

^^^^^

#

But pls for the love of someone, use some spaces will you

#

if (true) then
{
}

jade abyss
#

Nah, it saves Compiletime

rotund cypress
#

ffs ๐Ÿ˜‚

#

readability > important than compiletime

#

Also, why the f does SQF use then

#

Seriously

#

Triggers me so bad

unborn ether
#
if (

) then 
{
}
else 
{
};
rotund cypress
#

Dude

#

Stop

jade abyss
#

That's how almost every life-code looks like

unborn ether
#

Oh that tickles you right?

barren magnet
#

@unborn ether I am calling the police

peak plover
#
if()then{}else{};
barren magnet
#

If( true ) then
{
Do
};

peak plover
#

actually forgot commnets

rotund cypress
#

I mean if you have many conditions

if (
    true
     && true
) then
{
}```
barren magnet
#

No

#

It's && true )
{

lone glade
#

using

if (COND) then 
{

instead of

if (COND) then {

just uses one more line

unborn ether
#

&& is slower than AND ๐Ÿฟ

lone glade
#

there's no benefits at all

barren magnet
#

@lone glade that's not correct. It's far more readable

rotund cypress
#

Its all about readability and preference my friend @lone glade

lone glade
#

No, it isn't

barren magnet
#

You seem to never had to read other people's code

rotund cypress
#

P R E F E R E N C E

#

And yes this ^what arkensor said

lone glade
#

I have read bi_fnc_arsenal

cedar kindle
#

itโ€™s certainly not more readable the spacing is disgusting

lone glade
#

and trust me that bracket style haunts me

rotund cypress
#

BIS_fnc_arsenal***

#

Again P R E F E R E N C E

lone glade
#

nope

rotund cypress
#

As long as you don't use TABS you are fine.

lone glade
#

....

barren magnet
#

Opening and closing a scope deserve a own line

lone glade
#

that's actually preferences simzor

barren magnet
#

Yes use tabs

peak plover
#
if/*evaluate the following condition*/(/*put conditon here*/(count (units player)) > 1/*check if player group has more than 1 unit*/)then/*run code if the condition is true*/{/*put the code here*/player setDamage 1;/* kill the player*/};
barren magnet
#

And one line

#

@peak plover please get help

rotund cypress
#

^^^this tbh

lone glade
#

nah nigel, use comment like the big bois (warning this is sarcasm)

rotund cypress
#

@lone glade tabs are horrible, and certainly not preference.

unborn ether
#

Tabs are the best

rotund cypress
#

When you are working in a team, tabs are fucking aids.

jade abyss
#

what a nightmare @peak plover

lone glade
#

tabs vs space is entirely preference, I use 4 spaces myself

peak plover
#

tabs mustard rrace

lone glade
#

and that's why editorConfig exist

barren magnet
#

Every time a tab is used a puppy dies

rotund cypress
#

Do you know the difference between tabs and spaces? @lone glade

lone glade
#

SO EVERYONE IN THE FUCKING TEAM USES THE SAME INDENTATION METHOD

rotund cypress
#

Like the ACTUAL difference

jade abyss
#
    1    2    3    4    5    6    7    8    9```
@barren magnet
lone glade
#

yes, and I use spaces

#

doesn't mean everyone has to, it's actual preference that can be adjusted on an editor to editor basis

peak plover
#

What's the differnece 'tho?

rotund cypress
#

Tabs right; if you use it, aligning things will get fucked when different people use different tab sizes

barren magnet
#

I only seez spaces @jade abyss

unborn ether
#

What a lovely campfire placed in this room, especially when its fueled by some arguers about folding style.

#

Mm

jade abyss
#

tabs! Not spaces

lone glade
#

different chars nigel

peak plover
#

4 spaces is always 4 spaces, but tab indents to a certain place every line

#

I like tabs

rotund cypress
#

@peak plover get out

barren magnet
#

It's @jade abyss and my daily entertainment

cedar kindle
#

no, that can be adjusted by your editor

unborn ether
#

@peak plover SimZor is gonna eat you now dude ๐Ÿ˜„

barren magnet
#

More fire = more gud

rotund cypress
#

You set your tab size in your editor

jade abyss
#

Now tell me where the Rum is! It's gone... -.- can't find it

barren magnet
#

Set the tab size to 5

lone glade
#

you don't even have to set it if the project manager is not a goddamn moron

rotund cypress
#

If you use 4 spaces in one tab, and your colleague user 5 spaces, whats gonna happen when you align something

#

Things are going to be fucked

lone glade
#

E.D.I.T.O.R.CO.N.F.I.G

rotund cypress
#

and kittens are killed

cedar kindle
#

yea fuck sake

#

it doesnโ€™t matter, just make sure everyone uses the same setting

rotund cypress
#

or just use 4 spaces and the day is saved

#

ffs

lone glade
#

hell, you can even convert it upon saving / committing FFS

rotund cypress
#

if you have a proper editor, it has all the useful things that a tab gives you

#

Yeah thats completely fine

lone glade
#

can be do editor wars next?

peak plover
unborn ether
#
if (true) then {
" ";" ";player setDamage 1;
};
rotund cypress
#

As long as sometime on/before save a tab is converted to spaces

lone glade
#

atom is shit, sublime is better

barren magnet
#

Replace all ' ' by ' '

#

Btw

#

If if !() Vs if(! ())

jade abyss
#

pff... atom, Sublime... < N++

rotund cypress
#

Atom, pls no

#

That editor killed me almost

unborn ether
#

notepad.exe is the best

rotund cypress
#

Made me old and grumpy before a file would open

barren magnet
#

I only use nano

peak plover
#

I just use the initialization fields for the 3den ยฏ\(ใƒ„)/ยฏ

barren magnet
#

@peak plover XD

#

Best editor

cedar kindle
#

i manually insert 0 and 1 into the cpu

peak plover
#

manually insert the experience into the human brain

rotund cypress
#

Emacs ftw

barren magnet
#

I manually switch the cables from high to low voltage

lone glade
#

piece of paper that you scan and then OCR it

barren magnet
#

I put together the atoms to make everything

#

What was the initial question btw ?

meager heart
#

something about trains and kung fu

peak plover
#

Ok the real question is

#

Is it faster to

if !(_groups isEqualTo []) then {
    _group = [];
};

or

_group = [];
#

With a chance that' for about 100 iterations _group is empty

#

is it worth checking if it needs to be emptied or just empty it?

#

even if it's already empty

rotund cypress
#

Do a performance check

#

But I would always check

#

First example

peak plover
#

So

#

4 mikroseconds for normal equals

#

for if
if _groups is empty, 10 mikrosecond
if _groups is not empty, 11 mikroseconds

#

๐Ÿค”

#

checking a condition is more expensive than just writing a new value

#

hmm, cheaper to do

_group = [1];
if (<true/false>) then {
    _group = [];
};

than

if (<true/false>) then {
    _group = [];
} else {
    _group = [1];
};
#

interdasting

austere granite
#

You are interdasting

peak plover
#

๐Ÿ˜Š

barren magnet
#

Get a room you two

still forum
#

Rly? You guys are arguing about how awesome the shittiest mission frameworks in existence are? Man... Glad I didn't miss anything important while sleeping... @Demellion Dismal#4736 You can't kill FPS with scheeduled scripts because they only run 3ms. And it cuts your CPU cycles in a half at least. YOUR CPU GET'S MAGICALLY SLOWER WHEN YOU USE WAITUNTIL DUDE! NO USE WAITUNTIL! WTF
You only care about what the wiki says it's faster? Did you ever check to make sure the wiki is correct and that it really matters in what you are doing?
I can't even see where it says that isEqualTo is faster.

@rotund cypress count array > 0 vs isEqualTo [] is a difference of 0.0001ms on an empty array. So "much faster" is completly wrong. "A tiny bit faster" is the right thing to call that.

Oh yeah.. You are talking about isEqualTo vs == and then some guy comes along and tells you to convert isEqualType code to == because that's the same as isEqualTo right? Gosh....
== vs isEqualTo could be optimized by my optimizer if you have atleast one constant.

#

Good morning btw

lone glade
#

oh hai ded

peak plover
#

The 15 hour sleep man has returned

#

Just like the prophecy foretold

#

> YOUR CPU GET'S MAGICALLY SLOWER WHEN YOU USE WAITUNTIL DUDE!
Is that irony

still forum
#

no.

#

He said that

jade abyss
#

Yep

peak plover
#

,

#
_a = 2;
g = [[1,_a,3],{_this param [1]}];
[] spawn {
    systemChat str ((g param [0])call(g param [1]));
    // 2
};

Any 'proper' way of doing this?

jade abyss
#

ctrl+A -> Del

still forum
#

I don't even see what that's supposed to do

jade abyss
#

doing a systemchat msg?

still forum
#

why the hell are you using param

jade abyss
#

But... makes no sense at all

still forum
#

and why do you pass a variable in a global variable??

peak plover
#

I wanna do some stuff but I wanna do it later, but the parameters are only avaliable now
I need to save my stuff into an array but later still have exact same param and also code

#

Shit

#

That makes no sense

#

Wait

still forum
#

๐Ÿ˜„

dusk sage
#

== vs isEqualTo could be optimized by my optimizer if you have atleast one constant.

#

Dedmen -> ShillMen please

still forum
#

ShillMen?

jade abyss
#

new fancy word

dusk sage
#

(minus paid ๐Ÿ˜Š )

peak plover
#
_arr call ai_ins_fnc_gCache;

But I want it later
so I save the data and code into array

funcQ pushBack [_arr,{_this call ai_ins_fnc_gCache;}];
still forum
#

Ahhh. @pastel cloaku

#

๐Ÿ‘€

jade abyss
#

๐Ÿ˜‚ mentionnoob

peak plover
#

It's to make sure I don't cache it from outside at the same time it's being operated on by the normal caching loop

jade abyss
#

Thats how you do it, dedymom: @dusk sage

peak plover
#

Is there a 'proper' way of doing what I'm doing?

still forum
#

I still don't quite know what you are trying :x Why are you caching that stuff?

dusk sage
#

this poor Bog guy gets tagged so often

jade abyss
#

No clue what you try to do there, Nigel

unborn ether
#

Use setVariable into your namespace used, whatever that is.

#

or pass it via spawn arg

peak plover
#

๐Ÿ˜ฅ

jade abyss
#

cmon Nigel, you can do better than that

unborn ether
#

@peak plover Where your array comes from, like is that UI data, mission data ?

peak plover
#

array comes from a getter that gets it from a missionNamespaceVariable

dusk sage
#

thats a big word

unborn ether
#

@tough abyss What its destination? (Want to use it in UI, or in mission)?

peak plover
#

mission

unborn ether
#

Server/Client?

peak plover
#

server

unborn ether
#

missionNamespace setVariable ['whatevername',_arr];

peak plover
#

_mainArray = [_groupArray,_grouparray2];
Getter uses inArea and gets data from the elements from _mainArray to get groups and cached groups.
So then I wanna do stuff with the groups but they gotta be done in a certain order and there's a chance that the groups conflict with eachother

#

So I do get all groups in 300 m radius and for each of those uncache and combine with nearest group until 10 units in group

#

But I have a loop that processes those functions 1 per frame and I need to add the data and function to that loop

#

So 2 groups don't try to combine with the 3rrd one at the same time

#

๐Ÿคท

#

Is there a better way to do it

dusk sage
#

Is there context to this if I scroll up?

peak plover
#

No

dusk sage
#

What you've written doesn't read easily then

unborn ether
#

Groups can also recieve a setVariable

peak plover
#

Not reliable

unborn ether
#

If you want to differ them at source

peak plover
#

Some groups are cached

#

So they are only array

#

No units or group

unborn ether
#

Oh.

still forum
#

Btw why don't you just use BI dynamic simulation for your caching?

peak plover
#

deleteVehicle is better

#

Than disableSimualtion

#

and customization

unborn ether
#

I would make an anchor-like setVariable then to easily find them by a string in a like:

["groupanchor1",[data],"groupanchor2",[data]....]
peak plover
#

and persistance

unborn ether
#

So you can access it fast without scrolling each of them

#

Because when you find index, +1 means its data

#

data can contain like anything you want

jade abyss
dusk sage
#

omg

#

Emotes are enabled for you?

#

oh damn

#

Dwarden squeezed out the fun sponge a little

jade abyss
#

[ [ID1,Group], [ID2,Group], [ID3,Group] ]
if you wanna make it MultiArr, then cycle with forEach

dusk sage
#

Would be preferable to avoid putting the key/ID inside an array

jade abyss
#

It's a shitty idea, yeah

dusk sage
#

No need to perform a second select

jade abyss
#

But the one he mentioned before was worse^^

dusk sage
#

Demellions is better

unborn ether
#

Because find doesn't "cycle" the array

#

like forEach does

dusk sage
#

You ensure that your data is always one index away from your key, the same idea as yours without further nesting for the indexing

jade abyss
#

๐Ÿ˜‚

#

The whole principle is garbage

peak plover
#

๐Ÿค”

unborn ether
#

find - one operation

#

forEach - cycling until found

dusk sage
#

It's the same principle as a dictionary/hashmap, without any of the complexity behind it

unborn ether
#

So as usual you do nothing important with it

jade abyss
#

missionNameSpace setVariable [format["GroupName_%1","Bla"],_Vars];

dusk sage
#

We're not doing any ๐Ÿšด in ARMA

#

Utilising the actual implementation would be better, yeah

unborn ether
#

missionNamespace is a global namespace, any VARIABLE name is the same as its globaly declared, why would you create tons of vars?

dusk sage
#

Yes

#

Or create a new namespace to put them in

still forum
#

@BoGuu#1044 Discord Nitro guys get any emote

dusk sage
#

I'm sure ShillMen will tell you the size of the buckets

#

I'm not nitro

#

๐Ÿ˜›

still forum
#

Buckets?

#

Of the Namespace hashmap?

jade abyss
#

missionNamespace is a global namespace, any VARIABLE name is the same as its globaly declared, why would you create tons of vars?
drunk?

dusk sage
#

Yeah

still forum
#

15 I think

#
find - one operation
forEach - cycling until found

bullshit

unborn ether
#

@tough abyss Do one setVariable container, and parse data with find indexing. Thats how BoGuu said some sort of hashing. forEach will seek each element until found.

still forum
#
Because find doesn't "cycle" the array
like forEach does

bullshit

dusk sage
#

How many buckets is it limited to? Or is there no lim

#

I assume it creates them dynamically

jade abyss
#

Who wrote that, Dedmen?

still forum
#

Demellion ofc

jade abyss
#

lol

unborn ether
#

@still forum so scrolling a 500 elemts array is better than just find?

jade abyss
#

Dude, you are pretty new to Arma, or?

still forum
#

@BoGuu#1044 no limit. But it never reduces size until mission restart. Even if you nil out everything it will just keep empty buckets and not shrink

dusk sage
#

:/

jade abyss
#

@dusk sage

still forum
#

@unborn ether find is also iterating over all variables

dusk sage
#

Did you just imply bohemia?

peak plover
#

Hmmm

still forum
#

The difference is just if iteration is done in engine or in script

unborn ether
#

Check whats better with array of numerous data

still forum
#

What did you think find does? Just do some magic and get the index in O(1) ?

unborn ether
#

No

dusk sage
#

Looping over a 10000 element array takes the same time as a 10 element Dedmen, get with the times

still forum
#

fastest way would be to use a CBA namespace or Intercept_CBA hashmap

dusk sage
#

We're in 2018 now, we have space tech you know

still forum
#

Don't use CBA hash. Because it uses find which is incredibly slow on bigger arrays

#

If you don't have CBA then... Just copy their namespace stuff

unborn ether
#

The thing is that in forEach requiers evaluations of each found element to the one you need. Isn't that slower with big data?

#

@jade abyss Sorry, blacklisted dude, I don't see any benefit from you besides emotes

peak plover
#
ai_ins_groups setVariable [format["group_%1","Bla"],_ARRAY];
ai_insgroups pushback _ARRAY;

๐Ÿค”

dusk sage
#

find which is incredibly slow on bigger arrays
Past it being O(n), what is your definition of slow? Relatively?

lone glade
#

oh boi, what did I miss

still forum
#

If you only @unborn ether forEach is only slower because it uses script to iterate.

#

find is in engine written in C++ so it doesn't have to go through the script engine

jade abyss
#

@lone glade guess.

unborn ether
#

So comes up with im right for find?

still forum
#

No.

#

Find is faster. But you said it doesn't iterate the whole array which is complete bullshit

jade abyss
#

*depends on the size

unborn ether
#

Oh you mean that. Sorry that was kinda not properly said.

dusk sage
#

Yeah, it is just a for loop, but just wondering why you refer to O(n) as being slow, it's just as efficient for any N, naturally it'll be slower for any high N

#

Can't avoid that ๐Ÿคท Unless CBA does something wacky

still forum
#

it doesn't

#

Intercept_CBA does tho ๐Ÿ˜‰

jade abyss
#

One day, i will find out where you live, and i will punch you, furry.

dusk sage
#

ShillMen

jade abyss
#

for each and everytime you mention intercept

still forum
#

NRW. Gelsenkirchen

jade abyss
#

omw

dusk sage
#

and i will punch you

#

You could say, your fist will intercept with him

jade abyss
#

I hate all of you

lone glade
#

we all do

errant jasper
#

wait we all hate all of us?

still forum
#

Yes

peak plover
#
_data = ([1,[data],2,[data],3,[data]] find 2)+1;

_data = (([[1,data],[2,data],[3,data]] select {(_x param [0]) isEqualTo 2}) select 0) select 1;

๐Ÿค”

unborn ether
#

I've lost my sight on those selects

lone glade
#

find != select FFS.

jade abyss
#

What are you trying to achieve anyway, Nigel?

lone glade
#

find give you an index ref, select creates a new array

errant jasper
#

Yes the first is a bit nicer in that regards. But requires you to know a key won't be in a value position

peak plover
#

yeah

#

So before the discussion went to find

unborn ether
#

Well i still prefer option with find

peak plover
#

is it bad to
[_variable, {code}]

still forum
#

I don't see why that would be bad

unborn ether
#

Why

#

Its ok

dusk sage
#

lol

lone glade
#

as long as you don't call compile the code block it's fine

#

and yes, i've seen people do that

peak plover
#

call without compile

lone glade
#

nonono, i've seen call compile CODE

unborn ether
#

@lone glade Im not gonna pick that theme again. There is some cases where you need to pass a string-code. It was intentionally made in the engine right?

lone glade
#

...

peak plover
#

also fun fact can't save to profilenamespace {code} So you have to call compile if you saved to profile ๐Ÿ˜ฆ

still forum
#

@unborn ether No it wasn't

#

That is a leftover from SQS script

#

Dev's didn't bother fixing that when SQF was introduced

peak plover
#

have to save as string*

unborn ether
#

Any EVH still accepts string-code.

still forum
#

Yep

lone glade
#

and if we get sqf support in enfusion we will still be able to use getDammage

still forum
#

Because they are also stored as String internally and compiled before each execution

#

Again. Leftover from SQS because dev's were too lazy

jade abyss
#

@lone glade Doubt that (sqf support)

lone glade
#

me neither

jade abyss
#

"neither" or "too"?

dusk sage
#

It'd be a grave mistake if they didn't allow a very easy API such as SQF

unborn ether
#

Well i have some stuff that cannot be performed via code. Wow really.

lone glade
#

....

unborn ether
#

i mean objected {}

lone glade
#

unless you use moon rays it's still code

unborn ether
#

Simply because this code passes throught death of a mission to a outer namespace with onEachFrame

#

While any {} dies with mission

dusk sage
#

Simply because this code passes throught death of a mission to a outer namespace with onEachFrame