#arma3_scripting

1 messages ยท Page 266 of 1

tough abyss
#

IF you do them in arma

#

They have to be made of either polylines

#
  • ellipses
buoyant heath
#

septagons?

tough abyss
#

Or

#

You define a new custom hexagon marker class

#

From scratch

buoyant heath
tough abyss
#

Which you'd need to go and look at how markers are defined.

buoyant heath
#

Negative radius draws a hexagon

tough abyss
#

Hahah

#

facedesk

#

Oh well that makes it easy.

#

Might need to remember that.

buoyant heath
#

and the guy posted a picture of the results iirc

tough abyss
#

Ah slight problem

#

It has to be run as a draw eventhandler

#

Even says becareful

#

So how are you updating all the hexagons @rancid ruin If you are restricted to the non-scheduled environment?

#

Sounds expensive.

#

@buoyant heath I can see him running into performance problems

#

Serious ones.

#

Unless they are operating as messengers

#

constantly listening which is still nuts if you used triggers.

buoyant heath
#

Might be able to with markers

tough abyss
#

Still too expensive

buoyant heath
#

not really

tough abyss
#

how is he monitoring the markers?

#

Thats a lot of markers to watch

buoyant heath
#

Why would you be watching the markers constantly?

tough abyss
#

He's making a capture type game yes?

#

CTI ?

buoyant heath
#

He was thinking of loading areas of the map based on the hex grid.

tough abyss
#

Again how is he going to listen to each grid?

buoyant heath
#

Why listen to the grid? Watch player position then translate that to the grid

tough abyss
#

@rancid ruin How are you monitoring the grids or player to when they're inside the grid?

#

SO you'll constantly be looking x,y

#

and the distance between them?

buoyant heath
#

For a limited distance region yes

tough abyss
#

...

buoyant heath
#

It's not like he needs to check the whole map every time (or ever)

icy raft
#

Is there such thing as UVs in UI configs???

#

Like, you could add a tiled sprite and switch UVs?

#

Didn't find it anywhere, but I still hope that it still exists hahaha

rancid ruin
#

i'm not doing anything with the hexagons currently, they're just map markers

#

but i did test out creating locations for each hex. can set/getVariable on them and then do nearestLocation to figure out which hex is nearest to a position

rancid ruin
#

is there any decent way to size a structured text control to the size of it's contents?

#

it's using a monospace font so i guess i could size the width according to the number of characters in the longest line, and the height to the number of lines, but that seems a bit meh

tough abyss
#

How are projectiles created?

#

and calculated? @buoyant heath

#

SQF scripts?

#

or external .dll via PhysX?

#

Anyone know?

buoyant heath
#

Internal engine magic

tough abyss
#

Wouldn't it be shocking if it was calculated by an FSM

#

dies

tough abyss
#

If FSM is stuck in a state waiting for some condition to be true, how many times per second this condition is checked?

indigo snow
#

many times

#

iirc its not too reliable but you could run a simple loop that does diag_log diag_fps; and count the amount of logged lines per frame

rotund cypress
#

Hey Guys, is there an command for setting style in sqf? Like you would do in a dialog Style = ST_PICTURE

#

I've done this and I need to define the style otherwise the picture won't show in the box. Only the text

private _clothesReload = [] spawn {
    disableSerialization;
    waitUntil { !(isNull (findDisplay 602)) };
    _clothesReloadButton = (findDisplay 602) ctrlCreate ["RscActiveText",1928];
    _clothesReloadButton ctrlSetPosition  [0.267969 * safezoneW + safezoneX, 0.181 * safezoneH + safezoneY, 0.04125 * safezoneW, 0.055 * safezoneH];
    _clothesReloadButton ctrlCommit 0;
    _clothesReloadButton ctrlSetText "gui\img\icon_clothes.paa";
    _clothesReloadButton ctrlSetToolTip "Retexture Clothing";
    _clothesReloadButton buttonSetAction "[] call FLF_fnc_texturePlayer;";
};
meager granite
#

No there is not

#

control manipulation commands are limited in this regard, you can't change style, many properties or attributes

rotund cypress
#

Can I use define?

#

And define my own class

#

In a hpp file?

#

And include it in this file?

#

And rename RscActiveText to like My_RscActiveText?

meager granite
#

This is what supposed to be done in first place

rotund cypress
#

So I could do that using that command? ctrlCreate ["MY_RscActiveText",1928];

meager granite
#

No, ctrlCreate only works with game configs, not mission configs

rotund cypress
#

Ahhh ๐Ÿ˜ฆ

meager granite
#

You need to define your classes in mission config, then create display that uses these classes

#

Or you can search game config classes to see if there is active text class with ST_PICTURE already made

#

and use it instead

rotund cypress
#

Ok and thats the only way to do it?

#

Is there any other rsc I could use that is not RscActiveText that would work out of the box?

meager granite
#

There might be other active text class with style set to ST_PICTURE, look in game's config

rotund cypress
#

In the config viewer of debug console?

meager granite
#

Best option would be to dump entire config, using config viewer will be way too slow

#

Or you can write a script which will check all root classes in config to see if it has type and style that you need

#

Actually, I just checked myself, RscActivePicture is active text with ST_PICTURE style

rotund cypress
#

And that will work with setButtonAction?

meager granite
#

I guess

rotund cypress
#

Ok thanks a lot mate

icy raft
#

Please don't consider this spam, I don't have any relation with the page I'm gonna publish. My algorithms complexity teacher recommended me the page udemy.com for coding online courses. They have an offer for the next 14h that leaves *all the prices at 14โ‚ฌ. I just bough 7 courses worth 1200โ‚ฌ for just 98โ‚ฌ. I just leave this here if anyone is interested in expanding their coding abilities.

#

And pretty please, don't think of it as spam, it's just sharing with good will

slate vale
#

Hey guys, I am having a strange issue, in my other profiles / missions I have put a .sqf file and in the file I have just put a simple script which is hint "Test"; and when I go into editor and i either call, spawn or execvm it the hint doesn't pop up, anything I need to do before getting scripts working or anything at all?

jade abyss
#

@open vigil

rotund cypress
cedar kindle
#

selecting a line and pressing ctrl+c copies it iirc?

tough abyss
#

@slate vale Is this a dedicated server?

round scroll
#

do you waitUntil {alive player} and sleep 1; before calling the hint?

rotund cypress
#

@cedar kindle Yes but copying the whole file i mean

tough abyss
#

Scan all the config entries

#

@rotund cypress or de-pbo the root class defintions

rotund cypress
#

What is that called?

tough abyss
#

What files are in your dta folder?

#

In ArmA 3?

rotund cypress
#

bin core and languagecore_f

#

I guess it is bin.pbo

#

Because I saw that in the config

tough abyss
#

Screenshot

#

One of those files contains shader data

#

the other contains a file called

#

config.bin

#

you need to de-rapify it

#

aka "Unbinarise it"

jade abyss
#

If you have the unpacked data -> You will find something.

tough abyss
#

^ Or setup A3 dev environment

#

it's a single file.

#

Contains every mod definition

#

for both A3 and mods

rotund cypress
#

Yeah found config.cpp

#

In bin

tough abyss
#

it's compiled everytime the games.

#

run.

#

Okay got NP++?

rotund cypress
#

NPP and Atom I use

tough abyss
#

(Notepad++)

#

Okay see the button at the top

#

says "Search"

rotund cypress
#

Ctrl + F

#

Im not stupid ๐Ÿคฃ

tough abyss
#

Search for the class definition

rotund cypress
#

I did

#

Its there

#

๐Ÿ˜ƒ

jade abyss
#

Then you should find that stuff for your own...

tough abyss
#

Thats how I started to understand all the GUI stuff

rotund cypress
#

I know how to operate a editor lol

#

@jade abyss

#

Doesnt mean I know everything

#

Ok I see @tough abyss

tough abyss
#

The GUI is built on an OOP construct.

rotund cypress
#

Ill look in ther

#

Yeh

#

there*

jade abyss
#

The stuff you ask for is in the files, so where to look for the data of the files? Right in the files.

tough abyss
#

I made a copy of the file Dscha and added a unique key ID name at the top in comments

rotund cypress
#

Well I didnt know that @jade abyss

jade abyss
#

You can copy and paste everything you need from the .pbo's

tough abyss
#

that allows me to jump to the root GUI definitions

#

makes my life easy.

jade abyss
#

Or just inherit from it, depens on what you wanna do with it.
The other thing is: Alot of searching/testing is needed, if you want to accomplish something.

tough abyss
#

Using Inheritence is the best option

#

purely for the reason it's "good practice"

#

Use the base root classes you don't have to deal with certain headaches

#

with naming things like this.

jade abyss
#

Depends on @tough abyss I ended up creating my own Classes (copied them to a new file, added a tag to it) since Bohemia had the tendency to play around in the UI Files =}

tough abyss
#

MyGUIName : Inherits from some weird ass-name

#

Well of course in that case sure

#

but people name their GUI's weird names

#

Seen atlis lifes grossness?

rotund cypress
#

^^

jade abyss
#

Not how it is now, no clue. But i remember the mess, that Tonic left behind ๐Ÿ˜„

tough abyss
#

FatTonic?

#

xD

#

Thats a bit rude ๐Ÿ˜›

rotund cypress
#

It's still like that @jade abyss

#

tbh

jade abyss
#

I made a script once, was added to the released file. Each time when he entered a car as driver the the tires blew up and a msg popped up: "You are too fat, get out of the car", When he left the car -> Wheels get repaired again ๐Ÿ˜„

tough abyss
#

Haha

rotund cypress
#

Haha lol

#

Was that actually in the framework @jade abyss ?

jade abyss
#

I think so, can't rly remember if we just played around or rly added it to it. Its a few years ago.

rotund cypress
#

Ah I see

#

Was it like a player UID check?

tough abyss
#

Yep

#

still gross

jade abyss
#

getIn EH + UIDCheck

tough abyss
#
 class fuelTank: life_RscXSliderH {
            idc = 20901;
            text = "";
            onSliderPosChanged = "[3,_this select 1] call life_fnc_s_onSliderChange;";
            tooltip = "";
            x = 0.47;
            y = .80;
            w = "9 *(((safezoneW / safezoneH) min 1.2) / 40)";
            h = "1 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
rotund cypress
#

Ah lol ๐Ÿ˜„

tough abyss
#

fueltank inherits from Life_RscXSliderH

#

should be

rotund cypress
#

I would just name it RscFuelTank

tough abyss
#

Life_RscFuelTank

#

yes

rotund cypress
#

Well I guess he was not much for cleanliness maybe? ๐Ÿคฃ

tough abyss
#

As I said still dirty

#

No he was about obfuscating the shit out of it

#

Thats why the entire thing uses Macros now

rotund cypress
#

The macros has been toned down a lot

tough abyss
#

One thing you need to know about that inheritence system that can violate

#

be violated "sort of"

#

When you create a "custom class"

rotund cypress
#

The macros used too be huged back in th eday

tough abyss
#

the only way to name it unique

#

is use type = #;

#

The type is definition in this instance not the class

#

And the engine just works out okay this definition is valid and so is this one.

#

Only ways you can create sexy rounded GUIs or designs that look unique require

#

ST_PICTURE style.

#

Buttons become pictures etc.

#

and paa files unfortunately are space hogs

#

in life @rotund cypress the superclasses are in common.hpp

dusk sage
#

Macros == Obfuscation? ๐Ÿค”

tough abyss
#

All the code said was "I am tired of people using my code, I am going to macro everything"

#

Probably because macros bounce around a lot makes it harder to folow

dusk sage
#

And why would you name something that isn't a 'base' class, like a 'base' class

#

If you actually looked at half the macros, there is little chaining

rotund cypress
#

i know @tough abyss

dusk sage
#

More convenience

tough abyss
#

@dusk sage Alits Life used to when I worked on it

dusk sage
#

Laziness

#

Macros haven't really changed much

tough abyss
#

I rarely ever see these

dusk sage
#

ACE macros are harder to follow

#

Without considering the 'usefulness' argument

tough abyss
#

#ifdef MacroName(INPUT) (do something here)

dusk sage
#

You make it sound like that's a bad thing

rotund cypress
#

IMO

#

I think that why use macros when you can just type it out

#

For beginners

#

It will be easier

#

To follow

#

And to learn

tough abyss
#

Don't know is it @dusk sage

#

"Header guards"?

dusk sage
#

Tis SQF ๐Ÿ˜‰

tough abyss
#

Then why did BI add them to SQF?

jade abyss
#

Sometimes, they are usefull.

dusk sage
#

^

#

There is little chance you'll run into issues that header guards would be applicable

#

Due to the nature of SQF

#

We're calling, spawning all these functions

#

They won't conflict

rotund cypress
#

But isn't it the same as just typing it out

dusk sage
#

ifdef has more uses than guarding though

#

Ofcourse

#

It's laziness

rotund cypress
#

Yeah

tough abyss
#

I saw one guy use a #define MUTEX()

dusk sage
#

In C++ world and such, you can make far more useful macros

#

Sure you can chain macros in SQF, and it really saves time

rotund cypress
#

yeah ive seen that @dusk sage

tough abyss
#

You can actually do this though in SQF

dusk sage
#

But it can quickly become spaghetti code

#

Do what?

tough abyss
#

__EXEC

dusk sage
#

Yes

rotund cypress
#

C++ aint no SQF though

tough abyss
#

I use line to catch certain errors

#

__LINE__

rotund cypress
#

Also

#

When working in a project

#

Macros will just be a pain

tough abyss
#

__FILE__ is awesome sometimes as well

#

__EVAL
is another neat one.

little eagle
#

ACE macros are harder to follow
that's only because no one reads the doc and asks what X does instead (including me)

#

they're from CBA btw.

gilded rover
#
            mass = 50;
            class MuzzleSlot {
                iconPosition[] = {0.000000, 0.400000};
                linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE";
                compatibleItems[] = {"muzzle_snds_H_MG_blk_F","muzzle_snds_338_black","muzzle_snds_M"};
            };

            class CowsSlot {
                iconPosition[] = {0.500000, 0.300000};
                linkProxy = "\A3\data_f\proxies\weapon_slots\TOP";
                compatibleItems[] = {"optic_Hamr","optic_MRCO","optic_Nightstalker","optic_DMS","optic_ERCO_blk_F","optic_Holosight_blk_F","optic_Arco"};
            };

            class PointerSlot {
                iconPosition[] = {0.200000, 0.400000};
                linkProxy = "\A3\data_f\proxies\weapon_slots\SIDE";
                compatibleItems[] = {"acc_pointer_IR"};
            };
        }; ``` is there anyway to enable all attachments on weapon whithout having to type in everyones code as well as can someone give me the coding for enabling attachment of Bipod?
tough abyss
gilded rover
#

sorry

tough abyss
#

It's okay

#

You'll just find more help there.

rigid plover
#

anybody good with MCC at all? the MCC discord is dead.

weak tiger
#

any idea why (entities "HeadlessClient_F") would be [] whether one is connected or not? 2 modules in editor (and not empty when run from editor)

#

yes, playable

rigid plover
#

For some reason changing the colour of the smoke effect... does not change it

#

its remaining black no matter what

little eagle
#

@subtle glen did you place the HC's inside a vehicle? entities does not report units inside vehicles

weak tiger
#

its ok worked it out

#

skiplobby = 1 means they wont find a slot

little eagle
#

k

#

probably should still use:
(allPlayers select {_x isKindOf "HeadlessClient_F"})

#

that way they are not reported anymore after they disconnect, but again after they connect

rancid ruin
#

i thought headless clients were a kind of abstract client for unloading ai ownership to...but they're actual units?

#

why on earth can you put a headless client inside a vehicle??

little eagle
#

the implementation is... let's say hacky

rancid ruin
#

that is so weird to me

little eagle
#

why on earth can you put a headless client inside a vehicle??
no idea, you could and it's the first problem that comes to mind when using entities command

rancid ruin
#

so like, a headless client has a position and everything?

#

it's just like a normal vehicle?

#

could you kick the HC from a server with a lot of AI and watch the fps plummet?

little eagle
#

probably, never tried

weak tiger
#

yes

rancid ruin
#

what a strange concept

hot crypt
#

How Do I run a script at the beginning of launching a mod? Via #include in the config.cpp or?

rancid ruin
#

preinit / postinit i think

hot crypt
#

where should I put that?

hot crypt
#

lovely thank you!

rancid ruin
#

no problem. another option is to un-pbo other people's work and see how they do it

little eagle
#

How Do I run a script at the beginning of launching a mod?
At game start once per session or at each mission start?

hot crypt
#

@little eagle once per session, for example: loading a unit in the editor without facewear

little eagle
#

so once per placed unit

hot crypt
#

correct

little eagle
#

that is not what once per session means, but OK

hot crypt
#

yeah, wups D: brain shorted once again

little eagle
#

You sure it has to be once per created unit? Because that is really shitty to do without CBA

#

Once per mission would be easy

hot crypt
#

Well the main issue I'm getting is that when I place a unit from my mod, they get random face/eyewear adapted to them

little eagle
#

Oh, then just change the units config

#

So no facewear is allowed for them

#

e.g.

#
identityTypes[] = {"LanguageENG_F","Head_Euro","NoGlasses"};
#

I use this for my German soldiers and they never spawn with glasses

#

first one is the language they speak

#

second one is what heads/faces they can have

#

third is what facewear they can have

hot crypt
#

Oooh fancy!

#

and what about No entry 'bin\config.bin/CfgWeapons.29th_Soldier'

#

tried to find a fix but no one actually 'posted' a way to fix it, just a fixed version

little eagle
#

you referenced "29th_Soldier" somewhere as weapon, but it does not exist in CfgWeapons

#

ctrl + f for that class name and check where it does not belong

#

Maybe also try creating a new mission. When doing addons, the mission can be corrupted with class names that were removed

#

29th_Soldier certainly does not sound like a weapon

hot crypt
#

yeah, it's a uniform ๐Ÿ˜›

little eagle
#

uniformClass = "29th_Soldier"; ?

#

you have to use a different class name for the uniform item and the uniform model / soldier model I think

#

other wise the game chokes

hot crypt
#

that is wrong?

little eagle
#

well, do you have this item in CfgWeapons or not?

hot crypt
#

it's in cfgvehicles tho

little eagle
#

The uniform item (which you can drop on the ground) is a CfgWeapons entry

#
class CfgWeapons {
    class Uniform_Base;
    class UniformItem;
    class BWA3_Uniform_idz_Fleck: Uniform_Base {
        author = "$STR_BWA3_Author";
        scope = 2;
        displayName = "$STR_BWA3_UniformIDZFleckName";
        picture = "\bwa3_units\ui\bwa3_uniform_fleck_x_ca.paa";
        model = "\A3\Characters_F\Common\Suitpacks\suitpack_blufor_diver";
        class ItemInfo: UniformItem {
            uniformModel = "-";
            uniformClass = "BWA3_Rifleman_Fleck";
            containerClass = "Supply40";
            mass = 40;
        };
    };
#

e.g.

#

You need a uniform item and a soldier model / uniform model

#

they both are needed and are connected

#

See: uniformClass = "BWA3_Rifleman_Fleck";

hot crypt
#

small section

little eagle
#

one is named 29th_Soldier the other is 29th_uniform

#

uniformClass = "29th_uniform";

#

I think, instead of
uniformClass = "29th_Soldier";

hot crypt
#

I'm not following

#

mind to explain it a bit what you mean?

#

there is no - uniformClass = "29th_uniform"; - in the cfgWeapons

#

so it is a mission fail?

hot crypt
#

that is in cfgVehicles

#

not in cfgWeapons

little eagle
#

YES BUT YOU HAVE TO WRITE THE CFGWEAPONS CLASSNAME IN THERE TO CONNECT THEM

#

aaaa

hot crypt
#

alright sweet and

#

Is there a way to change that? tried it aswell but no luck..

little eagle
#

displayName

#

those are different soldiers , right?

hot crypt
#

Yep, all of them are different and have a "displayName" set to them with different names but it doesn't apply

little eagle
#

they need different displayName obviously

hot crypt
#

They all have different ones

#

but still show up as "29th Unit"

little eagle
#

In CfgVehicles?

hot crypt
#

correct

#

could it be linked to the other issue?

little eagle
#

no, it will show whatever the displayName in CfgVehicles is

#

if it's the same for multiple classes, they'll all show up the same

#

try restarting the game. maybe eden scripting has some caching of the config going on

hot crypt
#

I'll give it a shot

#

alright, naming issue is fixed

#

No entry 'bin\config.bin/CfgWeapons.29th_Soldier'

#

still remains

#

and the headwear issue is gone aswell

little eagle
#

facewear

hot crypt
#

yeah wups

little eagle
#

headwear is helmets

hot crypt
#

eyewear and facewear issue

#

sorry xD

little eagle
#

What is
uniformClass
in the CfgVehicles classes?

hot crypt
#

uniformClass = "29th_Soldier"

little eagle
#

Does a class named "29th_Soldier" exist in CfgWeapons?

hot crypt
#

negative

little eagle
#

There you go

#

that's all "No entry 'bin\config.bin/CfgWeapons.29th_Soldier'"

#

is telling you

#

no such class

#

What classes do exist in CfgWeapons?

hot crypt
#

"29th_uniform_Pvt","29th_uniform_PFC","29th_uniform_Cpl","29th_uniform_Sgt","29th_uniform_SSgt","29th_uniform_TSgt"

#

and a few more

little eagle
#

Then change

#

uniformClass

#

in the CfgVehicles class

#

to any of these from CfgWeapons

#

accordingly

hot crypt
#

that or this:

#

both are in cfgVehicles

little eagle
#

?

hot crypt
#

which should I change, as I'm guessing the second picture's classes rely on the first picture's class name?

#

which would mean that I have to make a new class like the first picture for earch and every one of the ones shown in the second picture?

little eagle
#

Are we still talkign about No entry ?

hot crypt
#

Correct

little eagle
#

You don't change the class names

#

...

#

You change the uniformClass entry

#

the class names are fine

#

But

#

as I said

#

The uniformClass from the class inside CfgVehicles

#

has to point to a class name inside CfgWeapons

#

Because you have to give your soldier model a uniform

#

And a uniform is a CfgWeapons entry

#
commy2 - Heute um 17:51 Uhr
What is 
uniformClass
in the CfgVehicles classes?

van Gastel - Heute um 17:51 Uhr
uniformClass = "29th_Soldier"

commy2 - Heute um 17:52 Uhr
Does a class named "29th_Soldier" exist in CfgWeapons?

van Gastel - Heute um 17:52 Uhr
negative

commy2 - Heute um 17:52 Uhr
There you go
hot crypt
#

I'm not following anymore, Nevermind, i'll just fiddle around with it

little eagle
#

How is it that difficult?

#

You change uniformClass to a class name from CfgWeapons

#

done

#

lol

#

Even the comment behind the entry says that

#

in your screenshots

hot crypt
#

Thanks a lot! fixed the issues

#

my god that took ages and way to much re-reading to understand

#

sorry for the trouble !

little eagle
#

yw

#

But you sure can be dense

hot crypt
#

although

#

hahaha

#

now it only gives me 1 single texture over and over again -.-

#

fml I feel retarded.

little eagle
#

"texture" ?

hot crypt
#

might be a conflict

#

lemme check

#

just to make sure

#

I can't follow with this: You change uniformClass to a class name from CfgWeapons

#

like, my brain is just retarded or I'm totally missing the simplest of things

little eagle
#

don't change anything yet

#

I'm looking

hot crypt
#

Well that is the changed version

#

i'll revert to the old one

#

there you go

#

this should be the one with the issue

little eagle
#

omg

#

why did you rename 29th_uniform to 29th_soldier ?

#

that is not a soldier, that is a uniform

hot crypt
#

mind blown

little eagle
#

all you needed to change

#

is L382

#

uniformClass = "29th_Soldier"; // This is the classname of your uniform, if you create more uniforms you need to create more soldier classes to correspond with them

#

to 29th_uniform

#

because that actually exists in CfgWeapons

hot crypt
#

same for the one underneath?

little eagle
#

which line?

hot crypt
#

436

little eagle
#

yes

#

there too

#

same problem

hot crypt
#

thats the magic fix I took literally ages for?

#

xD

little eagle
#

Don't tell me I didn't say this over and over again

hot crypt
#

You did

#

my god

little eagle
#

The classnames are fine

hot crypt
#

xDDD

little eagle
#

But the entry is wrong

hot crypt
#

dying of laughter

#

wot

little eagle
#

๐Ÿคฆ

hot crypt
#

aaaaaaaaaaaanddd you lost me again

#

fuck sake.

#

;-;

little eagle
#

why?

hot crypt
#

"But the entry is wrong"

little eagle
#

yes, uniformClass

#

it's a config entry

#

which is different from a class name

hot crypt
#

so now it should be good to go?

little eagle
#

Idk, it's very confusing if you name a uniform solder

#

and I'm pretty sure tons of things will go wrong if you name your uniform item (CfgWeapons) exactly how you name your soldier model /CfgVehicles)

hot crypt
#

let's see

#

if it goes apeshit, well rip

rancid ruin
#

that's not the correct attitude

hot crypt
#

I wont give up tho.

little eagle
#

I think you're having the wrong expectatiions about this

#

you have to fix one error at a time

#

changing one line won't magically fix everything

#

because atm it's a mess

#

tbqh

hot crypt
#

Well I've been fixing errors in this thing for over 5 months now hahaha, started from 0 and slowly working my way up

#

Well the error is still there, everything else works fine

little eagle
#

I could fix it in an hour. But where would the fun in that be. It's really not difficult. ยฏ_(ใƒ„)_/ยฏ

hot crypt
#

back to re-reading

rancid ruin
#

this discord is very resourceful for troubleshooting but i think this whole thing shoulda been in #arma3_config

hot crypt
#

It started with another problem, my mistake

rancid ruin
#

oh yeah, running a script when you launch a mod, i remember ๐Ÿ˜‚

hot crypt
#

right in the feels

#

Alright, I'm going to eat dinner, after that I'll start 'spamming' the #arma3_config channel ;D

bold timber
#

Is there any way to setup a "timer" to call a function every X time, like an "interruption/event" way? I don't like running scripts everytime doing while(1){ sleep(x) do this }; Or, alternatively, "call a function in 30 sec"

little eagle
#

otherwise, no

bold timber
#

Thanks, I will take a look

warped thicket
#

you also have CBA_fnc_waitAndExecute, which you can use in a function and make it call itself in X seconds

#

literally no performance impact

halcyon crypt
#

that doesn't call repeatably unless you do the CBA_fnc_waitAndExecute in the function you're calling

buoyant heath
#

right, waitandexecute is one and done

#

use the perframehandler with a delay for a repeating thing

#

or call your function again at the end of the W&E

halcyon crypt
#

hmm the docs on CBA_fnc_waitAndExecute are a bit contradictory

#

Description says: "Executes a code once in unscheduled environment"
Params says: "_delay The amount of time in seconds between executions, 0 for every frame. (optional, default: 0) <NUMBER>"

buoyant heath
#

Hmm, thought that had been fixed. W&E is one and done

halcyon crypt
#

yeah the header for the script is correct, guess the docs aren't updated yet

little eagle
#

the function header shouldn't be fixed in the release version either. PR was merged 19 days ago

halcyon crypt
#

ahhhh well I checked in the repo

#

actually, it is released ๐Ÿ˜›

#

CBA_A3 v3.1.2.161105

bold timber
#

Yes both functions should do the job, anyway as I avoid having dependable content with other addons I will redo my addon just using vanilla functions.. Thanks all ๐Ÿ˜ƒ

still forge
#

so i have a question, when signing a pbo, is there anything that is required inside it to make its bisign valid? I have a pbo i edited myself and when i try to sign it it still kicks me

tame portal
#

Try using Addonbuilder to pack and sign the pbo, other pbo packing programms sometimes create problems when signing files

#

such as PBOManager

still forge
#

yes thankyou

#

๐Ÿ‘Œ

still forge
#

so i have verifySignatures = 2; on my server, but if i was to remove a mod pbo from my modpack i can still join

dusk sage
#

You'd notice a difference if you added a mod not signed by the server

#

Not removing one

still forge
#

hmm yea

#

is there an easier way of doing this rather then adding some checks to my required addons in mission file?

#

.sqm that is

worldly zinc
#

Anyone know offhand the script to spawn in an MQ-12 falcon with AI?

#

Every time I spawn it in all I can do is "hack UAV"

#

and that doesn't allow direct control of pilot or turret

#

createVehicleCrew (_vehicle); ?

still forge
#

don't you have to link them together or some shit

#

if your using editor

dim owl
#

hey, i found a peeing script but i dont know how to use this in mp. there are particles which are created local and i tried to create them global but its not working. i tried it with mp function and remote exec no solution. the particles are created foreach client itself but i cant the pee of other players

tough abyss
#

@dim owl I won't help you ever implement pissing on people

dim owl
#

@tough abyss Thats for roleplay...

tough abyss
#

roleplay?

#

Altis Life?

#

You've got buckles and none.

worldly zinc
#

you can remote exec the script that creates the particles

#

troll

dusk sage
#

Good input as always @tough abyss ๐Ÿ‘

little eagle
#

It is a pretty dumb request, tbqh

halcyon crypt
#

Postal ftw ๐Ÿ˜

icy raft
#

@worldly zinc Don't. Create the particle array in the config and then call that array local to all clients

rancid ruin
#

did someone just ask how to script pissing

#

did i just see that

tough abyss
#

Yeah there is an animation for it

rancid ruin
#

vanilla?

#

is there one for poop as well?

native hemlock
#

iirc it's part of a campaign animation

spice kayak
#

Curious; is there any way to temporarily disable night vision mid-mission, or at a certain point? I know of the DisableNVGEquipment, but that seems to be exclusive to vehicles.

rotund cypress
#

Hey is there any possibility to disable a scroll action? E.g. get out of a vehicle through scrolling

rancid ruin
#

you could just lock the cargo or vehicle

native hemlock
little eagle
#

^ this sounds easier and cleaner

#

@spice kayak Not really, except for removing all the NV devices of the players. They could always pick up new ones though

spice kayak
#

Yeah, good point. I wanted some sort of like, 'EMP' type effect is all, and NVG would be one of those things affected.

rotund cypress
#

Thanks guys

#

I think what @native hemlock sent me is most suitable for what Im doing ๐Ÿ˜ƒ

little eagle
#

The problem with it is, that it won't take away to menu option.

rotund cypress
#

Doesn't need to take it away

little eagle
#

It just won't do anything

rotund cypress
#

I guess I will be able to show a hint which is just what I'm after ๐Ÿ˜ƒ

little eagle
#

Yeah, then go with that

#

@spice kayak
If you're using CBA, then this works:

// init.sqf
commy_disableNVG = true;

["visionMode", {
    params ["_unit", "_mode"];

    if (commy_disableNVG && {_mode == 1}) then {
        _unit action ["NVGogglesOff", _unit];
    };
}] call CBA_fnc_addPlayerEventHandler;
#

Just flip commy_disableNVG to true or false, if you want to enable them or not

spice kayak
#

Oh, that's amazing. I'll have to check that out, thanks!

little eagle
#

the event handler only fires if you change the NVG mode atm, so to kick out all players out of the NVG, use:

player action ["NVGogglesOff", player];
commy_disableNVG = true;
spice kayak
#

is commy_disableNVG part of CBA, or variable name? I've just tried googling it and gotten nothing. Sorry, I'm just getting back into things after not touching A3 for a year!

little eagle
#

no, it's a global variable name I just made up

#

it's used inside the evnt handler to toggle it on or off

spice kayak
#

Ah, I figured that was the case.

#

That makes sense.

#

Thought it was too coincidental with the naming haha.

little eagle
#

Well, I did create CBA_fnc_addPlayerEventHandler. It was a port from ACE

spice kayak
#

Oh, alright then! Man, I think the worst part about all this is having to probably re-learn everything about scripting. Ugh.

#

I had a good thing going too, but I'm sadly probably going to have to scrap nearly all of it. It's basically japanese to me at this point, and I can't read japanese D:

little eagle
#

Me neither. I can read SQF though.^^

spice kayak
#

Sucks, programming used to be a big part of my life, then life happened, and now it's like, what on earth is all this mumbo jumbo?! Well, I'll probably get started on it this weekend. Still not sure how to make the mission better though. Had a basic idea, but the execution is mediocre at best.

little eagle
#

SQF is the only programming I ever did. Computers are boring if it's not for a game with explosions and all that

#

and soldiers and tanks

#

It's like playing with programmable tin soldiers

spice kayak
#

Ha, my time with programming wasn't that enjoyable sadly :P

little eagle
#

For me it's like someone who learns circuits just for his model railroad.

#

Oh you will have to find enjoyment in doing Arma modding. Otherwise you won't be able to pull through

#

Alternively masochism

#

Error: Type Not a number, expect: Number, Not a number

noble juniper
#

what a lovely message

spice kayak
#

I used to find some enjoyment in it a year ago when I was making this mission of mine, but due to hard drive corruption, I had to wipe the drive. Sadly, I thought I had lost the whole damn thing, so I just gave up. Until yesterday, when I found a build of it on google drive. Not the latest, but close enough to. I really want to finish it, turn it into something great, but I just feel I can't anymore haha.

little eagle
#

my favourite error message:

_a = []; _a set [0, _a];

results in:

noble juniper
#

no problem dude, commy is here to help you ๐Ÿ˜„

little eagle
#
20:45:51 Error in expression <_a = []; _a set [0, _a];>
20:45:51   Error position: <set [0, _a];>
20:45:51   Error 25028600 elements provided, 0 expected
spice kayak
#

Well, commy can finish it if commy likes :P

#

I feel that's probably what it'll come down to, honestly; asking someone else to review it, take it, do whatever they want with it, make it something more than I ever could.

#

It could be a really fun mission, given the basic concept of it.

noble juniper
#

if you need security testing, ill gladly help.

spice kayak
#

Ha, security testing? I think I need ideas more than anything. I'm surprised I even managed what I did.

noble juniper
#

i'm good in having ideas. just add me on steam, same name and picture

spice kayak
#

The basic idea of the mission was a coop search and retrieve, with one person's goal to secretly sabotage the mission. It's randomly decided, so there's no way to know who it is. I think this screenshot best details what I was going for. http://i.imgur.com/JUcvI9l.png

#

The commander unit also had the ability to track the person in posession of the terminal, though the intervals of the scans were dependant on how many players there were. The more players, the less often you'll get information. A means of balancing, in a way. It was fun, but with the way it was structured, you needed at least 6 people to play the mission. Commander's screen: http://i.imgur.com/uMzNysc.png

#

I also love color coding. Getting that done was fun.

tender fossil
spice kayak
#

Ha, that doesn't surprise me at all.

#

@noble juniper Sorry about that, I've added you now. Would you mind if I added you too, @little eagle?

little eagle
#

I don't really use discord for PMs

spice kayak
#

Ha, all good. I did mean on steam though :P

#

But yeah, if I need any help, I'll ask on here!

halcyon crypt
#

@little eagle I had MakePBO errors suddenly complaining about duplicate definitions of the IS_ADMIN macro, did anything change related to that recently?

#

the fault was on our end but it wasn't there before

warped thicket
#

Mikero changed it in his tools

#

you need to #undef <macro>

#

for whatever reason

halcyon crypt
#

have been using the same tool versions for months now ๐Ÿ˜›

warped thicket
#

well you must have updated after he released it

#

or just didn't notice it

rancid ruin
#

is there a ctrl type for drawing lines in displays/dialogs?

halcyon crypt
#

pretty sure it has been a change in CBA that caused the error since there hasn't been changes on our side, not that it matters in any way since it's fixed already. Was just wondering. ๐Ÿ˜ƒ

little eagle
#

No, marceldev

#

It's a bugfeature in mikeros tools

#

it errors now when you redefine a macro. jonpas posted the solution

#

the error is not needed, but mikero thinks it is and you can't disable it

halcyon crypt
#

I know it's an "issue" with mikero's tools but we haven't changed the code and I haven't updated the tools in a couple of months so I just wondered why it started throwing errors suddenly

little eagle
#

two macros share the same name

rancid ruin
#

say i have an array of 5 or so positions, what's the best way to select the one which is closest to X position?

jade abyss
#
_Nearest = 1000;
_Nearest_Pos = [0,0,0];
_PlayerPos = getPos player;
{
    if(_x distance _PlayerPos < _Nearest)then
    {
        _Nearest_Pos = _x;
        _Nearest = _x distance _Nearest;
    };
}forEach _MyPosArray;
systemchat format["NearestPos: %1 - Distance: %2", _Nearest_Pos, _Nearest];

example

rancid ruin
#

thanks, i'ma test that now

jade abyss
#

ah wait, that won't work^^ gimme a sec. Writing in Discord is crap

#

@rancid ruin Check again.

#

Alternatively: You can start with:

_Nearest = ((getPos player) distance (_MyPosArray select 0));```
rancid ruin
#

isn't there a function for sorting arrays?

#

i seem to remember using it once and it didn't work

jade abyss
#

There is one, but afaik there is nothing that sorts an existing array by its distance to an object.

#

nearestObjects had a sorting Function in it, iirc.

dusk sage
#

I think there is a BIS function

jade abyss
#

(or an similar one)

dusk sage
#

That you can pass a func to

#

Third parameter

jade abyss
#

max. number of 10 input params is supported <- meh

rancid ruin
#

yeah i could never get that bis sort function to work

dusk sage
#

Or you could do

rotund cypress
#

Is there a way to increase native sprinting speed without using setVelocity?

rancid ruin
#

setAnimSpeedCoef

jade abyss
#

Yep

#

BUT: That also increases every other existing anim

rotund cypress
#

Ok

rancid ruin
#

that's what makes it fun

rotund cypress
#

Thanks

dusk sage
#
_distances = _positions apply {_x distance _definedPoint};

_closestPos = _positions select (_distances find (selectMin _distances)):
#

On phone, may not be coherent

jade abyss
#

@rancid ruin Put it on 100, allowDamage false; and run around the Map ๐Ÿ˜„

rancid ruin
#

i was hoping for use of min function, i like min

#

not seen selectMin before, nice

#

yeah if you don't allowdamage false then you die when flying from small bumps in the terrain, it's awesome

jade abyss
#

Yep

rotund cypress
#

I used to use setVelocity for speeding up

#

But

rancid ruin
#

it's like low gravity benny hill

rotund cypress
#

That killed me even moving forward the slightest

jade abyss
#

setVelocity + MP = yeah.... no. Just .... no.

rotund cypress
#

Yep

rancid ruin
#

ah selectMin is still dev version only

dusk sage
#

Ah, my bad

#

You can use min aswell

#

But will have to type it all out manually, or loop still

rancid ruin
#

has anyone experimented with any of the new sound controller stuff yet?

rotund cypress
#

Hahah 100 wasnt that fast ๐Ÿ˜„ @jade abyss I could atleast get 200 metres without dying ๐Ÿคฃ

#

It was fast though

tough abyss
#

@jade abyss ...

#

Invade & Annex uses that...

#

on a jet

jade abyss
#

wich bitch highlights me

tough abyss
#

_veh setVelocity [0,0,0]

#

in MP

jade abyss
#

Yeah? And?

tough abyss
#

You said don't use setVelocity in MP?

#

reason?

jade abyss
#

Constant using of e.g. setVelo[100,0,0]; is bs in MP

tough abyss
#

Reason?

jade abyss
#

Read?

little eagle
#
//_positions _origin

private _temp = _positions apply {[_x distance _origin, _x]};
_temp sort true;
_temp select 0 select 1

_origin being the center and _position being a bunch of 2d or 3d positions

#

fastest way to get the closest one in SQF

#

on average

rancid ruin
#

that's beautiful

#

thanks @little eagle

#

you are the master of logic and clean code

tough abyss
#

^ false

tough abyss
#

This is the last thing he needs to heard ๐Ÿ˜›

#

Lost some hours by Arma 3. Why?

#

If you create a castle tower object on the client and then run a code in server that get its position, vectorDir, vectorUp... the vectorDir will be wrong. What i do now is get all the info on client and send it to the server.

#

He needs to heard "i love you!" from a very in love woman.

meager granite
#

Position and orientation vectors set to local object do not syncronize to server instantly

tough abyss
#

Interesting.

#

is setPos instant?

meager granite
#

No

#

You can setpos as much as you want on local entity, updates will be sent to server (and other clients later) in normal pace

#

setPos on remote entity though will instantly send setpos packet to server.

#

Can't recall if setPos'ing remote entity will make it move right away on local client, might be dependent on simulation type.

paper rain
#

setPos's effect is always global. Does any command sync instantly? I wouldn't find it surprising if everything was tied to refresh time.

meager granite
#

No, setPos on local entity doesn't broadcast anything

#

Position syncs to server and then other clients eventually just like if you weren't setPos'ing anything, through regular updates.

tough abyss
#

What would the effect of setting the position of something in the non-scheduled environment be randomising the positions?

paper rain
#

I can't find that anywhere in the docs.

#

There's only a note for Arma 1.00 to 1.06

meager granite
#

I came to this conclusion through experience

#

@tough abyss To local or remote object?

tough abyss
#

either

#

Would it crash the server?

meager granite
#

Local: It will move somewhere each frame on your screen, will move to some position through some intervals of time on server, even less movement on other clients, depending on distance from their camera to object

#

Regularity of updates to server and from server to clients depends on simulation type, buildings update less, vehicles much more often

#

Remote: You'll spam server with setpos messages, infrequent position change on your screen, infrequent on server, infrequent on other clients.

#

Basically setpos'ing remote entity lot of times is not a good idea, only some positions will apply in the end

tough abyss
#

What about set posing on a server-local entity?

meager granite
#

Same

#

Orientation vectors are not broadcasted through commands at all, you can execute them as much as you want, if it will be remote entity, they will reset on next update from server, if it is local entity server will eventually get them from you.

tough abyss
#

Invade and Annex repeatedly setVelocity on a jet

meager granite
#

Same for setVelocity, it doesn't send any packets, you can execute it as much as you want

paper rain
#

What?

tough abyss
#
_air spawn
    {
        private["_x"];
        for [{_x=0},{_x<=200},{_x=_x+1}] do
        {
            _this setVelocity [0,0,0];
            sleep 0.1;
        };
    };
paper rain
#

setVelocity's effect is also global

meager granite
#

Command itself doesn't send any packets

paper rain
#

With local arguments

meager granite
#

Velocity will be eventually synced to server and other clients by normal means

paper rain
#

makes sense

tough abyss
#

Is what I posted above?

#

Bad?

meager granite
#

No, you can set velocity as much as you want

#

The only bad practice here would be to set position to remote entity often

#

Setting velocity or orientation vectors to remote entity is not an issue, they will just update on your client and reset to actual values from server eventually

tough abyss
#

Is Patrol Ops 3?

#

Better than Invade & Annex?

#

In general as a platform to build from?

halcyon crypt
#

I'd say I&A? PO3 probably has a lot of legacy code from the A2 era

#

That's a very uneducated opinion though ๐Ÿ˜„

molten quail
#

Anyone here looking for a unit to join? im recruiting to my unit.

halcyon crypt
molten quail
#

๐Ÿ˜ƒ imnot sure how to call it, its a milsim unit

halcyon crypt
#

wrong channel... see the above

molten quail
#

ok thanks

tough abyss
#

Just asking, if no one know, please just ignore me, and sorry... but, can i use realBoundingBox function in simple objects? ๐Ÿ˜„

#

I'm converting all buildables to simple objects, and looking all the related code to find possible problems, one problem was using typeOf on then (obviously :P)

#

So since i create the simple objects using alternative syntax (that have classname as argument) i store the classname in a object var "cnm".

#

And i can use typeOf like: (_obj getVariable "cnm") typeOf ["House",configFile >> "CfgVehicles"];

#

typeOf _simpleObject return "".

#

(i play so bad that you recruit me in a different way: you convince your oponent to recruit me :P)

rotund cypress
#

Hey Guys, is it possible to make this a tad transparent? cutText ['', 'BLACK OUT', 0.5];

#

I'm looking for a black out effect to do upon opening a menu but then having it a bit transparent so you still can see a bit through

little eagle
#

@๐† ๐‡ ๐ŸŽ ๐’ ๐“#9777

you are the master of logic and clean code
^ false
T_T

#

Who is the master?

#

@tough abyss

#

damn unicode

rancid ruin
#

you are the master commy

#

that little two liner was awesome

rotund cypress
#

Thanks @rancid ruin

#

Also, is there anyway to see script performance? How much performance or so a script takes? Except for the debug console

#

I mean like

#

All the scripts currently running

rancid ruin
#

think there's some diag functions yeah

#

i tend to just write my scripts as modularly as possible so i can test one at a time

rotund cypress
#

Yeah, I have problems with lag atm and every action being very slow but right now Im going through my git repo to see what could be causing it

#

Not really optimal

little eagle
#

this is used to determine the time a script takes to execute

#

the debug console button is a wrapper for this function

#

it does not work in MP atm for whatever reason

#

and it's not a good method when commands like createVehicle are involved, since that means that for every tested cycle, one vehicle will be created

rotund cypress
#

Okey thanks I'll have a go at that

rancid ruin
#

what would be the best way to approach lerp'ing the position of a draw ctrl event handler?

#

e.g move a drawn icon from point A to point B on the map ctrl at a speed in meters/s

tough abyss
#

Simple Objects: You can't set variables on simple objects ๐Ÿ˜ฆ and i use this a lot. Really worth to convert 2000+ buildings from normal building (created with createVehicle) to simple building objects (created with createSimpleObject) in terms of performance?

tough abyss
#

How would one script the removal of rounds fired from a vehicle mounted gun to prevent people from firing?

#

(safezone purposes)

rancid ruin
#

@tough abyss you could setvariable on logics or locations that you create at the position of a simpleobject

halcyon crypt
#

@tough abyss using boundingBoxReal on a simple object should probably work because it still has collision stuff enabled, I think

vague hull
#

does
_icon ctrlSetFade 0.5;
_icon ctrlcommit 1;
_icon ctrlSetFade 1;
_icon ctrlcommit 1;
sleep the thread? and are the single commits quequed or do I need to put a sleep in between?

meager granite
#

no it doesn't sleep

vague hull
#

alright, It doesnt queue too I guess?

meager granite
#

There is no queue

#

when you commit second time it changes target values to whatever you commited the last

jade abyss
#

@vague hull You need to add an sleep/uisleep (after the 1st CtrlCommit) manualy to it

vague hull
#

Alright, thx to both of you!

#

I might need to figure out a better way to do blinking icons then ..

#

dont wanna start extra threads for it

tough abyss
#

I - Chernarus map, no AI, player positioned on the void (outside the map):
Extra Objects: 0 / FPS: 108 fps
Extra Objects: 10000 simple objects / FPS: 103 fps
Extra Objects: 10000 complete objects / FPS: 83 fps
II - Chernarus map, no AI, player positioned in Chernogorsk:
Extra Objects: 0 / FPS: 58 fps
Extra Objects: 10000 simple objects / FPS: 56 fps
Extra Objects: 10000 complete objects / FPS: 47 fps

#

@rancid ruin @halcyon crypt thanks for the info.

tame portal
#

I like how simpleobjects I'm the Dev branch once pulled more FPS than normal objects ^^

rancid ruin
#

that's quite a difference in fps

open vigil
#

While I don't doubt the numbers, I'd love to see something official on that.

tough abyss
#

@rancid ruin just tested with 30000 objects now.

#

Player on void: 0 so and 0 co - 108 fps / 30K so and 0 co - 97 fps / 0 so and 30K co - 56 fps

#

Player on chernogorsk: 0 so and 0 co - 58 fps / 30K so and 0 co - 52 fps / 0 so and 30K co - 36 fps

#

@open vigil i'm sure to change anything i need to use simple objects now. This is a decision i could not archieve just with someone saying "Yes, simple objects is a lot better".

open vigil
#

I'm not disagreeing. It's just something I'd love for Bohemia to produce.

tough abyss
#

All the buildins are on the same place in all the tests, the difference is that simple objects building have a different Z position because i was not able to use the createSimpleObject alternative syntax that alow use of ASL positioning.

#

createSimpleObject ["building_class_name",ASL pos]; dont work.

#

it says "building_class_name" is missing.

rancid ruin
#

load up vr terrain and spawn 20k of the 1m blocks within viewing distance

#

that will rinse your fps

tough abyss
#

And i spawned 30K mostly buildings, not blocks, in chernarus!

rancid ruin
#

yeah i was trying to make minecraft in vr terrain

#

arma can't handle rendering that many blocks though

tough abyss
#

i see, the blocks was a lot near.

#

on the 30K test in chernarus the buindings was 89 meter away from the other

#

in a 89 meters grid

#

@open vigil i understand mate, just taking advantage of the chance to talk more about the test

meager granite
#

Go hardcore and script your own occlusion culling to hide blocks out of sight /s

rancid ruin
#

onEachFrame {{lineIntersectsWith..}foreach _20kBlocks}..

dusk sage
#

_20kBlocks ๐Ÿ‘Œ

rancid ruin
#

i think i got 6fps with that many blocks on screen

#

fps would go in to minus figures with some scripting on top

dusk sage
#

Negative amount of frames per second ๐Ÿค”

native hemlock
#

I'm confused if you are just pointing out that simple objects don't really affect FPS, or that replacing map objects with simple objects gives better FPS. I don't think you'll see any benefit from replacing map objects with simple objects. Map objects are likely already "simple" objects in the engine. You would also lose destruction effects, AI pathing, and probably some occluding.

#

(when I say you I'm referring to Donnovan)

tough abyss
#

What is the best way to profile performance @dusk sage

#

?

#

other than diag_codePerformance ?

#

diag_tickTime ?

native hemlock
tough abyss
#

What does this @native hemlock exportJIPQueue do?

#

or logentities?

native hemlock
tough abyss
#

Worked with Patrol Ops before?

#

Quiksilver?

#

Behaves similar to Invade & annex

#

Not a good option for our milsim group?

#

We have a pretty big unit

#

We are currenly running liberation.

#

It's an FPS hog

#

Ever played liberation?

#

and noticed how laggy it is?

#

What should I build upon?

#

I&A or Liberation?

#

I have noticed.

#

It's why I've been working at modularising I&A

#

But as I change more and more

#

the key indicators of being I&A

#

are being lost.

#

I also use a Framework present in the I&A

#

used in my missions.

#

So our I&A is both part framework core

#

and non-framework

#

I've learned a considerable amount from Patrol Ops 3 code

#

and I&A + Liberation

#

It varies

#

Depends on the configs values

#

It's kind of weird.

#

It works out the "aggressiveness" + AI count together

#

It's spawnable zone limit

#

is about 150

#

People trigging several zones at once == bad

#

@native hemlock on my mission players can place Arma 3 objects on the map, its a construction system. So instead of creating those objects with createVehicle i will create then with createSimpleObject. But i need to make some changes because simple objects dont allow some commands like, i know until now, typeOf and setVariable.

#

I&A is very good

#

and learning from that

#

and applying things in Patrol Ops 3

#

to I&A appears to be working

#

Actually no.

#

And I never see it?

#

On.. any server?

#

I remember playing Dom 2 on A2

#

We allowed to edit / build on it?

#

@tough abyss but since its all about buildings, i compared "complete" building objects with simple buildings objects. Motorized vehicles will continue to be created with createVehicle.

#

I found that the event handler being used by my framework could be apply to any attack message

#

Radiotower

#

The radiotower eventhandler is controlling everything

#

It's apart of a modular framework

#

Not really.

#

The EH can be applied to anything that involves objectives

#

@meager granite i avoid to use hideObject because i don't know the badies it generate. But since you is sugesting that, so must not be that bad. There is any gain in use hideObject in a custom building that is out of the player view distance?

#

that involve blowing stuff up

#

From VIPs, to radio-towers

#

The events are standalone

#

taking the "killed handler"

#

Making it into a function

#

Then you just hook that function

rancid ruin
#

sa matra was being sarcastic about hiding stuff out of sight

tough abyss
#

So the flexibility is maintained

#

Yeah basically

#

but make them variable parameters

#

The best thing about EH handled mission objectives

#

Is as soon as they fire

#

They can be just connected to a listening function

#

When the radiotower is blown up

#

For example I wrapped into it the remoteExec hint stuff I&A came with base line

#

So the mission flow was handled by the EH

#

For the MAIN AO

#

params [
    ["_radioTower",objNull],
    ["_unitsArray",[]],
    ["_dt",objNull]
];
_radioTower addEventHandler ["killed", {
["The tower has been destoryed and was handled by a handler"] remoteExec ["AW_fnc_globalHint",0,false];
private _targetCompleteText = format [TakenAOmsg,AO_String_Name];

    [_targetCompleteText] remoteExec ["AW_fnc_globalHint",0,false];
    ["CompletedMain",AO_String_Name] remoteExec ["AW_fnc_globalNotification",0,false];
    //Clean up the AO of vehicles and infantry
    deleteVehicle _dt;
    [enInfantryArray] spawn QS_fnc_AOdelete;
    [enVehicleArray] spawn QS_fnc_AOdelete;
        private _aoClean = [] execVM "scripts\misc\clearItemsAO.sqf";
        private _MarkersClean = AOMarker_IDs spawn GG_fnc_deleteMissionMarkers;
        waitUntil {scriptDone _MarkersClean};
        waitUntil {scriptDone _aoClean};
        
}];        
#

That sort of thing

tame portal
#

That's how event based programming works

tough abyss
#

Exactly.

#

I also noticed EH's cost less than scripts

#

Not sure why.

#

How all my code works, is 1 module is made from the next.

tame portal
#

HandleDamage eventhandler, check for condition, return damage

tough abyss
#

^

#

Thats how my code works.

#

I also have another option open

#

CBA_A3 written event handlers

tame portal
#

You can simplify it by tons

#

For example

#

Simply attach a variable to the Tower

#

Make it true as soon as someone plants the explosive

tough abyss
#

PV it?

#

To the server

tame portal
#

Doesn't matter in this case, if its my, it should

#

*MP

tough abyss
#
_tower setVariable ["hasBeenPlaced",true,true];
tame portal
#

Just make your conditions as easy as possible so code running it can check is easily, use eventhandlers and stick to it

#

It will save you a lot of performance issues with scripts

tough abyss
#

In OS programming the eventhandlers are called "SIGNALS"

tame portal
#

For example, many of those life servers have modded vehicles and since the creators don't know how to script they put in a loop for each vehicle instance to wait for a condition then animate a light bar
Why not just hook up the addAction on the vehicle or even better make it key based

tough abyss
#

Some of it is.

tame portal
#

That's really the goto example for bad programming

tough abyss
#

KeyHandler based

tame portal
#

Some

#

You're talking 10% here

tough abyss
#

Every life-servers I hate

#

So is this bad programming?

#
while {true} do {//badcode///};
#

?

tame portal
#

It's death to SQF

tough abyss
#

Well.

tame portal
#

Well do some stupid stuff in there and you see yourself with low frames. It obviously depends on the code inside of it

tough abyss
#

I&A uses largely while {true} do {};

#

Could also run that event based too

tame portal
#

While loops are really just the emergency solution. If something cannot be eventbased because of missing engine functions

tough abyss
#

use a scheduled inside an EVH

#

[_var] spawn { ///scheduled code // };

#

That way large pieces can be evaluated by unscheduled / scheduled

#

Not sure if thats a bad idea.

tame portal
#

You can also use onEachFrame handlers instead of while true, it runs less often

tough abyss
#

I thought it ran more?

#

How fast does while {true} do {};

rancid ruin
#

surely while just runs as often as the code takes to execute?

tough abyss
#

run ?

#

Well come to think of it

tame portal
#

While true is almost always faster and executes multiple times

#

If you aren't doing a 10 second CPU intensive operation of course

tough abyss
#
private ["_AO","_missionList","_currentMission","_nextMission","_loopTimeout","_isDebug"];
//Added beugging system. 
_isDebug = true; 
_loopTimeout = 20;

_missionList = [
"region_manager"
];

//if (PARAMS_AOReinforcementJet == 1) then {_null = [] execVM "mission\main\CAS.sqf";};        

/*
_currentMission = execVM "mission\main\region\regionCE.sqf";

waitUntil {
    sleep 5;
    scriptDone _currentMission
};
*/

while { true } do {
        
    // _mission = _missionList call BIS_fnc_selectRandom;
    // _missionList 
    _AO = compile "GG_fnc_regionManager";
    _SelectRand = floor(random(count(_missionList)));
    _currentMission = [] spawn (MissionNameSpace getVariable "GG_fnc_regionManager");
    
    diag_log format ["Mission Selected %1",_AO];
    
    waitUntil {
        sleep 5;
        scriptDone _currentMission
    };
    sleep _loopTimeout;
};
    
    
#

Replacing that while {true} do {}

#

with ```
_EHManager = addEventHandler ["eachFrame" { // do code // }];

tame portal
#

I assume that runs serverside?

tough abyss
#

Yes

#

Only SS

tame portal
#

Obviously that makes less sense in this case..

tough abyss
#

Probably would be better to do a _handle = while {true} do { [_somevars] spawn { waitUntil { scriptDone _handle};

#

?

tame portal
#

One loop on the server is fine

#

Although

#

Im pretty certain you don't need one at all

#

If it the mission isn't time limited

tough abyss
#

It

#

It's not*

#

It's based on the amount of enemies

#

and whether the radiotower is destroyed

#

The main mission anyway.

#

It also uses a createTrigger

#

To check if there is any Opfor left

#

It would probably be a good idea

#

To remove the createTrigger too

#

Replace it for EH based

#

with a tiny while loop in it

#

to check if the enemy count < threshold

#
waitUntil {_towerDestroyed && east countSide enemyUnits }; 
#

No no.

#

It would fire the killed handler

#

then inside the

 [] spawn { 
    waitUntil {_towerDestroyed && east countSide enemyUnits};
 };
#

Like that?

#

That way the handler would temporarily suspend

#

Halt until the condition become true

#

Then terminate

rancid ruin
#

do you guys just stick all your functions in a big file? no cfgFunctions?

tough abyss
#

Mine are all cfgFunctions

rancid ruin
#

a file compiler?

tough abyss
#

params [
    ["_radioTower",objNull],
    ["_unitsArray",[]],
    ["_dt",objNull]
];
_radioTower setVariable ["towerDestroyed",false];
_radioTower addEventHandler ["killed", {
["The tower has been destoryed and was handled by a handler"] remoteExec ["AW_fnc_globalHint",0,false];
private _targetCompleteText = format [TakenAOmsg,AO_String_Name];

    [_targetCompleteText] remoteExec ["AW_fnc_globalHint",0,false];
    _radioTower setVariable ["towerDestroyed",true];
    waitUntil {
        towerDestroyed && (east countSide enemyUnits < enemyLeftThreshold }; 
        
    ["CompletedMain",AO_String_Name] remoteExec ["AW_fnc_globalNotification",0,false];
    //Clean up the AO of vehicles and infantry
    //Deprecated detection method. 
    //deleteVehicle _dt;
    
    [enInfantryArray] spawn QS_fnc_AOdelete;
    [enVehicleArray] spawn QS_fnc_AOdelete;
    
    
        private _aoClean = [] execVM "scripts\misc\clearItemsAO.sqf";
        private _MarkersClean = AOMarker_IDs spawn GG_fnc_deleteMissionMarkers;
        waitUntil {scriptDone _MarkersClean};
        waitUntil {scriptDone _aoClean};
        
}];        
#

Purely event based now.

#

Now that would be cool

#

I can as I said use CBA_A3

#

XEH

#

Ever used CBA_A3?

#

@open vigil On my tests about simple objects, the server had more or less 500 normal motorized vehicles... with 200 motorized vehicles the percentage fall in fps for spawning 30K simple objects is even better!

little eagle
#

why the heck would you want that to evaluate every frame?
PFH does not execute code every frame, but every N amount of seconds. It's a CBA (ACRE originally) thing
you're thinking of onEachFrame
waitUntil loops execute every frame. And they take away scheduler time from every other script. Addons simply should not use them, as mission scripting becomes dependant on the used addons and therefore unpredictable.

dim owl
#

hey im trying to add a action to a tree. it will not work and i dont know why. heres my code:

_test = nearestTerrainObjects [player, ["Tree","Small Tree"], 10];
{
    _tree = (_x select 0);
    _tree addAction ["<t color='#FF0000'>Testaction</t>", {hint "test"}];

}foreach _test;
#

there is a german server which get it work with the trees. i think you can do that ๐Ÿ˜„

#

okay

#

ok thx

little eagle
#

my plan would be:

  • create game logic
  • place near tree
  • setvar the tree object in a logic variable
  • addAction to the logic
  • read the belonging tree with getVar
#

I wonder if object references are serialized for streamed objects or if they become null

#

I don't mean the id, but the object reference

#

guss you can use nearestObject too and just save the type

dim owl
#

its not working ๐Ÿ˜ฆ any other ideas ?

little eagle
#

I'm writing something

dim owl
#

thank you for your help ๐Ÿ˜—

#

yeah sure ๐Ÿ˜ƒ

#

@tough abyss

little eagle
#

Is this action supposed to belong ton every tree or jut some?

dim owl
#

does not work for me with the copy to clipboard :/

#

@little eagle just for some in near of a marker

#

okay

#

IT WORKED!!!!!! thank you so much!!!!

little eagle
#

you can use in with strings

#

toLower. I think modelInfo is all lowe case already

#

all trees in Arma?

#

What even defines a tree in Arma.

tough abyss
#

Check the nearObjects

#

And it's superclass