#arma3_scripting

1 messages ยท Page 396 of 1

jade abyss
#

Not Adanteh.

austere granite
#

This is 100% correct

peak plover
#

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?

austere granite
#

differnet terrains

jade abyss
#

Yeah, i guess

peak plover
#

Bornholm / Lythium

#

They good

#

What about script wise?

cloud thunder
#

The last A3 updates 1.78/1.80 broke some of the doors on Lythium

subtle ore
#

"Broke"

#

Lythium just didn't update for changes

peak plover
#

They do Dev builds too, so mods have a chance to check it out

gray hemlock
#

@little eagle From Razer on the Desolation dev team, thank you. Think that was exactly what he needed.

spark phoenix
#

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

still forum
#

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...

gray hemlock
#

lol, Yeah sure, please keep the information up to date....
That would have probably been a decent response.

still forum
#

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.

dim terrace
#

[Public] Entity locality is set before the init script call
โค

#

soon on devbranch

cedar kindle
#

0w0 whats this

little eagle
#

Does that mean I can use setVariable public and it works now inside the init event?

dim terrace
#

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

glad pendant
#

im currently reading through the pbos in the ace mod does anybody know what pbo the call functions are under?

dim terrace
#

so i.e. virtual garage functions were executed on each machine

meager granite
#

I think it affected JIP as well

dim terrace
#

indeed

little eagle
#

@glad pendant Almost every ACE component has it's own functions, and they are in the functions subfolder.

peak plover
#

What's with the double __

little eagle
#

fnc__handleRequestAllSyncedEvents?

peak plover
#

yeah.

little eagle
#

That's how jaynus named them. ๐Ÿคท

waxen jacinth
#

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;```

little eagle
#

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.

waxen jacinth
#

Ah, sounds like an option to try - cheers.

little eagle
#

Getting a paper to check just so I don't spread bs.

peak plover
#

nearestTerrainObjects

#

why

#

And yes you can

waxen jacinth
#

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

little eagle
#

r = sqrt(2)/2 * a, with a being the length of one side of the square.

peak plover
#

inAreaArray

#

my mullato

little eagle
#

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.

peak plover
#

ofc I thought it was somethign else

little eagle
#

To cover all edges.

peak plover
#

Yes yes

#

I wonder if inarea works with 3d triggers?

#

It should because alt syntax lets use z

little eagle
#

Never tried, I hope so.

#

What's the equivalent for "area" for 3d shapes?

peak plover
#

bounding box?

little eagle
#

Room?

peak plover
#

volume

little eagle
#

inVolumeArray

#

@still forum ^

peak plover
#

inpolygon takes 3d positon as well

little eagle
#

Must be mad math internally.

peak plover
#

Is inpolygon slow?

#

I just started using it in a loop

little eagle
#

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.

peak plover
#

3 points right now

#

But I might do 4

little eagle
#

That sounds like nothing.

peak plover
#

Drawing a polygon based on player fov and using it to change view distance and cache units

little eagle
#

inPolygon would've been useful for ACE backblast.

peak plover
#

yessir

little eagle
#

For a rectangle, the radius r = sqrt[(a/2)ยฒ+(b/2)ยฒ], with a and b being the two sides.

#

Except that's wrong. ๐Ÿ˜ฆ Fixed.

peak plover
#

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

little eagle
#

What do you mean by caching?

#

disable sim?

peak plover
#

yeah

#

and hide

#

network traffic gets lower, fps higher

little eagle
#

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.

peak plover
#

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

little eagle
#

If that doesn't break anything.

peak plover
#

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

meager heart
#

@peak plover i believe you know it but ... there are things like setDynamicSimulationDistance and setDynamicSimulationDistanceCoef to play with in "combo"

cold pebble
#

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)
meager granite
#

๐Ÿ‘

south pasture
#

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?

ripe imp
#

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?

rotund cypress
#

Hey guys, to get the position of cursorTarget, is there a better way than using screenToWorld [0.5, 0.5]?

south pasture
#

@ripe imp

getMarkerPos (allMapMarkers select (random count allMapMarkers));
ripe imp
#

what if i only want to pick one from a few of the markers, not all?

#

["name","name2"] instead of allMapMarkers ?

split coral
#

getMarkerPos selectrandom ["name","name2"]

ripe imp
#

thanks both!

split coral
#

๐Ÿ‘

plucky willow
#

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

little eagle
#

Are you trying to multiply?

plucky willow
#

no im trying to select from a range of numbers, including negatives

little eagle
#

Because something is missing
floor(random _rNum1) <<<here>>> _rNum2;

plucky willow
#

im trying to replicate this format

#

floor(random 2) -1;

little eagle
#

floor(random 2) + -1;

#

Or rather

#

floor random 2 + -1

plucky willow
#

floor(random 2) -1; picks a random number from -1 to 1

#

its not a s ubtraction

little eagle
#

Yes it is a subtraction.

#

floor random 2 - 1

#

Subtraction.

plucky willow
#

i see

#

so i need to add the variable okay i get it now

little eagle
#

Yes.

subtle ore
#

2 + -1 is still subtraction as well ^

little eagle
#

No, that's an addition.

subtle ore
#

Yes

#

But the value is now 1

#

It's subtraction with a mask Commy

little eagle
#

No, the value is -1, not 1.

subtle ore
#

Wtf? 2 + -1? No?

little eagle
#

2 add -1

#

Addition.

subtle ore
#

Yes

#

But the sum is now 1

#

Same thing as 2-1

little eagle
#

The result is the same, but the operation is different.

subtle ore
#

Yes

little eagle
#

That's like saying
1 * 1
is the same as
2 - 1

subtle ore
#

What i am saying it gets you the same result

#

The original post had -1

little eagle
#

The original was a subtraction.

plucky willow
#

yeah i thought it was a negative at first

#

thats why i tend to put spaces before and after my operators

little eagle
#

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.

subtle ore
#

@little eagle ๐Ÿ–• ๐Ÿ˜‚ ๐Ÿ–•

little eagle
#

What was that for?

plucky willow
#

why are all the speeds measured in kph instead of m/s?

little eagle
#

Just do:
vectorMagnitude velocity _vehicle

plucky willow
#

nice that gives m/s

#

thanks

subtle ore
#

@little eagle

1 * 1
is the same as
2 - 1``` That's why, it's not like saying anything
little eagle
#

You do realize that these two expressions:
2 + - 1
and
2 - + 1
are using 4 different commands, numbers not included?

subtle ore
#

Yep.

little eagle
#

And confusing unary and binary minus was what caused this issue, so you have to be correct in explaining it.

subtle ore
#

Well, you explained it correctly then yes? All is well

severe solstice
#
_nObject = nearestObjects [(getPosATL _playerObject), ["HeliH"], 200];
_nObject = _nObject[0];

would this work? can i overwrite an object like that?

rotund cypress
#

Hey guys, to get the position of cursorTarget, is there a better way than using screenToWorld [0.5, 0.5]?

little eagle
#

@severe solstice

_nObject = _nObject select 0;

or

_nObject = _nObject param [0, objNull];
#

@rotund cypress

positionCameraToWorld [0,0,0]

???

rotund cypress
#

Ah maybe that could owrk

little eagle
#

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.

rotund cypress
#

Yeah positionCameraToWorld did not work

little eagle
#

What's the goal?

rotund cypress
#

Basically if I am looking at a pos, I want to teleport to that position.

#

screenToWorld kind of works.

little eagle
#

The only problem with screenToWorld is, that it goes right through objects.

#

Only cares for terrain.

rotund cypress
#

Exactly

little eagle
#
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.

rotund cypress
#

Yeah that works

south pasture
#

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?

severe solstice
#

ty commy2

still forum
#

@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

austere granite
#

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

still forum
#

can you get a controls config path? Their config has the type

austere granite
#

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

river meteor
#

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

little eagle
#

safezone, proper grid

tame portal
#

@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 ๐Ÿ‘

river meteor
#

@tame portal Are you talking about the GUI editor they included?

tame portal
#

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

river meteor
#

Do you have a link to a list of these Macros? Haven't heard about this from EDEN

tame portal
#

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

simple solstice
#

What would be the best way of counting how much distance a vehicle has traveled from spawning it?

still forum
#

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

simple solstice
#

PFH was Per Frame Event handlers IIRC?

#

oh this one

still forum
#

no not PFHObject

#

just PFH

simple solstice
#

k got it

still forum
#

although PFH object might also be good for that.. Never used that

little eagle
#

It's kinda dumb. I just recreated it after I deleted it, because someone actually missed it.

#

And I felt bad.

simple solstice
#

just gonna use PFH with GetIn and GetOut

little eagle
#

Make the pfh remove itself and use only getIn. Will be cleaner.

simple solstice
#

isNull objectParent player > delete PFH

little eagle
#

Yes. pfhid is passed as _this select 1.

simple solstice
#

_this select triggered

little eagle
#

param [1] ๐Ÿคท

river meteor
#

What determines which controls are placed on top of other controls within the same dialog

shut flower
#

controls should be read from top to bottom

#

or the way around, don't remember

austere granite
#

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

shut flower
#

you sure? placing a button behind a rsctext hides it I think

austere granite
#

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

river meteor
#

Which control is the drop down menu?

austere granite
#

combobox

#

ctrlCombo

subtle ore
#

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?

jade abyss
#

It is possible

#

was done in A2 before. iirc some Epoch "Extensiones" added them

subtle ore
#

Right, I've already got it working with ctrlCreate

jade abyss
#

getText from the config where it links to the Pic

subtle ore
#

but I need that to work in config

subtle ore
#
private _icon = getText(configFile >> "CfgWeapons" >> primaryWeapon player >> "icon");
#

I'm just simply talking about how I would apply this to the control

jade abyss
#
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?!

subtle ore
#

AH nevermind

jade abyss
#
_Ctrl_Symbol ctrlSetText "\a3\ui_f\data\IGUI\Cfg\Actions\open_door_ca.paa";```
example
shut flower
#

you want to fill your control after you created it, don't you?

subtle ore
#

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...?

jade abyss
#

Do WHAT with the config?

shut flower
#

no clue what you mean with your config

#

you can execute a script from a control's init

#

maybe you mean this?

subtle ore
#

Yes

#

preciesly

jade abyss
#

Then say it

#

derp

subtle ore
#

I need to update the icon upon weapon switch

jade abyss
#

so not

#

posnfogndaspgindfspigndf

subtle ore
#

HEY Man, I thought I was being clear ๐Ÿ˜ฆ

jade abyss
#

Not even close^^

#

You want to upgrade the Ctrl, when you change the weapon

shut flower
#

you talked about things nobody invented already ๐Ÿ˜„

jade abyss
#

Yes or No?

subtle ore
#

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?

jade abyss
#

Doubt it will be well ๐Ÿ˜„

#

fighting gear? oO

subtle ore
#

๐Ÿ–•

jade abyss
#

๐Ÿ–•

#

bitch

shut flower
#

that escalated quickly

subtle ore
#

Dscha is a big bully ๐Ÿ˜ข

jade abyss
#

pff, tester

subtle ore
#

Errr..I don't have a rebutle.

jade abyss
#

rewhat?

shut flower
#

When you really want to do this on weapon switch you will need some eventhandlers for this

jade abyss
#

shh, don't spoil the fun for us

subtle ore
#

Heh

shut flower
#

sorry, I'll get some popcorn ๐Ÿฟ

subtle ore
#

Dscha, a rebutle man

jade abyss
#

Just repeating that, from 10min ago:

It is possible
was done in A2 before. iirc some Epoch "Extensiones" added them```
subtle ore
#

a refutation or contradiction.

#

Yeah but my question was -> HOW?

shut flower
#

may I spoiler now?

jade abyss
#

Thats for you to find out, little tester

#

=}

#

5 more min

#

making fun atm ๐Ÿ˜„

subtle ore
#

Bah

#

Someday I'll have mighty Staff and Veteran muscles like you Dscha

#

Maybe

jade abyss
#

No

#

^^

#

You are just a Tester

#

and stay it

#

๐Ÿ˜›

subtle ore
#

Asshole

jade abyss
#

(currently searching for the link)

#

+Yeah, i know

shut flower
#

Who told you you could reference players in a config? ๐Ÿ˜•

jade abyss
#

No clue what he meant with that anyway

shut flower
#

I'm quite surprised about the idea to do so

subtle ore
#

๐Ÿ˜‘

shut flower
#

there might be an intercept solution for this

subtle ore
#

We get it Dedmen, you like intercept solutions

#

Oh, you beat me to it Chris

shut flower
#

yeah I wanted to prevent dedmen to paste it here

jade abyss
subtle ore
#

Yeah.

#

I am not in kahoots with any lifer or zombie shit right now please be aware of that

shut flower
#

let it set the icons for the weapons on each frame, this a solution that will work all the time troll

jade abyss
#

Doesn't matter where it's from. It's the same principle

subtle ore
#

Well you know

#

Altis life + it's communtiy can make anything bad

shut flower
#

mainly it's community

jade abyss
#

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)

subtle ore
#

๐Ÿ‘

jade abyss
#

(take & Put is important! Keep that in mind)

nocturne iron
#

Anyone aware of a away to remove the zeus 'unit' ui with scripts?

shut flower
#

hide it on display init

jovial ivy
#

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)

shut flower
#

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

tough abyss
#

call compile / parseSimpleArray

#
#

Also arma escapes quotations by using double quotations

cloud thunder
#

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

little eagle
#

Did you place a virtual entity for the hc?

cloud thunder
#

yes , hc is working

#

the virtual entity is named HC_1

little eagle
#

Do some debugging with diag_log [_this]; in HandleDisconnect.

peak plover
#

hmm

#

Does

#

initPost not fire on buildings that are palced?

#

Alternatives?

little eagle
#

Disabled for buildings for performance reasons, decided back in A2.

peak plover
#

Ohhh...

#

#mad

#

fuck.

#

I just realized it's a good alternative for allMissionObjects "Buildings"

little eagle
#

What is?

peak plover
#

XEH addClass

little eagle
#

Building your own array of all buildings you mean?

peak plover
#
["Buildings", "init", {
    nig_allbuildings pushBack (_this param [0])
},true,[],true] call CBA_fnc_addClassEventHandler;
#

Yup

little eagle
#

Well, it would be.

peak plover
#

This way no perforamnce drop compared to allMissionObjects because it's fluidly adding them 1 by 1

jade abyss
#

Are those "buildings" scattered around the whole island?

peak plover
#

Yes

jade abyss
#

MissionPlaced or MapItems?

peak plover
#

misionplaced

jade abyss
#

Okay

#

MapItems could not be loaded, when the init for it is triggered and the EH wouldn't be attached to it

little eagle
#

Tried
entities "Building"
?
Should be faster than allMissionObjects

jade abyss
#

I had some serious headaches a few years back with that crap -.-

peak plover
#

entities does not work with buildings

#

:\

#

When the allmissionobjects hits ๐Ÿ˜ฆ

little eagle
#

Ouch.

peak plover
#

80 to 30 fps drops are not cool

cloud thunder
#

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

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.

cloud thunder
#

but typeof will always be the same for HC_1 and HC_2

little eagle
#

Mark them with a setVariable.

peak plover
#

I guess my only fix is to make this into a mod and just use init EH in there

little eagle
peak plover
#

ohh yes, thanks

errant jasper
#

Do the allMissionObjects still "hit" like that when you run it in a scheduled environment?

peak plover
#

yes

errant jasper
#

The command is bugged then.

peak plover
#

The command won't suspend if it takes more than 3ms, so I guess

south rivet
#

@cloud thunder why don't you do _this select 3 isEqualTo "HC_1"?

peak plover
#

The command must be internally unscheduled

errant jasper
#

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.

peak plover
#

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

errant jasper
#

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.

peak plover
#

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"

errant jasper
#

Run it on the server preInit? Thx, I will try that, next time I look at it.

peak plover
#

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

little eagle
#

Suspension only works between commands. If a single command is slow, it will be slow. Also, >30 fps is still above the 3ms limit.

errant jasper
#

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.

little eagle
#

The scheduler is shit, news at 11.

peak plover
#

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

errant jasper
#

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.

peak plover
#

mods are alternative

#

just any mod with init EH

little eagle
#

Did the xeh_all thing work?

errant jasper
#

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

peak plover
#

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)

errant jasper
#

Try printing the RPG's inheritance tree

peak plover
#

How do you do that

errant jasper
#

Do you know the class of the p3d ?

peak plover
#
nig_perf_arrayB arrayIntersect (allMissionObjects "Building")
// []
#

no dont know

#

How do I get the p3d class ?:D

errant jasper
#

I mean the classname that has that p3d as the model. But it might be: rhs_rpg7v2_pg7vl

peak plover
#

"LOP_TKA_RPG_Pack"

errant jasper
#

ahh, yeah backpacks are buildings

#

stupid really

peak plover
#

What, really?

#

WEll it didn't add any editr placed objects I had so it didn't work anyway

errant jasper
#

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

peak plover
#

aah, that makes sense

#

reammobox lol

errant jasper
#

And that is why you don't try to classify real world things in a tree structure

peak plover
#

no they did the exact opposite

errant jasper
#

Well also that ๐Ÿ˜ƒ

little eagle
#

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.

errant jasper
#

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

little eagle
#

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.

peak plover
#

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

little eagle
#

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.

peak plover
#

Yup

errant jasper
#

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.

little eagle
#

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.

austere granite
#

i think most private communities stayed with A2 for a while, public servers switched over almost instant

errant jasper
#

Yeah. I believe some of the long term content makers were dissatisfied with the conditions for Steam workshop.

peak plover
#

From A3 > A4 will be different too because sqf is gone

little eagle
#

I think that's just excuses and they lost interest.

austere granite
#

There's no indication sqf will be gone?

#

just have a wrapper for it

little eagle
#

SQF may be gone, but no one knows for sure.

errant jasper
#

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

austere granite
#

every now and then a rewrite isn't such a bad idea

errant jasper
#

It was their hobby I guess, and they wanted a new one.

peak plover
#

ACE3 still in dev. Medical is getting rewritten , which is huge

little eagle
#

The ACE 2 code is really bad. No better than your average mission. It had to be done all from scratch.

errant jasper
#

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.

little eagle
#

ACE 3 code is salvageable for a different game, but ofc SQF has to stay.

#

Same for CBA_A3 as it is now.

peak plover
#

The ballistics are crazy and stuff like that

#

das good

peak plover
#

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

errant jasper
#

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 ? ๐Ÿคฆ

peak plover
#

Yeah

errant jasper
#

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 ๐Ÿ˜ƒ

peak plover
#

I was like, why are all the ai running in place?

#

Why does nothing work

south pasture
#

Hi, should i explicitly remove EHs, associated with a unit, if the unit is deleted? Or engine cares of it itself?

peak plover
#

depends

#

_unit addEventHandlers are gone

#

allVariables _unit as well

south pasture
#

What should be disposed manually?

peak plover
#

if you are reffering to the unit directly

south pasture
#

@peak plover thnx

peak plover
#

// 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

little eagle
#

init script?

peak plover
#

postInit

little eagle
#

Weird.

peak plover
#

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..

cedar kindle
#

it does

#

used it several times

peak plover
#

Well i've got no other explenations

#

ohh, locality issue

#

I trhink

peak plover
#

Non local group had unkown

#

that's what was causing issue

#

But I can't remember ever having this happewn

#

weird...

tropic gazelle
#

@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`

tough abyss
#

Test it out and look at the extDB3 logs if it complains

tropic gazelle
#

[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

tough abyss
#

SQL1_1=
SQL1_2=
SQL1_3=
or put it all as single line

tropic gazelle
#

ok i will try ty @tough abyss

south rivet
#

@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.

peak plover
#

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...

south rivet
#

but, allPlayers should be an array. What is this

peak plover
#

I'm doing forEach allPlayers

south rivet
#

Ah

errant jasper
#

Did anyone join in progress at that time?

peak plover
#

nope

#

There are no opfor slots as well ( i tihnk O means opfor )

errant jasper
#

and obviously the server is dedicated, and no headless clients?

peak plover
#

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
errant jasper
#

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.

peak plover
#

Nope

#

No one died

#

The issue is

#

using allPlayers seems to return some weird entity that's apparently on the opfor side

errant jasper
#

Can you replicate it? Can you get its classname or any info on it?

peak plover
#

it's a unit created by a module

#

I'll try deleting the module ...

#

vanilla cas module btw

errant jasper
#

In your log, can you add the class to the output using typeOf ?

peak plover
#

haha well it does not show the O anymore, removed the module. Apparently CAS module is a player :S

rotund cypress
#

Question of the day, nil (broadcasted) object variables before deletion of an object or leave it?

rancid pecan
#

mhello

peak plover
#
_unit setVariable ['abc',123,true];
deleteVehicle _unit;
``` ?
rotund cypress
#

Nigel ๐Ÿคฆ

#

Thats not setting a variable to nil

peak plover
#

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

subtle ore
#

Heheheh

rotund cypress
#

lels, no i will never and have never used CBA and ACE

peak plover
rancid pecan
#

okey okey sorry

peak plover
#

setVariable does not hurt anything other than ram usage

rotund cypress
#

If I want my FPS to drop to 10 then sure ill use it

peak plover
#

And you needed >30milion variables to cache the game back in 32 bit

rotund cypress
#

crash*

peak plover
#

yes

#

42 fps with ace + 20 other mods

rotund cypress
#

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.

peak plover
#

10k objects 400 units

#

beat that

#

publicvariable only broadcasts once

rotund cypress
#

So?

#

Dont know where that came from

#

Also your FPS is shit

#

Should be > 60

#

You are also probably alone in that server

peak plover
#

show me that you can run 10k objects with 400 units with > 60

#

yea alone

rotund cypress
#

You running DRO?

peak plover
#

Nope

rotund cypress
#

@tropic gazelle please, no, just no.

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.

peak plover
#

Just altis with a bunch of bases and units spawned in 3den and that's it

#

exactly @errant jasper

rotund cypress
#

@errant jasper pretty ignorant statement

errant jasper
#

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.

rotund cypress
#

It will cost you a lot if you broadcast variables with large values

errant jasper
#

That what I am saying.

#

Do you read?

peak plover
#

define large values?

tough abyss
#

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

peak plover
#

sending 1 is same as sending 1000

#

sending a function or some code is bad

errant jasper
#

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.

rotund cypress
#

Well my question was more to like this: if an object gets deleted, does the player still store that data

errant jasper
#

And the answer is no.

rotund cypress
#

Okay so object gets deleted, all machines automatically remove all variables to that out of their storage?

tropic gazelle
peak plover
#

Not sure if it works like that

#

Don't know if the actual memroy getss cleared

rotund cypress
#

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

peak plover
#

Yeah, no point int sending out trash

errant jasper
#

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.

little eagle
#

There is no point in setting variables to nil before deleting an object.

#

Happy?

rotund cypress
#

Yes, but my curious mind asks you why there is no reason

#

Because it deletes itself?

little eagle
#

Also, you can set a million variables and FPS will not drop by 10 or even 1.

rotund cypress
#

Well, when clients are receiving them, something has to happen

#

Not saying it would affect it when they are already set

little eagle
#

Sure, you can't sent a million variables in a frame across the network without redchaining everyone.

rotund cypress
#

^

#

Im sure its not a million though

little eagle
#

What's a million?

errant jasper
#

It is important to distinguish between setting a variable, a thing local to a machine. And broadcasting a variable.

rotund cypress
#

Enough should be setting 3 variables at roughly the same frame

little eagle
#

You mean broadcasting?

rotund cypress
#

Yes

little eagle
#

Pretty sure you could do more, but why would you.

rotund cypress
#

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

little eagle
#

There are so many position updates etc, a few sqf variables won't hurt anyone.

rotund cypress
#

broadcasting

little eagle
#

Yes.

#

Easy test though. Play your mission: Red chain -> bad, no red chain -> good.

#

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

errant jasper
#

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.

little eagle
#

Don't broadcast every single frame : (

errant jasper
#

Yeah. That's bad.

peak plover
#

Memory is cleared after deleting the namespace for the variable

little eagle
#

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.

peak plover
#

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

little eagle
#

Medical is pretty bad when a unit respawns.

errant jasper
#

@peak plover The problem is publicVariable is "reliable" and "ordered"

little eagle
#

But then again, medical is pretty bad as a whole.

peak plover
#

don't old variables carry on to the new unit anyway?

errant jasper
#

position updates and directions updates are typically unreliable

little eagle
#

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.

errant jasper
#

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.

peak plover
#
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
};

little eagle
#

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.

peak plover
#

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

little eagle
#

ACE Medical does making placing groups as Zeus lag a bit more than usual though.

cedar kindle
#

even with medical AI disabled ?

little eagle
#

Yes.

winter dune
#
sliderSetRange [40008, 1, 10];
sliderSetPosition [40008, 1];
#

Can someone explain me why even if I do this, I can drag the slider to 0?

jade abyss
#

0 = 1

winter dune
#

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

jade abyss
#

Wait

#

sliderSetRange [101, 1, 100]; = Range from 1 to 10

#

So in the output should only 1-10 show up

winter dune
#

teoretically yes

jade abyss
#

(that's a bit too long ago that i messed with them)

winter dune
#

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?

winter dune
#

isn't equal by getting the second element from the slider?

#

which is the value

#

or do I have to use sliderPosition

jade abyss
#

good Q ๐Ÿค”

winter dune
#

i'll test it right now and tell you if something changed

jade abyss
#

Yeah, checking my old file if i can find something usefull in there

winter dune
#

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

jade abyss
#

Yeah

winter dune
#
if (round (_slider select 1) isEqualTo 0) then { _sliderValue = 1 } else { _sliderValue = round (_slider select 1); };
#

think will do the work

still forum
#

@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.

errant jasper
#

@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.

thorn saffron
#

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)

still forum
#

Well you can use the "was killed" XEH and check if the killer was your unit

austere granite
#

@still forum maybe you know this, but is there a specific reason that allVariables still returns nil variables?

still forum
#

Because they are not deleted.

#

nil is also a value. So if you set a variable to nil it still exists

thorn saffron
#

@still forum but I want to detect if unit killed someone, NOT if it was killed

still forum
#

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

little eagle
#

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.

thorn saffron
#

@still forum But you need to add the "killed" EH to the AI

still forum
#

Exactly what I told you

#

the XEH is added to everyone

cinder gyro
#

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?

lone glade
#

and now to finisht the goddamn feature doc with all the shortcuts ๐Ÿ˜ญ

cinder gyro
#

How would I define the box then?

lone glade
#

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

cinder gyro
#

Wait I need to use initBox and openBox on the object for it to work?

#

I want to open it via a Action btw

lone glade
#

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.

cinder gyro
#

That actually makes alot of sense facepalms

winter dune
#

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?

shut flower
#

take a look at the progress bar in ace

spring niche
#

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

still forum
#

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

lone glade
#

this is on the same level as "can I ask a question"

spring niche
#

Im not asking for help im just looking for people that can dev

still forum
lone glade
#

i'm looking for people that can dev
that's asking for help

still forum
#

But even then you have to provide info

#

"Hey dev something for me"
"What do you need?"
"I dunno. Just make something"
"wtf? Bye."

lone glade
#

paid peanuts too

subtle ore
#

@still forum @lone glade Deving life server LOL

still forum
#

Thought exactly the same

#

Was debating with myself if I shall repost this here with a ๐Ÿ˜‚ at the end

subtle ore
#

๐Ÿ˜„

thorn saffron
#

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";
    };
};```
still forum
#

noooo...

#

For one.. syntax error

#

second that won't do anything.

#

Third PreStart is not Killed.

lone glade
#

preStart is for running stuff after the game has loaded

still forum
#

before the main menu

#

Technically before a lot of things load

lone glade
#

before anything load other than assets really

thorn saffron
#

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?

still forum
#

x = = "" is the syntax error

#

killed is afaik wrong

thorn saffron
#

"killed" is one of the event handlers

still forum
#

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

thorn saffron
#
    class Man {
            kill_reward = "_this call HG\Functions\Client\AI\fn_aiUnitSetup.sqf";
        };
};```
still forum
#

Still syntax error. But this time in SQF and not in the config

#

\ and . are not allowed in non-string variable names

thorn saffron
#
    class Man {
            kill_reward = "_this call fn_aiUnitSetup";
        };
};```
still forum
#

๐Ÿ‘ 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

thorn saffron
#

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

still forum
#

typeName and isEqualTo and params? What witchcraft is dis?

#

I have no idea

thorn saffron
#

I just edited the existing function ยฏ_(ใƒ„)_/ยฏ

#

@still forum Now, how do I make that XEH thing to run in the script?

still forum
#

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

thorn saffron
#

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.

still forum
#

Why don't you just use XEH to call that thing on every units init then?

thorn saffron
#

Because I only need it when I use the shop script? Not sure how all of that works though

still forum
#

Or CBA's addClassEventHandler with retroactive enabled

#

Just add "init" handler on CAManBase

#

That is essentially the same as the init field in editor

thorn saffron
#

Would that need to be an addon that runs on every mission?

still forum
#

no

#

that is script

#

Well you need CBA

thorn saffron
#

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.)

still forum
#

one init script

#

but not initServer

thorn saffron
#

Alright! I think I got it working

tough abyss
#

How do you handle splash (explosive) damage from HandleDamage?

warm gorge
#

Is there any difference in doing either of the following?

#
[player] joinSilent grpNull;

and

[player] joinSilent (createGroup playerSide);
still forum
#

join grpNull probably does the same internally. So the first one would be faster ๐Ÿค“

warm gorge
#

Yeah thought so, cheers

subtle ore
#

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.

still forum
#

use full paths?

#

in mission just "..\..\stuff" to go up

final storm
#

How would you execute a script when the game first loads?

subtle ore
#

@still forum Ah okay, thanks.

still forum
#

preStart XEH with ACE or in CfgFunctions

final storm
#

thx

subtle ore
#

What's people's preference on:

if(true) then
{

} else {

};

versus

if(true) then
{

} 
else 
{

};
cerulean whale
#

neither xD

final storm
#

2nd

still forum
#

Both are wrong

cerulean whale
#
if ( true) then {

} else {

};
still forum
#

๐Ÿ‘†

#

But the space after the if ^^

subtle ore
#

Ugh

cerulean whale
#

yeha

subtle ore
#

so now we're debating this now

cerulean whale
#

I just copied his haha

#

It looks better in sublime lmao

subtle ore
#
if(true) then {

}:

versus

if(true) then
{

}:
still forum
#

first. Because having the { on a single line just doesn't have any use

#

waste of space

final storm
#

^

subtle ore
#

Well no use -> But clean looking? In my eyes yes

cerulean whale
final storm
#

good on the eyes

#

but can get too long

cerulean whale
#

by the end of a long ass file it's just even longer

still forum
#

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

subtle ore
#

Hmmm

#

Alright, well I'll remember that

still forum
#

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

subtle ore
#

Okay. Makes sense.

still forum
#

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.

jade abyss
#

Best:

if(true)then
{

};```
subtle ore
#

^^ My favourite, but obviously that isn't the popular opinion

cerulean whale
#

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

still forum
#

what?

#

You just asked that before and I answered you.

cerulean whale
#

That wasn't me?

still forum
#

wut?

#

Lol

subtle ore
#

That was Pablo old man

still forum
#

Why do two people randomly ask the same very rare question in the same hour

subtle ore
#

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

still forum
#

set preStart = 1 in your cfgFunctions entry

#

You don't execute it on gamestart. It executes itself

cerulean whale
#

well

#

fair point

#

lmao

#

cheers

still forum
#

throws ๐ŸŒ at @jade abyss. You awake? :u Dscha sleepin

restive cedar
#

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?

jade abyss
#

@still forum Sup furry?

still forum
#

I'm now also in the blu peoples grp.

jade abyss
#

OH damn

#

GG!

#

congratz

still forum
#

@restive cedar Did you try if Damaged EH might work? Dunno if you can somehow detect if a vehicle cause that damage

jade abyss
#

Partytime sherbLove sherbPeace sherbNoodle ๐Ÿฌ ๐Ÿน

still forum
#

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 ๐Ÿ˜„

jade abyss
#

๐Ÿ˜‚

#

I am also blue, soo... i doubt you will have any complains ๐Ÿ˜‚

still forum
#

You are some weird thumbs up guy. I'm a attractive fur fox

jade abyss
#

"attractive"

#

erm

restive cedar
#

humm need to test it but i wonder is nulling this will solve the issue
tailBladeCenter = "rotor_02_center";
tailBladeRadius = 0.5;
tailBladeVertical = 1;

jade abyss
#

Didn't the Geo of the model comes in count/"interacts" with the player model?

still forum
#

you mean colliding with the rotating geo lod. That's how I thought the tail rotor does damage

#

but not sure anymore

jade abyss
#

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

still forum
#

Learned something new... It really doesn't hit you

tough abyss
#

@restive cedar you could try use init code to try detect when the client creates a new player object

still forum
#

engine checks if you are in the area and if the rotor turns.. dead

jade abyss
#

wut?

still forum
#

So yeah tailBladeRadius might work

jade abyss
#

Oh my

still forum
#

If you are in the blade radius you get insta setDamage 1

tough abyss
#

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

still forum
#

What are you talking about @tough abyss ?

#

He asked how to prevent death when being hit by helicopter rotor

tough abyss
#

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

still forum
#

Oh okey.
The tailBladeRadius only works with helicopterRTD which is default? I think?

jade abyss
#

Does it also apply to the Advanced FS?

still forum
#

I guess so

jade abyss
#

(just asking, since it changes alot of stuff)

still forum
#

Don't think that would make a difference

#

I guess it might also damage the helicopter if something get's into the rotor

jade abyss
#

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...

tough abyss
#

Problem is they don't die lol ๐Ÿ˜‰

jade abyss
#

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

still forum
#

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

tough abyss
#

User settings, text and images. I think u can disable it there

still forum
#

Ahh and you can also <https://link/stuff> and it won't embed

jade abyss
#

Yep

still forum
#

Good to know

jade abyss
#

Thats how i trolled Commy ๐Ÿ˜„

restive cedar
#

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}];};

still forum
#

Dammaged is not HandleDamage tho

restive cedar
#

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

still forum
#

But. Does killed get the old object so that you can just delete it?

restive cedar
#

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

meager heart
#

addMissionEventHandler "EntityKilled" ?

#

It fires on everything

restive cedar
#

yer killed works but its too late at that point

#

nope damn

#

Must be hard coded

still forum
#

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

dim terrace
#

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

winter dune
#

@shut flower thanks, I already searched into the ACE but i didn't find it lol

winter dune
#

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

still forum
#

Yes It's roughly the same

#

if you use a delay of 0

winter dune
#

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?

still forum
#

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

winter dune
#

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

still forum
#

A progress bar ON the server??

winter dune
#

when a specifi action is triggered*

still forum
#

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

winter dune
#

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

still forum
#

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.

jade abyss
#

Wasn't the fnc outdated?
BIS_fnc_addStackedEventHandler

still forum
#

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

winter dune
#

so all in all, spawning a while true with a delay is less cpu demanding for a progress bar than using a for loop

still forum
#

yeah. But both are completly negligible

jade abyss
#

yes

winter dune
#

but why this? Can't understand it lol. Isn't more demanding if runs infinitly rather than X times per second?

still forum
#

?

jade abyss
#

imho, in 90% of the cases, you don't need it on EachFrame

still forum
#

while true and for with step 0 do exactly the same thing

errant jasper
#

Btw, besides pausing (not running) when not needed, is there any other practical different between onEachFrame and Draw3D?

still forum
#

Yes.

#

onEachFrame runs before and Draw3D runs after simulation

jade abyss
#

one before one after the Calculations

winter dune
#
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

still forum
#

while and foreach are completly different things

#

you can't measure the performance of a loop that never ends anyway

errant jasper
#

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.

still forum
#

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

jade abyss
#

*nods*

errant jasper
#

Alright, yeah it has worked well so far. Noone noticed it was up to a single frame behind ๐Ÿ˜ƒ

jade abyss
#
is slower than
_true = true; while {_true} But does it really matter?```
Because Engine is not "calling the function" `true` ?
still forum
#

If it was a frame behind then Draw3D will most likely be "frame perfect"

#

yes

jade abyss
#

oh my

cloud thunder
#

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?

still forum
#

isKindOf "Man"

tame portal
#

@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

still forum
#

microsecond*

tame portal
#

picosecond*

#

but yeah i dont think anyone will actually ever need this level of optimization

peak plover
#

You can use all the ms yoou gain from this on more cool things

still forum
#

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

cloud thunder
#

@still forum isKindOf "Man" works. THx. Is that a bad description on wiki, bug in arma or my misunderstanding?

still forum
#

I don't know. allUnits should only return infantry. Logics are not infantry

cloud thunder
#

Yeah, maybe a new bug? could be related/similar to @peak plover 's problem with allPlayers returning CAS module as player.

tame portal
#

@still forum in the case of updating hud elements I agree, but mostly people just make their code unreadable because of optimization :P

still forum
#

You'd have to have lots of hud elements to make it worth ^^

tame portal
#

Well worth it in some cases

peak plover
#

@tame portal > comments hurt performance
Don't think so

tame portal
#

?

still forum
#

if code get's unreadable just add comments

peak plover
#

unreadable code for performance?

#

comments never hurt performance

tame portal
#

I didn't say comments hurt performance?

peak plover
#

what deadman said

tame portal
#

I just said that people sacrifice readability to squeeze out a millisecond where it's not necessary

#

*Some

peak plover
#

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

still forum
#

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

tame portal
#

Take Quiksilvers huge file as an example.

still forum
#

That's what I was referring to

peak plover
#

๐Ÿ˜‚

still forum
#

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

tame portal
#

@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

peak plover
#

I find it very helpful finding bugs or doing small tweaks after my code is complete and I go over it to comment it

still forum
#

Actually in his case it didn't improve anything

tame portal
#

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 ๐Ÿ˜„

still forum
#

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"

peak plover
#

using private _var = false; is faster than _var = false;

tame portal
#

the file made my chrome browser on my phone hang, so i closed it again

still forum
#

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

peak plover
#

Yeah what Dedmen said

#

Put it only where neccesary

still forum
#

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.