#arma3_scripting

1 messages Β· Page 453 of 1

astral tendon
#

understandable, have a great day.

#

Though, you still can add a note?

still forum
#

I think this was the first time I tried to add a note via the way it was intended to... And it failed..
Yeah I just added it manually now

astral tendon
#

Thanks, I was rolling around google to find a exemple like that I made, that will help allot of new mission makers.

wary vine
#

feel so damn drained today -.-

#

I need a stiff drink o/ later all

still forum
#

you're pipes are probably leaking. You should call a plumber

digital hollow
#

while (drained ud9d-1) do {ud9d-1 drink water;};

wary vine
#

feck water.

#

thats what a nice bourbons for

#

@digital hollow generic error in expression expected number type number

digital hollow
#

More like liver.exe out of memory.

wary vine
#

I don't drink that much jeez.

#

im not german

gleaming oyster
#

looks around
psst, ud9d-1, there are a lot of germans here

wary vine
#

shh

#

they might hear you.

#

They will admit it πŸ˜‰

#

I have a german bar round the corner from me, they server drinks in glass boots , I went out a while ago, and tried wearing the boots... didn't end well.

shadow sapphire
#

I do NOT understand string syntax.

#

The fuck is that page talking about?

little eagle
#

string syntax
πŸ€”

digital hollow
#

Just put getAllHitPointsDamage into a watch field and copy the results out.

little eagle
#
copyToClipboard str (getAllHitPointsDamage _thing # 1);

???

shadow sapphire
#

@digital hollow, that's a good idea!

#

@little eagle, interesting. WHY is it that way?

little eagle
#

Why is what the way it is?

shadow sapphire
#

My orca is named Orca.

#

Oh, I mean, could you explain to me why the syntax for that goes that way.

gleaming oyster
#
copyToClipboard str (getAllHitPointsDamage Orca # 1)
shadow sapphire
#

I don't understand why we do it that way, or why it should be done that way, if that makes sense.

little eagle
#

πŸ€”
There is no "why". It is the way it is, because the people that made SQF made it that way.

#

It's arbitrary. Just like any language.

#

getAllHitPointsDamage reports an array containing three arrays.

#

Array one is the HitPoint names, which are not unique and therefore useless.

#

Array two is the selections of the hitpoints. The part in the model that can detect and receive damage, which are unique and therefore infinitely more useful than hitpoints.

#

And array three is the current amount of damage.

#

Elements in the three arrays belong to each other by index.

#

You're only interested in the selections, so you pick array number 2 (index 1).

#

To copy the array to the clipboard, you need to convert it to a string. Because for some reason, copyToClipboard only works on strings.

#

That's it. All commands explained.

shadow sapphire
#

VERY cool. Thanks so much. I am actually finally getting to the point where I'm understanding this stuff, but the page on strings was just not helpful. It looked like gibberish.

little eagle
#

You mean the description of the str command?

shadow sapphire
#

Yes.

little eagle
#
Converts any value into a string by placing " and " around the argument. Since Arma 3 v1.63.137891 this command will correctly escape all " inside a string:
// Before the fix:
hint str "string "" string"; // "string " string" <- invalid string
call compile str "string "" string"; // ERROR
// After the fix:
hint str "string "" string"; // "string "" string" <- valid string
call compile str "string "" string"; // OK
When used on object, object debug name is returned.
shadow sapphire
#

Oh, I guess that's the issue.

#

I didn't realize it was a command? IDK.

#

Still don't quite get that one, I guess.

little eagle
#

" and " is a dumb way of saying something, because it's the same character twice.

gleaming oyster
#

err...

little eagle
#

str ANY is a unary command that stringifies/serializes the input on the right side and returns a string.

shadow sapphire
#

But! Thanks to you two I got the hit points on the Orca. Answered a question I've had for years now. Haha, going to try to make the hull invulnerable on helicopters if they are below a certain speed and radar altitude, to prevent this dumb shit: https://www.youtube.com/watch?v=c2JtfFpALJA

little eagle
#

Did you think str was some special keyword and not just another command of the thousand plus we have?

shadow sapphire
#

No, I thought a string was just a format like an array or something.

winter rose
#

well, it is?

little eagle
#

STRING is a data type just like ARRAY.

#

str ANY reports STRING.

shadow sapphire
#

So str != string?

austere granite
#

....

astral tendon
#

we should have a command like srt but reverse to remove strings

little eagle
#

str is a command, and not data.

shadow sapphire
#

Gotcha.

austere granite
#

str 80085 >> "80085"`

shadow sapphire
#

That was probably the primary source of my confusion.

little eagle
#

"str" is a string.

#

Why tho.

gleaming oyster
#

wait a sec

winter rose
#

str is a command to "stringify" any type of data

austere granite
#

typeName "80085" >> 'STRING'
typeName 80085 >> 'SCALAR'

little eagle
#

Just like how parseNumber is a command to parse a string to number.

winter rose
#

@astral tendon > "we should have a command like str but reverse to remove strings"
call compile πŸ‘€

little eagle
#

parseNumber "80085" // 80085

#

call compile cannot deserialize everything you used str on.

#

str and call compile are not bijective for every data type.

astral tendon
#

@winter rose

call compile "hi";  //returns nothing
austere granite
#

str player >> "B Alpha 1-1:1 (Adanteh)"
call compile "B Alpha 1-1:1 (Adanteh)" >> REEEGETTHEFUCKOUTWHAREAAYOUEVENDOING

winter rose
#

@astral tendon and what do you want it to do? it will return hi variable content

astral tendon
#

just remove the string

little eagle
#
player call BIS_fnc_netId // "2:0";
"2:0" call BIS_fnc_objectFromNetId; // player
winter rose
#
hi = "lololo";
var2 = call compile "hi"; // var2 = "lololo"
#

but yes, call compile is not always working.

astral tendon
#

thats why i said would be cool have comand just to remove the strings

little eagle
#

str and call compile is a mess. Avoid it. It's funny how it happens to work for SIDE type only for west and east, because:

str west // "west"
str east // "east"

But not for resistance, because

str resistance // "guer"
astral tendon
#

because "fuck you" -BI

little eagle
#

No, you're not supposed to use str call compile.

winter rose
#

"remove the quotes" is quite… general

little eagle
#

Just a bad habbit that spread. It's your own fault for it failing.

#

I liked how nigel said fuck it and used

guer = resistance;
civ = civilian;

to work around it.

astral tendon
#
    Suspects_Pos =  call compile (format ["%1Suspects_Pos", MissionSelected]);
    Civs_Pos = call compile (format ["%1Civs_Pos", MissionSelected]);
    Officers_pos =  call compile (format ["%1Officers_pos", MissionSelected]);
    Cut_Camera = call compile (format ["%1Cut_Camera", MissionSelected]);
    publicVariable "Cut_Camera";

One exemple in my mission were I just need to remove the strings

little eagle
#

I also remember that one of you in this channel argued for hours that resistance somehow is something else than independant. Guy just wouldn't get it that they're aliases.

#

You mean, remove the quote marks.

#

" is not a string. It's a quote mark.

winter rose
#

reverseStr str (hint "OK") would still do nothing hehehe

little eagle
#

Also, you should just write the script as:

    Suspects_Pos =  missionNamespace getVariable format ["%1Suspects_Pos", MissionSelected];
    Civs_Pos = missionNamespace getVariable format ["%1Civs_Pos", MissionSelected];
    Officers_pos =  missionNamespace getVariable format ["%1Officers_pos", MissionSelected];
    Cut_Camera = missionNamespace getVariable format ["%1Cut_Camera", MissionSelected];
    publicVariable "Cut_Camera";
winter rose
#

west = blufor = "west"
east = opfor = "east"
resistance = independent = "guer"
yay, have fun

little eagle
#

My fav side is sideLogic

astral tendon
#
Suspects_Pos =  call compile (format ["%1Suspects_Pos", MissionSelected]);
Suspects_Pos //returns AirportSuspects_Pos (Airport is the name of the misson area NOT THE ATUALL MISSION)

Suspects_Pos = (format ["%1Suspects_Pos", MissionSelected]);
Suspects_Pos //returns "AirportSuspects_Pos"
little eagle
#

missionNamespace

#

getVariable

#

:~)

astral tendon
#

Suspects_Pos is also a game logic placed on the editor

#

that is for some dynamic CutScene for the end of each mission

#

then evreyone gets teleported back to the base to chose other mission

#

about the side stuff
BI dude 1: "Hey lets make it easy and put the name equal to all others"
BI dude 2: "LOL no, lets just make they figure it"

winter rose
#

that, or last minute change

#

I remember reading a blog entry stating they debugged Hardware T&L compatibility for OFPv1.00 minutes before delivery

#

so, if they changed guer to resistance to be more "pro", well, shit happens

astral tendon
#

what exactly?

little eagle
#

You're not supposed to use call compile to reverse str. It's really hard to get this into peoples heads, but west being stringified to "WEST" and that resembling uncompiled code that matches the command named west is an accident.
If you use this method, you're relying on accidents, and ofc it will only work in some cases.

#

A list of all weapons in the game?

molten folio
#

Can anyone Help me with my RscListBox Weapon list ?

little eagle
#

Complete list of all weapons`

#

?

astral tendon
#

missionNamespace getVariable seens just as hard, thats why i said it would be good a reversed command for str

molten folio
#

ye

#

all classed in CfgWeapons

little eagle
#

missionNamespace getVariable is the correct way though, Roque, even if the command names look long and intimidating at first.

astral tendon
#

though beside speed, what does it really matters?

little eagle
#

Command names are arbitrary though. A command like spawn has a really short name, but what it does is probably starting the most bloated and complicated machinery in the game as far as scripting goes.

#
"true" configClasses (configFile >> "CfgWeapons")
#

???

#

: though beside speed, what does it really matters?
It always works.

astral tendon
#

How would it fail if i use call compile?

little eagle
#

call compile str resistance

winter rose
#

will try to use guer command, failing

little eagle
#

call compile str player fails iff the player has no vehicle var name.

winter rose
#

^

little eagle
#

It works iff the player has a vehicle var name.

winter rose
#

in which case would you want/need to rely on it @astral tendon ?

little eagle
#

Stuff like this is script errors waiting to happen. Bad practice.

still forum
#

@astral tendon call compile "hi" does exactly what you expected. it removes the "strings" aka quotes. And a hi without quotes is a variable. And trying to get a variable returns the contents which is what you got.

astral tendon
#

@winter rose is just me getting complicated bilding missions really

#

it would take some time to explaim

little eagle
#

Actually for call compile str player to work you need more than a vehicle var name.

#

You need:

  • player object to have a vehicle var name
  • a global variable pointing to the player, and
  • the global variable being the same as the vehicle var name (case insensitive at least)
astral tendon
#

well, for that case i would use just player to get the variable

#

I dont really need to put and remove the string

little eagle
#

player object could be replaced by any other object. Same thing. Just the easiest example. Same stuff for cursorTarget.

winter rose
#

using str and call compile is not the same thing as JSONifing stuff, it's more of a .toString() (if you code a bit)

still forum
#

If only there was a easy way to turn a object into a globally unique ID and back

#

Oh wait.. Every object has it's oid that is globally unique and the same on every machine...

#

But we cannot access it without Intercept

little eagle
#

You could even trick it:

bob = cursorTarget;
player setVehicleVarName "bob";

call compile str player // same as cursorTarget
astral tendon
#

wat

little eagle
#

call compile str player is the cursor target now. Great scripting.

#

Try it, Roque!

astral tendon
#

the player is trying to aim at it self?

little eagle
#

No, call compile str is just not working the way you think.

#

As I explained...

astral tendon
#

lol

#

that right

#

player have the variable bob and call compile str player has the variable of the unit

little eagle
#

Yep.

thorn saffron
#

How can I get the gunner's turret heading, but without looking it via weaponDirection?

still forum
#

If you disect it it's clearer. str player -> "bob"
call compile "bob" ->

bob

-> content of bob variable

little eagle
#

The correct way is:

bob = cursorTarget;
player setVehicleVarName "bob";

(player call BIS_fnc_netId) call BIS_fnc_objectFromNetId // works, same as player
astral tendon
#

jesus

#

though

missionNamespace getVariable str player

also return the name of the unit

still forum
#

And is like 10x faster (approximate numbers used)

meager heart
#

How can I get the gunner's turret heading, but without looking it via weaponDirection?
getDir on the gunner? πŸ€” @thorn saffron

little eagle
#

Yeah, it's also broken, because the problems of stringifying players is an issue with str, not call compile.

astral tendon
#
Result:
0.0011 ms

Cycles:
10000/10000

Code:
missionNamespace getVariable str player 
Result:
0.0015 ms

Cycles:
10000/10000

Code:
call compile str player

eh....

still forum
#

Hah! see!v almost 2x

little eagle
#

OBJECT type simply cannot be serialized reliably.

molten folio
#

@little eagle sqf "true" configClasses (configFile >> "CfgWeapons") how do i show this in a RscList

still forum
#

_ctrl setText '"true" configClasses (configFile >> "CfgWeapons")'

#

hueue

#

"true" configClasses (configFile >> "CfgWeapons") apply {_list append (configName _x)}
replace append by the proper command to append stuff to a RscList control

little eagle
#

BIS_fnc_netId and BIS_fnc_objectFromNetId. Remember these, get used to them.

molten folio
#

what do they do?

#

anyone got a wiki page?

still forum
#

A wiki page? Sure

little eagle
meager heart
little eagle
#

I like how # is the only command that doesn't need any whitespace between the adjacent command.

getPosATL player#2
molten folio
#

so @still forum so i use both and replace append a the right command?

still forum
#

the only how about !^*/

#

what is "both" ?

molten folio
#

both scripts/

still forum
#

The first one was a rather obvious joke

molten folio
#

soo ill use the second one

#

xd

#

do i replace apeend with LbAdd?

still forum
#

Yeah. That sounds right

little eagle
#

The second one just errors, because append is used with rhs being a STRING not ARRAY.

still forum
#

read ze comment

little eagle
#

lbAdd I believe

still forum
molten folio
#
"true" configClasses (configFile >> "CfgWeapons") apply {_list lbAdd(configName _x)}```
#

like this?

still forum
#

_list has to be your control

#

yeah. Like that

molten folio
#
_list = _display displayCtrl 9110;```
#

??

still forum
#

ye

little eagle
#

Are we doing apply > forEach now or what?

still forum
#

oh

#

Didn't even notice that

#

wanted to use apply to get a array of strings and just changed my mind

little eagle
#

I don't mind.

molten folio
#

?!?!?!

#

Whats for each?

little eagle
#

SQF control structure.

winter rose
molten folio
#

i mean what dou mean Apply foreach/

little eagle
#

πŸ€”

molten folio
#

Are we doing apply > forEach now or what?

little eagle
#

Yeah, because I expected the statement to use forEach and not apply.

molten folio
#
AdminWeaponList = {
    disableSerialization;
    _list = _display displayCtrl 9110;
    lbClear _list;
    {
        "true" configClasses (configFile >> "CfgWeapons") apply {_list lbAdd(configName _x)}
    } foreach ;
};```
#

?!?!!?!

#

like that u mean?

little eagle
#

At some point they added apply, and it does what forEach does plus more, except that the array is written first and then the code, and not the other, super confusing, way around.

#

No.

still forum
#

Just forget about it @molten folio

molten folio
#
AdminWeaponList = {
    disableSerialization;
    _list = _display displayCtrl 9110;
    lbClear _list;
    "true" configClasses (configFile >> "CfgWeapons") apply {_list lbAdd(configName _x)}
};```
#

??

#

wow...

still forum
#

Why don't you try out your code instead of posting it and writing ??

little eagle
#

lgtm

molten folio
#

not working

little eagle
#

_display defined?

molten folio
#

was thinking of that

#

xd

molten folio
#
"true" configClasses (configFile >> "CfgWeapons" >> _x >> 'displayername') apply {_list lbAdd(configName _x)}``` i've added Displayer name but now how can i show the Picture ?
#

is it like this sqf "true" configClasses (configFile >> "CfgWeapons" >> _x >> 'picture') apply {_list lbAdd(configName _x)}

#

and How do i only show the weapons xDD not the uniform?

little eagle
little eagle
#

Someone was wrong on the internet... about SQF. How do I cope?

gleaming oyster
#

you don't, cave in and cry.

meager heart
#

life is unfair, just accept it...

gleaming oyster
#

someone shuffled your deck incorrectly in the game.

digital hollow
#

All the warnings were ignored when your scenario was being compiled.

astral tendon
#

Is there a way to make say3d play on a dead body? I am using the killed event handle to use the say3D

still forum
#

you can say3D on any object

#

yes. A dead body is a object too

astral tendon
#

But... he is dead

little oxide
#

In arma 2 say3D was working only on alive object

#

But not tested in arma 3

astral tendon
#

In Arma 3 too

#

If the unit died none of the says works

still forum
#

or kill the source with setDamage for example. I guess that's a no then?
You could use createSoundSource then.. That should work

little eagle
#

CREATE

#

A

#

DUMMY

#

, DUMMY

tame portal
#

JUST DO IT

astral tendon
#

createSoundSource loops the sound

little eagle
#
private _dummy = "#particlesource" createVehicleLocal [0,0,0];
_dummy setPosWorld getPosWorld _corpse;
_dummy say3D "whatever";
_dummy spawn {
    sleep 5;
    deleteVehicle _this;
};
tame portal
#

I disagree

little eagle
#

Since when do we ask for your permission again?

astral tendon
#

That will do it

tame portal
#

@little eagle Well

astral tendon
#

mind to put that exemple as a commet in the say3D page as a workaround for dead objects?

still forum
#

particlesource is atleast better than spawning a invisible helipad

tame portal
#

I actually don't know, since you said you're gonna call people that disagree with you a bot lul

little eagle
#

If you put it on the wiki, then do it like this:

private _dummy = "#particlesource" createVehicleLocal ASLToAGL getPosWorld _corpse;
_dummy say3D "whatever";
_dummy spawn {
    sleep 5;
    deleteVehicle _this;
};
gleaming oyster
#

πŸ€–

astral tendon
#

Well, I cant,

#

what about ma boi @still forum

little eagle
#

@still forum Schnell schnell, zackig zackig.

tame portal
#

Sometime it's really hard to tell if commy is being serious or not. It's a risk to answer

still forum
#

any description to that?

little eagle
#

Example X
Workaround for dead bodies.

#

Sometime it's really hard to tell if commy is being serious or not.
Depends on what you mean by "serious".

astral tendon
#

"If you need to make the say3D work on dead bodies/objects you can use this work around"

#

that kinda of stuff

wary vine
#

@molten folio

private _weaponTypes = ["AssaultRifle","BombLauncher","Cannon","GrenadeLauncher","Handgun","Launcher","MachineGun","MissileLauncher","RocketLauncher","Shotgun","Rifle","SubmachineGun","SniperRifle"];
{
  private _thisWeaponInfo = [(configName _x)] call BIS_fnc_itemType;
  private _thisWeaponType = _thisWeaponInfo # 1;
  if (_thisWeaponType in _weaponTypes) then {
    private _index = _list lbAdd (getText (_x >> "displayName"));
    _list lbSetPicture (getText (_x >> "displayPicture"));
  };
} forEach ("true" configClasses (configFile >> "CfgWeapons"));
``` has not been tested
gleaming oyster
#

displayername
:]

little eagle
#

MUSCLE

#

MEMORY

wary vine
#

shh

gleaming oyster
#

πŸ₯“

little eagle
#

That whole part should go,

#

Last line is borked.

#

yop

wary vine
#

changed it

gleaming oyster
#

bork bork 🐢

molten folio
#

@wary vine ur a legend ❀

wary vine
#

FECK

#

I need more whiskey

astral tendon
#

nobody saw anything

still forum
#

@little eagle be happy

gleaming oyster
#

share at least

wary vine
#

NO

#

This shit cost me Β£50 a bottle

gleaming oyster
#

i'll share a bowl?

little eagle
#

"true" configClasses (configFile >> "CfgWeapons")
beginner level

"true" configClasses configFile/"CfgWeapons"
enlightened level

wary vine
#

@little eagle do you wanna take this outside ?itsleiElmo

gleaming oyster
#

πŸ₯Š

queen cargo
#

Everytime I see that emojie in the mobile Version of discord I am remembered of an adult toy

wary vine
queen cargo
#

Not the Santa thing

#

But the newspaper

still forum
#

A dragon toy?

little eagle
#

πŸ₯Š 😏 πŸ₯Š

gleaming oyster
#

:[

still forum
#

Oh.. Probably not a dragon toy

gleaming oyster
#

oh god, commy stop

tame portal
#

@little eagle I don't know, thats hard to tell aswell

wary vine
#

@queen cargo you been playing with'em too much

queen cargo
#

More something to stuff my dragon into 😏 😏

gleaming oyster
#

πŸ‘ πŸ‘„ πŸ‘

still forum
#

Ahhh I understand

little eagle
#

Looks like a salt shaker to me.

wary vine
#

^^

tame portal
#

🍍

wary vine
#

thats what I thought it was first

#

@tame portal what have i said about playing with your pineapple in public πŸ˜‰

tame portal
#

The only person I consider their criticism about my pineapply worthy of being noticed is commy because it's hard to study him

little eagle
#

Pine apples are a fraud. They aren't apples and they don't grow on pine trees.

wary vine
#

xD

#

Your name is a lie...

#

Your not commy2.

#

Your just Commy xD

little eagle
#

You're*
Your welcome.

still forum
#

Actually.. never thought about that.. Why the 2?

wary vine
#

Shh

little eagle
#

It's short/cute for Commander2.

wary vine
#

it started when he was just a boy.

gleaming oyster
#

how cute

wary vine
#

when it was cool to have numbers in your username πŸ˜‰

#

Oh shit

#

nvm

still forum
#

My name also started when I was just a boy. That didn't know enough english to know how to properly write his name

little eagle
#

No, I had two classmates and we were Commander 1 , Commander 2 and Commander 3.

gleaming oyster
#

xxx-pu$$sy-sl8yr-xxx

tame portal
#

And I named myself after a hacki boi apparently, we all have sad background stories

wary vine
#

@gleaming oyster EXACTLY

inner swallow
#

Haha commy that's kinda cute :p

wary vine
#

Yup the other Optix.

little eagle
#

Commander 1 is who started BWA3 btw.

gleaming oyster
#

Where is C3?

#

@wary vine Lovely days.

little eagle
#

He's a politician now.

gleaming oyster
#

German politican, interesting

still forum
#

Commanding for real πŸ˜„

wary vine
#

Germans do politics ?

#

MIND BLOWN

still forum
#

No. We enforce them.

inner swallow
#

Hah

wary vine
#

ahahaha

little eagle
#

Yeah, His grandfather was a communist, so obviously his grandson is a conservative.

queen cargo
#

Nah
We usually just annectade

gleaming oyster
#

"obviously" :^]

queen cargo
#

But got a lot of spare time where we act like we would do politics

#

That is also why Merkel still is chancelor

wary vine
#

anyone wanna take a look at tidying something up for me πŸ˜‰

#

it works fine.

#

just could be neater πŸ˜‰

gleaming oyster
#

make pr on git <- @wary vine

little eagle
#

Why wouldn't it be like that? Being a politician is more hereditary than any specific ideology.

wary vine
#

my background slider for my phone but is messy asf

#

but works 100%

still forum
#

It contains public variables that anyone could manipulate. So definetly not 100%

little eagle
#

private _left = 0.368 * safezoneW + safezoneX;
private _right = _left + (0.261937 * safezoneW);
private _top = 0.273 * safezoneH + safezoneY;
private _bottom = (_top + (0.4532 * safezoneH));

It should be left, top, width, height

still forum
#

Learned yesterday that you cannot allow anyone to access anything of your stuff

wary vine
#

nope

still forum
#

else they will break it and say "your fault for not protecting it"

little eagle
#

Dedmen is trolling now.

still forum
#

Kinda.. Refering to the github conversation about ace arsenal

wary vine
#

@little eagle i need those specifically

gleaming oyster
#

or he's taking on commy's sense of serious

little eagle
#

getMousePosition params ["_mouseX","_mouseY"];
This looks like something I would write.

tame portal
#

Its missing a macro for that though

little eagle
#

1000 lines of defines.

#

One function call.

wary vine
#

its a mess but its works

tame portal
#

The macros? Yes

little eagle
#

Perfect

wary vine
#

πŸ˜†

still forum
#

the event stuff always triggered me

#

I'm just like "FFS show me what you are doing finally"

little eagle
#

HAHAHA

wary vine
#

i have not go around to using macros yet xD

little eagle
#

But I do show it. E.g. global event does:
CALL_EVENT(_params,_eventName);
SEND_EVENT_TO_OTHERS(_params,_eventName);
:kappa:

wary vine
#

xD

#

I just like everything being infront of me , for me, its easier to read

#

xD

#

Because you can't read what you can't see

little eagle
#

It's nicer this way, because I only need to edit one line to change stuff in it.

wary vine
#

Good point.

little eagle
#

E.g. use flat copy here, which would speed it up...

#

takes notes for upcoming pull request

wary vine
#

fecj

#

now im going to far with my phone xD

#

Im making a custom log.dll for it xD

still forum
#

custom log.dll pfft.. Intercept

wary vine
#

Meh,

#

Im just sending client errors to the server in playerUID.txt

#

so if they report an issue, all i gotta do is check that file.

tame portal
#

When commy sees 99% macros

still forum
#

always thought that was a stick figure pushing that rock

little eagle
#

Nah, it's an oily and naked buff dude.

gleaming oyster
#

Pushing rocks.

glad venture
#

is there a way to add cba to a server only and only call the cba functions with the server?

gleaming oyster
#

is that how you see yourself commy?

wary vine
#

oily and naked buff dude < not commy2

still forum
#

@glad venture Since the last version of CBA. Yes!

#

I added a optional PBO in the last update that disables the "YOU ARE MISSING MODS!" warning that get's posted on all clients if they join without CBA

wary vine
#

oily and naked maybe... buff dont know about that one. dude are you sure ?

still forum
#

Just move the optional pbo into addons and load as servermod

wary vine
#

xD

gleaming oyster
#

@wary vine I mean, if anythimg he's gotten buff in the brain from occupying his time in #arma3_scripting

wary vine
#

xD

gleaming oyster
#

And your brain being buff = swell = bad

still forum
#

swell == bad?
Oh boi

wary vine
#

I have been using swell wrong all my life 😦

gleaming oyster
#

You're letting the kids get to you dedmen,

boi

little eagle
#

is that how you see yourself commy?
lol definitely not as Ancient Greek Übermensch.

#

Ever read anything by A. Camus?

gleaming oyster
#

Nope

little eagle
#

Absurdist philosophy. I don't agree with any of it, but it's a nice book cover.

wary vine
#

.<

little eagle
#

And reading this channel definitely feels absurd quite often.

wary vine
little eagle
#

I never watched Futurama, so idk if that old guy is a good character or not.

wary vine
#

gotta go get some more ice, back in 10

#

htf did i run outta ice cubes before whiskey -.-

gleaming oyster
#

Do you not have a tray?

gaunt cairn
#

ice in whiskey....

wary vine
#

when its Β£50 a bottle... yes

#

next one i wanna try, just because of the name xD

gleaming oyster
#

coolio

#

only thing i have ever drank was some canadian whiskey and some mead. Mead was brewed by someone i know. I like the mead over the whiskey

little eagle
gleaming oyster
#

it sure is

gaunt cairn
#

it's the best thing ever

#

trash all the rest

wary vine
#

gotta make a 2d version of it for my phone now xD

meager heart
#

better make mobile arma for it, so you can play arma while playing arma πŸ‘Œ

still forum
#

@wary vine you typoed my name while googling

wary vine
#

I didnt

#

I just auto corrected within the search

#

check the tab title.

#

top right

tough abyss
#

@little eagle honestly I read the stranger and his shit made me wanna kill myself

still forum
#

Google doesn't even let you google for me πŸ˜„ muhahahaha

glad venture
#

does endmission only happen locally?

still forum
#

yes

tough abyss
#

In multiplayer scripting, do I need to define a script as a function to use it in remoteExec?

If so, do I need to define the allowedTargets, or is by default allowed for anything?

I'm scripting with a small group of irl friends, so security isn't a concern.

fringe yoke
#
{player setAmmo [primaryWeapon player, 1];} remoteExec ["bis_fnc_call", 0];
#

Something like that will work fine, just replace the code that gets passed to the call function

glad venture
#

is bis_fnc_endmission global or also local?

fringe yoke
#

But I'm not 100% sure if an answer for your question

tough abyss
#

It is global.

Description:
Ends the mission properly for all players in a multiplayer environment

wary vine
still forum
#

it's parsing as c++

#

you are not defining the type of that attribute

tough abyss
#

What is the proper way to wait until all players have loaded in with a script? I've seen various methods, such as "wait until time > 1", but don't remember which ones have issues.

fringe yoke
#

afaik there is no decent way to wait for everyone to be loaded. Especially with JIP compatible code

wary vine
#

<< new to vsCode @still forum where would I change that. I have downloaded the syntax's

inner swallow
#

If i need to do somehting after a player has loaded in, i use initPlayerLocal.sqf

tough abyss
#

I wish I kept better records of when I use to do all this stuff penguFAIL

fringe yoke
#

@tough abyss you could have each client set a variable in the player namespace, then have the server wait for all connected clients to have that variable set, but you would still need to be careful with JIP

tough abyss
#

I am confused on how to utilize parameters from an event handler.
For a GetIn example, I want to get the unit that triggers the event.

Documentation is as follows:

this addEventHandler ["GetIn", {
    params ["_vehicle", "_role", "_unit", "_turret"];
}];

https://community.bistudio.com/wiki/Arma_3:_Event_Handlers

#

Does anyone understand the above?

fringe yoke
#

It means that you now have variables by those names

glad venture
#

is there a way to delete a player's variables and actions and reset them when they leave a server?

fringe yoke
#

_vehicle will contain the object of the vehicle

tough abyss
#

So if I were to pass something to a script, I'd do ?

this addEventHandler ["GetIn", {
   null = ["_unit"] execVM "somescript.sqf";
}];
fringe yoke
#

[_unit], ["_unit"] is just the string of "_unit"

tough abyss
#

Typo, but null = [_unit] execVM "somescript.sqf"; doesn't work.

fringe yoke
#

How is somescript receiving the variable?

tough abyss
#

params ["_unit"];

fringe yoke
#

Hm, should be good then.

#

Does _unit = this select 0 work?

unborn ether
#

@glad venture Anything that is a part of a mission is utilized since that player leaves server to a lobby, besides something specific I can't remember for now. That happens because any global variable is a part of a missionNamespace which is reset when you leave mission, same for any mission functions, JIP and stuff. Something like addAction or anything that has object as an argument is also utilized, since any mission object is NULL since that moment. The only namespaces kept alive is parsingNamespace|uiNamespace|profileNamespace and some displays like findDisplay 0.

plucky willow
#

when i do ctrlCreate ["RscPictureKeepAspect",-1], how do i actually add in a picture?

unborn ether
#

ctrlSetText

#

Picture is described as a string path to it.

plucky willow
#

string as in within quotes?

ruby breach
#

@tough abyss ```sqf
this addEventHandler ["GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
[_unit] execVM "somescript.sqf";
}];

tough abyss
#

@ruby breach thank you ❀

unborn ether
#
_ctrl ctrlSetText 'a3\ui_f\data\map\MapControl\hospital_ca.paa';
plucky willow
#

would the mission path just be '\filename'?

unborn ether
#

just "filename.paa"

#

if its located in root.

plucky willow
#

okay, thank you πŸ˜ƒ

#

can i use any filetype picture, or are some more preferable than others?

#

also, are things like transparency saved when the picture is shown?

kindred lichen
#

Hey does anyone know if there's a way to check when a vehicle hits a building?

#

trying to build a bulldozer that can remove map buildings.

unborn ether
#

@kindred lichen EpeContact* EVH

meager heart
#

@wary vine

wary vine
#

still defaults to C++ on cpp files xD

meager heart
#

check there (settings) files.associations

#

you can set it "*.cpp": "sqf"

wary vine
#

gotcha ty

#

i got ext

tough abyss
#

How can I do a timer without locking-up scripting?

Say I want something to start a timer in the middle of a script, and still have the script continue without waiting for the timer:


//do stuff

execVM = "aTimer.sqf";

//do more stuff
quasi rover
#

dismantled weapons, such as mortar tube, mortar bipod, static launcher, are backpack or weapon or item? for its addBackpackCargo or addWeaponCargo or addItemCargo e.g..

little eagle
#

backpack

quasi rover
#

thx, commy2

velvet merlin
#

how to translate velocity to speed? 😊

little eagle
#

vectorMagnitude and either divide or multiply by 3.6

velvet merlin
#

thanks checking

#

alright. so i want to limit the speed of a vehicle if it goes over maxSpeed config paramter (+ some threshold)
would the approach be meaningful to apply the opposing velocity to the current one based on the vector delta of currentSpeed to maxSpeed multiplier (basically)

little eagle
#

Pseudo:

if (speed > maxSpeed)
    setVelocity (vectorNormalized velocity vectorMultiply maxSpeed);
#

Nothing you will be able to achieve with scripting will make physical sense. That's something you have to accept.

velvet merlin
#

yes thats clear. willing to pay that price over tanks rushing downhill like crazy

real tartan
#
_speed = 10;
_vehicle setVariable ["limit_speed", _speed];
_s = _vehicle spawn
          {
            while {canMove _this} do
            {
              _this limitSpeed (_this getVariable ["limit_speed", 10]);
              sleep 0.1;
            };
          };``` @velvet merlin
velvet merlin
#

(A3 1.24)To clarify, limitSpeed only do effect on non-player controlled AI units, it has continuous effect and AI won’t break through the speed limitation until one is contacted, engaged or regrouped.

#

@real tartan are you saying it works now also for players/any vehicle?

#

from what i understand its just meant as an "order" for AI

real tartan
#

you did not specify that you need it for players also, or I did not notice

velvet merlin
#

well true. however are AI actually capable of rushing down hills/is a problem with AI in the first place?

real tartan
#
_vel = velocity _vehicle;
_dir = direction _vehicle;
_speed = 10;
_vehicle setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+ (cos _dir*_speed),(_vel select 2)];
winter rose
#

@tough abyss see spawn on the BiKi

hint "starting";
[] spawn {
   sleep 2;
   hint "other stuff";
} ;
sleep 1;
hint "current stuff";

Depending on the size of each code to execute, choose where to put it, in the spawn or somewhere else.

Be wary of local variables (_vv) that are not passed to spawned code, unless you give them as parameters

tough abyss
#

Is that related to my timers post? If so, thank you.

winter rose
#

Yes it is, it went down under the radar due to a flow of messages but I gotcha πŸ˜›

tough abyss
#

Thanks, I appreciate it. I've actually asked about it a few times and never got a definitive answer.

winter rose
#

spawn creates another thread, so it is completely isolated from the parent's thread

#

it will run in parallel. check the BiKi page, and tell me if you need further help

tough abyss
#

I had always interpreted it as being similar to call, only it would wait for when the scheduler had time. So less likely to be immediate, but more efficient. So I completely missunderstood that, thank you.

winter rose
#

you're welcome :+1: anytime

velvet merlin
#

@little eagle did i misunderstood you with this?

#
_vehiclePlayer setVelocity (vectorNormalized ((velocity _vehiclePlayer) vectorMultiply _maxSpeedVehiclePlayer))```
#

this stops dead the vehicle essentially:

#
["speed",58.8517,48]
["velocity",[9.66028,11.5584,-6.35416]]
["vectorMultiply",[463.693,554.802,-305]]
["vectorNormalized",[0.590876,0.706974,-0.388656]]
["velocityAfter",[1.29093,1.59705,-0.910017]]```
#

for now this approach seems to work OK:

_vehiclePlayer setVelocity
[
    ((velocity _vehiclePlayer) select 0) * 1/((speed _vehiclePlayer)/(_maxSpeedVehiclePlayer)),
    ((velocity _vehiclePlayer) select 1) * 1/((speed _vehiclePlayer)/(_maxSpeedVehiclePlayer)),
    ((velocity _vehiclePlayer) select 2)
];```
#

(with if ((speed _vehiclePlayer) > (_maxSpeedVehiclePlayer + 10)) then)

#

its still a bit sudden and could be smoothed by some means

quasi rover
#

If I was fired by UAV of my side, who is the "_this select 3 (the source unit that caused the damage.)" in "Handle Damage" Event Handler ? UAV machine itself or the player who controlled the UAV?

winter rose
#

The controlling player iirc @quasi rover

quasi rover
#

thx

meager heart
#
if (_speed > _maxSpeed) then {
    _vehicle setVelocity (vectorDir _vehicle vectorMultiply (sqrt (_speed min _maxSpeed)));
};

limit speed thing πŸ€”

little eagle
#

@velvet merlin

did i misunderstood you with this?
Yes.

#
_vehiclePlayer setVelocity (vectorNormalized velocity _vehiclePlayer vectorMultiply _maxSpeedVehiclePlayer);
#

You used too many parenthesis.

still forum
#

@wary vine you can't. C++ code is C++ code. Just ignore the warnings. Or I guess there might be someway to completly disable language checking. Dunno how.

little eagle
#

Obviously you want to scale the vector to the speed max length after you turned it into a unit vector.

#

What you did is scale the current vector times the speed limit scalar and then turned it into a unit vector, meaning that the vehicle would always move at 1 m/s.

velvet merlin
#

thanks my bad

strange urchin
#

Oof

little eagle
#

Are you unhappy with this, Mario?

wary vine
#

@still forum i just did what @meager heart said seemed to work.

uncut trout
#

Is there a way for me to replace a variable (h1) with every vehicle that is an ace medical vehicle?

winter rose
#

setVariable var?

uncut trout
#

Oh hold on my question is much less clear written than it was in my head

still forum
#

You can set variables to things yeah πŸ˜„ You can also use arrays to put many things into a variable.
You mean you want something to retrieve a list of all vehicles, currenly in the mission, that are ace medical vehicles?

uncut trout
#

Yes!

little eagle
#
vehicles select {_x getVariable ["ace_medical_isMedicalFacility", false]}

???

uncut trout
#

Would that be where I use something like forEach?

still forum
#

Yep. That select syntax is "something like forEach"

little eagle
#

Would use what. You never told us what you want to do.

uncut trout
#

Neat, I’ll show you what I’m trying to do just to make sure

#

I’ll admit I didn’t write this script, I just found it and wanted to adapt to work with all vehicles marked as a medical vehicle with ace rather than one vehicle with an assigned variable

while {alive h1} do {
waituntil {sleep 0.5; {alive _x && _x in h1} count allPlayers > 0};
h1 setCaptive true;
waituntil {sleep 0.5; {alive _x && _x in h1} count allPlayers == 0};
h1 setCaptive false;
};

little eagle
#

πŸ€” What's that?

winter rose
#

a script that makes a vehicle captive if people are in it apparently

little eagle
#

I don't think setCaptive works with ACE.

still forum
#

Well. I can tell you what it is.. It's dumb.

#

iterating over all players and filtering out the players inside the vehicle.
instead of just iterating over the players inside the vehicle FFS

uncut trout
#

Welp alright

#

I’m not very good at scripting so I thought I’d come here πŸ‘πŸ»

digital hollow
#

GetIn EventHandler instead of loop would improve it as well.

pulsar tide
#

Sorry to barge in.... Should be an easy one. Trying to create a trigger which is rearm . BUT I want one trigger to do multiple class of vics. Can I place if ((_veh isKindOf "Air,"CAR") && (driver _veh == player)) exitWith { or do you need to create separate triggers?

still forum
#
waituntil {
    sleep 0.5; 
    private _medicalVehicles = vehicles select {_x getVariable ["ace_medical_isMedicalFacility", false]};
    {private _p = _x; alive _p && _medicalVehicles count {_p in _x}} count allPlayers > 0
};

That's even dumber though

uncut trout
#

Is there something that is not dumb or am I doomed to my own ignorance

still forum
#

Yeah. Searching for a good way to write it

little eagle
#
private _allMedicVehicles = vehicles select {_x getVariable ["ace_medical_isMedicalFacility", false]};

{
    _x addEventHandler ["GetIn", {
        params ["_vehicle", "_role", "_unit", "_turret"];

        if (local _unit) then {
            [_unit, "setCaptive", "commy_isMedicVehicleCrew", true] call ace_common_fnc_statusEffect_set;
        };
    }];

    _x addEventHandler ["GetOut", {
        params ["_vehicle", "_role", "_unit", "_turret"];

        if (local _unit) then {
            [_unit, "setCaptive", "commy_isMedicVehicleCrew", false] call ace_common_fnc_statusEffect_set;
        };
    }];
} forEach _allMedicVehicles;

@uncut trout
There.

still forum
#

Even better than my idea

little eagle
#

Put it into init.sqf

still forum
#

Will only work with vehicles that are present at mission start though

little eagle
#

True.

#

Does the mission spawn these medical vehicles (including respawn)?

digital hollow
#

GetInMan on all the player characters?

little eagle
#

Oh, yeah. Is this only for players?

#

That'd make stuff easier.

uncut trout
#

This is only for players yes, and the only medical vehicles present in the mission should be those at the beginning of the mission (unless Zeus spawns a new one for whatever reason, but that generally doesn’t happen

little eagle
#
// init.sqf
["vehicle", {
    private _unit = call CBA_fnc_currentUnit;
    private _vehicle = vehicle _unit;
    private _isMedicalVehicle = _vehicle getVariable ["ace_medical_isMedicalFacility", false];

    [_unit, "setCaptive", "commy_isMedicVehicleCrew", _isMedicalVehicle] call ace_common_fnc_statusEffect_set;
}, true] call CBA_fnc_addPlayerEventHandler;
#

There. It won't get easier and cheaper than that.

uncut trout
#

Thanks! I will try and dissect what you did so I can learn

little eagle
#

"vehicle" CBA_fnc_addPlayerEventHandler
executes the code in the curly brackets every time the avatar's vehicle changes, e.g. mount or dismount

#

CBA_fnc_currentUnit
is like player, except that it works when remote controlling with zeus

#

_isMedicalVehicle is self explanatory I think.

still forum
#

you have ace. So you could use ACE_player instead of calling a func :u

little eagle
#

pff ace

#

You could also use player, because this breaks when switching out as zeus anyway.

#

"setCaptive" ace_common_fnc_statusEffect_set
is just like setCaptive, except that infinetly many systems can use the command instead of each one overwriting the other.

#

The player is captive as long as one reason for it remains, a reason here is "commy_isMedicVehicleCrew" and that is an arbitrary string unique to your system using setCaptive.

uncut trout
#

I see. Why does it check isMedicalFacility?

still forum
#

Because you wanted medical vehicles. And not "all" vehicles

uncut trout
#

Wouldn’t isMedicalVehicle check for that though? Or does the MedicalVehicle function depend on MedicalFacility?

little eagle
#

_isMedicalVehicle is just a variable. You can name it _banana if you want or just _.

#

I prefer giving them names that make sense, so I can remember what they are next week and in a year too.

#

So a variable that is true if the thing it's about is a medical vehicle is named "is medical vehicle".

pulsar tide
#

What the correct format is under a EDEN condition area I want to CALL multiple cfgvehicle types? call {(_x iskindof "ship") || (_x iskindof "HAFM_Submarines") || (_x iskindof "HAFM_NAVY") || (_x iskindof "sfp_vehclass_ship")} && speed _x < 1} count thislist > 0 }

still forum
#

you cannot call a type.

little eagle
#

One can call functions or scripts, but not classnames.

pulsar tide
#

call{{_x iskindof "plane" && speed _x < 1} count thislist > 0 }

still forum
#

What purpose does that call serve?

little eagle
#

That does nothing

still forum
#

seems useless to me

little eagle
#

{_x iskindof "plane" && speed _x < 1} count thislist > 0
^^^ same thing

still forum
#
{(_x iskindof "ship" || _x iskindof "HAFM_Submarines" || _x iskindof "HAFM_NAVY" || _x iskindof "sfp_vehclass_ship") && speed _x < 1} count thislist > 0

You mean that?
Does || need braces commy?

little eagle
#

No.

pulsar tide
#

Trigger activation example...

still forum
#

Oh wait. That code is complete crap. One sec

little eagle
#

|| is lower prio than normal binary commands.

still forum
#
{(_x isKindOf "ship" || _x isKindOf "HAFM_Submarines" || _x isKindOf "HAFM_NAVY" || _x isKindOf "sfp_vehclass_ship") && speed _x < 1} count thisList > 0

There fixed.

#

@pulsar tide Full sentences please. I have no idea what you are trying to say

pulsar tide
#

yeah i was trying to send a screen shot..hang on

meager heart
#

commy, about speed limit things from the above... so vectorNormalized is better in that case, because of accuracy or ? πŸ€”

still forum
#

I see useless call's there that make no sense

#

and a local variable that also makes no sense

#

and taking something out of an array just to again turn it back into an array.

#

So yeah.. Get rid of the call it serves no purpose

little eagle
#

Better than what?

meager heart
#

hmm... lets say vectorDir

pulsar tide
#

thats what I was going off of

still forum
#

Completly different things πŸ€”

little eagle
#

vectorNormalized velocity
reports the direction the object is moving
vectorDir
reports the direction the object is facing
Objects can move sideways, you know.

still forum
#

vectorDir takes object and normalizes it's direction as direction vector.
and vectorNormalized takes a vector and normalizes it

pulsar tide
#

I was basically trying to have 1 trigger take care of Heli's, car and tanks.

still forum
#

I already sent you the code you need

#

twice

meager heart
#

vectorDir
reports the direction the object is facing
Objects can move sideways, you know.
that why i'm was using it πŸ˜€

still forum
#

And as i said. Get rid of that call it's useless. No matter if you copied that from somewhere else. Doesn't fix it's uselessness

little eagle
#

But in a curve, your vehicle is moving in a different direction than it is facing...

#

Dedmen, if he's not using CBA, then the call could be to trick the editor into ignoring return values.

still forum
#

Why would you want to ignore return values.. On a condition

#

or on a piece of code that already has a assignment and thus doesn't have a return value

little eagle
#

Idk, that's the only pupose I can come up with.

#

Otherwise it does literally nothing of value.

still forum
#

Probably another case of people copying things they don't understand. And telling others to use it like that

little eagle
#

Probably.

meager heart
#

ok got it... commy πŸ‘Œ

little eagle
#

He, reminds me of Absurdism again. Dedmen, did you ever disprove dialetheism?

still forum
#

yes

meager heart
#

Absurdism πŸ€”

still forum
#

Remember the worst script ever?

meager heart
#

hmm... yes (not sure)

winter rose
#

who proved dialetheism in the first place πŸ˜„

pulsar tide
#

@still forum Thank you sir.

meager heart
#

cough maybe maestro q cough

little eagle
#

Lou, who said things have to be either true or false?

still forum
#

I know a guy.. What was his name again... SchrΓΆdinger I think..

winter rose
#

there is always a why that can't be answered, but that doesn't prove you're right, it mostly states the other possibility could be wrong πŸ™‚

little eagle
#

They say there're no dumb questions, but "why" is a dumb one for me.

lone glade
#

why

winter rose
#

both "why" and "how" are interesting πŸ‘€ let's #offtopic_arma though πŸ˜ƒ

#

πŸ‘‹

meager heart
#

oh lol just realised what happened, sorry my mab lol (no time to seat down and chat the crap out of it, absurdic answer is fixed) so Absurdism is me for today... 😬

meager heart
#

also "why" was only because i'm bad with vectors... 🀷

little eagle
#

They're the best we have, because we don't have quaternions or even complex numbers in Arma.

#

Complex numbers would be perfect for a scripting language. The only reason you wouldn't want to use them in C++ is performance probably, but by using them in script, you would delegate a lot of math to C++ and keep the script short.

gaunt cairn
#

arma probably uses quaternions but just aren't accessible

little eagle
#

Apparently the edior uses Euler Angles internally.

#

In a non standard format too.

gaunt cairn
#

well complex numbers don't work well b/c for some reason hardware isn't optimized for that

little eagle
#

Yeah, in C++ et al. But if we're talking about a script language, things may change. It's the same as the vector commands really.

gaunt cairn
#

and since it is a vector computation should be done on gpu like hardware

little eagle
#

I'm a 100% sure this is not the case for SQF.

molten folio
#

@wary vine u gave me this sqf private _weaponTypes = ["AssaultRifle","BombLauncher","Cannon","GrenadeLauncher","Handgun","Launcher","MachineGun","MissileLauncher","RocketLauncher","Shotgun","Rifle","SubmachineGun","SniperRifle"]; { private _thisWeaponInfo = [(configName _x)] call BIS_fnc_itemType; private _thisWeaponType = _thisWeaponInfo # 1; if (_thisWeaponType in _weaponTypes) then { private _index = _list lbAdd (getText (_x >> "displayName")); _list lbSetPicture (getText (_x >> "displayPicture")); }; } forEach ("true" configClasses (configFile >> "CfgWeapons"); but its not workiing cause this line sqf private _thisWeaponType = _thisWeaponInfo # 1;

wary vine
#

are you sure its that line ?

molten folio
#

ye it poped in a black small console when i join my dev server

wary vine
#

how are you executing this ?

#

and what error does it give you ?

molten folio
#

this is how im putting it sqf AdminWeaponList = { disableSerialization; _display = findDisplay 385300; _list = _display displayCtrl 7777; lbClear _list; private _weaponTypes = ["AssaultRifle","BombLauncher","Cannon","GrenadeLauncher","Handgun","Launcher","MachineGun","MissileLauncher","RocketLauncher","Shotgun","Rifle","SubmachineGun","SniperRifle"]; { private _thisWeaponInfo = [(configName _x)] call BIS_fnc_itemType; private _thisWeaponType = _thisWeaponInfo # 1; if (_thisWeaponType in _weaponTypes) then { private _index = _list lbAdd (getText (_x >> "displayName")); _list lbSetPicture (getText (_x >> "displayPicture")); }; } forEach ("true" configClasses (configFile >> "CfgWeapons"); };

wary vine
#

what is the error it is giving you ?

#

zero divisor ?

molten folio
#

nvm

#

not that

#

xd

wary vine
#

so it wasnt that code ?

molten folio
#

no

#

if i wanna make a private Vari do i need put "_"?

still forum
#

Only local variables can be private.

#

So.. yes.

digital hollow
#

Does the engine treat underscore variables in a special way or is it just a naming convention?

wary vine
#

_localVar

#

and can only be a local var

#

var is a global var

still forum
#

"underscore variables" are called local variables

#

and can only be a local var that's wrong.

digital hollow
#

Right, so it's a coding practice, not an engine distinction?

little eagle
#

If you assign a variable, if it's identifier starts with _, then it becomes a local variable.

#

Only when assigning local variables one can use the private keyword.

still forum
little eagle
#

And private STRING, private ARRAY and params too can only be used with local variable identifiers (starts with _) as strings.

#

_localVariable
globalVariable

Of course there are exceptions, because why have consistency... Those are not of concern if you're a beginner though I guess.

winter dune
#
HC_Array = [owner hc_1, owner hc_2];
(HC_Array select 0) publicVariableClient "Units";

Type Array, expected number.

#

Am I missing something?

little eagle
#

Post the full error message from the rpt file.

winter dune
#
2018/05/03, 19:27:41   Error position: <publicVariableClient "Units";
diag_log>
2018/05/03, 19:27:41   Error publicvariableclient: Type Array, expected Number
2018/05/03, 19:27:41 File serverSide\initHC.sqf, line 26
#

the only thing that should be possible is that the array has no values

#

but it shouldn't throw the type array error

little eagle
#

The line before that?

winter dune
#
if (getPlayerUID hc_1 == "") then { HC_UID = [getPlayerUID hc_2]; HC_Array = [owner hc_2]; };
    if (getPlayerUID hc_2 == "") then { HC_UID = [getPlayerUID hc_1]; HC_Array = [owner hc_1]; };
    if ((getPlayerUID hc_1 != "") && (getPlayerUID hc_2 != "")) then { 
        HC_UID = [getPlayerUID hc_1, getPlayerUID hc_2]; HC_Array = [owner hc_1, owner hc_2];
    };
};

(HC_Array select 0) publicVariableClient "Units";
#

this is the full code

#

I'll throw some debug code to see the exact value

little eagle
#

No, post the full error from RPT. It's usually 4 lines.

#

First line should be something like "Error in expression: <some sqf>".

#

It starts with the error position, but that's only the rhs of the error. Literally the part I don't need to see.

still forum
#

What is that confusing indentation

little eagle
#

People need to put 100 chars in a line, because long scripts are scary, Dedmen.

winter dune
#

text to long

still forum
#
if (getPlayerUID hc_1 == "") then { HC_UID = [getPlayerUID hc_2]; HC_Array = [owner hc_2]; };
if (getPlayerUID hc_2 == "") then { HC_UID = [getPlayerUID hc_1]; HC_Array = [owner hc_1]; };
if ((getPlayerUID hc_1 != "") && (getPlayerUID hc_2 != "")) then { 
     HC_UID = [getPlayerUID hc_1, getPlayerUID hc_2]; HC_Array = [owner hc_1, owner hc_2];
};
};//wtf is this?
winter dune
#

wrong copy pasta xD

little eagle
#

xAndreei, use pastebin.

still forum
#

Another case of someone wanting help but not showing the actual script that he's using

little eagle
#

Not even the full error message :(

unborn ether
still forum
#

That too

winter dune
#

found the error, I was using that variable in another script which required a number and I was giving a full array without selecting anything

still forum
#

So it won't work even if you fix your script error

winter dune
#

units was the first thing that came in my mind

still forum
#

Use tags

winter dune
#

nothing related to that

still forum
#

Andr_Units

winter dune
#

πŸ‘

little eagle
#

This is how I would write this:

HC_UID = [];
HC_Array = [];

if (getPlayerUID hc_1 != "") then {
    HC_UID pushBack getPlayerUID hc_1;
    HC_Array pushBack owner hc_1;
};

if (getPlayerUID hc_2 != "") then {
    HC_UID pushBack getPlayerUID hc_2;
    HC_Array pushBack owner hc_2;
};

idk, seems more procedural and logical.

winter dune
#

hmm yeah, even better than mine lol

#

I always focus on functionally first and then on "optimization"

little eagle
#

But this isn't about optimization.

#

If it were, the script would probably look ugly af.

still forum
#
HC_UID = [];
HC_Array = [];
{
    if (getPlayerUID _x != "") then {
        HC_UID pushBack getPlayerUID _x;
        HC_Array pushBack owner _x;
    };
} forEach [hc_1, hc_2];

Easier to extend

little eagle
#

Yeah.

#

I like that one.

#

I'm trying to write something actually optimized, just so you people see that that is NEVER what I am going for, but it hurts physically.

winter dune
#

just so you "plebs" was better πŸ˜ƒ

little eagle
#

Yea, well I am the pleb, because I can't figure it out.

lost iris
#

If i restrain a player using this player playmove "AmovPercMstpSnonWnonDnon_Ease"; it keeps reverting. How do i make this animation stay

little eagle
#
getPlayerUID hc_1 isEqualTo "" && {
    getPlayerUID hc_2 isEqualTo "" && {
        HC_UID = [];
        HC_Array = [];
        true
    } || {
        HC_UID = [getPlayerUID hc_2];
        HC_Array = [owner hc_2];
        true
    }
} || {
    getPlayerUID hc_2 isEqualTo "" && {
        HC_UID = [getPlayerUID hc_1];
        HC_Array = [owner hc_1];
        true
    } || {
        HC_UID = [getPlayerUID hc_1, getPlayerUID hc_2];
        HC_Array = [owner hc_1, owner hc_2];
        true
    }
};

There.Optimized. (No guarantee the logic isn't inverted.)

still forum
#

🀒

little eagle
#

Control structures are for plebs. Everything is a lazy eval.

gleaming oyster
#

piece of 🍰

little eagle
#

It just takes getting used to.

#

It's not any more irrational than if-then-else. In fact, this one is more basic.

meager heart
#
HC_UID = [];
HC_Array = [];

[hc_1, hc_2] apply {
    if (getPlayerUID _x != "") then {
        HC_UID pushBack getPlayerUID _x;
        HC_Array pushBack owner _x;
    };
};
```pleb version v2.0
#

huehue*

little eagle
#

I'm thonking about ways to further optimize my version. πŸ€”

still forum
#

Wait..

#

Why do HC's even have getPlayerUID?

#

HC's don't have steam accounts. They shouldn't have player ID's

little eagle
#

Probably the servers.

still forum
#

But then they would all have the same

little eagle
#

And?

still forum
#

Why store it in an array then

little eagle
#

Why store the uid at all? No one cares what the uid of a hc is.

#

In fact, why store the owner ids? Just set them globally via PlayerConnected, and reset them via HandleDisconnect.

gleaming oyster
#

What if say, you wanted to target a certain HC that could take more of a load than the others

little eagle
#

Why do you need the owner of a hc?

still forum
#

Well.. Just choose one of the HC's then?

#

the first HC in the array will always be that one HC

#

so. if you want one of them to take heavier load. Just choose the first

little eagle
#

The whole script shouldn't be needed, unless I'm missing something. But when people ask about their scripts here, and I answer: "your script is needed, delete it", I feel bad.
So then I suggest how to make them readable, but they answer: "I optimize later".
Even though I haven't even begun optimizing anything. I don't even want to go there, because - well you can see how that'd look.

#

As far as optimization goes, in the truest sense of the word (= optimal), due to the existance of lazy evaluation, if-then-else control structures in SQF are deprecated. Which is hilarious to me.

tough abyss
#

@lost iris I believe you can use playMoveNow, which replaces the 'queue' of animations with whatever you want.

#

There is also a way to wait until an animation is finished, at which point you could loop it, but I don't remember the call.

little eagle
#

Bear suggested this one:

HC_Array = [hc_1, hc_2] select {getPlayerUID _x != ""};
HC_UID   = HC_Array apply {getPlayerUID _x};

And I like it a lot.

tough abyss
#

Can we no longer register for the community wiki? It's been locked for months, and lately I've come across a lot of dead code examples and pages with no information at all that I could fill out.

little eagle
#

Locked.

ruby breach
#

Have to message Dwarden

tough abyss
#

Gah.

meager heart
#

we have special locked animations, there are 8 total with special exit anims, so while animation is played unit can't move... until the exit anim will be played...
try this in the console

player spawn {
    private _animIndex = round (1 + random 7);
    _this switchMove format ["Acts_AidlPercMstpSlowWrflDnon_warmup_%1", _animIndex];
    _this playMove format ["Acts_AidlPercMstpSlowWrflDnon_warmup_%1", _animIndex];

    sleep 10; 

    private _animDone = switch (true) do {
        case (currentWeapon _this == primaryWeapon _this) : {"Acts_AidlPercMstpSlowWrflDnon_warmup_%1_out"};
        case (currentWeapon _this == secondaryWeapon _this) : {"Acts_AidlPercMstpSlowWpstDnon_warmup_%1_out"};
        default {"Acts_AidlPercMstpSnonWnonDnon_warmup_%1_out"};
    };

    _this selectWeapon primaryWeapon _this;
    _this playMove format [_animDone, _animIndex];
};
```@lost iris
lost iris
#

@meager heart Thanks, now i am having abit of trouble executing this on other players

meager heart
#

Bear suggested this one
do you speak with bears, commy ? πŸ€”

tough abyss
little eagle
#

@BaermitUmlaut

meager heart
#

lol

little eagle
#

He left the server, because you people are so horrible.

meager heart
#

internet anyway was a mistake πŸ˜€

still forum
#

@tough abyss don't post the same across multiple channels. #rules

tough abyss
#

Forgot to delete the original post, my bad.

molten folio
#
disableSerialization;
    _display = findDisplay 385300;
    _list = _display displayCtrl 2222;
    lbClear _list;
    _VehicleTypes = ["Car","Helicopter","Motorcycle","Plane","TrackedAPC","Tank","WheeledAPC","StaticWeapon","Submarine"];
    {
      _thisVehicleInfo = [(configName _x)] call BIS_fnc_objectType;
      _thisVehicleType = _thisVehicleInfo select 1;
      if (_thisVehicleType in _VehicleTypes) then {
        _index = _list lbAdd (getText (_x >> "displayName"));
            _pic = getText (_x >> "Picture");
            _list lbSetPicture [(_index)-1,_pic];
            _list lbSetData [(_index)-1,_x];
      };
    }forEach ("true" configClasses (configFile >> "CfgVehicles"));``` i got this vehicle list  and a button to spawn the selected vehicle , but how do i give the vehicle list the classes?
wary vine
#

?

still forum
#

How to give the list the classes?

#

Ahh

#

just use lbSetData to save the classname

#

wait.. you are already doing that

wary vine
#

yh

molten folio
#
_list lbSetData [(_index)-1,_x];```
still forum
#

You are already giving the classes to your vehicle list.. uh.. What was your question again?

little eagle
#

_x is CONFIG, not STRING

wary vine
#

you need to use _data = lbData (lbCurSel 2222)

still forum
#

configName to get the classname

molten folio
#
_selected  = lbData [2222, lbCurSel 2222];
      _veh = _selected createVehicle position player;```
#

this is the button

still forum
#

well. read my and commys last message.

#

you already got the answer to your question

molten folio
#
_class = getText(configfile >> 'CfgVehicles' >> _x >> 'vehicleClass');
_list lbSetData [(_index)-1,_class];```
still forum
#

dude

molten folio
#

k ill forget about it

still forum
#

What is so hard at reading two messages πŸ˜„

#

It's like you are just ignoring our advice and continue going your own way which turns out not to work in the end

molten folio
#

configName to get the classname

#

didnt get it

still forum
#

configName. As in the command

#

configName takes a CONFIG as parameter

#

and as commy told you. Your _x is CONFIG

molten folio
#

So what do i replace with _x

still forum
#

What?

#

nothing

#

Are you coding while tired again?

molten folio
#

no no i slept enough

#

its just first time working with this list

still forum
#

Well. I'll help you at reading messages then.
You wrote _list lbSetData [(_index)-1,_x];
Where commy answered _x is CONFIG

Then I told you to use configNameto get the classname. And configName takes a CONFIG as parameter

#

so what do you think you should do?

molten folio
#

CfgVehicles??

still forum
#

Troll yourself dude. Goodnight.

molten folio
#

fml

little eagle
#

Er schaut wie eine Sau ins Uhrwerk.

tough abyss
#

Sometimes errors don't show up ingame, but I know they're there. Why is that?

molten folio
#

nvm ik now

still forum
#

Enable the showScriptErrors start parameter in the launcher

tough abyss
#

Wouldn't no errors at all show up if that wasn't on?

still forum
#

It's by default enabled in the editor

#

but disabled everywhere else

little eagle
#

In the editor it's always enabled.

tough abyss
#

I'm playtesting through the editor presently

molten folio
#
_class = configName (configFile >> "CfgVehicles");
_list lbSetData [(_index)-1,_class];``` this what i understood from Wiki page
little eagle
#

Β―_(ツ)_/Β―

still forum
#

Man. I just cannot comprehend

#

I gave you a single line of script. And a single script command to fix your issue

#

you somehow magically manage to turn it into 2 lines and multiple commands that make no sense

molten folio
#

_list lbSetData [(_index)-1,configname];

#

??

still forum
#

You really need skill to get something like that done

#

dude

#

Can you maybe just read my messages and turn on your brain

little eagle
#

This has to be Quiksilver trolling us or something.

molten folio
#

....

still forum
#

Or do I really have to write everything 5 times to make you read all 5 words seperately?

#

Without skipping 90% of my sentences everytime?

#

Here. Just because I'm such a nice guy

configName takes a CONFIG as parameter
and as commy told you. Your _x is CONFIG

Just read it FFS.

little eagle
#

Assuming troll, 7/10, lacks the fun, frustrating even for those who're in on it. Otherwise, you're not made for coding it seems. :(

still forum
#

it's like.. Here take this fork and use it to pick up that carrot.
5 minutes later you come back with a shoe superglued to a potato

gleaming oyster
#

Sounds like a fun time

little eagle
#

πŸ˜‚ accurate

#

No one can say we didn't try though.

gleaming oyster
#

you did not try

still forum
#

I literally explained it like for a 3 year old. configName takes CONFIG. _x is CONFIG.

Just like "Round things fit into this hole" "This ball is round"

#

You are the 3 year old that still tries the triangular hole.

molten folio
#
_list lbSetData [(_index)-1,(configname _x)];```
little eagle
#

holy shit

tough abyss
#

So I'm trying to get this script to work. The script is not running, nor is it giving me an error.

Fire:

deviceTruck addEventHandler ["GetIn", {
    params ["_vehicle", "_role", "_unit", "_turret"];
    null = [_unit] remoteExec ["scripts\deviceTask.sqf", 2];
}];

Script:

params ["_unit"];
if( side _unit == west) then 
{
    hint "player";
    //Next task
    ["task2", "SUCCEEDED",true] remoteExec ["BIS_fnc_taskSetState", 2, true];
    ["task3", "Assigned",true] remoteExec ["BIS_fnc_taskSetState", 0, true];
}
else
{
    hint "ai";
    //Kick out AI
    _unit action ["eject", vehicle _unit];
};

I can't tell what's wrong. I'm assuming it might have something to do with the parameters, but arma 3 isn't giving me any error at all. showScriptErrors is on.

still forum
#

null = is useless

tough abyss
#

with or without it, it doesn't make a difference.

still forum
#

script is the thing you call via remoteExec? _unit is undefined

gleaming oyster
#

people use it because you can't get a return in a init box

#

otherwise in script it's useless

still forum
#

parameters are passed inside _this. you need to pull them back out. using params ["_unit"] for example

#

or _this select 0 but please don't use _this select to grab parameters.. please..

tough abyss
#

ah, sorry, I missed that in my c/p

#
params ["_unit"];

at the top

still forum
#

(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

little eagle
#

There is no point in using remoteExec inside a GetIn eventhandler, as GetIn fires for remote objects anyway.

ruby breach
#

Also, remote execing to the server and then telling the server to display a hint isn't going to accomplish much

tough abyss
#
getin
Triggers when a unit enters a vehicle. It can be assigned to a remote vehicle **but will only fire** on the PC where the actual addEventHandler command was executed
little eagle
#

I think that's just for debugging which is fine local hosted.

tough abyss
#

the hint is just for debugging

#

is this stack overflow or

ruby breach
#

Ahh, I didn't even think about local host

little eagle
#

Well, the idea is to add the eventhandler on every machine. Or just on the server if you only want to execute server stuff.

#

So the comment you posted just confirms what I wrote.

tough abyss
#

Regardless, the script itself isn't running.

little eagle
#

Well duh, because that's not how you use remoteExec.

#

But why correct that if it isn't needed in the first place?

unborn ether
#

So much harsh about strange things people trying to do πŸ˜„

still forum
#

Oh... Didn't even notice the broken remoteExec

tough abyss
#

what is broken about it

still forum
#

You cannot execute files

#

only commands or functions

tough abyss
#

This same fuckin' discord told me otherwise last night

unborn ether
#

Can you show who and when?

still forum
#

You could execute execVM instead to launch a file

little eagle
#

what is broken about it
It exists inside GetIn. It should never be put inside GetIn.

still forum
#

Whoever said that should be shot in the shoulder then

tough abyss
#

So my whole issue was misinformation from this discord, and most of everyone who replies just criticizes the code instead of helping me get it working, except Dedmen, who gives me the actual answer. Thank you.

still forum
#

What?

little eagle
#

No one said that that I can remember.

still forum
#

stop saying good things about me

#

You'll regret it someday πŸ˜„

tough abyss
#

"Why do you have hint"
"Why are you doing X with the getin"
"Why this"

The why doesn't matter, there's something broken with the code. Seriously feels like stack overflow

little eagle
#

Dude, remoteExec is just wrong inside GetIn period. Even if you fix the syntax error, your script will not work. Why post anything here if you don't want it to be critically evaluated?

still forum
#

I'm very good at criticising code. But right now I'm laying on my belly on my bed and typing on the laptop that is standing next to my bed at head height and my neck is hurting

unborn ether
#

Well, anyways thats pretty your fault too. Reading Wiki helps. Everytime I write some, I always turn to wiki to remind myself how I'm trying to achieve that exactly. Its no shame in reading man.

tough abyss
#

GetIn fires locally.

still forum
#

No it doesn't

#

you missunderstood what the wiki said

#

it fires where you added the eventhandler

little eagle
#

GetIn fires locally.
Teach me about SQF

#

Β―_(ツ)_/Β―

still forum
#

if you want it to execute on the server. Then add the eventhandler on the server and you are golden

tough abyss
#

To correct myself, it fires where you added it, so if I added it locally it fires locally.

unborn ether
#

@little eagle systemChat is local mate, FYI

still forum
#

No need to add it on client and forward it to the server. If you could directly execute on the server

meager heart
#

also _unit action ["eject", vehicle _unit]; < with just this, unit will be not happy about that accident and he will try to get back in his vehicle...

unborn ether
#

@tough abyss Its stricly AG EL, so it will be assigned to anytihng local or global, but always will fire the event for that particullar PC.

little eagle
#

Why would you add it locally? To which client? If the client disconnects the script stops worlking for anybody else?

#

That's just bad.

tough abyss
#

Yes, you're right Dedmen. I understand that now, but it is incredibly frustrating when you ask for help, and the replies are just "Your code is bad."

Help me fix it, because something is wrong and I need to learn what it is. In this case, files cannot be ran over remoteExec. Then you can rip the code apart and tell me how bad it is.

little eagle
#

I said what you have to do ffs.

still forum
#

@meager heart Making me very happy that I don't build missions.. Wouldn't want to handle that mess

tough abyss
#

If there's a blatant mistake like that, I'm clearly missing something I don't know. It's important to learn or I'm just going to be back here with the same issue later.

meager heart
#

Β―_(ツ)_/Β―

tough abyss
#

Can't learn to swim if you tell me to just take a bridge.

little eagle
#

I even told you why what you wrote doesn't work. Like thrice now.

still forum
#

Why learn to swim if you don't need to πŸ˜„

#

I never learned to swim. I had a vest

unborn ether
#

Mate you apply non-applicable syntax and blaming for no help. As I said you could at least investigate wiki pages of the commands you use.

still forum
#

Also IMO no further bashing needed. I think he got it πŸ˜„

#

Just think of the other guys that come to this channel. It's nice having someone who actually wants to learn.

#

It's like 10PM and certain people should be sleeping instead of reading scripts πŸ˜‰

#

I wanted to sleep an hour ago.. I hate you guys

little eagle
#

BIS_fnc_taskSetState inside remoteExec is another error. The point of the task system is to be synchronized in MP. By executing the same function everywhere, you probably just break it.

tough abyss
#

That's good to know. I haven't done much scripting since pre-Arma3-campaign

unborn ether
#

@meager heart That is for AI situation right? You need to unassign it before?

little eagle
#
if (isServer) then {
    deviceTruck addEventHandler ["GetIn", {
        params ["_vehicle", "_role", "_unit", "_turret"];

        if (side group _unit == west) then {
            //Next task
            ["task2", "SUCCEEDED", true] call BIS_fnc_taskSetState;
            ["task3", "Assigned", true] call BIS_fnc_taskSetState;
        } else {
            //Kick out AI
            _unit action ["eject", _vehicle];
        };
    }];
};
#

This assumes all AI belongs to the server. Otherwise this works in any scenario.

tough abyss
#

So if all tasks are synchronized, what would I do if I wanted to complete a task for one player, but not another?

little eagle
#

Don't use BIS_fnc_taskX

tough abyss
#

The old SetTaskState will work with the new task system?

little eagle
#

Doubt, but not sure.

tough abyss
#

I'll have to tinker with that at some point.

Above works like a charm, thanks commy.

meager heart
#

@unborn ether yes, or allowGetIn 🀷

little eagle
#

Just kicking the AI out is weird. They'd... just try to get back in again, no?

meager heart
#

yes ^

tough abyss
#

Is there a way to lock a vehicle only to AI?

#

I remember having issues with that in prealpha

little eagle
#
if (isServer) then {
    deviceTruck addEventHandler ["GetIn", {
        params ["_vehicle", "_role", "_unit", "_turret"];

        if (isPlayer _unit) then {
            //Next task
            ["task2", "SUCCEEDED", true] call BIS_fnc_taskSetState;
            ["task3", "Assigned", true] call BIS_fnc_taskSetState;
        };
    }];
};
#

Getting shorter and shorter. I almost like it.

#

It probably should check if task1 is already completed.

wary vine
#

@still forum what does configName do ?

little eagle
#

Changes your profile name.

wary vine
#

OH SHIT

gleaming oyster
wary vine
#

@gleaming oyster I was jokin xD

#

we need a discordbot

#

ngl

#

!biwiki configName

gleaming oyster
#

πŸ’©

wary vine
#

would be nice

meager heart
#

2 bots

little eagle
#

!wiki configName

meager heart
#

sqf, search

#

!google stuff

#

!sqf addAction

wary vine
#

a bot linked with the wiki would be nice tho

gleaming oyster
#

it's been done.

wary vine
#

where ?

gleaming oyster
#

Ask @rotund cypress

tough abyss
#

HoldAction requires the object to have collision with the player's hitbox, meaning it cannot be used on many Things, apparently.

molten folio
#

is there a script that adds items to the player without it classed for example : uniform selected from list , but dont want to have the script spawner to have adduniform

wary vine
#

you will have to make an item handler.

molten folio
#

aight

wary vine
#

using BIS_fnc_ItemType

molten folio
#

ye

wary vine
#

gimmie a sec, I might have something for you to work from.

molten folio
#

nice ❀

#

xd

wary vine
#

its an old script of mine and not optimized, but it did work.

molten folio
#

aight

wary vine
#

There are probably better handle items scripts out there.

#

im guessing its a life server, do you know what framework you are using ?

#

there might already be a handleItem function in it.

molten folio
#

ye im looking at it

#

now

tough abyss
#

does anyone know how to make this work in multiplayer? I've tried _x, _unit and a few other things but it doesn't respond.

    player setVariable ["#rev", 1];```
lost iris
#

Is there a way to get lets say the 4 item in an array?

wary vine
#

_arr select 3 or _arr # 3

lost iris
#

that only seems to return the 3 character though

wary vine
#

so (the array var) ``(select or #) ``(then the index you want - 1)

#

i.e 0 would return the first index

#

1 would return the second, etc etc

lost iris
#

i have an array like [2018,03,05,22,05] and i want to get the 4th item which should be 22

wary vine
#

[1,2,3,4] select 3; // 4

#
 (0) (1)(2)(3) (4)
[2018,03,05,22,05]
lost iris
#

i think i am being stupid hang on

wary vine
#
[2018,03,05,22,05] select 3 // 22
lost iris
#

yeah not sure what i was doing but it works now thanks

#

well how do i convert this "[2018,03,05,22,05]" into and array apparently it was a string

ruby breach
#
parseSimpleArray "[2018,03,05,22,05]";
lost iris
#

legend, i didnt know that was a thing thanks

kindred lichen
#

@unborn ether hey thanks man, little late, but saw the ping, that exactly what I was looking for.

wary vine
#

quick question would count work like

#

{_x} count [true,true,false,true]; // 3