#arma3_scripting

1 messages ยท Page 405 of 1

little eagle
#

I just said that using:

COSH(x) ((exp (x) + exp - (x)) / 2)

is nicer on the eyes than writing the two exponentials and the fraction every time. Fraction bars are always ugly in code.

lone glade
#

I wish we had a different sign for it

little eagle
#

atan2 is actually a thing in coding outside of sqf though. And I must say that whoever came up with the name did a great job.

#

I wish we had a different sign for it
If I ever make a language, it would use : for division, and / for the fraction bar. With the fraction bar being the lowest priority command of them all, and : being the same as *.

lone glade
#

"after the commy rose, now introducing CommyCode (CC)"

stable wave
#

Which namespace do variables in onButtonClick field exist in?

lone glade
#

wat

stable wave
#

I mean the onButtonClick attribule in the button control

strong shard
#

@stable wave you can use currentNamespace and isEqualTo

meager heart
#

I think he asking about wich varspace he need for he's script above, there he have just nothing_here getVariable

lone glade
#

no, his sentence still makes no sense

winter dune
#

If there is a function called A which spawns vehicles, if I remote execute it with for every player in the game, it will spawn 1 * number of players vehicles or only one?

lone glade
#

one for each player

winter dune
#

so you can actually make your server crash if you do this, nice

lone glade
#

you can make everyone crash, server included if you call a recursive func

winter dune
#

in this case, should be used createVehicleLocal if I want to remote execute that function for everyone except server

lone glade
#

wait, what

little eagle
#

currentNamespace getVariable default doesn't sound like a bad idea.

winter dune
#

i'll explain better with a sqf example

lone glade
#

you'd still have one vehicule per player

#

and it's a terrible idea...

little eagle
#

If the goal is to crash the game, then you don't need to create vehicles.

winter dune
#
// Function A

createVehicle  ... ;

// remoteExecCall

[] remoteExecCall ["functionA",-2];
little eagle
#

That would create one vehicle per connected client, except the host.

winter dune
#

the goal is to optimize the life garbage ๐Ÿ˜ƒ

lone glade
#

๐Ÿคฆ

#

I wouldn't call that any better

little eagle
#

Looks more like a bug.

lone glade
#

or an offering to the fire gods

winter dune
#

well, the example I posted is in the official repo

#

soooo

little eagle
#

I guess it depends on what the vehicle is that is created.

lone glade
#

unless it's a lightsource...

winter dune
#

but instead of spawning 1 vehicle, it spawns from 2 to 4 for each player

little eagle
#

If it's something that should be for every player, then it's ok I guess.

winter dune
#

yes, lightsource

#
createVehicle ["#lightpoint", getPos _vehicle, [], 0, "CAN_COLLIDE"];
lone glade
#

that changes everything

little eagle
#

Except that it assumes dedicated server, which is dumb. Why would you intentionally make your mission not being debugable in SP?

lone glade
#

oh wait.... that's for "police lights" isn't it....

winter dune
#

yep

little eagle
#

No, it doesn't. #lightpoint is supposed to be created with createVehicleLocal.

winter dune
#

ooooooooooook

#

fuck me then

lone glade
#

yeah, that's what I was gonna say ๐Ÿ˜„

#

lightsources are local, no exception

winter dune
#

actually, now I'm realizing why you don't like life missions xD

little eagle
#

Not sure what would happen if you createVehicle (global) a local simulation.

#

Depends on how CV handles this.

#

It is very confusing though, and since confusing code = bad code, it's bad code regardless.

warm gorge
#

How would you go about go about creating an ingame banner sized texture over a plank of wood of some sort? Ive seen servers do it to place above shops but unsure how its achieved

lone glade
#

exact same way people do billboards or how the ACE slideshow works, setObjectTextureGlobal

warm gorge
#

Ah figured it out, thought it was some fancy way I didnt know of. Simply just using a user texture object with an image with transparency to give the effect that its smaller

meager heart
#

also there setFlagTexture if you need make custom flags

still forum
#

@peak plover It's not like the wiki says Return Value: Array for isFaltEmpty
@queen cargo Intercept math commands are already done. That was the first in Intercept-CBA

queen cargo
#

I know @still forum

thorn saffron
#

is there a single command to remove all items, magazines and weapons from an inventory?

peak plover
#

Sure the wiki says it, but the name kind of implies that it's a bool

still forum
#

Wiki > Name

peak plover
#
Q: Is this position flat?
A: [3541345,13451541,0];

Q: Where is this postion?
A: Yes
#

logic

still forum
#

For Arma. Yes

peak plover
#

I just spent hours writing a script and when i run it all it breaks, that was the reason

thorn saffron
#

shopInventory addItemCargo (getItemCargo box1)

#

Does not work for me, I have an idea why

#

I'm trying to transfer stuff from one box to another

#

getItemCargo returns 2 arrays one for the class name, and another for the number of that particular items
[["optic_Aco","acc_pointer_IR","NVGoggles","G_Tactical_Clear","H_HelmetB"],[1,1,1,1,1]]

peak plover
#

:>

#

addItemCargo <<<<<<< addItemCargoGlobal

still forum
thorn saffron
#

I kind of worked out this myself ๐Ÿ˜›

peak plover
#
private _target = shopInventory;
private _cargo = getItemCargo box1;
{
    _target addItemCargo [_x,((_cargo param [1])param [_forEachIndex]);
}forEach (_cargo param [0]);
thorn saffron
#

I guess it won't run if I just put it in the console, right?

peak plover
#

Why not

#

Depends what this is for too

thorn saffron
#

for testing

#

also it didn't work

winter dune
#

is shopInventory and box1 assigned to your objects?

thorn saffron
#

yes

winter dune
#

try to hint them to be sure that they are assigned

thorn saffron
#

would have helped if I spelled it correctly ๐Ÿ˜›

#

ok got the transfer working

meager granite
jade abyss
#

wtf @meager granite

austere granite
#

wtf lel

still forum
#

Have seen worse tho

meager granite
#

Having tabs for each level would've been a cherry on top of it

jade abyss
#

Hard to find something worse

still forum
#

not really

#

I'd take me 1 minute to show you something worse

jade abyss
#

Challenge Accepted

#

(don't come up with quakslivers stuff ๐Ÿ˜„ )

meager heart
#

lol

still forum
#

Non-quiksilver stuff wasn't part of the challenge

jade abyss
#

@still forum
(don't come up with quakslivers stuff :smile: )

peak plover
#

That's where call {if()exitWith{}} would have helped

still forum
#

Non-quiksilver stuff wasn't part of the challenge

#

That would be a perfect example where one should use a switch

jade abyss
#

Now find something worse than that

#

In this case? Yeah, switch. For the sake of readability

peak plover
#

quicksilver stuff >๐Ÿ˜ก
using ' instead of "
using private array

still forum
jade abyss
#

Whats wrong with ' instead of " ?

#

How does it look like? I never used arsenal

austere granite
#

its... big ๐Ÿ˜„

#

inb4 thats what she said

jade abyss
#

Not to you ๐Ÿ˜„

still forum
#

Worst publically visible script BI ever made

jade abyss
#

Still waiting for @peak plover 's answer

austere granite
#

i disagree with switch dscha

jade abyss
#

You're a french, aye?

austere granite
#

because you'd have to make it a switch (true)

jade abyss
#

inb4: ๐Ÿคฆ

peak plover
#

@jade abyss ' instead of " is good. But if he cars of that small helpful '. Why is he using private array? Everryone knows the array variant is slower

still forum
#

We already established that he is an idiot

jade abyss
#

using ' instead of " <-- Sounded not like "is good" ๐Ÿ˜„

#

Agree, Dedfurry

austere granite
#

could also just make it a loop and use BREAKOUTTTTTTTTTTTT

jade abyss
#

You could also put a finger up your blackhole

thorn saffron
#

how do you make SQF syntax show up in discord?

jade abyss
#

```sqf
CODE
```

austere granite
#
#define DSCHAISLAME(var1,var2,var3) if (sd_xp >= var1) exitWith { sd_level = var2; sd_xpNeed = var3 };

call {
    DSCHAISLAME(7000,15,8000);
    DSCHAISLAME(6200,14,7000);
}

special commy method

jade abyss
#

fork you

#

MacroDerps

still forum
#

It's good tho

thorn saffron
#
private _target = shopInventory;   
private _cargo = getItemCargo box1;   
{   
    _target addItemCargo [_x,((_cargo param [1])param [_forEachIndex])]; 
}forEach (_cargo param [0]); 
 {_cargo removeItem _x;} forEach (_cargo param [0]); ```
ok, so this creates copies of the items from the box1, but ```{_cargo removeItem _x;} forEach (_cargo param [0]); ``` does not remove the original items.
peak plover
#

bis arsenal is 3k lines 1 file

still forum
#

I would personally make an array of xp,level,xpneed and iterate till I find the right one

austere granite
#

yeah same dedmen

jade abyss
#

And? Nigel?

peak plover
still forum
#

@thorn saffron Does box1 have more than 1 of that item?

#

because removeItem removes one

#

and if you move everything anyway why don't you just remove all items

austere granite
#

wtf is wrong with those colors Nigel

#

Monokai only color scheme

jade abyss
#

looks girlish

peak plover
#

looks girlish
You would know

jade abyss
#

Yeah, cause i know some girls ๐Ÿ˜„

austere granite
#

that was not a good joke nigel

#

too easy

#

made it easy for dschappy new year

still forum
#

@jade abyss You doo? Are they really as glibbery as everyone says?

peak plover
#

sooo true

still forum
#

Scooby doo

jade abyss
#

@still forum Depends on what you do to them ๐Ÿ˜‚

#

Guess why some ppl call me DschadoMaso

#

(okay, noone does... but it sounds cool)

#

Anyway, @thorn saffron , what are you trying to achieve in the end +where does the Array come from?

inner swallow
#

you should call yourself dschinghis khan

still forum
#

@jade abyss If you read the code you'll see where it comes from

jade abyss
#

I already did, Dschangis Kahn

inner swallow
#

oh, i missed it ๐Ÿ˜„

jade abyss
#

Yeah, from 1 crate to another @still forum , still wanna know what he is trying to achieve

inner swallow
#

๐Ÿ‘Œ๐Ÿฝ

thorn saffron
#
private _target = shopInventory;    
private _cargo = getItemCargo box1;    
{    
    _target addItemCargo [_x,((_cargo param [1])param [_forEachIndex])];  
}forEach (_cargo param [0]); 
 
clearItemCargo box1;```
works but if I use _cargo instead of box1 I get the generic error
```clearItemCargo _cargo;```
jade abyss
#

because: _cargo is the ItemList

thorn saffron
#

duh

jade abyss
#
clearItemCargo box1```
still forum
#

Ofcause you get an error if you do bullshit that doesn't work

#

also you don't get a generic error.

#

Read a few lines lower. Thanks

peak plover
#

This looks like the makings of a good life mod

thorn saffron
#

@still forum Hey, i have little idea when it comes to any kind of scripting

still forum
#

Read Biki. Always read Biki.

#

If you have little idea when it comes to any kind of reading too. You're screwed I guess.

#

We don't do anything different. We either read Biki or remember what is written there

thorn saffron
#

And how the fuck I'm supposed to know what exactly to look for

still forum
#

You are using clearItemCargo So I would look for clearItemCargo

#

You were using getItemCargo before. So I'd suggest looking for getItemCargo

still forum
#

It's really not that hard

#

SQF is quite easy

jade abyss
#

it is, yeah. If you know the basics, it's pretty simple.

#

No need to memorize, at least not everything.

thorn saffron
#

Yeah cause I didn't look at it and I totally did not figure out that the return out of getItemCargo is 2 arrays that are incompatible with addItemCargo

still forum
#

Though granted the Biki isn't that good in explaining the basics. As in syntax. You can read the syntax on every commands page as examples. But it doesn't really explain that well why it is like that

jade abyss
#

Yeah Taro, thats a pretty big fk up by BI, in that case

#

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

#

Welcome to scripting, thats a new layer of madness (compared to configs)

still forum
#

I don't know which idiot decided to put the counts in a seperate array.
But I also don't know which idiot decided on the save format of the Arsenal

jade abyss
#

save Format of Arsenal is? (too lazy to search)

still forum
#

But I know that KK is most likely responsible for get/setUnitLoadout which was good

#

save format of arsenal is "bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage","bandage",.....

jade abyss
#

dafork

still forum
#

get/setUnitLoadout is ["bandage",50]

jade abyss
#

Reminds me on the DayZ Databases ๐Ÿ˜‚

peak plover
#

ugh

#

eww

still forum
#

getItemCargo is [["bandage"],[50]]

jade abyss
#

๐Ÿคฆ sherbFail

#

gg

#

PartyTime

peak plover
#
class Item7
{
    class data
    {
        class type
        {
            type[]=
            {
                "STRING"
            };
        };
        value="rhs_mag_30Rnd_556x45_M855_Stanag_Tracer_Red";
    };
};
class Item8
{
    class data
    {
        class type
        {
            type[]=
            {
                "STRING"
            };
        };
        value="rhs_mag_30Rnd_556x45_M855_Stanag_Tracer_Red";
    };
};
#

This is the true power of arsenal

still forum
#

This!

jade abyss
#

@peak plover Remove the tabs pls

still forum
#

And that's why storing an array of duplicate strings is the best idea ever

thorn saffron
#
{   
    _target addItemCargo [_x,((_cargo param [1])param [_forEachIndex])]; 
}forEach (_cargo param [0]);

For me its hard to create stuff like this, often I just can't wrap my head around this kind of stuff

still forum
#

because not only that format is dumb. But also the way BI serializes Arrays is even dumber

jade abyss
#

@thorn saffron Try to understand forEach first

#

Then it's fkn easy

still forum
#
{   
    _target addItemCargo [_x, (_cargo select 1) select _forEachIndex]; 
} forEach (_cargo select 0);
peak plover
#

๐Ÿ˜ก

still forum
#

Or if you want even easier

{   
    _target addItemCargo [(_cargo select 0) select _forEachIndex, (_cargo select 1) select _forEachIndex]; 
} forEach (_cargo select 0);
#

That's probably easier to understand

#

You just go through all items. Pick the name from the first array and the count from the second

peak plover
#

param is harder to understand than select? It's prety much the sam

still forum
#

pretty much the same but what better says select that element from this
this select that or this param [that]

#

The first basically says exactly what it does

thorn saffron
#

That I kinda figured out that I had to do it like this, the issue with scripting for me is HOW to do what I want

still forum
#

the second.. not really at all

#

Also param add's unnecessary overhead

peak plover
#

Sure

#

I guess it depends on case and this case it's better to select

#

I still have some old stuff where I used select and then did isNil check ๐Ÿคฆ

still forum
#

Use the right tool for the job. Always.
param has no place in this job

candid jay
#

all, is there a way to retrieve terrain elevation under an object?

#

not the object elevation itself, the terrain level

#

fo instance if I want to set an object on the ground under a flying one.

inner swallow
#

you could do ASL - ATL or something

peak plover
#

Terrain elevation under a object?

inner swallow
#

they mean, if something is flying at 500m and the terrain height below the thing is at 350m, then they want to obtain 350m

candid jay
#

yes

inner swallow
#

i mean i suppose you could only get the X,Y coordinates of the flying thing

#

and for whatever you want to set under it, it just spawns at X,Y,0 ATL

candid jay
#

ok so that would be ATLtoASL [X,Y,0] for absolute, I guess

inner swallow
#

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

#

i was thinking of a multi step process, but maybe that works too

#

not familiar with ATLtoASL

candid jay
#

ok will try that

#

thank you

inner swallow
#

cheers

little eagle
#

@candid jay

all, is there a way to retrieve terrain elevation under an object?

getTerrainHeightASL getPosWorld _object;
austere granite
#

getTErrainheifds

#

๐Ÿ˜ฆ

#

what commy said

#

nice blue name btw

little eagle
#

@austere granite ๐Ÿ’ฉ

peak plover
#

What happend to your name commy

candid jay
#

thanks!

little eagle
#

Or do you mean the objects elevation above the ground?

still forum
#

It's a fake account. Some guy is pretending he is commy :U

little eagle
#

Now the tables have turned. : /

still forum
#

There. have blue

#

Y u no blue?

#

How can one stop being a veteran

little eagle
#
  1. Get kicked.
still forum
#

but why

little eagle
#

๐Ÿ’ฉ abuse.

still forum
#

Can only get banned so. temp ban which auto removed groups then

#

You cannot abuse poo ๐Ÿ˜ฎ

austere granite
#

i wish dedmen would get kicked for his shitty name ๐Ÿ˜ฆ

tough abyss
#

No

jade abyss
#

You mean for his Avatar? @austere granite

#

damn furrys ๐Ÿฅ ๐Ÿ”จ

grizzled spindle
#

Is there any difference between setVehicleLock and lock?

still forum
#

read notes

jade abyss
#

This URL should be a sticky, and pop up when somebody joins this Channel

grizzled spindle
#

No I have read the wiki and it looks the only difference is one takes a number and one a string

still forum
#

READ Dude

#

It literally answers exactly what you are asking

rotund cypress
#

@grizzled spindle that is the difference between them

still forum
#

Just like the note that I told to read on the wiki page that I linked says

grizzled spindle
#

Well sorry if that rustled yall feather but i was wondering if there was somehting i missed. Like why create 2 functions that do the same thing? Anyway ill drop it now. Happy new year

peak plover
#

Made me physically furious. Happy new yearss

jade abyss
#

@grizzled spindle Don't ask for reasons, in 99% of the time.

still forum
#

One takes Enum as string which can cause enum errors. The other takes it as number.

#

both of these commands (not functions) are over 12 years old now.

#

and lock didn't take enum back when it was added. That was only added 2 years ago

#

So no one created 2 functions that do the same thing. Back when they were created they were doing different things.
10 years later one of them was extended so it can also do the stuff that the other command can.

queen cargo
#

@little eagle no longer blue? interesting ๐Ÿค”

tough abyss
#

One of us! One of us!

still forum
#

commy is still blue even if you don't see it

jade abyss
#

Yeah, he sobs the whole day

little eagle
#

Nah, but it's funny being asking by EVERYONE about it.

peak plover
#

poop abused ๐Ÿ˜

little eagle
#

The ๐Ÿ’ฉ is dead, long live the ๐Ÿ’ฉ!

peak plover
#

how do you do that?

jade abyss
#

Hey @little eagle, why u no blue anymore?

#

๐Ÿ˜‚

#

(need any reaction?)

little eagle
#

๐Ÿ’ฉ

jade abyss
#

๐Ÿ˜„

subtle ore
#

Wow, much bulli

peak plover
#
Result:
0.219925 ms

Cycles:
4547/10000

Code:
{_x distance player < 150}count allunits;
Result:
0.0366 ms

Cycles:
10000/10000

Code:
count(allUnits inAreaArray [(getpos player),150,150,0,false])
#

rewriting old scripts is funny

tame portal
#

The question is, why is it that much faster? ๐Ÿค”

peak plover
#

gains in over 0.18 ms

#

Because sqrt

tame portal
#

Sounds right

peak plover
#

inAreaArray just comapres the positions afaik

#

15151 > 5156

#

like that

austere granite
#

das bretty gud

tame portal
#

I would have thought its because theres more done in C++ without going back to SQF

little eagle
#

That's right. I was about to write that.

tame portal
#

Mine or nigel?

little eagle
#

You.

queen cargo
#

@peak plover @tame portal reason is because count actually calls the code which takes time
whilst the later just iterates over all elements in native code

tame portal
#

๐Ÿ‘Œ

peak plover
#

๐Ÿค”

#

Very good

austere granite
#

Bretty gud

peak plover
#

caching checks will never be the same

#

clientside caching 2018

tame portal
#

I just realized again that DayZ will have a debugger

#

dies

little eagle
#

You essentially remove an SQF loop, for the price of one C++ loop. Which is much much better.

queen cargo
#

@tame portal arma also has one if you actually would use community tools ..

#

ArmA.Studio

tame portal
#

I meant an "official" one ๐Ÿ˜›

queen cargo
#

though ... the debugger currently is dead due to no interest in it and an update broke it

tame portal
#

I've used yours before

peak plover
#

๐Ÿ˜

#

Well

austere granite
#

your tools scare me

#

I write in notepad.exe

#

everythign else is too complicated

tame portal
#

Type your code into a terminal

little eagle
#

This warrants a poop.

peak plover
#

hahah

tame portal
#

๐Ÿ’ฉ

peak plover
#

You poopy brain

lone glade
#

D.E.F.I.N.I.T.E.L.Y

#

LEARN TO WRITE IT

austere granite
#

sepErate

peak plover
#

separate

still forum
#

@tame portal Arma also has a official debugger. It's just BI internal sadly and they never published it.

lone glade
#

it's NOT:
defiantly
definately
definily or whatever other variation ๐Ÿ˜ก

austere granite
#

like i would listen to someone that doesn't like Atom

lone glade
#

try to open a 5MB file

#

tell me what happens

austere granite
#

I make sure I don't have 5MB files

#

ez

little eagle
#

I've seen 5MB scripts.

tame portal
#

Definitely

peak plover
#

ASk quicksilver

lone glade
#

such a great editor

austere granite
#

So have I, and I choose to not have them

lone glade
#

what if you missclick a binary file?

tame portal
#

Bluescreen

austere granite
#

why would i have binary files on my computer

#

i heard those give viruses

peak plover
#

^

#

soooo tru

#

brain is having a fart

#

private _patrolWPs = missionNamespace getVariable ['ai_ins_patrolWPs',[]];
_patrolWPs pushBack _wpPos;
austere granite
#

only works if the var already exists

peak plover
#

๐Ÿค”

little eagle
#

You need to setVariable this too.

austere granite
#

so use setvar

little eagle
#

Because the default isn't already attached.

lone glade
#

nope

little eagle
#

Yes.

peak plover
#

That's what I thought @austere granite

#

Thanks

austere granite
#

you do if it does the defaeult return

little eagle
#

^

austere granite
#

algantha wrong about atom, wrong about this

#

โค

lone glade
#

he doesn't copy the array

#

it's gonna modify the original

little eagle
#

But he creates a new one in case it was undefined.

austere granite
#

there is no original if it uses default return

little eagle
#

And that one doesn't stick.

tame portal
#

but if it doesnt exist, it creates a new one but doesnt save it as a global var again

lone glade
#

oh, I was assuming it existed

austere granite
#

ASUMING

peak plover
#

Yeah It's got achance that htis will run before

austere granite
#

with extra S

little eagle
#

๐Ÿ’ฉ

tame portal
#

Asks script related question
Multiple people are typing

lone glade
#

learn to read?

little eagle
#

Well, this is the scripting channel.

lone glade
#

unless he's telling me to type assuming with three S ๐Ÿ˜„

austere granite
#

nah i failed alganthe, sorry ๐Ÿ˜ฆ

#

i apoligize

peak plover
#

๐Ÿ‡จ ๐Ÿ‡บ ๐Ÿ‡ท ๐Ÿ‡ท ๐Ÿ‡ช ๐Ÿ‡ณ ๐Ÿ‡น ๐Ÿ‡พ ๐Ÿ‡ช ๐Ÿ‡ฆ ๐Ÿ‡ท
Ofcourse we are talking about scripting and not poop or random stuff

lone glade
#

triggerring initiated

austere granite
#

current year is objectively in the top 5 of maymays though

#

inb4 too

tame portal
#

I was pointing out that as soon as theres a question in the room everyone races to answer it ๐Ÿ˜„

#

Never seen that in other channels lol

peak plover
#

It's more of a competition

lone glade
#

because they're fairly easy to answer for everyone involved

little eagle
#

Make it a harder question.

lone glade
#

now, if commy asked some questions related to his sqf catenary mathemagics nobody would answer

little eagle
#

tfw so smart no one can answer your question

austere granite
#

i have that problem with UI now in arma ๐Ÿ˜ฆ

lone glade
#

....

tame portal
#

Points intensifies

lone glade
#

I'LL HAVE YOU KNOW COMMY WROTE A LOBBY IN 3 DAYS

#

and rested on the 4th ๐ŸšŽ

#

(we don't have troll emojis, i'm improvising)

tame portal
#

He's like a budget god in SQF

#

๐Ÿ

lone glade
#

thonking

queen cargo
#

the actual interesting part is getting the lobby working ingame
the actual coding is mostly just busywork

lone glade
#

literally sqf in a nutshell

little eagle
#

If I write something, and this might seems strange to you, it is implied that it actually works. EVEN INGAME.

lone glade
#

filled with bugs

peak plover
#

gibs me lobby lol

queen cargo
#

not sure what you try to imply @little eagle

little eagle
#

What did you imply by saying the interesting part is getting it to work ingame?

queen cargo
#

getting it to replace the lobby

#

finding the right config entry

#

that stuff

austere granite
#

@little eagle you might want to make sure you add a thing that you can limit slots to a Donator tag

lone glade
#

ctrl+F in ui_F -> done

austere granite
#

Like use the Paypal API and implement slot unlocking

#

LIFE LOBBY 2017+1

lone glade
#

where did I put my torch again...

little eagle
#

It's easy to expand for anyone with a bit of knowledge in sqf. Atm it's pretty bare bone.

austere granite
#

bit of knowledge in sqf
life

#

maybe you can implement the AltisLifeCoin crypto too to unlock slots

little eagle
#

I have P as a project in ST3. So all I need to do is to ctrl+shift+F if I want to find something in the games sqf source.

austere granite
#

Is ST3 some sort of atom package?

lone glade
#

burn him

little eagle
#

Kappa

lone glade
#

no blobs, no kappa, discord is clearly the inferior product

little eagle
#

Someone attach a ๐Ÿ’ฉ to this worthy post.

peak plover
#

haha

#

Commy is such a meme

lone glade
#

commy blue power got absorbed by dedmen, in the end there can only be one !

little eagle
lone glade
#

I wonder how many i'm at

little eagle
#

Actually it's issues and pull requests, but shh.

lone glade
#

59

#

wtf

little eagle
#

And the number of commits on master will double once medical-rewrite is merged.

lone glade
#

319 for commy

jade abyss
#

defenetely time for that.

edgy dune
#

question, how can I get the name of a object im looking at when I use addAction, im tryna make a force pull action cause why not XD

#

nopenvm

#

I got it

echo rivet
#

hey guys i'm wondering if you may have a solution for this. I'm spawning a function with a parameter. Is it possible to change that spawned function by calling it with [0] spawn _oxygenON; or how would you go about breaking the loop?


[1] spawn _oxygenON;

oxygen.sqf

_oxygenON = {
     
     _state = _this select 0; 

 while {_state == 1} do stuff

#

i guess that would just be calling the function all over again

subtle ore
#

@echo rivet

while{_state == 1} do 
{
    if(_state == 0) exitWith 
    {
       //exit current scope
    };
};
echo rivet
#

omg kill me

subtle ore
#

Lol

queen cargo
#

it is noit @echo rivet

#

you probably gonna need an actual global variable

#

alternativly you could just take the spawn script handle and use terminate on it later on

#

spawn itself however, will always create a new instance of that (and not affect the existing instance)

echo rivet
#

yeah i'm fixing a global

#

thats the easiest solution

worn igloo
#

I need someone to help me find the reason why my function isn't executing using the call command

meager heart
worn igloo
#

Basically what this script does is create an ambient heli that is spawned randomly 3000 meters around the player. Then it moves across somewhere near the player. It works when executed via execVM but when I call it it doesn't execute. The function is defined.

#

ok

meager heart
#

๐Ÿ‘

worn igloo
#

I tried calling the function with sqf _w = [] call a3e_fnc_AmbientHeli; but the code never executes

meager heart
#

Just first what i see private <array> and private <string> are deprecated

#

function is defined ?

#

where you call it ?

worn igloo
#

yeah I defined the function properly in function.hpp

#

from the debug menu

meager heart
#

is this exact how you call it ?
_w = [] call a3e_fnc_AmbientHeli

worn igloo
#

yes

meager heart
#

where ; at the end ?

worn igloo
#

oh

#

whoops yeah that too

meager heart
#

_w = [] call a3e_fnc_AmbientHeli versus _w = [] call a3e_fnc_AmbientHeli;

worn igloo
#

yeah ik I just typed it out quickly, it wasn't a copy paste

meager heart
#

so when you call it nothing happens or some errors ?

worn igloo
#

No errors are thrown that's why I'm so lost

#

execVM works perfectly fine keep that in mind

meager heart
#

then maybe something wrong in cfgFunctions

#

i mean where you define it and how you do it

worn igloo
#

this is function.hpp that is included in description.ext

meager heart
#

file name ?

worn igloo
#

functions.hpp

meager heart
#

no that function file name

worn igloo
#

oh

#

fn_AmbientHeli.sqf

#

sub category of DRN

meager heart
#

you have there

#
class CfgFunctions
{
  class A3E
  {
        class drn
        {
            class DRN
            {
                class AmbientHeli {};
            };
        };
    };
};
#

what is

#
class drn
{
            
};
worn igloo
#

hmm

#

not sure but all the other functions work properly

#
_w = [] call drn_fnc_AmbientHeli;``` Now that I think of it I might have been using this instead
#

I can't currently test my script bc I'm away from home and don't have access to arma, is there a way I can test it online?

meager heart
#

i don't think so

worn igloo
#

Dash was supposed to implement something along the lines

meager heart
#

Dash ?

worn igloo
#

yeah its an IDE for arma 3

meager heart
#

oh ok

still forum
#

SQF-VM could. But it doesn't have CfgFunctions

worn igloo
#

Is there some restrictions on compiling a block of code? Could there be anything preventing it from being compiled?

still forum
#

If you have a syntax error it won't compile

#

If you are still here in an hour I maybe can take a look at it. Maybe I'll see something

worn igloo
still forum
meager heart
#

yes I think you just need remove that subclass drn

still forum
#

move drn stuff into a3e you mean

#

removing the subclass would just break everything

meager heart
#

yes sorry

worn igloo
#

yeah I realized that earlier, I did infact call the function using sqf _w = [] call drn_fnc_AmbientHeli;

#

I was reading that if you have call return a something and the function doesn't return anything it will throw an error. Does this mean it could halt the function completely?

#

asking does this make a difference sqf _w = [] call drn_fnc_AmbientHeli; vs sqf [] call drn_fnc_AmbientHeli;

meager heart
#

i think it depends on where you are using it and how, if function not returning anything that not mean that it will throw an error

#

and error can hold anything i believe if just halt ๐Ÿ˜€

worn igloo
#

I'll just wait till I get home tomorrow and try again

meager heart
#

glhf

still forum
#

@ะ‘ะตะปะบะพะฝ#5567 I was reading that if you have call return a something and the function doesn't return anything it will throw an error. There is only one very rare case how you can make a function return nothing. And that thing is a bug in the script engine

#

@worn igloo

ivory ferry
#

I need a script to put in the debug console to damage the vehicle I'm in, what do I type?

still forum
#

(vehicle player) setDamage <damage>

ivory ferry
#

what value do I put in just for a little bit

still forum
#

0.1

#

0 is no damage at all. 1 is boom.

#

0.1 is 10% between no-damage and boom

scenic shard
#

has anyone been successful in making the player switch to another team and unit on death? (MP-mission)

scenic shard
#

I have tried to create a new unit by script and use selectPlayer _unit, but nothing happened.

also tried to join the player to a new group from the correct faction, but then it seems like respawning starts to freak out.

what I want to do is whenever a west player dies they change faction to resistance, and if they die again as resistance they just respawn as normal

rotund cypress
#

@scenic shard use createAgent command and not createUnit. (EDIT: selectPlayer should apparently work with createUnit as well)

#
selectPlayer _agent;```
#

And also, thats not really possible with ArmA right now, you are all in different factions, Blufor, Independent, Opfor, Civ etc. I mean the closest you'd get would probably be to put everyone on civ and then just spawn them with different clothing.

still forum
#

Your player will always be the faction he selected in the slot selection. You might be able to find some workarounds to make other people believe he is of a different faction

little eagle
#

Easily doable with selectPlayer. If it doesn't work for you, you made a mistake.

scenic shard
#

hm ok, then I'll go back to that version and try to see why it didn't work

rotund cypress
#

If you post your createUnit code we can maybe help you a bit better.

drowsy skiff
#

@scenic shard post your code or pastebin link and that will help people here to spot obvious errors / make suggestions

warm gorge
#

Has anyone heard of an issue where players spawning sometimes become invisible and cant move until they relog?

rotund cypress
#

No.

#

That sounds quite strange.

#

Follow exactly what happens when they log in and you will most likely find an issue that comes with it.

#

@warm gorge

warm gorge
#

Yeah always get complaints but can never reproduce it myself

rotund cypress
#

Check your code before they log in / gets logged in and try to think what code can cause some of these issues.

echo rivet
#

hey, i'm trying to pass a bool value to this function using the following. But I get Error ==: type bool, expected number, string, not a number etc etc. I don't get why this doesnt work >.<

[[player, true], "A3W_fnc_oxygen", false, true] call A3W_fnc_MP;

to function 

oxygen.sqf

 private ["_player","_state"];
 
 _player = _this select 0;
 _state = _this select 1;

while {_state == true} do 

{
    _player setOxygenRemaining 1;
    hint "Oxygen";
    if (_state == false) exitWith {};
    
};
still forum
#

Did you try to read the wiki?

echo rivet
#

yeah i stayed up for hours last night trying to find whats wrong, tried different solutions

still forum
#

If you read that you'll know that you can't use == with bool's

#

And if you'd further think about that you'll notice that comparing bools actually doesn't make any sense

little eagle
#

What's the purpose of this?

still forum
#

Because bool == true is the same as bool
and bool == false is the same as !bool

echo rivet
#

while {state} do

... if (!_state) do

still forum
#

Yes

#

Why don't you do that then?

little eagle
#

What's the purpose of this?

echo rivet
#

because it gets stuck in the loop

still forum
#

Well yes

echo rivet
#

keeping the oxygen from dropping

rotund cypress
#

A3W_fnc_MP

still forum
#

Again

#

Scroll all the way down and read the last note

#

waitUntil only exits if you exit with true. You however exit with nil which is not true

#

also.. Your exitWith doesn't even make sense because if _state is not true it will exit anyway

rotund cypress
#

There is no waitUntil in his script

still forum
#

And you also never set _state to false

#

SQF isn't magic. Variables don't magically change their value

echo rivet
#

think i bit off more than I could chew, im quite new to scripting in arma

still forum
#

Yes there is no waitUntil. Didn't even see that

lone glade
#

A3W_fnc_MP;

#

k

still forum
#

@echo rivet Where do you set _state to true?

little eagle
#

So this is for a diving mission - not addon - that's supposed to make the player be able to hold breath forever?

echo rivet
#

@still forum I pass true from [[player, true], "A3W_fnc_oxygen", false, true] call A3W_fnc_MP;

still forum
#

Okey

#

So?

#

It always is _true

echo rivet
#

until I change it

rotund cypress
#

@echo rivet use remoteExec and not the MP function

#

Its really old

lone glade
#

it's not even that

still forum
#

@echo rivet Where do you change it?

lone glade
#

it's not BI_fnc_MP

still forum
#

That was what I originally wanted to ask. when you set it to false not true.

echo rivet
#

later in the code with [[player, false], "A3W_fnc_oxygen", false, true] call A3W_fnc_MP;

warm gorge
#

Why is this be ing remote executed

rotund cypress
#

Most likely a copied function from BIS_fnc_MP though @lone glade

still forum
#

You are calling the function a second time with a different parameter

#

that doesn't change the first instance of that function

#

why do you set the servers oxygen on serverside anyway?

rotund cypress
#

@echo rivet I would say use a global variable instead, if you want the loop to ever end, you need to set that to false somewhere

warm gorge
#

I dont think its serverside if hes passing player

still forum
#

@warm gorge Why?

#

Is there any reason why you couldn't pass a player to a function?

warm gorge
#

Nevermind I didnt read the code properly, my bad

rotund cypress
#

Tbh, I think the player needs to be local in order to set the oxygen

little eagle
#

This is like 5 lines of code if done properly. No idea why you're all making it so complicated.

still forum
#

Again a reason why it doesn't make sense to remote execute it

rotund cypress
#

^^

#

lurre_globalVar_state = _initialState;

while {lurre_globalVar_state} do 
{
    player setOxygenRemaining 1;
    hint "Oxygen";
};```
scenic shard
#

ok so here is the code I use to try and switch side:

player addEventHandler 
[
"Killed",
{
    params["_oldUnit"];
    if (side (_unit) isEqualTo WEST) then
    {

            private _group = missionNamespace getVariable "indGroup";
            if (isNil "_group") then
            {
                _group = createGroup resistance;
                missionNamespace setVariable ["indGroup", _group]; 
            };
            
            _newUnit = "B_RangeMaster_F" createUnit [position _unit, _group];
            selectPlayer _newUnit;

    }
}
];

seems like a unit is created fine but I dont get control over it and get sent to the respawn screen

echo rivet
#

i read it was best practice to execute such scripts serverside to prevent hacks

rotund cypress
#

@echo rivet read my paste above

little eagle
#

Don't believe everything you read on the internet.

rotund cypress
#

Then just change lurre_globalVar_state to false whenever you want to end it

still forum
#

@echo rivet You should stop caring about "best practices" that some idiot told you if you don't even know the basics

#

Doesn't make sense to think about security if your code doesn't even remotely work at all

little eagle
#

So of course you can't use selectPlayer if you don't have the object reference.

rotund cypress
#

Also, oxygen is not really something that is critical to have very secure.

echo rivet
#

@still forum yeah that makes sense

#

im just in it for the learning, its' a pretty useless script even if it works ๐Ÿ˜›

rotund cypress
#

@echo rivet did you see my snippet?

echo rivet
#

yeah awesome man

#

ill try that

rotund cypress
#

_initialState is a parameter

little eagle
#

That code needs some breaks though. No point in resetting the players oxygen 12 hundred times per frame.

rotund cypress
#

^^

#

Also, the hint will hurt your ears

#

If you dont sleep

still forum
#

just use a waitUntil instead of a while

little eagle
#

^ this tbh

rotund cypress
#

Why?

still forum
#

Because waitUntil only loops once per frame

little eagle
#

1 code block, not 2.

scenic shard
#

@little eagle aw crap, thanks!

still forum
#

while loops forever until 3ms are filled

echo rivet
#

could sleep it for a couple of seconds, it takes a while to drown

still forum
#

Or maybe 10k executions. but I guess the 3ms is reached first

rotund cypress
#

Or if (oxygenRemaining < 0.1) then {setOxygenRemaining.......};

#

@echo rivet

#

Instead of sleep

little eagle
#

You will always drown with this if the player has low enough fps, and enough other scripts are running, because the scheduler is ๐Ÿ’ฉ.

rotund cypress
#

You could use a waitUntil block as these guys said, but then inside the while loop

#

Also now when I think about it, pretty pointless to have an initialstate parameter so you could remove thath @echo rivet

#

Just set the lurre_globalVar_State to true at the top

#

Also, I would recommend to not have this running all the time, but rather if (surfaceIsWater position player)

little eagle
#

That check is probably worse than just using the setter anyway every time.

rotund cypress
#

Maybe even using onEachFrame for this

#

Wouldnt really help if the player has low FPS though

little eagle
#

Dunno, if he never experiences the scheduler falling asleep with your setup, who cares. Hard to motivate people for edge cases if it means they have to use their brains abit.

#

Don't think you can drown between frames ๐Ÿ˜‰

rotund cypress
#

That is most likely true, hehehe, but they could if their FPS was really really low and it checked for getOxygenRemaining.

#

I suppose.

little eagle
#

No, because you'd reset it.

#

Even if the simulation is slow, you reset it every frame.

rotund cypress
#

I didn't mean reset each frame, but check each frame

#

if (getOxygenRemaining < 0.1) {setOxygenRemaining...};

little eagle
#

You mean like the frame is so long that it's enough for oxygen to reach zero, and we assume the check to kill you happens before sqf?

rotund cypress
#

Something along those lines ๐Ÿ˜‚

little eagle
#

Pretty sure other things start breaking down at 0.1 FPS.

rotund cypress
#

A fairly good edge case though ๐Ÿ˜‰

#

And yes, probably that as well.

little eagle
#

Could be tested if it actually happens. I still have my doubts. I bet oxygen reduction is slowed down with simulation time.

rotund cypress
#

Would be fair.

austere granite
#

The actual damage script is in an FSM I think

rotund cypress
#

Ayy, that would make sense.

#

Except for AI stuff though, what actually is a good use of FSM? I've never really used it much.

little eagle
#

Everything that operates in states, I guess.

still forum
lone glade
#

^ for real state machines

little eagle
#

I like how the first example is showing something that could be implemented in SQF without the FSM editor.
As a design concept it's fine, but the actual FSM editor and .fsm files are horrible.

fickle field
#

join the chat someone

still forum
#

yes

#

definetly

little eagle
#

Ready.

#

No can do.

still forum
#

@raven void Someone needs you here

#

Oh there is really a guy called someone

little eagle
#

Y-you just tagged a random person.

still forum
#

Discord didn't even show me when I wrote the mention

#

Discord says there is no "someone" so I thought I could post

echo rivet
#

Ok thanks for the input everyone. Here is the fully functioning script. It will be available for admins on a wasteland server.

if (isDedicated) exitWith {};

if ((getPlayerUID player) call isAdmin) then 
{

    if (isnil "OxygenSwitch" ) then {OxygenSwitch = 0};


    if (OxygenSwitch == 0) then 

    {
        OxygenSwitch = 1;
        OxygenRefill = true;

            while {OxygenRefill} do 
            {
                player setOxygenRemaining 1;
                hint "OxygenON";
                sleep 10;
            };
    }
    else
    {
        hint "OxygenOFF";
        OxygenRefill = false;
        OxygenSwitch = 0;

    };
};
rotund cypress
#

admin aboose

echo rivet
#

tss ๐Ÿ˜›

scenic shard
#

when I exec this part from the debug menu I spawn a new unit and take control of it as it should. but when it's wrapped in a killed EH I die and respawn as normal.

any idea how to fix it?

private _group = missionNamespace getVariable "indGroup";
            if (isNil "_group") then
            {
                _group = createGroup resistance;
                missionNamespace setVariable ["indGroup", _group]; 
            };
            
            _newUnit = _group createUnit ["I_Soldier_A_F", getMarkerPos "respawn_west", [], 0, "NONE"];
            selectPlayer _newUnit;
lone glade
#

because the respawn code is ran after the killedEH

scenic shard
#

is there any way around that, or any way I can disable the respawning for that unit. as it is no longer the "real" player unit and should not be used anymore

little eagle
#

set the respawnTime to 0.1 and use respawn event instead?

scenic shard
#

hmm, is it possible to have different respawnDelay's for different factions?

little eagle
#

No.

scenic shard
#

ok, should be fine anyway. just need to duplacate all the respawn markers for both teams.

unborn mauve
#
    Modify the existing fields with your units, vehicles and groups.
    In the initVar.sqf, when the files are compiled and called, add a condition to run your files when a condition is met.
    Load the game with the mod of that faction.```
#

Any idea how I could do this?

#

Antistasi trying to change the faction from CSAT to NATO

#

Am a total noob when it comes to scripting so bear with me

little eagle
#

@still forum

15:22:56 [0,310.372,0,"XEH: PreStart started."]
15:24:09 [0,383.486,0,"XEH: PreStart finished."]
still forum
#

Uh

#

Yes?

little eagle
#

Do you see how bad it is?

lone glade
#

70ms ain't bad

tough abyss
#

terrible

#

needs optimization

#

/s

little eagle
#

70 seconds, alganthe.

lone glade
#

that's close to how fast ACE Arsenal opens

#

WTF

#

okay, nevermind

#

this is not ok

tough abyss
#

wait what

#

oh shit

#

hes right

still forum
#

@little eagle did you profile how much of that is ACE?

little eagle
#

All minus 2 seconds.

still forum
#

Do you want me to add that to my profiler? Log the compile time for EVERY compiled script?

#

So you can find what scripts take the longest?

little eagle
#

It's preprocessFile, not compile.

still forum
#

preproc is cheap tho

little eagle
#

Hence, preprocess at addon build.

#

Well that is what you all keep saying, but the numbers don't add up.

still forum
#

How about you compile at addon build? :3 Dats awsm

tough abyss
#
 9:00:17 [0,14.177,0,"XEH: PreStart finished."]```
#

my server

little eagle
#

No ACE, duh.

tough abyss
#

ye

little eagle
#

2 sec preprocess / compile for CBA looks right.

still forum
#

Maybe I'll do that when I can dev again

little eagle
#

Though even that could be sped up.

peak plover
#

@still forum Didn't have an offsite backup?

#

tsk tsk

still forum
#

not even onsite

#

well..

#

I have a offsite backup off some of that stuff

#

but I deleted that after moving it away

peak plover
#

did you lose anything important? ๐Ÿ˜ฆ

still forum
#

so it's only theoretically a backup of some of the stuff

#

not yet

#

It isn't fully dead yet

peak plover
#

sucks ๐Ÿ˜ฆ

peak plover
#

Hey ace people need quick tip

#

I converted the ACE3 settings to cba settings

#

where does I put them ?

lone glade
#

from a mission?

peak plover
#

For server

cedar kindle
winter dune
#

why does this code throw a missing ; error?

_lightSource = createVehicleLocal ["#lightpoint", getPos _vehicle, [], 0, "CAN_COLLIDE"];
still forum
#

did you copy-paste that or typed it off?

#

what about the lines above/below that?

#

need more context

winter dune
#

just this piece of code

#

throws that error

#

_vehicle is defined

still forum
#

How do you know that exactly that bit throws the error?

winter dune
#
_vehicle = vehicle player;
_lightSource = createVehicleLocal ["#lightpoint", getPos _vehicle, [], 0, "CAN_COLLIDE"];
#

this into the debug console

still forum
#

okey

#

Well. I see that your code is wrong and absolutely won't work like that

#

but I don't see a missing ; error in there

winter dune
#

it was a createVehicle, I changed that into Local

#

maybe the syntax is invalid

still forum
#

yes

#

yes it is

#

The error message usually shows exactly where something is wrong

#

AHH

#

I see

winter dune
#

before [

still forum
#

the createVehicleLocal command doesn't exist

subtle ore
#

๐Ÿค”

winter dune
#

ohhhhhhhhh

#

_lightsource = "#lightpoint" createVehicleLocal _pos;
#

maybe

still forum
#

There are 3 types of commands nular (0 arguments), unary (1 argument), binary (2 arguments)

#

and there is no unary form of createVehicleLocal

jade abyss
#

unary?

still forum
#

meaning the game falls back to reading that as a variable. So you have written
_var = _var2 [array]

#

which doesn't make sense obviously. So the compiler uses the universal "missing ;" fix

#

In logic, mathematics, and computer science, the arity ( listen) of a function or operation is the number of arguments or operands that the function takes. The arity of a relation (or predicate) is the dimension of the domain in the correspondin...

jade abyss
#

ah

#

wrong format

still forum
#

I always like saying how it really is although that confuses everyone. But it's how it is. That command doesn't exist.

#

A different command with the same name does exist. But that one in the code doesn't

still forum
#

yes

jade abyss
#

๐Ÿค”

still forum
#

"A different command with the same name" could confuse people. As most people assume "same name == same command"

subtle ore
#

But we can say it's now local versus global with the same command?

#

Oh

jade abyss
#

Creates an object of the given type. ๐Ÿค” confus0rt what you mean with "not the same command"?

still forum
#

There is no "createVehicleLocal ARRAY"

#

A command exists of name and number of arguments

#

The createVehicleLocal 1 argument command doesn't exist

jade abyss
#

Ah, you mean != same syntax's available

still forum
#

but there is a createVehicleLocal 2 argument command that does exist

subtle ore
#

You really confused that to no end Dedmen lol.

jade abyss
#

Command = Exists
Same syntax as nonLocal Version = Nope

#

Yeah, pretty hard^^

still forum
#

Syntax is part of the command

jade abyss
#

dfsgndsfngdnfsgndfsgn

still forum
#

They are not seperate

subtle ore
#

Yes, that isn't of any confusion.

still forum
#

Like

  • ARRAY
    and ARRAY + ARRAY

Completly different commands

#

But most people would say it's the + command. But it really isn't

jade abyss
#

Are you drunk? ^^

subtle ore
#

I honestly thought you were implying that createVehicleLocal was createVehicle just with local effects applied

still forum
#

no ^^ Just a Intercept dev that knows how Arma works

jade abyss
#

But yet, the command createVehicleLocal is there ๐Ÿค”

still forum
#

The binary command createVehicleLocal exists.
The unary command createVehicleLocal doesn't exist

jade abyss
#

You overcomplicate stuff atm

still forum
#

nular/unary/binary is part of the command's identity

#

That is how things work in the engine. It's the reality

jade abyss
#

Yet, you overcomplicate it^^

still forum
#

I'd say that's needed to understand why it complains about a "missing ;" when you just missed an argument

subtle ore
#
"Cookie_F" createVehicleLocal _cookiePos:
//real 
"RaisinCookie_F createVehicleLocal[_pos]
//not real
#

Is that what you're trying to say?

still forum
#

no

subtle ore
#

Or? I am confused

still forum
#

They are both binary

#

and the binary command exists

jade abyss
#

I think everyone is atm

still forum
#

"Cookie_F" createVehicleLocal _cookiePos exists
createVehicleLocal _cookiePos doesn't exist.

subtle ore
#

That was never in question?

jade abyss
#

Yep

#

Yet he talks about it^^

still forum
#

That is what caused the error though. So.. I'd say that was in question

jade abyss
#

Long story short: He used the wrong syntax.

#

As i wrote before.

subtle ore
#

In what way? An array was used as the right param?

still forum
#

He used a syntax that doesn't exist. Which is some kind of wrong

#

No. He only had one parameter

#

There is no createVehicleLocal command that takes one parameter

subtle ore
#

I see

#

He was using the alt syntax for createVehicle

jade abyss
#

Yep

still forum
#

Arma has 3 tables of script commands. 0, 1, 2 arguments.
He had a command with 1 argument with the name createVehicleLocal.
So Arma sees "Hey! 1 argument" so it looks in the table for commands with 1 arguments.
That table doesn't contain a createVehicleLocal command. Thus it doesn't exist

jade abyss
#

And again, you overcomplicate and confuse ppl, when you write: the command xyzdoesn't exist.

still forum
#

But that's how it is

jade abyss
#

furry

still forum
#

And that's why Arma tells you "missing ;" instead of "invalid argument"

subtle ore
#

๐Ÿฟ

jade abyss
#

Just type: Wrong Syntax.

#

ppl get that quicker and easier, than your binary,unary, whateverarty stuff from above.

#

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

still forum
#

Okey yeah. The syntax was wrong. Here is how it would be correct:

_lightSource = createVehicleLocal;
["#lightpoint", getPos _vehicle, [], 0, "CAN_COLLIDE"];
#

Just like Arma recommended to you in the error message

subtle ore
#

Does intercept correct this error message in a way that is more meaningful?

#

๐Ÿค”

still forum
#

no

#

It could add a unary createVehicleLocal command though with same syntax as createVehicle

#

Which would make the error go away

subtle ore
#

Useful? I guess?

jade abyss
#

Since it will only be on the server, doubt it

#

maybe for NameSpaceStuff

still forum
#

IMO createVehicle and createVehicleLocal should support the same kinds of arguments

subtle ore
#

/shrug

still forum
#

But this is Arma.

jade abyss
#

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

still forum
#

Intercept won't be only on the server if you also use it on the client

subtle ore
#

Well is there any indication as to why it wasn't so to begin with?

still forum
#

Some BI dev was too lazy/forgot/didn't think about it

subtle ore
#

Heh

jade abyss
#

aka "never needed it"

subtle ore
#

That's usually how it goes

#

If they don't need it

#

Then it doesn't get thrown in

jade abyss
#

I mean, the initial Version was the same, just the Alternative Syntaxes are different

subtle ore
#

Right

jade abyss
#

Syntax:
type createVehicle position
type createVehicleLocal position

subtle ore
#

Just why not make it consistant?

jade abyss
#

createVehicle was updated, ...local not

#

Why?
Reasons.

still forum
#

Then find the guy that forgot to update createVehicleLocal and throw some old newspapers at him

jade abyss
#

We don't, and you doubt we will ever, know that.

#

๐ŸŒ <- ?

subtle ore
#

Old newspapers? Hot coffee, he'll remember weeks after to get into gear

quasi thicket
#

@little eagle - It didn't work ๐Ÿ˜ฆ

winter dune
#
_vehicle = vehicle player;
_attach = [[-0.37, 0.0, 0.56],[0.37, 0.0, 0.56],[-0.5, 2.1, -0.95],[0.5, 2.1, -0.95]];

_lightBlue = [0.1, 0.1, 18];

_lightleft = "#lightpoint" createVehicleLocal (position _vehicle);
_lightleft setLightColor _lightBlue; 
_lightleft lightAttachObject [_vehicle, _attach select 0];                        
_lightleft setLightBrightness 0.2;

still can't make it work properly, everything seems to run without any error, but I still can't see anything. It is supposed to create a blue lightpoint.

#

the funny thing is that with createVehicle, it works

#

with createVehicleLocal nope

#

I'm retarded and need sleep

#

thanks to all your replies before

#

still tricky to me with all this fancy stuff

tough abyss
#

Table indexโ€™s start at 1 k bye

quasi thicket
#

Ok, i'm gonna ask here as well

#

How do i move a group of players, into a vehicle on a dedicated server

#

because i can NOT get it to work

#

4 groups named alpha, bravo, charlie & delta and 2 vehicles names plane1 & plane2

subtle ore
#

@winter dune Is this being executed on a client? Server?

winter dune
#

I misstyped a variable

#

it is executed on client side

candid jay
#

any ideas why [_foreman] remoteExec ["SCAR_UCM_fnc_addActionsToForemanLocal", 0, _foreman]; run on server, does not call SCAR_UCM_fnc_addActionsToForemanLocal when a player dies and reenters game?

#

_foreman is an invincible AI.

little eagle
#

You use another function with foreman as id, that replaces this one?

candid jay
#

no this is the only one.

little eagle
#

What do you mean, when a player dies and reenters?

#

Respawn?

candid jay
#

no, player dies, no respawn.

#

they go back to lobby

#

select same slot and reenter.

little eagle
#

Well, JIP is only executed if you join in progress. They probably never disconnected from, the game.

candid jay
#

settings are respawnOnStart = -1; respawn = 3; respawnDelay = 5; respawnDialog = 0; respawnButton = 0;

#

ok but then they should still have actions

#

my issue is that actions on foreman are lost.

#

and i have no clue

little eagle
#

How many of these foreman there may be?

candid jay
#

1

#

would that make a difference?

little eagle
#

Then just use true as JIP flag, and consider this syntax to be broken.

#

Wouldn't be surprised.

candid jay
#

i have the same issue with other ai, and those can be killed

little eagle
#

addActionsToForemanLocal is CfgFunctions?

candid jay
#

itโ€™s one of those moments where i really want to uninstall arma and set it on fire

#

yes it is.

little eagle
#

So you're saying if I do:

{
    diag_log [clientOwner, _this];
} remoteExec ["BIS_fnc_call", 0, cursorTarget];

as local host, it will print on a second machine, but not if I go back to lobby and reenter?

#

That is something that can be tested.

#

Btw., again. If you use the same object as JIP flag twice, you will overwrite the previous RE from the JIP stack.

#

So this syntax is in any case really shitty for this

subtle ore
#

Is it possible script a gear dialog open for vehicles like you can a player?

little eagle
#

Since no vehicle weapons or mags have icons, I'd say no.

subtle ore
#

Well no i am talking as if the player were to open the inventory of the vehicle to see their MX for example whilst out of the vehicle

little eagle
#

Just press G/I and switch from container to "player" or something like that. Done that before.

subtle ore
#

So workaround time? Lovely

little eagle
#

I don't get what you mean. You press G/I and there's your inventory?

#

Where's the workaround?

subtle ore
#

scripted

little eagle
#

So I assume just opening the dialog the normal scripted way doesn't work?

subtle ore
#

As far as i can tell no

#

Nevermind, found my problem.

#

Works just fine

candid jay
#

do you know if variables set with setVariable and global are set on clients before init.sqf is called on them for JIP?

little eagle
#

Pretty sure they are.

#

Who knows. init.sqf is always a toss.

#

This works for me. Second array on the right was before I (the unit looked at) returned to lobby and reentered.

#

So it was executed again.

#

Note how I used player as JIP id, and it just reported it's netId. I'm 99% sure you just re-use the id in a second script and it overwrites the previous function from the stack.

halcyon crypt
#

You went back to being a noob? ๐Ÿ˜ฎ

little eagle
#

๐Ÿ˜ฎ

halcyon crypt
#

the veteran tag ๐Ÿ˜›

little eagle
#

Instead I now have a poop medal.

#

The turd of honor.

halcyon crypt
#

lol

candid jay
#

i am not, itโ€™s running only once on server. oh well.

little eagle
#

I can't reproduce then.

candid jay
#

i canโ€™t see your image, res is low

#

maybe coz iโ€™m on mobile

little eagle
#

Probably. Looks fine for me. Sometimes it converts to jpg, and on jpg it's always hard to read texts.

#
{
    diag_log [clientOwner, diag_frameNo];
} remoteExec ["BIS_fnc_call", 0, player];

Was the code.

candid jay
#

do you mind pasting that code here so i can see it?

little eagle
#

Done.

candid jay
#

oh lol

#

thanks

little eagle
#

Executed locally on the host.

#

Back to lobby: frameno updated, owner the same
DC from game: frameno updated, owner incremented by 1.

#

So it always executes again.

candid jay
#

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

#

i donโ€™t know where else to look.

little eagle
#

Using mods? Maybe a mod uses RE with jip id.

candid jay
#

oh well

#

well

#

will change that code anyway to an alternative

little eagle
#

Just make a small framework out of this. Put all RE functions in an array and setVariable public them. Then on client, walk through that array on all units or something.

#

This RE syntax is wonky anyway.

candid jay
#

ok

zinc forum
#

Hey, can anyone help me with (what I think to be) a small project? I'm trying to figure out someway to make an ingame chat command or something where you can type in a password to gain access to curator or become a moderator. I'm a very novice scripter so while I have the idea in my mind, I don't know how to create it.

#

Yeah, I know that, but what if you wanted a second zeus that wasn't admin? Since you can only have one admin on at one time.

tough abyss
#

hmm then no clue

zinc forum
#

Couldn't there be way to trip some sort of trigger that assigns curator to the player who triggered it?

#

Using game logic and an outside script?

#

If this is typed then call upon code elsewhere?

#

I really don't know.

little eagle
#

Using mods?

zinc forum
#

No, trying to do this for my unit's public server, but I can use mods for regular operations

little eagle
#

I think this is a two part problem. First to make custom chat commands, second to assign a curator by script.

#

Both of which are possible. But don't know where your problem is.

zinc forum
#

The issue I havve is I have little idea how to do it. I don't know how to script it.

little eagle
#

Both steps?

zinc forum
#

๐Ÿ˜ฆ

#

Most of the scripting I'm doing right now is searching online for code and editing it as I go

little eagle
#

Oh boy.

zinc forum
#

It's working so far, we're making an annex and invade. I just don't know the syntax or the functions to use

little eagle
#

It's working?

zinc forum
#

What I've been doing, the annex and invade, I've gotten a teleporter script to work and an automated gate script.

#

but I haven't gotten anywhere with this because I don't know where to start

little eagle
#

Well, you can start with either step I mentioned.

#

That's how I'd approach it.

zinc forum
#

I was looking online and found something for custom chat commands, but I wouldn't know how to use it to assign a curator by script

little eagle
#
// '#skipTime 12' will make it night
["skipTime", { parseNumber (_this select 0) remoteExec ["skipTime"]; }, "admin"] call CBA_fnc_registerChatCommand;

You mean this? Because it requires CBA / mods.

#

But it would make one step easier for sure.

zinc forum
#

wow

#

Thanks, I didn't know about that

#

So if you change "skipTime" to something else and type it in while CBA is active, it will make you admin?

#

Would there be a way to directly add curator without becoming admin? I mean not that it matters to much because you could have a MCC zeus then a second zeus using this method (or atleast I'm assuming you can).

little eagle
#

Something like this is how you add curator by script:

// init.sqf
if (isServer) then {
    commy_ZeusGroup = createGroup sideLogic;

    commy_fnc_assignCurator = {
        params ["_unit"];
        private _logic = commy_ZeusGroup createUnit ["ModuleCurator_F", [0,0,0], [], 0, "NONE"];
        _unit assignCurator _logic;
    };
};
#

And this is how you'd execute it on client:

_unit remoteExecCall ["commy_fnc_assignCurator", 2];
zinc forum
#

Wait so how does this work?

little eagle
#

Creates a zeus module and assigns the passed unit to the zeus module, which means Y can be used to open the curator interface etc.

zinc forum
#

_unit is a global command right?

little eagle
#

No, it's a local variable, but close.

zinc forum
#

So if I have this in the init of a unit, then they can become a curator?

little eagle
#

Well, _unit would have to be this for the init box.

#

And I guess the init box is executed on every machine already, so the RE part should be adjusted to not spawn a ton of curator logics for no reason.

zinc forum
#

Isn't this the same as creating two game masters and making units the owners of the module?

little eagle
#

You can only have one assigned unit to every curator module as far as I know.

#

Don't ask why it's so complicated. They should've dropped the modules earlier, but this was before the 3D-Editor.