#arma3_scripting
1 messages ยท Page 396 of 1
This is 100% correct
I wonder what they would even be
Probably like epoch, breakingpoint, life and koth
But they can't really add anything
So what if it's just more planes and cars?
differnet terrains
Yeah, i guess
The last A3 updates 1.78/1.80 broke some of the doors on Lythium
They do Dev builds too, so mods have a chance to check it out
@little eagle From Razer on the Desolation dev team, thank you. Think that was exactly what he needed.
for anyone wondering, the enfusion code documentation on http://lystic.net/dayzwiki/ was exported from the patch nearly 6 months ago. I can update it if you all would like me to keep it going
Update from what? The publically available 11 month old Enscript documentation that is actually more current than lystic's website?
I don't quite understand why the doc from january has more information than his copy of that doc from 6 months ago...
lol, Yeah sure, please keep the information up to date....
That would have probably been a decent response.
The latest information is 11 months old. If lystics website is 6 months old then there is absolutely nothing to update.
So no. There are other things more worth investing time into.
0w0 whats this
Does that mean I can use setVariable public and it works now inside the init event?
not sure, it's more about if(local _vehicle)exitWith{}; in init fields
on dedicated server all vehicles were local to everyone during init phase and then changed locality accordingly after mission fully started
im currently reading through the pbos in the ace mod does anybody know what pbo the call functions are under?
so i.e. virtual garage functions were executed on each machine
I think it affected JIP as well
indeed
@glad pendant Almost every ACE component has it's own functions, and they are in the functions subfolder.
What's with the double __
fnc__handleRequestAllSyncedEvents?
yeah.
That's how jaynus named them. ๐คท
Does someone have an idea, how i could hideobjectglobal within a markershape or isn't it possible since nearestterrainobject only allow radius? I tried something like that but it only takes value 100 as radius:```C
_area6 = createMarker ["area6", [5004.360,11376.789]];
_area6 setMarkerSize [100,20];
foonx_hideobjects = {
{
_pos = getMarkerPos _x;
_size = getMarkerSize _x select 0;
_obj = [];
{hideObjectGlobal _x} forEach nearestTerrainObjects [_pos, _obj, _size];
} forEach _this;
};
_hideObj = ["area6"];
_hideObj call foonx_hideobjects;```
I think you have to multiply a radius by sqrt2 so that the corners of a square are filled in. And then discard all objects outside the square with an inAreaArray check.
Should be the same for rectangle, and you have to multiply the shorter side iirc.
Ah, sounds like an option to try - cheers.
Getting a paper to check just so I don't spread bs.
Well, tryin to hide some stuff in a corridor and except of setting up small zones with low radius i thought i give it a try over a marker
r = sqrt(2)/2 * a, with a being the length of one side of the square.
Yep, nigel, but first you have to get some candidates.
Of course you could check ALL terrain objects, but you have to use nearestTerrainObjects anyway to get them.
So might as well make the radius as small as possible.
ofc I thought it was somethign else
To cover all edges.
Yes yes
I wonder if inarea works with 3d triggers?
It should because alt syntax lets use z
bounding box?
Room?
volume
inpolygon takes 3d positon as well
Must be mad math internally.
Idk, I don't think it's particularly bad for SQF standards.
Probably depends on how many objects you check and how many points the shape has.
That sounds like nothing.
Drawing a polygon based on player fov and using it to change view distance and cache units
inPolygon would've been useful for ACE backblast.
yessir
For a rectangle, the radius r = sqrt[(a/2)ยฒ+(b/2)ยฒ], with a and b being the two sides.
Except that's wrong. ๐ฆ Fixed.
Ok does this make sense to you
Locally caching objects and units outside of the player view distance increases fps
Doesn't the enigne already do that
The game itself doesn't do that. They're still simulated as long as they are on the map. But it'd be interesting how it compares with the dynamic simulation stuff.
Well
For one thing
Dynamic simlation works globally based on wake up objects or players
one player on each side of map
will mean more oobjects active
client side caching means that if somone else is fighting on the other side of the map. they are cached for me
If that doesn't break anything.
At first I used allMissionObjects
And it did
But now I use cba initPost and add everything to an array. So it does not have a scriptiing impact
@peak plover i believe you know it but ... there are things like setDynamicSimulationDistance and setDynamicSimulationDistanceCoef to play with in "combo"
Hey
'Unknown Enum Value' Errors
They fixed it ๐
Fixed: The 'Unknown enum value' errors would display incorrectly for the createAgent, createUnit, setVehiclePosition, and createVehicle script commands (https://feedback.bistudio.com/T127233)
Fixed: The 'Unknown enum value' errors would display incorrectly for the getUnitTrait script command (https://feedback.bistudio.com/T127243)
Fixed: The 'Unknown enum value' errors would display incorrectly for the edit3DENMissionAttributes and set3DENMissionAttributes script commands (https://feedback.bistudio.com/T127247)
๐
Hi there,
is it normal to have lots of Server: Object 2:XXXX not found messages in RPT? Are those heavy desync issues? Any way to mitigate that situation?
What should i point attention at?
if i have a bunch of markers, how can i get the position of one of them, choosing randomly?
can I have them in an array somehow?
Hey guys, to get the position of cursorTarget, is there a better way than using screenToWorld [0.5, 0.5]?
@ripe imp
getMarkerPos (allMapMarkers select (random count allMapMarkers));
what if i only want to pick one from a few of the markers, not all?
["name","name2"] instead of allMapMarkers ?
getMarkerPos selectrandom ["name","name2"]
thanks both!
๐
im having some trouble generating a random number using variables
_rNum1 = 2;
_rNum2 = -1;
_rNum = floor(random _rNum1) _rNum2;
_thisWorks = floor(random 2) -1;
_rNum = floor(random _rNum1) _rNum2;
that line doesnt work
Are you trying to multiply?
no im trying to select from a range of numbers, including negatives
Because something is missing
floor(random _rNum1) <<<here>>> _rNum2;
Yes.
2 + -1 is still subtraction as well ^
No, that's an addition.
No, the value is -1, not 1.
Wtf? 2 + -1? No?
The result is the same, but the operation is different.
Yes
That's like saying
1 * 1
is the same as
2 - 1
The original was a subtraction.
yeah i thought it was a negative at first
thats why i tend to put spaces before and after my operators
It wasn't. It used the binary minus command, not the unary minus command.
thats why i tend to put spaces before and after my operators
Very good idea.
@little eagle ๐ ๐ ๐
What was that for?
why are all the speeds measured in kph instead of m/s?
Just do:
vectorMagnitude velocity _vehicle
@little eagle
1 * 1
is the same as
2 - 1``` That's why, it's not like saying anything
You do realize that these two expressions:
2 + - 1
and
2 - + 1
are using 4 different commands, numbers not included?
Yep.
And confusing unary and binary minus was what caused this issue, so you have to be correct in explaining it.
Well, you explained it correctly then yes? All is well
_nObject = nearestObjects [(getPosATL _playerObject), ["HeliH"], 200];
_nObject = _nObject[0];
would this work? can i overwrite an object like that?
Hey guys, to get the position of cursorTarget, is there a better way than using screenToWorld [0.5, 0.5]?
@severe solstice
_nObject = _nObject select 0;
or
_nObject = _nObject param [0, objNull];
@rotund cypress
positionCameraToWorld [0,0,0]
???
Ah maybe that could owrk
Or do you mean this?
private _target = lineIntersectsSurfaces [
AGLToASL positionCameraToWorld [0,0,0],
AGLToASL positionCameraToWorld [0,0,1000],
cameraOn, objNull,
true, 1
] param [0, [nil, nil objNull]] select 2;
But then you might as well use cursorObject.
Yeah positionCameraToWorld did not work
What's the goal?
Basically if I am looking at a pos, I want to teleport to that position.
screenToWorld kind of works.
The only problem with screenToWorld is, that it goes right through objects.
Only cares for terrain.
Exactly
private _posASL = lineIntersectsSurfaces [
AGLToASL positionCameraToWorld [0,0,0],
AGLToASL positionCameraToWorld [0,0,1000],
cameraOn, objNull,
true, 1
] param [0, [[]]] select 0;
This reports the position you're looking at, including intersections with objects, but it is [] if there is no intersection.
The 1000 is the maximum distance.
Yeah that works
Second try
Is it normal to have lots of Server: Object 2:XXXX not found messages in RPT? Are those heavy desync issues? Any way to mitigate that situation?
What should i pay attention to code wise?
ty commy2
@little eagle I thought you have more time now :u Intercept-CBA is there for you ^^ I don't know the math for that stuff
What's the easiest way to figure out which sort of control type a given ctrl is?
i have some random controls and wanna figure out if i gotta do lbSetCurSel, ctrlSetText or whatever on them
can you get a controls config path? Their config has the type
yea i figured, that would require manually going through each controls group parent and check like thta
think ill just setVar in this case
and use that as a switch so i know what sorta value to expect
What is the best way to link the positions of a background picture and text? Been trying all sorts of things, but the dialog changes dramatically with every change of game resolution
safezone, proper grid
@river meteor BI also included a nice way to make dialogs with the EDEN update, a bunch of helpful macros
Those macros help you write dialogs once and have them function on all resolutions and whatnot ๐
@tame portal Are you talking about the GUI editor they included?
Nah, the way the new dialogs are made is purely from writing the configs for the dialogs
It might require some thoughts on what has to be displayed where but once you get the hang of it you will be making shiny dialogs that work on all resolutions and whatnot in no time
Do you have a link to a list of these Macros? Haven't heard about this from EDEN
They are in your gamefiles
one second
#include "\a3\3den\UI\macros.inc"```
There
And also cpp #include "\a3\3den\UI\macroExecs.inc"
this is for example how a dialog of mine looks like
^ that dialog template defines some macros of its own to make it even easier, the dialog is always selft centered with those
to be honest if you just want a quick dialog i suggest you do it without this stuff, otherwise you will have some hours of testing and fiddling around with it ahead of you
like i said, its fairly easy to get the hang of it once youve built one dialog with it
What would be the best way of counting how much distance a vehicle has traveled from spawning it?
With cba? PFH with 1 second delay and add up distance from position stored on last execution of that PFH to current position. The more precise you want the less delay you use
k got it
although PFH object might also be good for that.. Never used that
It's kinda dumb. I just recreated it after I deleted it, because someone actually missed it.
And I felt bad.
just gonna use PFH with GetIn and GetOut
Make the pfh remove itself and use only getIn. Will be cleaner.
isNull objectParent player > delete PFH
Yes. pfhid is passed as _this select 1.
_this select triggered
param [1] ๐คท
What determines which controls are placed on top of other controls within the same dialog
this, but then focus controls that
created order/config order, but any control that can take focus will go on top of that no matter what
you sure? placing a button behind a rsctext hides it I think
there is no way outside of that to control z order
using ctrlSetFocus on that button will pull it forward then
lts say you put a listbox first in config, then put a picture or so halfway over it
when you click the listbox, it will go over the picture
Which control is the drop down menu?
can I reference the player in a control config? I want to be able to return the current weapon icon and set the image for the control
would I have to do that with script or is it possible in config?
It is possible
was done in A2 before. iirc some Epoch "Extensiones" added them
is a good indicator where you have to go:
https://community.bistudio.com/wiki/primaryWeapon
Right, I've already got it working with ctrlCreate
getText from the config where it links to the Pic
but I need that to work in config
private _icon = getText(configFile >> "CfgWeapons" >> primaryWeapon player >> "icon");
I'm just simply talking about how I would apply this to the control
can I reference the player in a control config? I want to be able to return the current weapon icon and set the image for the control
would I have to do that with script or is it possible in config?```
What do you want exactly now?!
+why Ref a player in the ctrl config?!
AH nevermind
_Ctrl_Symbol ctrlSetText "\a3\ui_f\data\IGUI\Cfg\Actions\open_door_ca.paa";```
example
you want to fill your control after you created it, don't you?
sighs in sadness @jade abyss I've already gotten it to work -> I just would like to be able to do this with a config
@shut flower Essentially...?
Do WHAT with the config?
no clue what you mean with your config
you can execute a script from a control's init
maybe you mean this?
I need to update the icon upon weapon switch
HEY Man, I thought I was being clear ๐ฆ
you talked about things nobody invented already ๐
Yes or No?
YES, now that I know I can execute a script from the control all is well Dscha. ๐ค
Ah wait a sec, are you in your fighting gear?
๐
that escalated quickly
Dscha is a big bully ๐ข
pff, tester
Errr..I don't have a rebutle.
rewhat?
When you really want to do this on weapon switch you will need some eventhandlers for this
shh, don't spoil the fun for us
Heh
sorry, I'll get some popcorn ๐ฟ
Dscha, a rebutle man
Just repeating that, from 10min ago:
It is possible
was done in A2 before. iirc some Epoch "Extensiones" added them```
may I spoiler now?
Asshole
Who told you you could reference players in a config? ๐
No clue what he meant with that anyway
I'm quite surprised about the idea to do so
๐
there might be an intercept solution for this
yeah I wanted to prevent dedmen to paste it here
@subtle ore You mean smth like that:
https://cdn.discordapp.com/attachments/309042409759834113/309110309598003200/Screenshot_1.jpg
Yeah.
I am not in kahoots with any lifer or zombie shit right now please be aware of that
let it set the icons for the weapons on each frame, this a solution that will work all the time troll
Doesn't matter where it's from. It's the same principle
mainly it's community
EH with Open/Close Inventory and take/put wich call a function that updates the Pic in the Ctrl (checking for primary, Secondary Weapon etc)
๐
(take & Put is important! Keep that in mind)
Anyone aware of a away to remove the zeus 'unit' ui with scripts?
hide it on display init
Is there like, a good way to deal with silly double quotes? [true,[0,""Already Connected to Database""]] (Can't really not get them, it gets returned like that from extDB3 it seems)
you could use call compile
but this is a quite unsecure way
as long as you just want to parse out messages send by extdb this should be ok
but don't do this for real data you retreive from extdb
call compile / parseSimpleArray
Or look at using https://forums.bistudio.com/forums/topic/211872-oo_extdb3-a-driver-for-extdb3-addon-mysql/ or https://bitbucket.org/torndeco/extdb3/issues/69/set-of-functions-used-to-handle-extdb3-api
OO_EXTDB3 - A driver for extDB3 addon MysqlLastest version : 0.2 by Code34
GitHub : https://github.com/code34/oo_extdb3.altis
OO_extDB3 is a driver...
I have compiled some functions that could help begining mission developpers in the task of using extdb3. Most of theses functions are error safe and well optimized. I would be glad to see them improved and included in a pbo next to the .dlls.
Feel free to contact me on steam for any questions.
http://steamcommunity.com/id/youpala
Also arma escapes quotations by using double quotations
Does any one have any idea on how to id a headless client on dissconect?
This is not producing any result
addMissionEventHandler ["HandleDisconnect", {if (_this select 0 == HC_1) then {"HC_1 Disconnected" remoteExec ["hint", -2];}];
};
HC_1 is the name of the headless client module
Did you place a virtual entity for the hc?
Do some debugging with diag_log [_this]; in HandleDisconnect.
Disabled for buildings for performance reasons, decided back in A2.
Ohhh...
#mad
fuck.
I just realized it's a good alternative for allMissionObjects "Buildings"
What is?
XEH addClass
Building your own array of all buildings you mean?
["Buildings", "init", {
nig_allbuildings pushBack (_this param [0])
},true,[],true] call CBA_fnc_addClassEventHandler;
Yup
Well, it would be.
This way no perforamnce drop compared to allMissionObjects because it's fluidly adding them 1 by 1
Are those "buildings" scattered around the whole island?
Yes
MissionPlaced or MapItems?
misionplaced
Okay
MapItems could not be loaded, when the init for it is triggered and the EH wouldn't be attached to it
Tried
entities "Building"
?
Should be faster than allMissionObjects
I had some serious headaches a few years back with that crap -.-
Ouch.
80 to 30 fps drops are not cool
addMissionEventHandler ["HandleDisconnect", {diag_log [_this];}];
returns
[[HC_1,2.04158e+009,"HC9272","HC_1"]]
so yeah , don't know know why code above didn't produce any result. Nonetheless, the entity name does return first in the list so this is enough to gone on building code to clean up HC's messes. Thanks for the suggestion.@little eagle
It's bad practice to use vehicleVarNames for scripts. They always break when you try to do something.
Should check the typeOf of the object the machine disconnected from or something like that.
but typeof will always be the same for HC_1 and HC_2
Mark them with a setVariable.
I guess my only fix is to make this into a mod and just use init EH in there
@peak plover Try with this, but keep in mind that it's "Building", not "Buildings".
ohh yes, thanks
Do the allMissionObjects still "hit" like that when you run it in a scheduled environment?
yes
The command is bugged then.
The command won't suspend if it takes more than 3ms, so I guess
@cloud thunder why don't you do _this select 3 isEqualTo "HC_1"?
The command must be internally unscheduled
Yup, that the problem. Since games are soft realtime systems, any command that might take a long time (a variable amount of time), should at least optionally be suspendable.
Would be cool to have an alt syntax for heavy commands like that
to allow suspension if takes more than a defined time
Even better allow to tweak the time it takes
I am facing a similar issue right now. For a particular mission a buddy is making, many gas stations have been removed. I need some way to remove the gas station signs around them. But they have no classname, so only immediate way I see is to search through all object on the map and check for the model file.
You can do that, but do it during pre-init,because they are map objects it shoudl work
Well anytime before time > 0 is good
drunign "briefing"
Run it on the server preInit? Thx, I will try that, next time I look at it.
I spawn ALL of my ai on postInit (so they can be spawned in editor placed buildings) and the benefit is no laggy start when starting mission
Suspension only works between commands. If a single command is slow, it will be slow. Also, >30 fps is still above the 3ms limit.
Yeah, I know. But other things that the scripting engine needs their time too. But I think it is a wrong for a command named something like .all. or find. Since you have no way to prevent a spike.
The scheduler is shit, news at 11.
It needs 8 to 30 ms is below the 3ms limit
At 100 fps 1 ms increases fps a lot more than at 30 fps
Im just saying for those big commands it sohuld be an option to limit execution time per frame
Because I can work around that, but not this
Anyway it's not all bad it's cool
Yeah, the problem is you have no alternative to prevent a possible FPS spike. Almost all of my code runs in the unscheduled space. I find it is faster, and it prevents any concurrency problems.
Did the xeh_all thing work?
Sure, for that particular issue I had. But in general, if you need to run any "all" command during runnin gameplay .....
Btw, @little eagle , is CBA intentionally extension-free, or just not found any reason to have one?
Just curious
umm
["Building", "init", {
nig_perf_arrayB pushBack (_this param [0])
},true,[],true] call CBA_fnc_addClassEventHandler;
added units too ?
wait
RPG is a buiilding?
So I guess no it does not work (properly)
Try printing the RPG's inheritance tree
How do you do that
nig_perf_arrayB arrayIntersect (allMissionObjects "Building")
// []
no dont know
How do I get the p3d class ?:D
I mean the classname that has that p3d as the model. But it might be: rhs_rpg7v2_pg7vl
"LOP_TKA_RPG_Pack"
What, really?
WEll it didn't add any editr placed objects I had so it didn't work anyway
Noticed, it when crawling for gas stations. All buildings have a fuel supply memory point, despite the memory point maybe being abstent
I believe, backpacks are "static" and "Static" are buildings
Yeah, Backpacks << Bag_Base << ReammoBox << Strategic << Building << Static << All
And that is why you don't try to classify real world things in a tree structure
no they did the exact opposite
Well also that ๐
Muzzleflash, I don't think there was ever a need for one. Having one would be really annoying, as everytime Battle Eye fucks up, you get bug reports and complaints for stuff you can't do anything about.
Ahh, yeah that's true. In fact because of forced steam workshop updates, and e.g. ACE updates, I never have it on, so forgot about it
Maybe A4, when Intercept is still a thing. Then everything could be added command based. But who knows if it will still be needed then.
Apaprently it's still years away
So might as well focus on A3, because a lot of people won't switch until it's got a bunch of mods
But then again modders are more likely to go to a4 faster if it's performance hugely bets a3
Which wasn't really the case in a2 >> a3
I switched immediately, but I never did any modding outside of basic stuff for my unit.
in A2.
No point in planning anything for A4, since we don't even know if it will use RV4 or RV3.5.
Yup
Most of the squads I have been in, typically delays quite a bit before adopting to new one. Arma is just not Arma without ACE.
Sure, but someone has to make the mods.
Not many people stayed A2 -> A3 in the modding comm, so lots of stuff had to be reinvented.
i think most private communities stayed with A2 for a while, public servers switched over almost instant
Yeah. I believe some of the long term content makers were dissatisfied with the conditions for Steam workshop.
From A3 > A4 will be different too because sqf is gone
I think that's just excuses and they lost interest.
SQF may be gone, but no one knows for sure.
But to be honest, was surprised ACE3 took so long. I know it is large mod. As an outsider, I perceived it to be mostly a port, to adapt to minor changes in script commands, and GUI stuff, but seems it was closer to a rewrite. Still I am grateful for the teams effort. From the names I think some of the "old guys" are not there any more.
Yeah, I think some people lost interest
every now and then a rewrite isn't such a bad idea
It was their hobby I guess, and they wanted a new one.
ACE3 still in dev. Medical is getting rewritten , which is huge
The ACE 2 code is really bad. No better than your average mission. It had to be done all from scratch.
I know. As an outsider, I just thought they would port and then replace components gradually, instead of writing it from scratch. The end result is better.
ACE 3 code is salvageable for a different game, but ofc SQF has to stay.
Same for CBA_A3 as it is now.
What will happen if I remoteExec a unit new voice, set it to also run on jip and then the unit dies and gets deleted?
Hmm wowo, endmission on the server will keep the mission running on the client without anything working
That depends. I guess it will still run, poorly, e.g. the unit is null? If you use the object/netid as the jip identifier, then it should not run when the object is deleted.
Really, you can endMission on the server and clients stil run ? ๐คฆ
Yeah
Well I know that I will be subjecting players to come April 1st.
Maybe a scoreboard for how long it takes each player to notice ๐
Hi, should i explicitly remove EHs, associated with a unit, if the unit is deleted? Or engine cares of it itself?
What should be disposed manually?
if you are reffering to the unit directly
@peak plover thnx
// Get/set unit side
private _unitSide = _unit getVariable ["unit_respawn_side",nil];
if (isNil "_unitSide") then {
_unitSide = (side (group player));
_unit setVariable ["unit_respawn_side",_unitSide,true];
};
Returns UNKOWN
IS this something new? didn't happen before
init script?
postInit
Weird.
imma try with sleep 1
yeah
sleep fixed it
I swear to god this was working fine when I tested all of this a few months ago
Damn, I thought postinit had sides..
Non local group had unkown
that's what was causing issue
But I can't remember ever having this happewn
weird...
@tough abyss Hello, can be create a table in extdb3?
` SQL1_1 = CREATE TABLE ?(
uid VAR_CHAR (32),
kills INT (11),
friendly_fire INT (11),
nick VAR_CHAR (64),
first_connect_at DATETIME,
last_connect_at DATETIME,
total_connections INT (11),
died INT (11),
PRIMARY KEY (uid)
)ENGINE=InnoDB;
SQL1_INPUTS = 1`
Test it out and look at the extDB3 logs if it complains
[17:44:12:595246 +01:00] [Thread 260] extDB3: SQL_CUSTOM Config Error: D:\Mods\@extDB3\sql_custom\capfunctions.ini(49): '=' character not found in line [17:44:12:595650 +01:00] [Thread 260] extDB3: Failed to Load Protocol: SQL_CUSTOM
SQL1_1=
SQL1_2=
SQL1_3=
or put it all as single line
ok i will try ty @tough abyss
@peak plover I also have a problem since 1.78 where quite some scripts require a second of sleep before working in any init stage.
Im getting a 'player' with allPlayers that is local to the server
๐ค
2017/12/20, 19:33:40 "true"
2017/12/20, 19:33:40 "O Alpha 1-1:1"
2017/12/20, 19:33:40 "true"
2017/12/20, 19:33:40 "O Alpha 1-1:1"
2017/12/20, 19:33:40 "true"
2017/12/20, 19:33:40 "O Alpha 1-1:1"
2017/12/20, 19:33:40 "true"
2017/12/20, 19:33:40 "O Alpha 1-1:1"
2017/12/20, 19:33:40 "true"```
That's impossible...
but, allPlayers should be an array. What is this
I'm doing forEach allPlayers
Ah
Did anyone join in progress at that time?
and obviously the server is dedicated, and no headless clients?
There's a hc, but I have allPlayers - (entities 'HeadlessClient_f')
2017/12/20, 19:47:59 "O Alpha 1-1:1" //unit
2017/12/20, 19:47:59 "true" //local
2017/12/20, 19:47:59 "EAST" //side
2017/12/20, 19:47:59 "blu_21_2" //unit
2017/12/20, 19:47:59 "false" //local
2017/12/20, 19:47:59 "WEST" //side
2017/12/20, 19:47:59 "---done---" //script finsihed correctly
Did any player die at that time?
If a player dies, and he disconnects, his locality might get transferred to the server. Or does it get deleted? Anyway, I am at a loss.
Nope
No one died
The issue is
using allPlayers seems to return some weird entity that's apparently on the opfor side
Can you replicate it? Can you get its classname or any info on it?
it's a unit created by a module
I'll try deleting the module ...
vanilla cas module btw
In your log, can you add the class to the output using typeOf ?
haha well it does not show the O anymore, removed the module. Apparently CAS module is a player :S
Question of the day, nil (broadcasted) object variables before deletion of an object or leave it?
mhello
the only problem
" Session lost " and players kick
120 - 150 people are active on my server daily
my dedicated https://www.ovh.com/us/dedicated-servers/game/ - mc-64 oc
_unit setVariable ['abc',123,true];
deleteVehicle _unit;
``` ?
Yeah, but
Is that what you mean?
Because you don't need to do that
if oyu have ace / cba you already have ~70 variables set to any player
Heheheh
lels, no i will never and have never used CBA and ACE
@rancid pecan wrong channel #server_windows || #arma3_troubleshooting
okey okey sorry
setVariable does not hurt anything other than ram usage
If I want my FPS to drop to 10 then sure ill use it
And you needed >30milion variables to cache the game back in 32 bit
crash*
Well, the storage may not be a problem, but if you are broadcasting lots of variables, you will find there will be performance issues for sure.
So?
Dont know where that came from
Also your FPS is shit
Should be > 60
You are also probably alone in that server
You running DRO?
Nope
@tropic gazelle please, no, just no.
Anyway, on topic, setting a few variables cost nothing. There is no need to nil them before deleting. In fact to do so will incur unnecessary communications overhead.
Just altis with a bunch of bases and units spawned in 3den and that's it
exactly @errant jasper
@errant jasper pretty ignorant statement
The overhead comes, would be you would potentially need to inform all clients that they should nil. And since the object is deleted the data gets removed regardless.
It will cost you a lot if you broadcast variables with large values
define large values?
Just use pastebin, also i would try use raw sql queries instead of prepared statements for that. Anyway you error is bad SQL Prepared Statement.
Up to you to figure that one out
I said that if you want to nil it on all machines, because each have their own copy, you will have to communicate to each of those machines so they can nil it each, which is pointless since the object is going to be deleted anyway.
Well my question was more to like this: if an object gets deleted, does the player still store that data
And the answer is no.
Okay so object gets deleted, all machines automatically remove all variables to that out of their storage?
@tough abyss https://pastebin.com/azHtAf2M Sorry
Either way its not a problem, but I was curious to if it did or not.
And regardless, broadcasting variables will cost something.
Depending on how large the values are
Yeah, no point int sending out trash
Well we can't technically know what happens when an object gets deleted because that is not visible to the scripting engine. But there is no reason BIS could not do that (delete the memory, or reuse it). And in that case, there is little reason to believe setting it to nil will.
Yes, but my curious mind asks you why there is no reason
Because it deletes itself?
Also, you can set a million variables and FPS will not drop by 10 or even 1.
Well, when clients are receiving them, something has to happen
Not saying it would affect it when they are already set
Sure, you can't sent a million variables in a frame across the network without redchaining everyone.
What's a million?
It is important to distinguish between setting a variable, a thing local to a machine. And broadcasting a variable.
Enough should be setting 3 variables at roughly the same frame
You mean broadcasting?
Yes
Pretty sure you could do more, but why would you.
Well some people would do that
Some people sets much more than 3 variables in a single frame, I have seen some pretty bad mission designs
There are so many position updates etc, a few sqf variables won't hurt anyone.
broadcasting
Yes.
Easy test though. Play your mission: Red chain -> bad, no red chain -> good.
ยฏ_(ใ)_/ยฏ
Although I would say people should have a good reason to broadcast every single frame. Even most game engines only do it at most say 20 times per second, regardless of FPS.
This also helps compact network packets, reducing the overhead.
Don't broadcast every single frame : (
Yeah. That's bad.
before:
https://i.imgur.com/SZVEKzn.png
_target = cursorObject;
for "_i" from 0 to 100000 do {
private _name = format ['var_%1',random 1000000];
private _arr = [];
for "_i" from 0 to 100 do {
_arr pushBack (random 10000);
};
_target setVariable [_name,_arr,true];
};
AFTER:
https://i.imgur.com/WI5VFJ1.png
AFTER DELETEVEIHCILE:
https://i.imgur.com/SUV54TD.png
Memory is cleared after deleting the namespace for the variable
I think the most frequent broadcast in ACE is weather synch, which does broadcast the wind from the server every 5 seconds or something like that.
if you are worried about that then imagine how much sending positions are doing
sending a single variable per server is nothing
even on every frame
Medical is pretty bad when a unit respawns.
@peak plover The problem is publicVariable is "reliable" and "ordered"
But then again, medical is pretty bad as a whole.
don't old variables carry on to the new unit anyway?
position updates and directions updates are typically unreliable
Yes, nigel. They have to be reset.
Cause new body.
And yes, there are smarter ways, but:
But then again, medical is pretty bad as a whole.
That's why you have to be careful with how much you sent. Given most bandwidth, and a good enough server, you could of course send several MBits per second in terms of bandwidth. But using publicVariable, if anything is lost in transmission, publicVariables are halted on until the first lost has been received.
player setVariable ['noob', true,true];
//killed myself
player getvariable 'noob';//true
Ohh yes
Medical settings like blood lvl get rest
I try to go by the logic, ```sqf
if (i think it will be more than 1 unit normally takes) then {
don't publicvar
};
Medical isn't that bad tbh. It has some smart ideas. E.g. the health states like blood pressure and all that junk are only sent to the medic when a unit is examined.
If I've got 300 ai, then sending out player ace vars is nothing and not noticable.
Because the ai have tons of variables like pos, and if they shoot the bullets and impacts and what not
ACE Medical does making placing groups as Zeus lag a bit more than usual though.
even with medical AI disabled ?
Yes.
sliderSetRange [40008, 1, 10];
sliderSetPosition [40008, 1];
Can someone explain me why even if I do this, I can drag the slider to 0?
0 = 1
If I debug the sliderPosition when I drag it, it goes from 0 to 10
so let's say that I want to have only from 1 to 10
do I have to set the range from 1 to 9 and then add 1?
to get a range that goes from 1 to 10
Wait
sliderSetRange [101, 1, 100]; = Range from 1 to 10
So in the output should only 1-10 show up
teoretically yes
(that's a bit too long ago that i messed with them)
but if I set a variable, which hint the current slider position
like this one
_sliderValue = round (_slider select 1);
I get a value from 0 to 10
maybe cause of the round process?
isn't equal by getting the second element from the slider?
which is the value
or do I have to use sliderPosition
good Q ๐ค
i'll test it right now and tell you if something changed
Yeah, checking my old file if i can find something usefull in there
think I found why
Round : Rounds up or down to the closest integer.
so if the sliderPosition is less than 0.49
I'll get a 0
Yeah
if (round (_slider select 1) isEqualTo 0) then { _sliderValue = 1 } else { _sliderValue = round (_slider select 1); };
think will do the work
@errant jasper
Anyway, on topic, setting a few variables cost nothing. There is no need to nil them before deleting. In fact to do so will incur unnecessary communications overhead. Nil'ing PVARs will remove them from th JIP queue. So it does have a benefit.
@rotund cypress Okay so object gets deleted, all machines automatically remove all variables to that out of their storage? Yes. Everything that doesn't have any reference to it get's deleted.
So if that objects variable had the only reference to that value it will get deleted.
Well we can't technically know what happens when an object gets deleted I do.. So I don't know why you couldn't too.
Intercept-network can analyze PVAR traffic btw.
I think the most frequent broadcast in ACE is weather synch, which does broadcast the wind from the server every 5 seconds or something like that. Yep. But if you are not alone there are lots of CBAs bouncing around. Didn't look what's inside them yet.
@still forum True nil'ing, will help with removing PVARs from JIP queue. Though the original context was in the variable space of an object. I guess we can know what happens when you delete an object. Just not from official info or without violating the EULA - so I didn't know (for sure) before.
is there any EH or XEH to detect if unit killed something (NOT was killed mind you). I want a script to run when player kills stuff without putting scripts on the targets (so it can be compatible with ALIVE and other scripts that spawn AI)
Well you can use the "was killed" XEH and check if the killer was your unit
@still forum maybe you know this, but is there a specific reason that allVariables still returns nil variables?
Because they are not deleted.
nil is also a value. So if you set a variable to nil it still exists
@still forum but I want to detect if unit killed someone, NOT if it was killed
That's what i just told you
There is a special handler for nil on missionNamespace though I think. Where the variable really get's deleted when set to nil
Was about to say. It works fine for the mission namespace.
There was a time when you couldn't even set them to nil on CONTROL and DISPLAY, but that was fixed.
@still forum But you need to add the "killed" EH to the AI
I have this in a sqf ```sqf
[_box, player, true] call ace_arsenal_fnc_openBox;
and I have this in the init of the object I want to open it in
```sqf
this addAction ["Arsenal", "scripts\openArsenal.sqf"];
To me that looks like it should work but I cant get it to actually work, anyone know what I did wrong?
box is undefined if that's your only piece of code, also,
https://ace3mod.com/wiki/framework/arsenal-framework.html
and now to finisht the goddamn feature doc with all the shortcuts ๐ญ
How would I define the box then?
you don't need to, just check the link I posted or put:
[this, true] call ace_arsenal_fnc_initBox;
in the init field of the object
Wait I need to use initBox and openBox on the object for it to work?
I want to open it via a Action btw
OPENBox OPENS the box, it's the func making sure you can open it and does it if you can.
IINITbox adds a variable to the object with all the items you specified and adds an ACE interaction
there.
That actually makes alot of sense facepalms
Would someone be kind and give me an example on how to create a good progress bar (not the dialog part) and tell me how can I improve it's performance?
I dont know if this is the right place to do it but, I need a couple of devs that can help me out on my project
You need to provide more information.
"Hey I need your help but I won't tell you with what! You have to ask me what i want so you can do my work for me!"
You won't get many people helping you that way
this is on the same level as "can I ask a question"
Im not asking for help im just looking for people that can dev
#creators_recruiting then
i'm looking for people that can dev
that's asking for help
But even then you have to provide info
"Hey dev something for me"
"What do you need?"
"I dunno. Just make something"
"wtf? Bye."
paid peanuts too
@still forum @lone glade Deving life server LOL
Thought exactly the same
Was debating with myself if I shall repost this here with a ๐ at the end
๐
Would this XEH setup run a function when any units get killed?
class unit_killed_event {
killed = = "_this call HG\Functions\Client\AI\fn_aiUnitSetup.sqf";
};
};```
noooo...
For one.. syntax error
second that won't do anything.
Third PreStart is not Killed.
preStart is for running stuff after the game has loaded
before anything load other than assets really
oops, sorry I was copying stuff from the examples
I didn't notice Extended_PreStart_EventHandlers
@still forum where is that syntax error, why it won't do anything?
"killed" is one of the event handlers
Yeah. But it is Extended_Killed_EventHandlers then a subclass of whatever name
No
A subclass of the same name as the one you add the event to
so you probably want CAMan or Man
And the killed has to be a unique name for your mod that no one else overwrites
class Man {
kill_reward = "_this call HG\Functions\Client\AI\fn_aiUnitSetup.sqf";
};
};```
Still syntax error. But this time in SQF and not in the config
\ and . are not allowed in non-string variable names
class Man {
kill_reward = "_this call fn_aiUnitSetup";
};
};```
๐ Now to fixing the indentation ๐
That should work. And then in fn_aiUnitSetup you check who the killer was. And if it was the local player or.. whoever you want then you know that, that guy just killed someone
I'm editing the simple shop script. Normally it requires you to run the function detecting if the unit was killed using the init, it would mean adding it to every placed unit.
The original script: https://pastebin.com/2XX5MG3h
I tried to edit it to bring out the code from inside the "Killed" EH: https://pastebin.com/r7YuF0Rs
I just edited the existing function ยฏ_(ใ)_/ยฏ
@still forum Now, how do I make that XEH thing to run in the script?
Huh? "run the XEH thing in the script" ? The XEH thing runs your script. Your script runs in the XEH and not the other way around
The Simple Shop is a script you add to a mission with adds shooping money and stuff. One issue is: to get money for killing the AI you need to add this to the placed AI unit's init field
[this] call HG_fnc_aiUnitSetup;
I'm trying to figure out a way to make the kill-reward thing work for any AI, even the one dynamically created by ALIVE or similar mods. Just without the need to edit the mods themselves.
Why don't you just use XEH to call that thing on every units init then?
Because I only need it when I use the shop script? Not sure how all of that works though
Or CBA's addClassEventHandler with retroactive enabled
Just add "init" handler on CAManBase
That is essentially the same as the init field in editor
Would that need to be an addon that runs on every mission?
got CBA as I have many mods that use it
["Man", "init", {[_unit] call HG_fnc_aiUnitSetup;}, true, [], true] call CBA_fnc_addClassEventHandler;
and add this to the init scripts? (initServer.sqf etc.)
Alright! I think I got it working
How do you handle splash (explosive) damage from HandleDamage?
Is there any difference in doing either of the following?
[player] joinSilent grpNull;
and
[player] joinSilent (createGroup playerSide);
join grpNull probably does the same internally. So the first one would be faster ๐ค
Yeah thought so, cheers
How exactly would I go about moving the currently referenced directory to a below directory.
I want to include a definitions file in a script but the script isn't in the root.
So it's in -> scripts\server\time\fn_realTime.sqf
and the defintions is located in: -> configs\defines.hpp
Obviously doing #include "configs\defines.hpp" won't work.
How would you execute a script when the game first loads?
@still forum Ah okay, thanks.
preStart XEH with ACE or in CfgFunctions
thx
What's people's preference on:
if(true) then
{
} else {
};
versus
if(true) then
{
}
else
{
};
neither xD
2nd
Both are wrong
if ( true) then {
} else {
};
Ugh
yeha
so now we're debating this now
if(true) then {
}:
versus
if(true) then
{
}:
first. Because having the { on a single line just doesn't have any use
waste of space
^
Well no use -> But clean looking? In my eyes yes
by the end of a long ass file it's just even longer
The
if cond
{
<code>
}
comes from C. Because in C you can also do
if cond
<code>
which is very different. So if you don't see the { if it's at the same line it could be a problem
In SQF you always have to have the {. So it makes no sense to draw extra attention to it and make sure you can see it
Okay. Makes sense.
Ofcause you could forget it. In C forgetting it can cause unforseen consequences that might be very hard to find the cause of.
In SQF it's a error.
Best:
if(true)then
{
};```
^^ My favourite, but obviously that isn't the popular opinion
Anyone know how one would one call a function as the game starts? I have defined it in cfgFunctions just am wondering how I would execute it on gamestart
That wasn't me?
That was Pablo old man
Why do two people randomly ask the same very rare question in the same hour
ยฏ_(ใ)_/ยฏ
set preStart = 1 in your cfgFunctions entry
You don't execute it on gamestart. It executes itself
throws ๐ at @jade abyss. You awake? :u Dscha sleepin
Anyone know of a way to disable the deaths cased but walking into tail rotors as it bugs out in MP and i dont see bis fixing it as its been like this for years now. So any clue how i can disabled this system or code around it?
@still forum Sup furry?
I'm now also in the blu peoples grp.
@restive cedar Did you try if Damaged EH might work? Dunno if you can somehow detect if a vehicle cause that damage
Partytime
๐ฌ ๐น
Dirty Idea is to add handleDamage and if you get insta killing damage while only being a few meters away from a helicopter then ignore that damage
I wonder how long it takes till people complain to Dwarden why that furry thing is blue ๐
You are some weird thumbs up guy. I'm a attractive fur fox
humm need to test it but i wonder is nulling this will solve the issue
tailBladeCenter = "rotor_02_center";
tailBladeRadius = 0.5;
tailBladeVertical = 1;
Didn't the Geo of the model comes in count/"interacts" with the player model?
you mean colliding with the rotating geo lod. That's how I thought the tail rotor does damage
but not sure anymore
Yep
I mean, you will get blocked by the rotor when the engine is standing, irrc
And since it's an "active PhysX"-object... hm.. basicly the same as ramming an Inf with a car
Learned something new... It really doesn't hit you
@restive cedar you could try use init code to try detect when the client creates a new player object
engine checks if you are in the area and if the rotor turns.. dead
wut?
So yeah tailBladeRadius might work
Oh my
If you are in the blade radius you get insta setDamage 1
The issue is when it happens, the client creates a new player. You end up with a dead body with gear & player is controlling a new player with same gear
What are you talking about @tough abyss ?
He asked how to prevent death when being hit by helicopter rotor
I know the bug he is on about
Pointed him at another route he might consider looking at.
I just gave up on it and just kick the client when it happens
Oh okey.
The tailBladeRadius only works with helicopterRTD which is default? I think?
Does it also apply to the Advanced FS?
I guess so
(just asking, since it changes alot of stuff)
Don't think that would make a difference
I guess it might also damage the helicopter if something get's into the rotor
tbh, i wouldn't change it^^ Let them die, when they run into the rotor ๐
But i am a sadist and dong give af, so...
Problem is they don't die lol ๐
wut?
Arma
Torndeco - Today at 8:13 AM
The issue is when it happens, the client creates a new player. You end up with a dead body with gear & player is controlling a new player with same gear```
Totaly missed that
btw. BlueManGroup atm in #arma3_scripting . No peasants writing ๐
Being blue has one downside... Links automatically expand with a preview that I can't remove. Or can I? On Slack I can remove the preview
User settings, text and images. I think u can disable it there
Ahh and you can also <https://link/stuff> and it won't embed
Yep
Good to know
Thats how i trolled Commy ๐
yes Torndeco that the issue im talking about ill do soem tests with handledammage and see what i can get to work its just so annoying to have the clones
handledammage no good
will keep looking
humm so nothing is being triggered
res=[]spawn{ waituntil {!isnull player};player addeventhandler ["Dammaged", {diag_log str _this}];};
Dammaged is not HandleDamage tho
yer i tried both
i might have a conflict as im using nss admin panel and that might cause a replacement of the EVs
i got this from killed
"[NSS_AC_Admin__SP_PLAYER_,NSS_AC_Admin__SP_PLAYER_,<NULL-object>,true]"
ok so Hit, HitPart, HandleDamage and Dammaged do not tigger from tail rotor splats
Killed triggers but its pointless as it only sends the player as the killed and killer
But. Does killed get the old object so that you can just delete it?
The issue is that the old object keeps all handles,defines and so on what im trying to do is prevent the cloning in the first place ill look into the config way now and see if that yealds better resaults
yer killed works but its too late at that point
gonna try this now https://pastebin.com/kp5HAsY4
nope damn
Must be hard coded
I think it might be 2 meter distance from your feet...
If you get up on a ramp so you stand 1m away from the rotor and if you get hit.. Then yeah.. They disabled the radius check
pretty sure it can be adjusted
but in case of helicopters, you have engine function + collision with actual geometry
instead of empty memory point try i.e. using main rotor - engine might somehow try to fallback to some default value in case parameter is empty
@shut flower thanks, I already searched into the ACE but i didn't find it lol
one last thing, is cba_fnc_addPerFrameHandler similar to BIS_fnc_addStackedEventHandler with the param onEachFrame?
and if yes, is there a way to reproduce it without using cba
so for example, is better to use a frame handler instead of a while true / for i from 0 to 1 in a progress bar, right?
depends
a EachFrame handler fires each frame
a while true loop everywhere from each frame to every couple minutes
And I don't even know why you would use a for loop with step 0
but in terms of execution per second
have to test it, don't know even what to ask lol
I only know that I have to find something less cpu demanding for the progress bar
which right now on my server runs with a for loop step 0
A progress bar ON the server??
when a specifi action is triggered*
And where did you get the Idea of using a for loop with step 0?
A progress bar on the server doesn't make any sense as no one can see it there anyway
not on the server side
on the client side
I thought that while true will execute more than needed
but I never tested it so far
A while loop in the scheduler is as low cpu demanding as you can get
a loop that infinitely runs .. Runs infinetly often.. So.. Your definition of "more than needed" is weird.
Wasn't the fnc outdated?
BIS_fnc_addStackedEventHandler
and added to the ordinary function? @little eagle
https://community.bistudio.com/wiki/addEventHandler
addStackedEH uses a single addMissionEventhandler with EachFrame as backend
previously it used onEachFrame as backend
Also.. You really shouldn't use StackedEH as onEachFrame except if you really need to pass a variable that you can't pass otherwise
so all in all, spawning a while true with a delay is less cpu demanding for a progress bar than using a for loop
yeah. But both are completly negligible
yes
but why this? Can't understand it lol. Isn't more demanding if runs infinitly rather than X times per second?
?
imho, in 90% of the cases, you don't need it on EachFrame
while true and for with step 0 do exactly the same thing
Btw, besides pausing (not running) when not needed, is there any other practical different between onEachFrame and Draw3D?
one before one after the Calculations
These first two loop types are identical in speed (+/- 10%), and are more than 3x as fast the proceeding two loop types.
for "_y" from # to # step # do { ... };
{ ... } foreach [ ... ];
Where as these two loops are much slower, and for maximum performance, avoided.
while { expression } do { code };
for [{ ... },{ ... },{ ... }] do { ... }
this is from the wiki
while and foreach are completly different things
you can't measure the performance of a loop that never ends anyway
I currently, have a tiny animations framework, with setup, running the animation for a certain duration, and then teardown. I currently use EachFrame, so should I switch to Draw3D? Should be mentioned some of the "animations" involve creating local vehicles moving them around, and eventually deleting them.
But that's somehow correct. But also
while {true}
is slower than
_true = true; while {_true} But does it really matter?
@errant jasper if EachFrame works fine then stay with that
*nods*
Alright, yeah it has worked well so far. Noone noticed it was up to a single frame behind ๐
is slower than
_true = true; while {_true} But does it really matter?```
Because Engine is not "calling the function" `true` ?
oh my
Wiki says allUnits does not contain units of sideLogic
but, on dedicated
{deleteVehicle _x} forEach (allUnits select {!(side _x isEqualTo west) && !(side _x isEqualTo civilian)});
and
{deleteVehicle _x} forEach (allUnits select {!(side _x isEqualTo west) && !(side _x isEqualTo civilian) && !(side _x isEqualTo LOGIC)});
deletes game logics
On hosted server it does not delete them. Trying not to delete game logics. Any ideas?
isKindOf "Man"
@still forum
But that's somehow correct. But also
while {true}
is slower than
_true = true; while {_true} But does it really matter?
I need that nanosecond
microsecond*
picosecond*
but yeah i dont think anyone will actually ever need this level of optimization
You can use all the ms yoou gain from this on more cool things
I do need them. If you have to iterate over dozens of players every frame to collect their position data.. saving a few microseconds somewhere is worth a lot
@still forum isKindOf "Man" works. THx. Is that a bad description on wiki, bug in arma or my misunderstanding?
I don't know. allUnits should only return infantry. Logics are not infantry
Yeah, maybe a new bug? could be related/similar to @peak plover 's problem with allPlayers returning CAS module as player.
@still forum in the case of updating hud elements I agree, but mostly people just make their code unreadable because of optimization :P
You'd have to have lots of hud elements to make it worth ^^
Well worth it in some cases
@tame portal > comments hurt performance
Don't think so
?
if code get's unreadable just add comments
I didn't say comments hurt performance?
what deadman said
I just said that people sacrifice readability to squeeze out a millisecond where it's not necessary
*Some
You cannot sacrifice readability for performance, it's impossible, you can always comment, causing readability to be good and code fast.
However people sacrifice readability in sake of laziness and time
Yeah some people go crazy about performance.. Like putting everything in over a hundred local variables. Because using local variables is faster than calling commands..
And then some lines later they do the most crazy ultra bad performance things as if they don't care about performance
Take Quiksilvers huge file as an example.
That's what I was referring to
๐
Some improvements make a lot of sense and are important in some code.
But then people come along. Take these optimizations that make sense elsewhere. Put it in a place where it makes no sense at all and repeat that with all optimizations till they have a mess of crap code that's completly unreadable because they are also too lazy to comment why they are doing things like that
@peak plover if I make everything to local variables instead of refetching stuff, I am kind of making the code unreadable while lowering the execution time by maybe some seconds, so yeah its possible ๐
and well yeah what he just said.. people usually dont comment
I find it very helpful finding bugs or doing small tweaks after my code is complete and I go over it to comment it
Actually in his case it didn't improve anything
so dont let them go down the path where its necessary to comment if they cant be arsed to do it
I didnt read through the whole file ๐
as local variables are only better if your scope is close to them. Which is what I meant with the "put it in a place where it makes no sense at all"
using private _var = false; is faster than _var = false;
the file made my chrome browser on my phone hang, so i closed it again
local variables are a improvement that can be significant. But in his case it was worse than not using local variables in the first place
Some people get a feel for when things make sense. Other people just slap butter on their toast till they have a butter with toast.