#arma3_scripting
1 messages ยท Page 410 of 1
today?
Everyday?
๐

๐
Tester Upgrade Lvl 0 - Discord Nitro
@still forum
Still seem to be 10GB, even when we had bigger ones (~12GB is one i still have on my disk here)
https://docs.gitlab.com/ee/user/admin_area/settings/account_and_limit_settings.html
H
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.
which one
Everything is possible
@lone glade I mean the virtual arsenal
go cry in a corner ๐ญ
and yeah everything is possible if you know how to code
Yeah, get in that corner birch
Yeah! You Tree!
Yeah!
Answer is.. Vanilla Arsenal: Have fun I won't get into this shit again.
ACE Arsenal: yeah easy.. here's how...
oh ACE got its own arsenal?
Done
shoots @lone glade and he now has to go to bed and ignore all further messages because he is dead
I gues you could say he is a... @still forum now ๐
YEAAAAAAAHHHH
Not bad. Gotta say


What is the best practice way to run an sqf script when a ui button is pressed?
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
why would it?
virtual items != items
if you had to stock "real" items to access them... server framerate would hang itself
@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
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.
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.
For the love of someone, why sleep in an unflip script? Please ๐ @warm gorge
Why not?
^
@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
Yeah exactly @jade abyss having a sleep for that is hope scripting.
if (velocity _obj...) or if (speed _obj ...)
What?
Why would you die?
Good to have random sleeps here and there just to make sure you know
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.
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
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.
The only reason its scheduled is because theres a BIS_fnc_guiMessage at the top
I could change that I guess tho
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?
Im not too sure to be honest now that I think of it
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;```
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.
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
Whys that? How do you suggest implementing that
Flipping the car is bad while moving
Ah yep I know what you mean
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.
Cheers for the help
np
Is ctrlAddEventHandler stackable?
yes
@rotund cypress Always add a short uiSleep in any waitUntil you use. It is a huge performance destroyer
waitUntil {uiSleep 0.1; true}
@still forum we found how to fix unscheduled loops perf /s
@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.
??? absolutely not
Well i've seens tons of popular frameworks do it in a while style
it's the length / cost of the condition block
^
And also @unborn ether I don't know why you would tell me such a thing at random like you just did? ๐ค
@rotund cypress Because I cry with blood when i see waitUntil without any sleeps
Well stop crying.
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
doesn't matter, not the same usage
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
@rotund cypress Well tell that to the developers of the frameworks such as Epoch, A3PL, Exile and infiSTAR
As sometimes you have to use breakOut instead of exitWith.
A3PL developers, what a joke ๐
Ok, call him a Tonic with some dudes.
call him a tonic?
Arma 3 Project Life (A3PL) is a child of a Tonic
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.
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
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.
Well initially it was just for a few weeks, just to do yet another life server.
Never knew that could escalate so quick.
I am not sure I follow what you are saying.
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.
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.
You should probably read what i've posted before.
I did.
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.
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.
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
๐ ๐ ๐ ๐ ๐ ๐
Why would anyone ever do that?
You are spawning 50 threads with a waitUntil in it
and? Thats nothing
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
Yeah, but look - if you don't spawn 50 threads you are fine
waitUntil is bad at is core, so no relativity to your well optimized code outside or not
Thats why you should avoid using scheduled environments unless you really need to
๐คฆ
just keep watching dscha
The only what i'm seeing from him is facepalms actually ๐
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
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
question,is the afterburner effect on some jets a animation?and if so im a assume that u can set it with https://community.bistudio.com/wiki/animateSource
Its just like saying using == instead of isEqualTo
^^^ objects?
Yes
that's..... a completely different thing ....
Either way, I didn't say don't use it, I said, only use it if you have to
just keep watching alganthe
one is case sensitive and the other isn't, one supports more types too....
sshhhh
๐
is scheduled environment in a EH okay?
Ffs, you don't think I know the difference between isEqualTo and ==???
The thing is isEqualTo is 3x faster that == while evaluation is 80% done the way it was intended with ==
๐ฟ want also some? @lone glade
I know isEqualTo is faster
yeah, pass me some
can't add the fkn emote... -.- Discord's beeing a birch again
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
Readable? Well at this point of using operators its slacking
oh I asked
dafork you saying?
"question,is the afterburner effect on some jets a animation?and if so im a assume that u can set it with https://community.bistudio.com/wiki/animateSource"
Should be there
Stop spreading your nonsense
T_T i cire and trie
@jade abyss Use links to understand whom you talking to please
@edgy dune I doubt it, since the Anim is triggered by the Engine (same reason why you can anim the steeringwheel with it)
Either way, never told anyone that you should use isEqualTo for comparing strings or == if you are not comparing strings.
Why would i ever use == if isEqualTo is faster anyways?
@unborn ether Follow the Convo and don't tell me what to do, am i clear on that?
What the fudge are talking about?
Never said or asked why you would.
.... BECAUSE ONE IS FUCKING CASE INSENSITIVE jesus
ppssshhhttt alganthe
Well yeah, in that use-case yes.
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
@jade abyss Are you a god or what? Go make jokes somewhere else dude.
dscha confirmed god
๐
we're all fucked
Can't find his tag, but BoGuu can confirm I know the use-case for isEqualTo and == jesus
if(lube) then {lube};
Not understanding why you trying to dig shit on me, jesus.
if(!lube)then{tears};
@rotund cypress I don't give a fudge about functional part dude, i care about its 3.6x (wiki) faster than ==
Well, if you just do a performance check you'll see.
You don't need the wiki for that.
And to get back on track, if you are checking this for a couple of seconds
waitUntil {missionNamespace getVariable ["flag", false]}
Isequto is more powerful
Im out dude, thats not even funny anymore)
Why would you use a sleep
whose kung fu is better ? ๐ค
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)
isEqualTo takes all types, == doesn't but it's case insensitive
It is slightly faster than ==, especially when comparing Strings nooo u lied to me noooo-"lord vader"
I love iseequalto
@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.
I've got an idea for oneachframe that will only do 1 script at a time for me
In here? Doubt it
It's like a scheduler for my scrupts
cuel, stop changing your avatar, BRING BACK THE CHICK
but even shittier nigel
I like it
;0
Still better than that snail with a butthole in it's face.
Y WANA FITE M8?
get ova hear!
gun fuck u up
Wait, you were french, right?
I am still french
If so: nvm, no threat anyway
don't know where the "were" comes from ๐
๐
or.... did I get exiled ?
Oh, prep for more ๐ฟ
wait a second, THIS ISN'T FRANCE!
THIS IS A GULAG!
Nah, just wave your โฌ -flag ๐
you mean my undies on a stick
@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
No its not one cycle.
@unborn ether You can stop insulting ppl now, or the fun will be over soon.
It's 10000 @unborn ether
over 9 000 frames?
@jade abyss You telling me that? I was discussing some stuff and you both guys startled somethign over here
Did i insult anyone? No, so you better watch your tone.
Calm down, and everything will be fine.
yes, you hurt my snail feelings
You're an alganthe, you don't count ๐
Oh god guys, you are scripting gods, im just out ok. Follow the Convo and don't tell me what to do.
Jezus
Don't know you are saying I am dumb @unborn ether ๐ I never told you such a thing.
lol
๐
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
oh?
So just lets stop
What?
did I miss something?
Guys just stop that ping pong conversation which is going nowhere... .Dscha kung fu is better, he won
Also I was speaking in general, not saying you are dumb.
ITS CALLED TABLE TENNIS
@meager heart I didn't even fought^^
I am just sitting here, laughing and watching the chat
๐
Someone been impersonating my name asking how attachTo works? Anyone? ๐
same here
here, get some
armaDrama โข never gets old.
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
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.
Stop pretending to be a cool dude and harrass people on argumented critics.
dudes, stop, i can't take it anymore ๐ my belly hurts
Hahaa
ad hominems are flying round' here.
Ok, just stay the same dudes, ok ๐
Never reconsider what people saying anything. Im out seriously ๐
2nd time now ๐ฟ
Doubt it, you've told us a lot of times.
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
Oh so you were not actually telling me that lol @lone glade
Thought you were directing that at me.
Hahah lol
๐ฟ
case insensitivity
PERFORMANCE!! DDUUUDDDEEEEEE
And don't tell me it's less typing
๐
What is case sensitive and what not ?
Yes.
isEqualTo: case sensible
==: isn't
ffs
@jade abyss answering questions that can not be answered with yes or no with yes since 2001
Yep, i perfected it.
maybe
Also:
isEqualTo = Can compare Arrays
== = not
Tbh then iseqalto ยฉ is the better choice then
depending on the use case*
Not really
Pfff
@Arkensor#0120 BUT ZE OVERHEAD!!!111oneone
ZE OVERHEADDDDDD
(Yes, i find that funny)
not having to use toLower / toUpper helps...
But I reads zat ze iseqalto command is faster
I guess you will just toUpper all your strings so you can always use isEqualTo yes? @unborn ether
๐ฟ
thus negating the perf advantage of isEqualTo, noice
๐
I don't see a reason why you would compare something incasesensitive
strings
Well, mistakes can happen @barren magnet
the answer is strings returned from config / commands, shit is inconsistent as fuck
config names is perfect example
people tend to mix cases when doing configs
....
"Dscha likes cookies" IS NOT "DsChA likes CoOKies"
maybe
Yerp, fluff
depends on the code i.e niarms & exile both had/have issues with different cases for confignames
Thus expecting it to be the same is very bad coding style
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};
nah, it's entirely on the inconsistency of commands that return classnames / configNames
Nope, its just people using isEqualTo everywhere ๐
Yeah I mean, you should be consistent
๐ฟ
If you want something case insensitive make it tolower
๐
CALL COMPILE KILLS BABIES
Okay
@barren magnet but then you negate the performance gain from using isEqualTo
Several people are typing...
or use == without toLower
@jade abyss my belly hurts now too ๐
try calling a string, dummy
{mycode} foreach array
why would anyone ever use count?
This is not a serious discussion @nigel#4210
calling people "dummies" is not nice mr @unborn ether
I don't think insults are allowed in this Discord.
I think that's called projection
@unborn ether Haven't you said that you are out? ๐ค
@rotund cypress Stop avoiding the questiongs then, afterwards you've insulted me dude
Do that with == im waiting
You're done ๐
Yes SimZor you always insult me
๐ข
gonna continue shouting something irrelevant?
shouts something irrelevant
@rotund cypress Can you perform the same code i've posted using == or typeName without expanding that code for no reasons?
Not sure what you mean...
i donโt see how thatโs relevant tbh
Do you lack basic reading comprehension or are you ignoring what I write
Typename in most cases can be substituded with isEqualType
D.I.F.F.E.R.E.N.T U.S.E C.A.S.E.S
I guess he ignores, since... yeah... you know... admitting some stuff
Obviously you cannot use == @unborn ether
That is a complete different thing
== is not even remotely similar to isEqualType
typename not ==
Well with typeName you would have to use == as well
no you don't
typeName "" == STRING
in or isEqualTo ๐คท
So yes, you would have to
typeName is deprecated anyway with isEqualType
Exactly
So you bascily cant
So not sure why its relevant
_myArray = [0,1,2,3] apply {_x = 0}; can you do that with select? i'm waiting.
itโs still not relevant to the discussion
Yea
๐
Okay let me ask you a question Mr "optimizer" do you know the difference between count and foreach?
@unborn ether
No i dont ๐ฟ
_myArray = [0,1,2,3] select {_x = 0;true};
```not even sure you need true ๐
btw do you guys like trains ?
does that not work?
no
nah.
k
Guys how to return a player unit, anybody?
player ?
allPlayers
AllUnits
๐ thanks gonna not it
oh wait
allUnits select {isPlayer _x}
we had a competition to find the worst way to do that didn't we
๐
๐
@lone glade Yep
private _array = [];
{_array pushBack _x} forEach _array;
Profit
altis life way
(allMissionObjects '') select {isPlayer _x}
profit what?
omg this is ridiculous
that's not proper recursion
this conversation is making me fucking nauseous
private _array = [];
{_array pushBack _x} forEach _array;
foreach never does anythingbecause _array has 0 elements
Fucking fail
Actually that is quite genius
private _objects = nearestObjects [[0,0,0], ["Man"], 25000];
private _player = objNull;
{
if (_x isEqualTo player) then { // Why exitwith?
_player = _x;
};
} forEach _objects;
Nicely optimized
Ayyyy
Running this in unscheduled should disconnect as well for "_i" from 0 to 1 step 0 do {}
@jade abyss SORRY
why 25 000?
nearestObjects [[worldSize / 2, worldSize / 2,0], ["Man"], worlSize];
go big or go home
@jade abyss I admit im bad
At least
@lone glade XD
also man returns bunnies and snakes
just FYI
basic knowledge for experienced scripters like you said earlier about display 12
disconnectFunc = {
if (canSuspend) throw "Suspension not allowed";
for "_i" from 0 to 1 step 0 do {};
}```
will error out
throw?
{_x closeDisplay 0} forEach allDisplays
eek
throw needs to be in a try catch block
๐คฆ
Next gen disconnection ๐
it will only error if suspension is allowed @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"
you're saying that if the line isn't evaluated it won't error out
Exactly
which technically is true, but it doesn't mean it works
Thats how a throw should and does work
you'll notice it appears as a syntax error and get logged
If its something you think will happen, then you try / catch it, else just leave it.
No it does not
can u force a jet exhaust animation?
@lone glade trust me, i use this in my mission everywhere every day
It does not error if condition is not evaluated to true
Jet exhaust is that not a particle effect?
Regardless being in a try catch block or not
There are far more funny ways to disconnect people
@unborn ether here he goes again
Do you even setpos loop to 1e25 ?
hhahahah
nice way me mate
wouldn't be surprised if that would crash server though
Many people are typing
onEachFrame {player setDir (random 360)};
Disconnects well, from your own body
@barren magnet Do you remember old Tonics way to forceCrash player? Was it setVelocity Something?
god ol' recursion never fails
@jade abyss #include with bare words
nah, that crashes the mission / everyone that tries to load it....
That wont work to crash btw @unborn ether
Was the setpos [Nein, Nein, Nein];
bad syntax for prepro commands -> insta crash
@lone glade does that happen with -nologs?
yes
Ah okay
it's the engine that can't handle the error
I love Tonic ๐ฟ
pff, that birch
Works
It works
works = Crash?
Yeah
Don't need to boot up arma for that
Well sure its out of bounds i think
huehuehue
Didn't you say you made a script that damaged all wheels cause he was so fat? @jade abyss
CTD:
_a = {call _a}; isNil _a;
lol
Enters a vehicle: Hint you are too fat boi
increase the vehicle mass to an extreme degree
Set velocity randomly to the left or right
He always did, iirc
it only works on physX enabled vehicles / objects since it's an impulse tho
iirc it didn't worked with "Men", only with PhysX Obj.
@rotund cypress There is, this bug is called PhysX
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
Oh god... from 2015:
https://pastebin.com/iSiKTfsU
GNU code style? ๐ @jade abyss
Ok so we agree that isEqualTo is in any way better than == ?! Fine ๐ฟ
no EVH used, ouch
@little eagle read from the start, it's worth it.
Not enough Macro's in it, to be interesting for him ๐
He meant the conversation I think
a
No shit, Sherlock @rotund cypress
what triggers me isn't the while true nor the two waitUntil in succession, ITS THE BRACKETS
#define tonic "fattie"
#include "fat.sqf"
GOD DAMN
brackets are fine
except for the 4 spaces on second line
and no spaces triggers me
You just know nothing of folding
USE TABS INSTEAD
Allman brace style is gud
๐คฆ
3 spaces
get out
Nearly looks correct but isnt
1 Space is enough, let's get to the mars.
Or one tab + 3 spaces
64KB of memory is enough
Actually 4 tabs is the best ๐ฟ
doesn't matter if you have a proper editor anyways
btw. haven't you said you wanted to leave @unborn ether ?
notepad.exe
he can't
Oh
he joined the cool bois club
@jade abyss This particular convo, not like discord kek
Lies, you liar ๐
yeah.... no.
haeY
@jade abyss Make discord great again. Let's build a wall around @unborn ether
Like im gonna even continue
pls dont
@barren magnet Too much effort. Just dig a hole and push him in
XD
Teach me
All as planned
Go and wรถrk wรถrk @rotund cypress
Should do.
twรถrk
Nein!
if()then
{
};```
>
```sqf
if()then{};```
^^^^^
But pls for the love of someone, use some spaces will you
if (true) then
{
}
Nah, it saves Compiletime
ffs ๐
readability > important than compiletime
Also, why the f does SQF use then
Seriously
Triggers me so bad
if (
) then
{
}
else
{
};
That's how almost every life-code looks like
Oh that tickles you right?
@unborn ether I am calling the police
if()then{}else{};
If( true ) then
{
Do
};
actually forgot commnets
I mean if you have many conditions
if (
true
&& true
) then
{
}```
using
if (COND) then
{
instead of
if (COND) then {
just uses one more line
&& is slower than AND ๐ฟ
there's no benefits at all
@lone glade that's not correct. It's far more readable
Its all about readability and preference my friend @lone glade
No, it isn't
You seem to never had to read other people's code
I have read bi_fnc_arsenal
itโs certainly not more readable the spacing is disgusting
and trust me that bracket style haunts me
nope
As long as you don't use TABS you are fine.
....
Opening and closing a scope deserve a own line
that's actually preferences simzor
Yes use tabs
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*/};
^^^this tbh
nah nigel, use comment like the big bois (warning this is sarcasm)
@lone glade tabs are horrible, and certainly not preference.
Tabs are the best
When you are working in a team, tabs are fucking aids.
what a nightmare @peak plover
tabs vs space is entirely preference, I use 4 spaces myself
tabs mustard rrace
and that's why editorConfig exist
Every time a tab is used a puppy dies
Do you know the difference between tabs and spaces? @lone glade
SO EVERYONE IN THE FUCKING TEAM USES THE SAME INDENTATION METHOD
Like the ACTUAL difference
1 2 3 4 5 6 7 8 9```
@barren magnet
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
What's the differnece 'tho?
Tabs right; if you use it, aligning things will get fucked when different people use different tab sizes
I only seez spaces @jade abyss
What a lovely campfire placed in this room, especially when its fueled by some arguers about folding style.
Mm
tabs! Not spaces
different chars nigel
4 spaces is always 4 spaces, but tab indents to a certain place every line
I like tabs
@peak plover get out
It's @jade abyss and my daily entertainment
no, that can be adjusted by your editor
@peak plover SimZor is gonna eat you now dude ๐
More fire = more gud
You set your tab size in your editor
Now tell me where the Rum is! It's gone... -.- can't find it
Set the tab size to 5
you don't even have to set it if the project manager is not a goddamn moron
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
E.D.I.T.O.R.CO.N.F.I.G
and kittens are killed
hell, you can even convert it upon saving / committing FFS
if you have a proper editor, it has all the useful things that a tab gives you
Yeah thats completely fine
can be do editor wars next?
if (true) then {
" ";" ";player setDamage 1;
};
As long as sometime on/before save a tab is converted to spaces
atom is shit, sublime is better
pff... atom, Sublime... < N++
notepad.exe is the best
Made me old and grumpy before a file would open
I only use nano
I just use the initialization fields for the 3den ยฏ\(ใ)/ยฏ
i manually insert 0 and 1 into the cpu
manually insert the experience into the human brain
Emacs ftw
I manually switch the cables from high to low voltage
piece of paper that you scan and then OCR it
something about trains and kung fu
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
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
You are interdasting
๐
Get a room you two
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
oh hai ded
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
Yep
,
_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?
ctrl+A -> Del
I don't even see what that's supposed to do
doing a systemchat msg?
why the hell are you using param
But... makes no sense at all
and why do you pass a variable in a global variable??
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
๐
== vs isEqualTo could be optimized by my optimizer if you have atleast one constant.
Dedmen -> ShillMen please
ShillMen?
new fancy word
_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;}];
๐ mentionnoob
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
Thats how you do it, dedymom: @dusk sage
Is there a 'proper' way of doing what I'm doing?
I still don't quite know what you are trying :x Why are you caching that stuff?
this poor Bog guy gets tagged so often
No clue what you try to do there, Nigel
Use setVariable into your namespace used, whatever that is.
or pass it via spawn arg
๐ฅ
cmon Nigel, you can do better than that
@peak plover Where your array comes from, like is that UI data, mission data ?
array comes from a getter that gets it from a missionNamespaceVariable
thats a big word
@tough abyss What its destination? (Want to use it in UI, or in mission)?
mission
Server/Client?
server
missionNamespace setVariable ['whatevername',_arr];
_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
Is there context to this if I scroll up?
No
What you've written doesn't read easily then
Groups can also recieve a setVariable
Not reliable
If you want to differ them at source
Oh.
Btw why don't you just use BI dynamic simulation for your caching?
I would make an anchor-like setVariable then to easily find them by a string in a like:
["groupanchor1",[data],"groupanchor2",[data]....]
and persistance
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

omg
Emotes are enabled for you?

oh damn
Dwarden squeezed out the fun sponge a little
[ [ID1,Group], [ID2,Group], [ID3,Group] ]
if you wanna make it MultiArr, then cycle with forEach
Would be preferable to avoid putting the key/ID inside an array
It's a shitty idea, yeah
No need to perform a second select
But the one he mentioned before was worse^^
Demellions is better
You ensure that your data is always one index away from your key, the same idea as yours without further nesting for the indexing
๐ค
It's the same principle as a dictionary/hashmap, without any of the complexity behind it
So as usual you do nothing important with it
missionNameSpace setVariable [format["GroupName_%1","Bla"],_Vars];
We're not doing any ๐ด in ARMA
Utilising the actual implementation would be better, yeah
missionNamespace is a global namespace, any VARIABLE name is the same as its globaly declared, why would you create tons of vars?
@BoGuu#1044 Discord Nitro guys get any emote
missionNamespace is a global namespace, any VARIABLE name is the same as its globaly declared, why would you create tons of vars?
drunk?
Yeah
@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.
Because find doesn't "cycle" the array
like forEach does
bullshit
How many buckets is it limited to? Or is there no lim
I assume it creates them dynamically
Who wrote that, Dedmen?
Demellion ofc
lol
@still forum so scrolling a 500 elemts array is better than just find?
Dude, you are pretty new to Arma, or?
@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
@unborn ether find is also iterating over all variables
Did you just imply bohemia?
Hmmm
The difference is just if iteration is done in engine or in script
Check whats better with array of numerous data
What did you think find does? Just do some magic and get the index in O(1) ?
No
Looping over a 10000 element array takes the same time as a 10 element Dedmen, get with the times
fastest way would be to use a CBA namespace or Intercept_CBA hashmap
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
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
ai_ins_groups setVariable [format["group_%1","Bla"],_ARRAY];
ai_insgroups pushback _ARRAY;
๐ค
find which is incredibly slow on bigger arrays
Past it being O(n), what is your definition of slow? Relatively?
oh boi, what did I miss
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
@lone glade guess.
So comes up with im right for find?
No.
Find is faster. But you said it doesn't iterate the whole array which is complete bullshit
*depends on the size
Oh you mean that. Sorry that was kinda not properly said.
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
One day, i will find out where you live, and i will punch you, furry.
ShillMen
for each and everytime you mention intercept
NRW. Gelsenkirchen
omw
we all do
wait we all hate all of us?
Yes
_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;
๐ค
I've lost my sight on those selects
find != select FFS.
What are you trying to achieve anyway, Nigel?
find give you an index ref, select creates a new array
Yes the first is a bit nicer in that regards. But requires you to know a key won't be in a value position
Well i still prefer option with find
is it bad to
[_variable, {code}]
I don't see why that would be bad
lol
as long as you don't call compile the code block it's fine
and yes, i've seen people do that
call without compile
nonono, i've seen call compile CODE
@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?
...
also fun fact can't save to profilenamespace {code} So you have to call compile if you saved to profile ๐ฆ
@unborn ether No it wasn't
That is a leftover from SQS script
Dev's didn't bother fixing that when SQF was introduced
have to save as string*
Any EVH still accepts string-code.
Yep
and if we get sqf support in enfusion we will still be able to use getDammage
Because they are also stored as String internally and compiled before each execution
Again. Leftover from SQS because dev's were too lazy
@lone glade Doubt that (sqf support)
me neither
"neither" or "too"?
It'd be a grave mistake if they didn't allow a very easy API such as SQF
Well i have some stuff that cannot be performed via code. Wow really.
....
i mean objected {}
unless you use moon rays it's still code
Simply because this code passes throught death of a mission to a outer namespace with onEachFrame
While any {} dies with mission
Simply because this code passes throught death of a mission to a outer namespace with onEachFrame

