#arma3_scripting

1 messages ยท Page 458 of 1

lone glade
#
["ACE_rateOfFireL00",["reloadTime"],"Rate of fire",[true,true],[{[(_this select 0) select 0,  _this select 1,  [[-1.4,  0.31],  [1,  0.01]]] call ace_arsenal_fnc_statBarStatement_default},{[(_this select 0) select 0,  _this select 1,  [[-1.4,  0.31],  false]] call ace_arsenal_fnc_statTextStatement_rateOfFire},{true}],5],
["ACE_accuracyL00",["dispersion"],"Accuracy",[true,true],[{[(_this select 0) select 0,  _this select 1,  [[-4,  -1.7],  [1,  0.01],  true]] call ace_arsenal_fnc_statBarStatement_accuracy},{[(_this select 0) select 0,  _this select 1,  [[-4,  -1.7],  false]] call ace_arsenal_fnc_statTextStatement_accuracy},{true}],4],
["ACE_maxZeroingL00",["maxZeroing"],"Range",[true,false],[{[(_this select 0) select 0,  _this select 1,  [[0,  2500],  [0.01,  1],  false]] call ace_arsenal_fnc_statBarStatement_default},{},{true}],3],["ACE_impactL00",["hit","initSpeed"],"Impact",[true,false],[{[_this select 0,  _this select 1,  [[0,  3.2],  [-1,  1100],  2006]] call ace_arsenal_fnc_statBarStatement_impact},{},{true}],2]
,["ACE_massL00",[],"Weight",[false,true],[{},{[_this select 0,  _this select 1] call ace_arsenal_fnc_statTextStatement_mass},{true}],0]

this is a page

#

and yes I could use findif

ruby breach
#

Now replace all of those selects with # ๐Ÿ˜„

lone glade
#

no

ruby breach
#

Ahaha

lone glade
#

is an alias of select that breaks macros has 0 speed improvements (because it's an alias) and is less readable

#

it has higher precedence, sure, but who cares about that

ruby breach
#

(It's worth noting I was joking, lest I sound like an idiot)

lone glade
#

can't read sarcasm, and i've seen people think that^

#

I have seen things you wouldn't believe

little eagle
#

: I have seen things you wouldn't believe
I too was on the internet in the late 90s.

lone glade
#

they had internet in the eastern block?

little eagle
#

late 90s
eastern block
:thonking:

winter rose
#

wall = 1989

gleaming oyster
#

Berlin?

still forum
#

no deuschland

little eagle
#

๐Ÿ‡ต๐Ÿ‡ฑ Thuringia

lone glade
#

lies commy

gleaming oyster
#

Lies and Deceit

lone glade
#

anything past berlin is still the eastern block

little eagle
#

You do realize that Thuringia is technically to the west of Berlin?

lone glade
#

nope, look like east to me

little eagle
#

I once knew a guy that would've said that it lies to the east of Berlin if you look "downwards from Denmark".

still forum
#

oh no. Don't get started about vectors again

little eagle
#

I love em, and how some people think sometimes.

quasi rover
#
hint str[typeOf cursorObject, crew cursorTarget];
//["B_UGV_01_rcws_F",[B Alpha 2-1:1 REMOTE,B Alpha 2-1:2 REMOTE]]

what's the REMOTE mean?

still forum
#

It means they are remote and not local

#

the remote has the same meaning as the english word "remote"

quasi rover
#
//["B_UGV_01_rcws_F",[B Alpha 2-1:1 REMOTE,B Alpha 2-1:2 REMOTE]]
//["B_UAV_05_F",[B Alpha 1-5:1,B Alpha 1-5:2]]

These two are located at the same place. but why one is remote, the other not?

lone glade
#

their position in the world has no bearing on that

still forum
#

remote means elsewhere

#

local means where you are

#

in real life. Not in game

lone glade
#

at that point we're running out of metaphors and examples to explain locality aren't we?

meager heart
#

also one uav is connected to a player aka remote controlled maybe ๐Ÿ˜€

hollow thistle
distant egret
#

Hey I'm trying to load a file from my game dir, I'm currently using #include but this crashes the game when people don't have the file for obvious reasons. So I was wondering if it was possible to load in a file another way that doesn't crash the game. I've looked at how CBA loads the cba_settings.sqf but it tells me the file isn't there.

What I'm trying in the debug console,
TEST = preprocessFile call compile str "server\playerids.sqf";
TEST returns an empty string and tells me with an popup that the file doesn't exist.

The folder structure is like this, Arma 3\server\playerids.sqf.

I'm probably looking over something silly ๐Ÿ˜‹.

still forum
#

loadFile

#

and same as preprocessFile Which you are using completly wrong btw. and #include requires -filePatching

distant egret
#

Shit forgot about loadFile....

lone glade
#

str "server\playerids.sqf"
when you extra need that string to be a string ๐Ÿ˜„

still forum
#

Hey Arma. If I call str on this string you'll read my mind and figure out that I want to load a file from my arma directory right?

little eagle
#

You cannot use loadfile to guard against #include.

still forum
#

what?

little eagle
#

Because preprocessing is done before the script runs.

lone glade
#

if there's an issue with a preprocessor command the game will crash, no matter what

still forum
#

You missunderstood him commy

#

he is using #include to load files from disk and want's to get rid of it

little eagle
#

Right.

still forum
#

and using loadFile instead of #include won't crash the game when the file is not there

#

so yes. He can use loadFile

little eagle
#

Well, loadFile will crash a dedicated server if used during the init phase.

still forum
#

wut

lone glade
#

TIL

little eagle
#

It will put you back into mission select.

#

It's not actually loadFile that is the problem though.

#

It's a general problem with error messages on a dedicated server.

#

All things that would cause an error message popup on a machine with interface will show this behavior, but only if no client is connected to server yet.

#

Thus it works during the mission, when there always is someone connected to the mission.

#

Pick an arbitrary command that causes a gui error message, put it into a servers preInit and select a mission.

#

Easy repro.

still forum
#

init phase means after mission selection though right?

#

so not preStart

little eagle
#

preInit and sometime after. It literally only ends the mission, because the admin isn't connected yet.

#

It will not crash at preStart.

#

preStart it won't even trigger a gui message even on interface machines.

#

The server doesn't actually crash, but the mission is aborted.

still forum
#

it does

little eagle
#

ok

still forum
#

Intercept loadFile at preStart causes gui popup in main menu

little eagle
#

hmm.

still forum
#

to be precise prePreStart before initFunctions. But that doesn't matter much

little eagle
#

Well, it doesn't crash the server in any case, probably because there is no mission that could be aborted, and that is what the problem is.

#

A missing file for #include always crashes the program, and that's so stupid.

#

I mean, how hard can it be to check if the file exists and abort gracfully ffs.

still forum
#

I could patch that in half an hour probably. Without access to the code

little eagle
#

dll needed?

still forum
#

just print RPT warning and instead of including the file insert empty text

#

I guess I could patch the arma exe... But that's hard. So yeah

little eagle
#

Why don't we have dll's in CBA again?

still forum
#

I don't know the answer

#

Intercept_cba is still waiting

little eagle
#

Waiting for what?

delicate lotus
#

Is it possible to change the group of a unit to sideEnemy?

#

like by using JoinSilent?

winter rose
#

addRating -10e10 ^^

delicate lotus
#

wait, would units inside a group shoot at eachother when they have sideEnemy?

winter rose
#

yes.

delicate lotus
#

hmm thats counterproductive...

winter rose
#

(I think?)

little eagle
#

They would, but you specified sideEnemy, and addRating - is the only way.

winter rose
#

wait, maybe not actuallyโ€ฆ would deserve a try

little eagle
#

sideEnemy should be enemy even to units on sideEnemy.

winter rose
#

@little eagle could we createCenter sideEnemy and create a group from it?

little eagle
#

createCenter does nothing in A3.

delicate lotus
#

hmm. Whats a better way to make a group of units enemy to independent, east, and west?

little eagle
#

Invent a new game with more than 3 sides.

#

createSide

#

A4 when?

delicate lotus
#

would be funny if they really implement createSide in A4...

winter rose
#

createGroup sideEnemy then (maybe)

little eagle
#

I'm currently working with four 32x4096 graphics in Arma.

gleaming oyster
#

for what?

little eagle
#

The four arms of a reticle. They wanted it to be super sharp (its a dynmaically zooming reticle using commy tech โ„ข), so I split it up into four controls.

#

8196x8192 was too much^^

gleaming oyster
#

they,
commy tech,
All good words. But are we talking about ace or a seperate invention?

little eagle
#

BWA3

gleaming oyster
#

deuschland mod?

meager heart
#

bundeswehr โ„ข

little eagle
#

I'd do it for ACE too, but someone else would have to draw the assets. This is what all my posting about the debug reticle script is all about.

meager heart
#

hmm. Whats a better way to make a group of units enemy to independent, east, and west?
civilian setFriend [<side>, 0]; < last time tried in alpha times, not sure ๐Ÿค”

wild flint
#

If it's one solitary group, setscore -9000 usually works

#

Otherwise multiple groups will get into squabbles

sonic ocean
#

@little eagle its working thanks so mutch just one thing i dont understand the time bit
private _playtime = 01500; // in seconds, time until the marker is gone

little eagle
#

What's not to understand?

#

1*60*60

lone glade
#

รŸ
the invasion has started

little eagle
#

That's one hour.

sonic ocean
#

so first one is?

little eagle
#

1 hour times 60 minutes times 60 seconds.

sonic ocean
#

so for 15 min it would be
0 15 00

little eagle
#

No.

sonic ocean
#

1 15 00?

little eagle
#

15*60

#

15 minutes a 60 seconds.

#

15 times 60 seconds.

#

= 15 minutes.

sonic ocean
#

ok like that

#

one day ill be at you're level

little eagle
#

damnit

#

That's just a math thing.

gleaming oyster
#

just a mahz yeah

little eagle
#

Pre programming.

sonic ocean
#

gmammer

little eagle
#

-.-

sonic ocean
#

XD

gleaming oyster
#

gremmor

sonic ocean
#

grammar

gleaming oyster
#

You removing evidence i see

little eagle
#

whistle

meager heart
#

ta dum tss ๐Ÿฅ

lusty canyon
#

how can i add all mod vehicles to my zeus list? (i can spawn a mod vehicle with createvehicle but they dont show up in the zeus list)


{
_x addCuratorAddons ??????

} foreach allCurators;
still forum
#
                _cfg = (configFile >> "CfgPatches");
                _newAddons = [];
                for "_i" from 0 to((count _cfg) - 1) do {
                    _name = configName(_cfg select _i);
                    _newAddons pushBack _name;
                };
                if (count _newAddons > 0) then {DedmensCur addCuratorAddons _newAddons};

from my stash

#

oh god that's terrible.

#

one sec

gleaming oyster
#

Eck.

still forum
#
private _newAddons = ("true" configClasses (configFile >> "CfgPatches")) apply {configName _x};
_curator  addCuratorAddons _newAddon;

There

lusty canyon
#

what do i put in the _curator var?

still forum
#

your curator

#

the thing that you put to the left of addCuratorAddons

#

look at the code you posted above

lusty canyon
#

private _newAddons = ("true" configClasses (configFile >> "CfgPatches")) apply {configName _x};
{
_x addCuratorAddons _newAddon;

} foreach allCurators;

would this work?

still forum
#

no

#

_newAddon variable is undefined

lusty canyon
#

cuz private?

still forum
#

no

#

cuz typo

lusty canyon
#

ah right

#

thanks

delicate lotus
#

Hey, how does the difficulty settings for AI skill and precision effect the actual AI skill?

lusty canyon
#

thanks D ill give it a whirl now

delicate lotus
#

Is there some open formular to the calculation or how does it work?

#

Like for example, ifI use this setSkill 1; on a unit and I start the mission with a difficulty of 0.5 for both aiming and general skill, how is the AI skill going to be effected?

lusty canyon
delicate lotus
#

so what im reading there is that all values can reach from 0 to 1 except spotTime which is capped at 0.7...

#

but that page doesnt really tell me how much Custom Difficulty will effect it...
And skillFinal only gives me the final endresult which is also not very helpful...

little eagle
#

It's not capped at 0.7

#

It's multiplied by 0.7.

delicate lotus
#

yeah so if the max skill is set, which 1 and it gets multiplied by 0.7 its capped at 0.7...

#

Or can skill go higher then 1?

little eagle
#

No.

#

"Capped at 0.7" sounds like 0.8 would be turned to 0.7.

#

But actually 0.8 gets turned to 0.8x0.7.

delicate lotus
#

okay but how does the difficulty which you can set in the game options effect all this?

little eagle
#

skillFinal = skillScripted x skillDifficultyConfig

delicate lotus
#

AH

#

hmm okay thats interesting

little eagle
#

At least that's what I assumed. Maybe the algorithm is more complicated.

#

This page explains it. It's like that linearConversion command.

verbal otter
#

hello, how i can set trigger activation only on one player?

#

tryed this on client on start

little eagle
#

Tried what?

verbal otter
#
_trg = createTrigger ["EmptyDetector", _pos];
    _trg setTriggerArea [_size, _size, 0, false];
    _trg setTriggerActivation ["ANYPLAYER", "PRESENT", true];
    _trg setTriggerStatements ["this", 
        format["[4,''] spawn capture_notify;CaptureVendor = '%1';CurrentCaptureTrg=thisTrigger;",_marker],
        "[5,''] spawn capture_notify;CaptureVendor = '';CurrentCaptureTrg=nil;"
    ];```
little eagle
#

```sqf

```
for syntax highlighting

verbal otter
#

is working fine, but when one people enter trigger - notify shows on all clients ๐Ÿ˜ฆ

little eagle
#

player in thisList
?

verbal otter
#

yes

little eagle
#

That would solve it, no?

verbal otter
#

you mean _trg setTriggerStatements ["this" - change to "player"?

little eagle
#

I said nothing like that.

#
if (player in thisList) then {
    // blah
};
verbal otter
#

ahh, thank you! will try

little eagle
#

Triggers are ugly as sin, and especially that format stuff right there.

meager heart
#

also thisList select 0 < player in trigger

verbal otter
#

thank you

meager heart
#

probably better option will be just function, call it for ^ and do whatever you want for that one player

gleaming oyster
#

Triggers are gross.

little eagle
#

Use a loop with a marker plus inArea instead of a trigger.

meager heart
#

^

gleaming oyster
#

(loop with an exit)

#
while{true} do {
```
๐Ÿ˜ฌ
little eagle
#

(loop with an exit)
Why?

#

The vendor isn't one time only.

gleaming oyster
#

Well why not?

little eagle
#

Because you may 've forgot your purse?

meager heart
#

๐Ÿ˜„

gleaming oyster
#

Well I keep a wallet, so a check will do.

little eagle
#

"wallet" was the word I was looking for, thanks.

gleaming oyster
#

Uh Huh :^)

little eagle
#

I no native speaker, jawohl.

errant jasper
#

Trigger to SQF:

while {true} do {
    waitUntil {sleep CHECK_INTERVAL; /* TRIGGER COND */};
    // ON ACTIVATION HERE ...
    waitUntil {sleep CHECK_INTERVAL; /* not (TRIGGER COND) */};
    // ON DEACTIVATION HERE ...
};```
gleaming oyster
#

My bag of taunts are empty my friend, all is well.

little eagle
#

YES

#

TWO STATE MACHINE

meager heart
#

I no native speaker, jawohl.
you're doing better than some native speaker from this... great place ๐Ÿ˜„

#

pls no state machines ๐Ÿ˜ฎ

little eagle
#

That's what happens when you spent half your life on the internet. You begin to forget your mother tongue...

gleaming oyster
#

Better than a ruski

meager heart
#

my last engrish lesson was in...

#

like 1998 or so

#

๐Ÿ˜”

lone glade
#

reading scripting gives me murderous vibes, this is not good for me

#

or should I say... impulses

little eagle
#

Did you look at my script from yesterday, alganthe?

gleaming oyster
#

๐Ÿ—ก

meager heart
#

or should I say... impulses
kinda goosebumps, but worse...

gleaming oyster
#

English class is worthless unless it's not your native tongue. Creative reading and writing is more effective

meager heart
#

raght

#

problem is that sometimes you read some... wrong texts in the interwebs

lone glade
#

I taught myself english in pretty much one summer

#

You just need the will to learn and self discipline

little eagle
#

I learned English pretty much by modding games^^

gleaming oyster
#

English and German share some roots, so I imagine it'd be very easy for the reverse. A english speaker to learn german.

lone glade
#

writing? maybe. vocalizing? I highly doubt it.

little eagle
#

The words should be easy to learn, but the grammar is completely different.

gleaming oyster
#

Why do you think so?

lone glade
#

have you ever heard a german talk?

gleaming oyster
#

Yes I have. i think the articulation just like any language would be the hardest part

little eagle
#

SONDERKRAFTFAHRZEUG

lone glade
#

articulating english isn't thaaaat bad, french and german is a lot harder if it's not your native language*

meager heart
#

i heard germans talk on spanish...

lone glade
#

ever heard a french talk english?

meager heart
#

yes

lone glade
#

it's like nails on ZE CHALK BORDE

errant jasper
#

As Scandinavian I don't think German and English is that close. Certainly not compared to my native language. Also some sentences are quite different.
English: I am hungry
German: Ich habe hunger. <- (I think - I almost all of what I learned which is still not that much).

meager heart
#

Russian: ya golodniy

little eagle
#

Literally translated that would mean: I have hunger.

meager heart
#

gg

little eagle
#

I am hungry
should be
Ich bin hungrig

lone glade
#

you're hungary?

radiant egret
#

Lol

lone glade
#

guys, I think the germans are trying to take over, the invasion started

errant jasper
#

AFAIK, and by googling, that is how it is @little eagle . If you German I ofc won't tell you are wrong.

#

In Germany it is a noun not verb.

lone glade
#

they already have their bastion of modding at armaworld

errant jasper
#

German stackexchange: Ich bin hungrig is legal and works, but is less common than Ich habe Hunger.

radiant egret
#

๐Ÿ‡ฉ๐Ÿ‡ช

little eagle
#

AFAIK, and by googling, that is how it is
That's just google trying to make it sound nicer. Nobody says "I have hunger" in English I assume, so they pretty it up to get a better sounding translation.

gleaming oyster
#

Well, I was more talking about greetings and gestures. Off the top of my head it's blank, but English and German don't share a connection in the literal wording

lone glade
#

"I have hunger.... by the food plate! Come eat at our restaurant!" huehuehue

meager heart
#

ja

#

so the conclusion: just speak or chat with native (input language here) speakers more... probably the fastest way ๐Ÿ‘Œ

gleaming oyster
#

qual es tu nombre ? :^)

meager heart
#

sldt1ck

gleaming oyster
#

me nombre es mudnut

#

donde esta el bano?

#

Pretty much the only spanish I know after 3 years of it

winter rose
#

@@lone glade > it's like nails on ZE CHALK BORDE

Sacrebleu! รจ_รฉ dis iz not tru!

little eagle
#
allPlayers select {_x in chat} apply {_x setDamage 1};

This is my native language.

meager heart
#

_this allowDammage false; ๐Ÿ˜ฌ

gleaming oyster
#

Woah. Nice counter.

meager heart
#

btw that thing exist ^ (allowDaMMage)

winter rose
#

Wouldn't work; it is not setDammage

little eagle
#

But you still die from setDamage 1 even if you used allowDamage.

#

Only setHit is ignored when allowDamage is set to false.

gleaming oyster
#

Hmmm. Can handleDamage intercept this or are you KO'd either wayM

little eagle
#

Contrary to what the wiki says.

#

AND I EDITED IT A YEAR OR SO AGO.

#

AND THEN IT GOT REVERTED

#

AAAAAA

gleaming oyster
#

Then keep pushing your rock and type it again?

meager heart
#

that rock is huge man

gleaming oyster
#

I think commy is buff enough

winter rose
#

@little eagle = Sisyphus

#

all unsung heroes, actually ๐Ÿ˜„

gleaming oyster
#

@winter rose = Sleepless Wiki Man

delicate lotus
#

I guess its possible but, how do I detonate mine dispensers using a script command?

#

setDamage 1 didn't work

winter rose
#

maybe with a _scripted version (see createVehicle)

inner swallow
#

BTW, as someone who frequently uses google translate for translating things in languages i have/had to deal with... it's often wrong, very wrong

austere hawk
#

Thank you for they sausage. Best rice, x3kj

meager heart
#

Your fat chicken cock with rise was delicious, mesh thanks! ๐Ÿ™‡

hoary stratus
#

hey, how can i create a object?
like this:

testObject = {
    name = "blabla",
    age = 23,
    nick = "gino"
}

Can i do this in SQF?

queen cargo
#

no

#

you could create arrays though

#

but not named ones

#

there are solutions out there that provide this functionality

#

but all of them require mods or careful deletion of the same objects

hoary stratus
#

ah ok, thanks ๐Ÿ˜„

little eagle
#

You totally can.

queen cargo
#

but all of them require mods or careful deletion of the same objects

little eagle
#
testObject = createLocation ["Invisible", [0,0,0], 0, 0];
testObject setVariable ["name", "blabla"];
testObject setVariable ["age", "23"];
testObject setVariable ["nick", "gino"];
queen cargo
#

careful deletion of the same objects

little eagle
#

No mods to see here. Though, this will not survive post a mission, as all objects are deleted once a new mission starts.

queen cargo
#

how often do i have to repeat myself?

#

if one wants to spam those "objects" one has to delete those too himself

#

no GC or anything elswe

little eagle
#

And?

queen cargo
#

hopefully nobody will see that

little eagle
#

See what?

queen cargo
#

your shit advice

gleaming oyster
#

๐Ÿฟ

little eagle
#

He asked if it was possible.

#

And it sure is.

#

You're just being wrong again.

#

You're always wrong.

queen cargo
#

no, i said it is not possible

little eagle
#

It's impressive really.

queen cargo
#

but using other solutions

#

because you want him to create memory leaks

#

obviously he is a beginner in SQF

#

for asking that question

little eagle
#

Are you retarded? How is that a memory leak.

queen cargo
#

they are not deleted by the GC

little eagle
#

Jesus Christ just get off the internet. Uninstall Arma.

queen cargo
#

that is how

little eagle
#

Almost nothing is deleted on it's own and that is a good thing. You may want to use it later.

#

You're just retarded on purpose again.

queen cargo
#

Almost nothing is deleted on it's own are you stupid?

little eagle
#

Hurr durr, soldiers aren't deleted by a "gc" therefore creating them is causing memory leaks.

queen cargo
#
[] call {
    private _arr = [];
};
//_arr is gone```
little eagle
#

You're a joke.

queen cargo
#

that is SQF

#

soldiers etc. are vehicles and game objects

#

both got different lifecycles

little eagle
#
arr = [];
// arr is not gone

Oh noes a "memory leak".

#

Jump off a bridge.

meager heart
#

shoots fired

queen cargo
#

still no,

#
arr = nil```
#

gone

#

GC took care for you

little eagle
#

Okay, go fuck yourself.

queen cargo
#
magic = nil; //memory leak```
#

so stop givving bad advices without the additional "BE CAREFUL" note

#

i told him there are solutions out there, you said "you are wrong"

#

just to be in the right

#

giving a probably scripting starter a horrible advice that would lead in horrible FPS drops etc.

little eagle
#

No one wants your advice dude.

#

Go away.

queen cargo
#

---fin---
now stop giving bad advices just to be in the right

little eagle
#

This is not bad advice. You're just annoying on purpose again.

#

How would you even know what is bad advice? You have no talent and nothing to show for after all these years.

queen cargo
#

now that i prooved you wrong, again, you go down to personal level again?

little eagle
#

prooved
I hate you so much right now.

#

Everything about you.

queen cargo
#

how mature
got enough to show and stopped actual modding for ages
you know that, pretty much everybody knows that

i now create tools barely people use for some reason that i then abandon simply because there is no reason in developing them further

#

you want to see my "stuff sto show"?

little eagle
#

You should stop going to this server too.

queen cargo
little eagle
#

No one wants to see any of it.

queen cargo
#

but you the great commy2, having to be correct even if it is at the cost of some rookie scripter, you have everything to show

little eagle
#

You lied to him, because you have an obscure problem about something that in practice is a non issue.

queen cargo
#

i did not
i told him solutions are available but require additional stuff
SQF itself has no such capabilities

#

and that is the whole story
no, not possible unless you use workarounds

#

you know that

#

i know that

#

the whole frking server knows that probably by now

#

yes, there are solutions and no, i did not hid that

little eagle
#

SQF itself has no such capabilities
I just showed him the opposite!

#
testObject = createLocation ["Invisible", [0,0,0], 0, 0];
testObject setVariable ["name", "blabla"];
testObject setVariable ["age", "23"];
testObject setVariable ["nick", "gino"];
queen cargo
#

no, you created a game object and added variables onto it

#

that is litterally a workaround to his problem

#

game objects require deletion and are "expensive" in creation compared to pretty much everything SQF value types have

#

they have no GC because game objects are supposed to live till another day, or more specific: till the end of the mission
they require manual deletion

little eagle
#

I dare you to create a location in the game. It takes almost no time.

#

Just try it out.

#

Create a million of them.

#

Won't tank you at all.

queen cargo
#
private _foo = [];
private _foo = createLocation ["Invisible", [0, 0, 0], 0, 0];```
wanna know what takes longer?
wanna know what is not deleted at the end of scope?
should i repeat all that over again?
little eagle
#

The difference is that I have done it before. Tried it. And you theorize about it and come up with some stupid shit that has no use to anyone.

queen cargo
#

you are wrong, accept it

#

๐Ÿฟ time is over

little eagle
#

Of course "foo" will take longer, because that is an invalid classname.

#

You write to the rpt file.

#

You're so dumb, it hurts.

quasi rover
#
player addEventHandler ["HandleDamage",
{
    params ["_unit","","","_source"];
    private _uavugv = allUnitsUAV select {isUAVconnected _x};   //[B Alpha 2-1:2 REMOTE]
    private _shoot = {_source in crew _x} count allUnitsUAV;  // 0
    hint format[" _source: %1, _uavugv: %2, _shoot: %3", _source, _uavugv, _shoot];
        ....
}];

_source: B Alpha 2-1:2 REMOTE, _uavugv: [B Alpha 2-1:2 REMOTE], _shoot: 0
I'm trying to get the real shooter(player who remote controll AI) of UAV/UGV, but _shoot for testing get '0' value, not '1'.
and why _source and _uavugv is the same ?

halcyon crypt
#

I see commy2 and X39 are at it again? ๐Ÿ˜›

little eagle
#
this addEventHandler ["HandleDamage", {
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
}];

Tried _instigator, barnes?

winter rose
#

No way to keep it civil so it seems

meager heart
#

also maybe something like this ๐Ÿค”

private _player = {
    if (getConnectedUAV _x isEqualTo _uav) exitWith {_x};
    objNull
} forEach playableUnits;
#

(not sure)

quasi rover
#

uhh.. the _instigator is the real shooter who remote-controlled AI ?

ruby breach
#

allUnitsUAV is an array of the UAVs themselves. So {_source in crew _x} count allUnitsUAV will aways return 0

#

playableUnits select {isUAVconnected _x} may be a better way

#

But that would just return the first player connected to any UAV

#
playableUnits select {getConnectedUAV == _source}
``` maybe?
little eagle
#
private _controllingPlayer = allPlayers select {getConnectedUAV _x isEqualTo _source} param [0, objNull];
quasi rover
#

I wanted to find the UAV/UGV that is remote-controlled & get _source first , then use uavControl to find the real shooter.

#

thanks guys.

little eagle
#

_source is the UAV

quasi rover
#

not AI who is the crew in UAV?

little eagle
#

gunner _uav

#

driver _uav

#

It's just some dummy ai.

#

Needed to remote control the vehicle.

meager heart
#

also HandleDamage eh not 100% reliable...

quasi rover
#

I know that, and _source in EH 'HangleDamage' is the dummy AI, I think.

little eagle
#

vehicle _source
would be the vehicle if that's the case.

quasi rover
#

Sorry, not easy to figure it out because of my poor English, So _source in EH 'HandleDamage' is what? The UAV itself or dummy AI(crew of the UAV) in my case ?

little eagle
#

I don't know. You could try by printing typeOf _source

meager heart
#

probably vehicle _instigator

#

getShotParents will be overkill for that ? ๐Ÿ˜€

little eagle
#

There is no need to, when one could just use driver or vehicle instead.

#

Can you post the whole thing? Because that cannot be.

quasi rover
#

Sorry it's not any, I might be wrong.

#

typeOf _source: B_UGV_01_rcws_F

#

Thanks guys.

#

I thought _source is the dummy AI, but it's UAV/UGV itself. ๐Ÿ˜…

little eagle
#

Yeah, stringified objects are pretty useless for debugging as the vehicle shares the exact same name as the effective commander inside. Very confusing, typeOf it a great help.

warm gorge
#

What could cause the 'Take Control of UAV' action to not show up on a drone even know you can connect to it?

meager heart
#

make sure that your drone has a crew, make sure that you have uav terminal and player setUnitTrait ["UAVHacker", true]; < could help too... @warm gorge

open vigil
#

What have I woken up to @little eagle & @queen cargo ? Thatโ€™s best taken care of via PM.

thorn saffron
#

So, I tried (again) converting the ambient combat module (ACM) from A2 to A3. I did replace the functions that aren't a thing anymore, but for some reason it still does not work in the game, even if I configured it. I didn't see anything in the RPT. If anyone would like to take a look, here's what I already got. I suspect it might be some broken calls in the FSM script or something like that. Or that the functions are not defined in an hpp file.
If anyone would be willing to help out let me know.

little eagle
#

Drone needs an ai crew (createVehicleCrew solves this), that ai has to be on the players side OR the player has to be an uavHacker, the player needs an uav terminal and it has to be the correct one of that side OR the player has to be an uavHacker again.

verbal otter
#

i get it working ๐Ÿ˜„

#
_trg setTriggerStatements ["this", 
        format["if (player isEqualTo (thisList select 0)) then {[4,''] spawn capture_notify;CaptureVendor = '%1';CurrentCaptureTrg=thisTrigger;};",_marker],
        format["if (CurrentCaptureTrg isEqualTo thisTrigger) then {
            if ((player distance2d %2) > %1) then {
                [5,''] spawn capture_notify;CaptureVendor = '';CurrentCaptureTrg=nil;
            };
        };",_size,_pos]
lone glade
#

WHY

#

JUST WHY DID YOU DO THIS

verbal otter
#

@lone glade you talk to me?

lone glade
#

yes.....

little eagle
#

You made a monster.

verbal otter
#

i has a problem with trigger, for now is working fine. i share solution. maybe somebody get it useful

little eagle
#

if (player isEqualTo (thisList select 0)
This to me seems like a ballsy assertion in MP. Is this really guaranteed?

winter rose
#

player in thislist ๐Ÿ‘€

verbal otter
#

yes, tested on mp

#

thisList select 0 is always player

winter rose
#

even if there are other units? even if you are the third player connecting?
this trigger behaviour is not documented on the wiki, and it may not hold true for all cases

verbal otter
#

i create trigger on client, not on server

lone glade
#

he absolutely didn't test this properly

verbal otter
#

today i will make more tests

lone glade
#

see^

winter rose
#

really, use in for 100% result

lone glade
#

or don't use triggers are all

#

they're just shittier loops really ๐Ÿ˜„

winter rose
#

here, you bet that player is always the first item in the trigger, whereas in just checks if it is in the trigger

(unscheduled loops iirc, right?)

lone glade
#

triggers are scheduled

winter rose
lone glade
#

wait, how come I can break the scheduler with them then O.o

little eagle
#
// init.sqf
if (hasInterface) then {
    [_pos, _size] spawn {
        params ["_pos", "_size"];

        private _zone = createMarker ["Vendor", _pos];
        _zone setMarkerShape "ELLIPSE";
        _zone setMarkerColor "ColorBlue";
        _zone setMarkerAlpha 0.25;
        _zone setMarkerSize [_size, _size];

        while {true} do {
            waitUntil {sleep 3; player inArea _zone};
            // entered area
            [5, ""] spawn capture_notify;

            waitUntil {sleep 3; !(player inArea _zone)};
            // left area
            // nothing
        };
    };
};

There. This'd be much nicer, and you even have syntax highlighting thanks to not manipulating strings.

lone glade
#

0 spawn
reeeeeeeeee

little eagle
#

Well trigger reee

#

...

lone glade
#

๐Ÿ˜„

winter rose
#

I would actually enjoy being able to call spawn without argument, such as call ๐Ÿ˜

verbal otter
#

๐Ÿ˜„

lone glade
#

but you can lou

#

USE EMPTY BRACKETS

#

like a goddamn normally formed human being

little eagle
#

Made the args passed into the spawn just for Lou.

lone glade
#

I don't see them being defined anywhere commy

#

I call bamboozles

little eagle
#

They're assumed to be defined above the script. Same as the original.

#

_pos and _size

lone glade
#

I can't see above, I still call bamboozles huehuehue

winter rose
#
spawn {
   sleep 1;
   hint "Muuuh I want it to work!!";
};
// err line 1: #spawn {
// arguments nil, expected Any
lone glade
#

that sleep

#

can I slap you?

winter rose
#

many have tried ๐Ÿ˜„

little eagle
#

Oh that's what you meant.

lone glade
#

if only I had the ability to exert the force through the internet

winter rose
#

wha'? this sleep is gud ^^ maybe not perfect, but gud

#

now try me bro!

lone glade
#

ah, yes, "performance loops"

#

reduce that sleep to improve performance

winter rose
#

?
oh, and nay it's not in a loop, just a parallel thread that's it ๐Ÿ˜„

lone glade
#

parallel thread? what is this?

#

those don't exist yet lou, we don't have the technology yet ๐Ÿ˜„

#

humanity isn't that forward thinking, we barely made it to the moon

winter rose
#

hah! you think the Moon is real? Sheep!

meager heart
#

that trigger...

late gull
#
myAsd = {
  hint "ok";
};
myAsd = {
In File .\asd.sqf: Line 1 Expected Semicolon (or eol)
#

any idea whats wrong there? -.-

cedar kindle
#

whereโ€™s that error from?

radiant needle
#

Is there a way to put out vehicle fires?

#

Like detect if a destroyed hull is on fire, and if it it is, make it not on fire?

lone glade
#

^no

#

only deleting the destroyed vehicle will remove the fire early

radiant needle
#

Would it be possible to copy the hull and replace it with a non burning but destroyed one?

lone glade
#

it's not a hull, it's a vehicle

radiant needle
#

I'm just using hull to refer to any "vehicle" that is destroyed and no longer interactable with.

little oxide
#

There is a way to find a position inside the boundingboxreal of an object ?

lone glade
#

^ yes

winter rose
#

@lone glade only deleting the destroyed vehicle will remove the fire early
I think veh setDamage 0 turns flames off? deserves a test, as I don't remember in which game it worked

lone glade
#

honestly I wouldn't be surprised at that point

#

but that'd be closer to a bug than a feature lou

winter rose
#

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

radiant needle
#

Yeah setDamage 0 does work

winter rose
#

I don't know if it stops secondary explosions though, nor flame damage

#

beware

radiant needle
#

So would If (damage _Veh != 1) exitWith{};

#

work to close the script if the vehicle is not destroyed?

#

I'm making fire extinguisher smoke grenades and just don't want them to magically repair vehicles

copper raven
#

if(alive _veh)exitWith{}; ?

radiant needle
#

Eh yeah so setDamage 0 gets rid of the fire and smoke, but light and damage still exists\

lone glade
#

like I said, it's closer than a bug than a feature huehuehue

radiant needle
#

Although I guess you can pretend it's just glowing red hot

#

but I can probably hack it

#

spawn a new vehicle at 0,0,0, destory it, setDamage to 0 then teleport it over and delete the real vehicle

#

Is there a place to see the CfgVehicle hierarchy for use with isKindOf?

#
[(_this select 1)] spawn {
_Veh = _this select 0;
if (alive _Veh) exitWith{};
if (_Veh isKindOf "Man") exitWith {};
_VehType = typeOf _Veh;
_VehPos = getPosATL _Veh;
_VehDir = vectorDir _Veh;
_VehUp = vectorUp _Veh;
_VehDirUp = [_VehDir,_VehUp];
deleteVehicle _Veh;
_NewVeh = _Vehtype createVehicle [0,0,0];
_NewVeh setDamage 1;
_NewVeh setDamage 0;
_NewVeh setDamage 1;
deleteVehicle _Veh;
_NewVeh setVectorDirAndUp _VehDirUp;
_NewVeh setPosATL _VehPos;
};
#

this seems to actually work pretty well

lone glade
#

Is there a place to see the CfgVehicle hierarchy for use with isKindOf?
the config viewer / retrieving the parents of the class

winter rose
#

BIS_fnc_getParents gives you parents (no, not you Mr Wayne)

unborn ether
#

Why no one use private?

late gull
#
_myVar = true;
// and
private  _myVar=true;

those are not the same

lone glade
#

yes, the second one is objectively better

late gull
#

no

#

they do different function

lone glade
#

Yes, private your goddamn local vars

#

or use params when you pass args, but at least do it

compact maple
#

thatโ€™s the same as private[var1,var2]; right ?

lone glade
#

yes, but you don't have potentially undefined vars / unused vars

compact maple
#

right

errant jasper
#

That's not even the worst part. I will not call code that does not properly scope their variables, because I don't wanna waste time debugging my code just to find out some callee overwrites my variable.

still forum
#

@queen cargo a "memory leak" is when you cannot access a object anymore to delete it. Which is not the case. you can use allUnits/vehicles/allLocations and so on. And Arma also keeps references to them. So that's not a memory leak. And if you decide to not want to help someone asking a question. It's also not a good idea to attack the guy that helps the guy by calling him stupid and his advice being shit. If your advice is better then bring it on. If not then get out.

A couple million objects might be a problem yes. But half a dozen locations is not. So don't make a universe out of an electron.

game objects require deletion and are "expensive" in creation Yep. Locations being the most inexpensive of them.
You mean his advice is shit and lies because your oh so awesome way of doing it is literally 0.0062ms faster (creating location vs empty array). But your method is so hard to use it's literally unusable. Thank you for your good advice and ๐Ÿฟ emotes.
Now please get out and let the people alone that are here to help people with their problems.

#

@compact maple it does the same yes. But private _var = ... is infinite times faster than private [...]

compact maple
#

even if there is so many variables ? @still forum

still forum
#

@late gull your error from above with the expected semicolon. You either didn't post the complete error message or the complete code.

#

yes.

compact maple
#

i didnt know that, thanks you,will use it

still forum
#

private _var = is free.

#

private [...] is not

late gull
#

@still forum the complete file is that, there is no more error info, ussing rapify to check the file

still forum
#

what?

#

you are using rapify to check a script?

#

That doesn't work. Rapify is for configs

lone glade
#

O.o

#

"if it doesn't pack it means it doesn't work" I'm not sure how I feel about that logic

compact maple
#

rapify is a social media about rap, isnt it ?

cosmic lichen
#

@still forum How can I add a command category to 'See also' ? Category:Command Group: Markers doesn't seem to work.

still forum
#

like other things

queen cargo
#

Are you kidding me? Reread what I said
I told him: nรถ, not possible unless you use a mod or a work around

Commy said I am wrong
And it is a memory leak if your Script is never deleting it
Obviously the game keeps track of it, obviously you still can access it
But if you do not do so, you just created a memory leak because the objects are created and that's it

The same dort of memory leak that would be created in literally all other applications too as the OS keeps track of the memory too

So no, it was the correct adivice of me, if he wanted to know those other solutions I mentioned, he could have asked
And I did not started to insult around, it again was Commy

still forum
#

So by writing this chat message you created a memory leak? Stop doing that! memory leaks are bad!

#

And I did not started to insult around, it again was Commy
Commy provided solution.
And wrote
No mods to see here. Though, this will not survive post a mission, as all objects are deleted once a new mission starts.
And?
See what?

You provided no solution and wrote:
how often do i have to repeat myself?
hopefully nobody will see that
your shit advice

I'd count that last one as an insult.

little eagle
#

The answer to the original question should've been "Yes, but..." and not "No".

still forum
#

Not should've been. It was.
Then there was that dude raging about it and throwing non relevant info at people.

fossil yew
#

Anyone know a mod (script) where a wounded player could be attached to a vehicle that has a stretcher behind it?

#

Preferably with animation and nurses ๐Ÿ˜„

still forum
#

script would be attachTo I guess. The player cannot move anymore then though. But that's probably what you'd want

little eagle
#

Yeah, I don't see how created locations stored in locals not getting deleted at the end of the script automatically has anything to do with what was asked for.

#

Also, you could always just... delete them before the script ends...

still forum
#

a global variable is the same "memory leak" as you said. Though that dude then started throwing lies around that you can just delete variables by using = nil.. Like you couldn't just delete locations.

#

Though I wouldn't say that either solution was what that guy wanted. Because he didn't actually say exactly what he wanted. I would've just replied with "more details pls"

little eagle
#

He does this all the time. Go off on tangents about completely irrelevant stuff. I hate this so much. It's like he wants to confuse people,not show them stuff.

hollow thistle
#

I believe he was just a bit upset that you have not put a warning about location not being like normal variable which is deleted automatically at end of scope.
But he should not call your advice 'shit'...

queen cargo
#

Good
So all memory leak now are officially no Bugs
Good to know

still forum
#

The original question asker asked about how to create objects.
So I don't see how someone telling him how to create objects is bad advice because it creates objects.

lone glade
#

all i'm hearing is: "GLOBAL MEMORY LEEEAKS"

#

"location not being a local variable"
yes, it's a location

still forum
#

Hey I want a banana. I'll go to the banana shop to buy one.
NOOOO!! Don't ever go to the banana shop! They'll sell you bananas!!!!
Better go to some other shop that I won't tell you about and buy something else!!!!

But.. but I wanted a banana ._.

lone glade
#

which is a different data type mind you.

fossil yew
#

don't fight guys please

#

it's irrelevant, you'll wasting time anyway

ruby breach
#

You can go buy a banana at Banana Bro's... but if you leave it lying around it's going to go bad and smell

still forum
#

Why tell someone that wants to eat a banana that it will go bad if he let's it lay around?

ruby breach
#

An attempt was made to bananafy the "here's how to do it but" argument above. It didn't work very well.

queen cargo
#

Go tell a rookie He can create game objects to create js like objects
Good idea

The chances that He knows He has to delete them when He is no longer using them are so great

Not only that, but obviously I was wrong by saying that it is not possible in sqf unless workarounds are used was wrong

And you proove that with a workaround

But hey
I should have provided him the workaround instant instead of telling him that arma does not knows named arrays

still forum
#

does not know*

#

and technically you could call a variable containing an array a "named array"

hollow thistle
#

associative array?

still forum
#

There is also CBA hash if you need to connect string and value

#

but namespaces are better if you only need strings

#

and locations are the cheapest namespaces you can get

#

tens of thousands of locations is not really a problem.

winter rose
#

anyway, @queen cargo was right about SQF not having language objects , @little eagle said yes it is, but then provided an in-game object and set/getVariable.

@little eagle provided a solution but was wrong saying it was the same,
@queen cargo was wrong taking it personally,
then shitfest happened.

case closed

queen cargo
#

Again, I said that
Native sqf has no named arrays
Workarounds exist and mod solutions too

And the bs with "technically variables are named arrays too" go tell that around

#

It was personally @winter rose
You can read that a few lines later

still forum
#

What is a "named array" even?

#

A array with a name? ArrayName = [array]?

little eagle
#

string keys.

#

Literally a LOCATION.

#

He just doesn't like the syntax, even though these things are logical equivalents. He's a programmer, and I'm just a thonker.

hollow thistle
#

Lou said all that was to say in this regard imo.

winter rose
#

@queen cargo you fired the first off-the-line shots, you both could have kept it civil but didn't .

[23:56] commy2: No mods to see here. Though, this will not survive post a mission, as all objects are deleted once a new mission starts.
[23:56] X39: how often do i have to repeat myself?
[23:56] X39: if one wants to spam those "objects" one has to delete those too himself
[23:56] X39: no GC or anything elswe
[23:57] commy2: And?
[23:57] X39: hopefully nobody will see that
[23:57] commy2: See what?
[23:57] X39: your shit advice

looks like there's something between you, and I don't want it to be me though.

#

now if we could carry on, that would be nice. real nice.

delicate lotus
#

Hey, I don't know if this is the right channel for my problem but its related to scripting so ill just ask it.
I currently have a stringtable.xml containing all my messages localized with their needed formation.
Now I want to create Briefing Text and Task + Task Descriptions using those localized texts.
I managed to get it to read the text from the stringtable.xml but apparently localize strips all the HTML tags.
So I wanted to substitude that using parseText localize ...; but parseText gives me a structured text which is not accepted by createDiary and setSimpleTaskDescription.
Any suggestion how I could fix this? Or is the only way by replacing all < to < and > to > using a string replace option after localizing?
Or is it possible to convert a structured text into a normal one?

still forum
#

localize doesn't strip HTML tags

delicate lotus
#

but the BI wiki says that!

little eagle
#

The xml does.

winter rose
#

โ†‘

delicate lotus
#

oh well

still forum
#

I'm using stringtables for TFAR diary entries too. Works fine

winter rose
#

you have to > < in Stringtable yep

delicate lotus
#

yeah I do that but createDiaryRecord does not accept parseText stuff

little eagle
#

> >
< <
& &

#

etc.

still forum
#

correct

#

diary doesn't take already parsed text

#

because it does it interally

#

you pass it the text directly. You don't parse it first

delicate lotus
#

well then something else is wrong here, because:
<Original>Alpha - dein Team <br>Tiger - Basis</Original>
is not turned into
Alpha - dein Team
Tiger - Basis
but into
Alpha - dein Team Tiger - Basis

delicate lotus
#

oh I forgot the slash after the br

#

Im so stupid holy shit...

winter rose
#

I believe the / is not mandatory

queen cargo
#

HTML is not using / in the end of br Tags @delicate lotus

winter rose
#

HTML 4 does :p

queen cargo
#

Nope, neither HTML 4

delicate lotus
winter rose
#

wut? I have been lied to!

delicate lotus
#

now... how to I use lineBreak instead of <br/> then?

#

just write linebreak into the stringtable text ?

still forum
#

Why not use br/?

#

TFAR and ACE both use it and it works?

winter rose
#

so it's xhtml, right - been a long time I didn't read specs ^^

delicate lotus
#

didnt you wrote: don't use br?

still forum
delicate lotus
#

I clearly saw that and im not haluzinating

still forum
#

Yep. But I quickly deleted that again while I checked

delicate lotus
#

oh okay

still forum
#

I remembered TFAR diary having newlines which you can see on my link is the case. Didn't remember that it was newline and br

delicate lotus
#

Yes, it works now!
Guys, thank you very much for the help. Youre the best!

hollow thistle
#

Just to be precise I belive that xml does not care if you use <br> or <br/>. It is just an format of storing data. The html parser does care what tags you use.

lone glade
#

and locations are the cheapest namespaces you can get
lies, the cheapest ones are displays ๐ŸšŽ

delicate lotus
#

isnt the cheapest namespace the missionnamespace itself?

still forum
#

Not necessarly.

#

Because missionNamespace you have to add tags to your variables which makes them longer. Which increases the get/set time.
Also the missionNamespace is filled with lots of other stuff which again increases the access time slightly

queen cargo
#

@winter rose HTML parsers usual accept it and thus all mayor Browsers
But it still is agianst the specs
HTML simply is not an XML application

little eagle
#

the cheapest ones are displays
Are you sure about that?

lone glade
#

I was pulling his leg, but now that I think about it that might be right

little eagle
#

The cheapest ones are those that already exist. I mean, if you already have displays and controls, use their namespace.

still forum
#

I never looked into the mission display namespace ๐Ÿค” I wonder what weird stuff might be in there

queen cargo
#

Ways to execute Code

#

Those are in there

lone glade
#

^ those are everywhere ๐Ÿ˜„

#

tho BI did a good job of squashing the most obvious ones

queen cargo
#

Ui namespaces Was called via mission namespaces fnc
Changing the ui namespaces variable and adding compilefinal allowed fancy Code execution without even the need for hax

winter rose
#

@queen cargo yeah, I was all about html loose/traditional/strict, xhtml 1.0 once
I know HTML 5 is veeery loose about its "xml" yes

<ul>
<li>element
<li>element

(not sure now if you have to close the ul though, I'd say yes butโ€ฆ)

little eagle
#

ui namespace != 46 namespace != mission namespace

#

It's confusing though.

#

Sadly allVariables doesn't work on DISPLAY thanks to the Lifers.

lone glade
#

how is it confusing commy?

still forum
#

my allVariables does ๐Ÿ˜‰

queen cargo
#

@winter rose you could leave that open and most Browsers would Auto fix it for the client

Browsers in General are way to forgiving because of historical reasons

lone glade
#

call the hammer squad, we got a filthy hacker in here

#

i'm pretty sure ded is in a black hoodie with a weird mask on in a dimly lit room and with RGB everywhere

still forum
#

My keyboard is only R

little eagle
#

Dedmen is the 400 pound hacker.

winter rose
#

and html and browsers are forgiving now :D
remembers quirks mode (looks at IE6 ๐Ÿ‘€ )

queen cargo
#

HTML is not forgiving, it has specific specs
But the parsers are

winter rose
#

HTML 5 itself is, much more than 4

spark sun
#

Do we have a command which return the player object from the playerID ? (allPlayers select {owner _x isEqualTo _playerID})

winter rose
#

there is a BIS_fnc yup

#

BIS_fnc_getUnitByUid โ† there it is!

still forum
#

owner only works on server

#

and UID is not owner

winter rose
#

โ˜

still forum
#

so using the ownerID is a bad idea. You need to let the server generate a array of ownerID->player object and PVAR that

winter rose
still forum
#

allPlayers param [allPlayers findIf (getPlayerUID _x == _playerUID}, objNull] something like that probably

#

I'm sure the BI func is outdated

still forum
#

๐Ÿค” how does that even work?

#

since when does distance take array of objects?

#

according to wiki it doesn't.

spark sun
#

true

little eagle
#

@spark sun @still forum
I think this:

private _asker = allPlayers select {owner _x isEqualTo remoteExecutedOwner};

is supposed to be

private _asker = allPlayers select {owner _x isEqualTo remoteExecutedOwner} select 0;
spark sun
#

yea but now I just removed it :p

little eagle
#

ok

little eagle
#

Yeah, that seems much nicer.

spark sun
#

yea, somebody can ask for an other one now. Not usefull now but may be for the futur ๐Ÿ˜‰

still forum
#

TIL that you can mention people in github commit messages and it will notify them

spark sun
#

does it work ?

#

Nice!

lone glade
#

yes it does

#

it's very fun, and can be used to bother ded ๐Ÿ˜„

little eagle
#

@still forum

still forum
#

no

digital hollow
#

"and can be used to raise ded"

winter rose
#

๐Ÿคฃ

#

@Dโ€ฆ

#

@Deโ€ฆ

#

@Dedโ€ฆ

#

๐Ÿ˜›

little eagle
#

dada dada dada da da

#

DEDMEN

hollow thistle
#

I will try to not forget about this when I will be committing my code (of doubtful quality). ๐Ÿคฃ

still forum
#

if you mention me in the commit I will look into it and comment everything that I don't like

#

and then continuously complain about it till you fix it

hollow thistle
#

^^

spark sun
#

So, do it

hollow thistle
#

It is kinda like an offer for a code review on de(d)mand.

spark sun
#

๐Ÿ˜‰

little eagle
#

It hurts...

hollow thistle
#

Ye, it was a shitty pun.

digital hollow
#

The punishments will continue until code quality improves.

little eagle
#

&ersand

cosmic lichen
#

Is there a way to change the scroll width and height via script command of a RscHTML inside a RscControlsGroup?

still forum
hollow thistle
#

This looks awesome. No unscheduled code in Liberation yet...

#

Also it is supposed to be fun after work hobby. When I will get access to profiler like that it won't be fun anymore :D

still forum
#

scripting is not fun ๐Ÿ”จ

hollow thistle
#

I will HAVE to optimize if I will see it is slow. Now it runs scheduled and I can't check if it is slow.

#

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

#

I guess that after we will start to implement parts where AI starts to spawn I will think about optimization.

#

Is there any "nice" way to "escape" from scheduled to unscheduled?

#

Create PFH that executes once and kills itself after job is done?

still forum
#

isNil {code}

#

executes code unscheduled

#

and then returns back to scheduled code

hollow thistle
#

Ty.

still forum
#

yeah

#

and it is very likely that it will suspend after the createVehicle because that takes quite some time

#
if (_returnVeh) then {_return = _vehicle;};

_return

-> if (_returnVeh) then {_vehicle} else {_return}

peak plover
#

is that profile up to date again?

still forum
#

wait. The return value doesn't do anything

#

So if (_returnVeh) then {_vehicle} else {true}

hollow thistle
#

It is set to true at beginning :D

still forum
#

oh

#

yeah that

#

edited

#

The profiler is not yet released. Still testing and fixing some stuff. Should get it done today tho

hollow thistle
#

We are using this convention where if something succeeds it should return True.

still forum
#

you could probably assume it works and work with try/catch ๐Ÿ˜„

peak plover
#

โ›”

errant jasper
#

Rather than wrap all functions in isNil, I would rather wrap the call from scheduled itself.

#

But if most code is scheduled I can see why it would be simpler.

hollow thistle
#

Then the person calling the function would be responsible for remembering to wrap it.

errant jasper
#

True, what's why it you have lot of scheduled it alright. But 99% of my code runs in unscheduled, and then it is just fluff.

hollow thistle
#

I agree.

still forum
#

distance vs distanceSqr no measurable difference if both arguments are the same object.
In case anyone wanna know

errant jasper
#

Why vectorDistanceSqr exists? It does not suffer from errors on small distances?

#

Or distance only works with up to 3 dimensions? nvm, vectorDistanceSqr only works with 3D according to BIKI.

willow rover
#

What is the best method of calling a function every X minutes?

still forum
#

distance takes terrain level into account. and vectorDistance just uses the coordinates.
and the Sqr means it's without taking the squareRoot

#

@willow rover do you have CBA?

willow rover
#

I will check

#

yea

errant jasper
#

What do you mean terrain level into account?

still forum
#

Okey. Easy variant. Or most performant?`

#

It takes posAGL. It first has to turn it into ASL before it can measure the distance

errant jasper
#

Interesting. Even if both args are arrays?

still forum
#

yes...

#

Read the wiki page ^^

willow rover
#

Thanks but what is the third part for? Is that passing a variable to the function?

still forum
#

passing arguments yes

#

you can also just read the page I linked you

#
profileScript [{
private _isEnemy = false;
}]

1.544285us

_false = false;

profileScript [{
private _isEnemy = _false;
}]

0.994126us

Ohh boi. Half a microsecond!

hollow thistle
#

profileScript is your extension isnt it?

still forum
#

that's my special profiling command from my script profiler

#

Much more advanced and precise than the normal diag_codePerformance

hollow thistle
#

๐Ÿ‘

meager heart
#

in ms wow factor is higher, for those code benchmarks ๐Ÿ˜€

hollow thistle
#

But 1000 times less accurate ๐Ÿ˜„

meager heart
#

true

peak plover
#

How do I get cool profiler window, dedmen?

still forum
#

I can also convert it to hours. Think the wow factor will be even cooler?

hollow thistle
#

Eh, centuries would be better.

still forum
#

It's included in the last RC https://github.com/dedmen/ArmaScriptProfiler/releases But RC4 doesn't work with latest Arma.
You go ingame. Start the GUI and click play/record in the GUI. Then you do stuff ingame. Then you go back to GUI and press stop. It will process the recorded data and display it.

minor crescent
#

Hey so I was wondering if anyone could potentially help me out. Im trying to make a leaderboard system that logs stats through an INIDBI DB, but it doesn't actually write/log the stats. Any ideas?

peak plover
#

Ohh

#

Well

hollow thistle
#

I wish i could go directly to latest code on master from CBA docs.

still forum
#

I just directly look in the code instead of the wiki thing

hollow thistle
still forum
#

@little eagle ๐Ÿช

little eagle
#

Is your objective to copy paste the CBA PFH function?

#

Because the function itself is boring. It just pushes code and ids to some arrays.

#

The interesting part is in the pfh engine script.

peak plover
#

๐Ÿค”

still forum
#

yep. That's what I meant with it doesn't work in the current version

peak plover
#

aah

still forum
#

it ignores scheduled scripts. And my "is scheduled" check is bugged

peak plover
#

okay

still forum
#

so it marks most things as scheduled and ignores them even though they aren't

peak plover
#

1 thing is making 50 ms lag spikes

#

no clue what

still forum
#

I can give you dev build if you want right now

peak plover
#

Yeah

still forum
#

x64?

peak plover
#

I'd like that

#

yee

hollow thistle
#

@little eagle I do not intend to copy paste code. Just suggested a nice usability improvement for cba docs.

peak plover
#

Wait @still forum I can connect to computers on my network? so I can run server with profiler and get data from that to my pc?

little eagle
#

Oh, I didn't want to... blame? Nah, accuse you of anything. Just giving tips.

still forum
#

yes you can

peak plover
#

That is fucking amazing

#

Thank you

still forum
#

even over the internet and profile your server or smth

hollow thistle
#

indeed it is.

still forum
#

Teamviewer VPN also works nicely. Did alot of dev work over that

peak plover
#

Whoa

#

That's like amazing

cobalt vine
#

that's an awesome feature

hollow thistle
still forum
#

if you right-click viewSource on callExtension you can also see what data was passed to the extension.
Or if your CTRL+left click onto the node in the middle graph it will show you what was passed in _this

#

@hollow thistle yep

#

That also includes CBA_missionTime. Which you might or might not need

peak plover
#

This one works nice thansk a bunch

still forum
#

Tell me what the problem was when you find it ^^

hollow thistle
#

PFH object thingy looks interesting. If i can understand correctly this allows for easy pausing/starting of pfh via setVariable on returned object.

still forum
#

PFH returns object? afaik it returns just index?

still forum
#

ahh yes that thing.. Never used that and not even sure what exactly it does

#

Next version of the profiler strips the ugly #line macros and millions of newlines in CBA/ACE scripts and replaces them by a nicely readable
#include "x\cba\addons\statemachine\script_component.hpp" :3 Stolen from my debugger code :U
So you can now nicely view other peoples code that shows up in your profile. This also circumvents people's script "encryption" btw. But don't tell anyone

hollow thistle
#

encryption in easily hookable scripting language. Kappa.

#

Is there any way to get function suggestion for all avalible functions in debug console? (CfgFunctions)

still forum
#

the current suggestions are engine side I think

#

so not really

little eagle
#

Hard coded sadly.

#

I don't know why tho. Seems like something predestinated for config.

#

Is that a word?

#

predestined

#

That's it.

naive oyster
#

can someone help me figure out why i can't find a position inside a house?

#
_allBuildings = nearestObjects [markerpos _rndsector, ["House", "Building"], 250];
if (count _allBuildings == 0) exitWith { diag_log "[ERROR] Could not select a house in sector."; };
_rndBuilding = selectRandom _allBuildings;
_buildingpositions = [_rndBuilding] call BIS_fnc_buildingPositions;
if (count _buildingpositions == 0) exitWith { diag_log "[ERROR] Could not select a position in house."; };
cosmic lichen
#

Are the buildings damaged? Many of them lose their positions if damaged

little eagle
#

nearestObjects does not report terrain objects, only mission objects.

#

Buildings that belong to the map are terrain objects. Mission objects are those placed in the editor or created by script command during the mission.

cosmic lichen
#

Hmm, just tested it, it also returns editor placed buildings

little eagle
#
private _allBuildings = nearestTerrainObjects [markerpos _rndsector, [], 250, false, true] select {
    !(_x buildingPos -1 isEqualTo [])
};
#

This is how I would retrieve _allBuildings.

#

@naive oyster ^

naive oyster
#

ok, i'll try that

cosmic lichen
#

@little eagle His method is faster, at least with a large array.

little eagle
#

I edited a few times. Now it should work good.

#

R3vo it also reports only empty arrays, because:

nearestObjects does not report terrain objects, only mission objects.

cosmic lichen
#

Yep, your right, I confused that.

little eagle
#

So who cares if it's faster. It's not like you search for building positions to spawn ai more than once every ten minutes anyway. At max.

minor crescent
#

Think someone could help me out? Im trying to make a leaderboard/stat saving system by using INIDBI2

#
while {true} do {
    databaseplayers = ["new", "databaseplayers"] call OO_INIDBI;
    {
        _section = getPlayerUID _x;
        _playerKills = _x getVariable ["GMKills", 0];
        _playerTime = _x getVariable ["GMPlaytime", 0];
        _playerDeaths = _x getVariable ["GMDeaths", 0];
        _donatorLevel = _x getVariable ["GMDonator", 0];
        _playerName = name _x;
        ["write",[_section, "kills", _playerKills]] call databaseplayers; 
        ["write",[_section, "deaths", _playerDeaths]] call databaseplayers; 
        ["write",[_section, "name", _playerName]] call databaseplayers;
        ["write",[_section, "playtime", _playerTime]] call databaseplayers;
        ["write",[_section, "donatorLevel", _donatorLevel]] call databaseplayers;
        leaderBoardArray = [];
        newDatabaseLBArray = "getSections" call databaseplayers;
        {
            _nameOfUser = ["read", [_x, "name"]] call databaseplayers;
            _userKillCount = ["read", [_x, "kills"]] call databaseplayers;
            _userDonatorLevel = ["read", [_x, "donatorLevel"]] call databaseplayers;
            _userDonator = format ["%1", _userDonatorLevel];
            leaderBoardArray pushBackUnique [_nameOfUser, _userKillCount, _userDonator];
            leaderBoardArray sort true;
            publicVariable "leaderBoardArray";
        } forEach newDatabaseLBArray;
    } forEach playableUnits;
    sleep 30;
};```
#
_sender = _this select 0;
_senderid = getPlayerUID _sender;

databaseplayers = ["new", "databaseplayers"] call OO_INIDBI;

_kills = ["read", [_senderid, "kills", 0]] call databaseplayers; 
_deaths = ["read", [_senderid, "deaths", 0]] call databaseplayers; 
_playtime = ["read", [_senderid, "playtime", 0]] call databaseplayers; 
_donatorLevel = ["read", [_senderid, "donatorlevel", 0]] call databaseplayers; 

_sender setVariable ["GMKills", _kills,true];
_sender setVariable ["GMDeaths", _deaths,true];
_sender setVariable ["GMPlaytime", _playtime,true];
_sender setVariable ["GMDonator", _donatorLevel,true];```
#

but it won't actually save to the DB

cosmic lichen
#

never worked with INIDB sorry

queen cargo
#

just some random question, do you ever actually save the value?

minor crescent
#
_ehHandle = player addEventHandler ["killed", {
    if (isPlayer (_this select 1) && player != (_this select 1)) then {
        {playSound "killsound"; hint "Enemy Killed";} remoteExec ["bis_fnc_call", (_this select 1)];
        {_kills = player getVariable "GMKills"; player setVariable ["GMKills", (_kills + 1), true]} remoteExec ["bis_fnc_call", (_this select 1)];
        _deaths = player getVariable "GMDeaths";
        _newDeaths = (_deaths + 1);
        player setVariable ["GMDeaths", _newDeaths, true];
    };
}];```
#

@queen cargo

queen cargo
#

there is no second call to inidb
and i kinda doubt it automatically happens

#

ok ... forget it, i did missed something

#

go check the result of the write calls

#

if they are true, ask for help in the forums

still forum
little eagle
#

Nice find, Dedmen.

minor crescent
#

So I got it to save @queen cargo However it doesn't persist, so when I join the server again it resets me back to 0

#

any ideas?

minor crescent
#

So theoretically if I included a "While {false} then all that but instead of write its read?

#

@queen cargo

little eagle
#

A while {false} does nothing ๐Ÿค”

minor crescent
#

rip

#

so @queen cargo I have a loadstats.sqf which has this ```sqf
_sender = _this select 0;
_senderid = getPlayerUID _sender;

databaseplayers = ["new", "databaseplayers"] call OO_INIDBI;

_kills = ["read", [_senderid, "kills", 0]] call databaseplayers;
_deaths = ["read", [_senderid, "deaths", 0]] call databaseplayers;
_playtime = ["read", [_senderid, "playtime", 0]] call databaseplayers;
_donatorLevel = ["read", [_senderid, "donatorlevel", 0]] call databaseplayers;

_sender setVariable ["GMKills", _kills,true];
_sender setVariable ["GMDeaths", _deaths,true];
_sender setVariable ["GMPlaytime", _playtime,true];
_sender setVariable ["GMDonator", _donatorLevel,true];```

#

but when I join the server and i have stats, but if I relog it rewrites the stats and overwrites the other ones

#

setting all the stats to 0 again

cosmic lichen
#

@proven marsh I've done some rewriting and shortening. I removed the syntax stuff completely since the dedicated page was just rewritten

proven marsh
#

Nice. Thank you for doing that. I have been looking at it and just struggling on finding a place to start. Learning this script was very much a "decide what you want to do, then learn how to do it" approach for me, so it is odd to think of a step one. You sorting it out like that makes that easier.

#

While you were doing that I added resources to the See also on the page, consider including that in your changes.

cosmic lichen
#

Will do

meager heart
#

guys, on that page ^ there is "Layout examples" and maybe >

Statement 1;

Block
{
    Statement 2;

    Nested block
    {
        Statement 3;
        Statement 4;
    };
};
```๐Ÿ˜• 

Statement 1;
Block {
Statement 2;
Nested block {
Statement 3;
Statement 4;
};
};

#

no ?

proven marsh
#

I personally use the latter. I still frequently see both though.

little eagle
#

This is strange to me, as the "Block" is also "nested"... Within the main scope of the function.

#

Also, it enumerates the statements, though "Block" and "Nested Block" are in fact also statements that are skipped in the counting for some reason.

meager heart
#

maybe just change them to some if-then example ๐Ÿค”

little eagle
#

Or call.

proven marsh
#

In an absolute sense, sure. But when we are talking the first page that a newcomer scripter sees, it is fair to see it at face value. It's just the structure. Agreed that making it if-then or even a function definition may be more sensible.

cosmic lichen
#

I'd rather put then onto the Code Optimisation page in "Make it readable"

little eagle
#

It would make more sense when explaining what a statement is to a beginner, to just say that it is everything terminated by ; or } or the EOF.

earnest path
#

Hey guys I have a little mod that i made with just code addons and it has config.cpp that loads fine if i load it on the server as a mod but if i put it within another mod it does not seem to load up the config.cpp any ideas?

#

Will the client ever see the server side configFile trough the debug console config tool?

little eagle
#

No.

earnest path
#

Ok so it might be loading up correct than and i am just confised ๐Ÿ˜ƒ

astral tendon
#

Is there a way to get the UAV target that he is aiming at? because assignedTarget allways returns objectnull

meager heart
#

afaik works with vehicles only

astral tendon
#

though i need to know a target, this is what i need to get

meager heart
#
private _target = allUnits apply {_uav aimedAtTarget [_x] > 0.5; _x} param [0, objNull];
#

maybe

astral tendon
#
player targets [false, 300, [east,sideEnemy]]; //empty array

player targets [false, 300, [sideUnknown,sideEnemy]]; // returns all units

wtfuf

meager heart
#

probably player do not knowsAbout units around ๐Ÿค”

little eagle
#

What about.

#
private _target = allUnits apply {_uav aimedAtTarget [_x] > 0.5; _x} param [0, objNull];

->

private _target = allUnits select (allUnits findIf {_uav aimedAtTarget [_x] > 0.5});
meager heart
#

yeah was thinking about it... need test it ๐Ÿ˜€

#

select i mean vs apply

little eagle
#

I propse a new command: selectIf:

allUnits selectIf {_uav aimedAtTarget [_x] > 0.5};
#

Quits the loop after the first true and reports that item.

meager heart
#

yeah will be nice

astral tendon
#

is selectIf a comand?

little eagle
#

No.

propose
verb
put forward (a plan or suggestion) for consideration by others.
astral tendon
#

...

little eagle
#

But it should be.

#

It is one in my heart.

meager heart
#

zero divizor with select and findIf option, commy

little eagle
#

Oh, you know what would fix that?

#
private _target = allUnits param [allUnits findIf {_uav aimedAtTarget [_x] > 0.5}, objNull];

PARAM!

meager heart
#

yeah fixed... but now next trouble with <NULL-object> ๐Ÿ˜€

little eagle
#

Well, if there is none, then null is what you get.

meager heart
#

sorry forgot about gyazo... can you see it ?

#

nvm... he is offline ๐Ÿ˜•

astral tendon
#

other option is if there a way to get the possition were the UAV is aiming at?

meager heart
#

what with object, you changed plan ?

astral tendon
#

I changed

#

none of those above worked

#

all i need is to get what unit is the UAV aiming at.

meager heart
#

lol

#
hint str (allUnits apply {vehicle player aimedAtTarget [_x] > 0.5; _x} param [0, objNull]); 
``` this ^ https://gyazo.com/9dfbbec5a471ee5ec3299b72c59c590e
#

works ๐Ÿ‘Œ

little eagle
#

I don't think so.

#

That's just a convoluted way of writing:

allUnits param [0, objNull]
meager heart
#

sorry ? ๐Ÿค”

astral tendon
#

this ^

#

don't ๐Ÿ‘Œ๐Ÿฟ

meager heart
#

it return Opfour ๐Ÿ˜„

astral tendon
#

yes, is the name of the unit made for create units.

meager heart
#

can you test it one more time and add in watch field in the console cursorObject ? ๐Ÿ˜€

#

just repeat what you did b4

astral tendon
meager heart
#

that ai you looking at is the target you need ?

astral tendon
#

yes i need to know him with out i have to be in the UAV

meager heart
#

also what is sierra1 select 0 ?

astral tendon
#

the unit inside the UAV

meager heart
#

LOL

#

dude

astral tendon
#

sierra1 is a UAV

meager heart
#

nice

#
copyToClipboard str (allUnits apply {sierra1 aimedAtTarget [_x] > 0.5; _x} param [0, objNull]); 
#

try this

little eagle
#

Still wrong.

astral tendon
#

generic error

little eagle
#

sldt1ck, this is not how apply works.

astral tendon
#

and

[B Sierra 1:1,[B Sierra 1:1],B Sierra 1]

sierra1 returns this

#

and still generic error

meager heart
#

lol

#

edited above ^

#

and paste here what it will return pls

astral tendon
#

generic error

meager heart
#

๐Ÿ˜”

astral tendon
#

Press F to pay respects

meager heart
#

drone was that darter thingy ^

astral tendon
#

my drone is a laser desinator

#

what does your var_drone returns?

meager heart
#

link above dude

astral tendon
#

i mean the VARIABLE var_drone in the watch

meager heart
#

var_drone < uav name
var_target < that target ai

astral tendon
#

yes, what it returns if you put in the watch?

meager heart
astral tendon
#

wat

#

my returns this

#
Sniper1 ={
SniperDummy1 = createAgent ["I_Sniper_F", _this, [], 0, "CAN_COLLIDE"];
SniperDummy1 allowdamage false;
SniperDummy1 disableAI "all";
[SniperDummy1, "AmovPercMstpSrasWrflDnon"] remoteExec ["switchmove", 0];
Sierra1 = [(getPosATL SniperDummy1), 0, "B_Static_Designator_01_F", west] call BIS_fnc_spawnVehicle;
createVehicleCrew (Sierra1 select 0);
(Sierra1 select 0) allowdamage false;
((Sierra1 select 1) select 0) allowdamage false;
{(Sierra1 select 0) removeWeapon _x} forEach weapons (Sierra1 select 0);
(Sierra1 select 0) addMagazine "7Rnd_408_Mag";
(Sierra1 select 0) addWeaponTurret  ["srifle_LRR_F",[0]];
(Sierra1 select 0) attachTo [SniperDummy1, [0, 0.1, 0.6], "granat2"];
[(Sierra1 select 0)] remoteExec ["hideObject"];
SniperDummy1 setCaptive true;
(Sierra1 select 0) setCaptive true;
(Sierra1 select 0) setAutonomous true;
SniperDummy1 call Sniper;
SniperDummy1 setdir (getdir _this);
((Sierra1 select 1) select 0) setCombatMode "BLUE";
//sniper report 
Sierra1 select 0 execVM 'SniperTargeting.sqf';
group (Sierra1 select 0) setGroupIdGlobal ["Sierra 1"];
(Sierra1 select 0) setSkill 1;
(Sierra1 select 0) setVariable ["voice", (selectrandom ["s1"]), true];
(Sierra1 select 0) disableAI "AUTOTARGET";
(Sierra1 select 0) disableAI "AIMINGERROR";
[(sierra1 select 0),["Set Sniper to Not fire",{(_this select 0) setCombatMode "BLUE"}]] remoteExec ["addAction"];
[(sierra1 select 0),["Set Sniper to Fire if hostile",{(_this select 0) setCombatMode "GREEN"}]] remoteExec ["addAction"];
};

this is how my UAV is created

unborn ether
#

๐Ÿ‡ต ๐Ÿ‡ฆ ๐Ÿ‡ท ๐Ÿ‡ฆ ๐Ÿ‡ฒ ๐Ÿ‡ธ

meager heart
#

๐Ÿ™„

edgy dune
#

XD

meager heart
#

I've seen this raw sqf strength only once before, it didn't scare me enough then, it does now.

vapid venture
#

Interesting, if you script something like this :private ["_animEH"];
_animEH = BIS_leader addEventHandler [
"HandleDamage",
{
private ["_damage", "_source"];
_damage = _this select 2;
_source = _this select 3;

    if (_source in [vehicle BIS_inf, BIS_inf]) then {_damage} else {0};
}

];
(Allows only player to hurt the entity) Ace completely overrides it.

#

Quick question, So for an entity I have a script that looks like this: BIS_AlphaLead = this; this setCaptive true; {this disableAI _x} forEach ["ANIM", "AUTOTARGET", "FSM", "MOVE", "TARGET"]; 0 = this spawn {_time = random 1; waitUntil {time > _time}; _this switchMove "hubstanding_idle2"; _animEH = _this addEventHandler ["AnimDone", {(_this select 0) switchMove (_this select 1)}]; _this setVariable ["BIS_animEH", _animEH]; _killedEH = _this addEventHandler ["Killed", {(_this select 0) removeEventHandler ["AnimDone", (_this select 0) getVariable "BIS_animEH"]}]; _this setVariable ["BIS_killedEH", _killedEH]}

#

I'm trying to get it so that it stops spawning with different gear than I give it in the scenario, is there anything in here that can be altered that would allow me to prevent it from doing that?

unborn ether
#

@vapid venture Its hard to read that without code markup. But if you want to use specific loadouts you should use Respawned EVH and handle gear there.

little eagle
#

@vapid venture That's because ace medical uses its own HandleDamage eventhandler and whenever you use two, the return value for damage from the first one is ignored.

#

Whichever happens to be added last will take effect.

edgy dune
#

Also harder to tell what killed the unit with ACE yea?

vapid venture
#

True

little eagle
#

That's because you have death by bleeding etc. in ACE, which is done by using setDamage. And there is no way to tell setDamage who to report as killer in Killed.
I don't like ace_medical either for these reasons.

vapid venture
#

Yeah itโ€™s not the most scripter friendly

unborn ether
tough abyss
#

Is it possible to add multiple items to an array at once? Basically, an inline array?

say I have _array1 = [1, 2, 3];
I want to, essentially,
_aray1 pushBack [4,5,6];

meager heart
#

append < with this

#

@tough abyss

tough abyss
#

Thanks.

#

Going to add that to https://community.bistudio.com/wiki/Array#Adding_.28appending.29_to_arrays

unborn ether
#

_arrayThree = _arrayOne append _arrayTwo; // Output: ["One","Two"];

meager heart
#

armalinux ๐Ÿค”

tough abyss
#

that specifies appending two declared arrays, but not necessarily an inline array.

unborn ether
#

@meager heart what? ๐Ÿ˜„

meager heart
#

seek database for player crimes ๐Ÿค”

unborn ether
#

@meager heart Nah nah you don't see that. No no. ๐Ÿ‘€

meager heart
#

oh shit sorry...

unborn ether
#

"oh shit im sorry. Sorry for what?" ยฉ

#

well actually thinking of expanding it to a full-scale tool with ability to execute code plain and templated code. I don't know if its worth it.

meager heart
#

is it admin panel kinda thingy ?