#arma3_scripting

1 messages Β· Page 347 of 1

spice kayak
#

Though I can't understand why the hint for one team isn't working, but is working for another when it's running off the same variable and sleep time.

#

It's clearly able to load the code, and read the variables, but it's like it isn't updating the variables. The sleep / loop is working, because the hint isn't fading away. So why would a publicVariable only be updating for one player, and not another.

spice kayak
#

Okay, can there be conflicts when you're running two copies of arma on your computer, one being the host and another being a client?

#

Because I'm getting some things that wouldn't make sense otherwise.

#

This is getting too frustrating :( Hopefully some sleep will help me out. Night everyone!

peak plover
#

replace your hints with systemchat and test it

#

Maybe a hint is overriding another

#

I had to learn that the hard way

waxen tide
#

if you have lots of systemchats, replace them with diag_log and you can find them in the logfile for pretty much infinte amounts.

#

I had to learn that the hard way

peak plover
#

haha πŸ˜„

#

True enough

queen cargo
#

diag_log call {"test"}
what does this do?

still forum
#

print "test"

#

because the call returns "test"

queen cargo
#

mhh ... that is ... problematic then

#

most linters also probably do that wrong
as ... call has a binary and unary variant

#

i personally parse that as (diag_log) call ({"test"}) currently as my parser thinks it is the binary variant

waxen tide
#

Achievement unlocked: Functions

tough abyss
#

@still forum did you see any kind of syntax or input params for those two?
DeployWeaponAuto
DeployWeaponManual

#

player action["DeployWeaponManual", currentWeapon player]; no dice with something like that

still forum
#

@queen cargo unary has higher priority than binary

#

@tough abyss no

queen cargo
#

@still forum i know
no problem for other unary thigns
only that call has a binary and unary variant is the problem

#

as in the AST the binary has to appear before the unary

still forum
#

SQF parser also reads from left to right afaik

queen cargo
#

need to adjust parser so that it remembers that if left was an unary and mid is binary, it probably means the unary variant of it

indigo snow
#

listen to deadmen, read from left to right et voila πŸ˜›

queen cargo
#

1 + 2
1 (+ (2))

#

is incorrect

#

(1) + (2) would be

indigo snow
#
  • has a higher priority though
still forum
#

read from left to right. You find + which is a binary operator. Done

indigo snow
#

its like maths 1 + 2 * 3, its still left to right but the * goes first

queen cargo
#

that is the whole point
call has a binary and a unary variant

need to add detection for when left arg is already unary, right arg cannot be binary

#

diag_log call {"test"}
--> diag_log is unary
--> call cannot be binary as left is unary

indigo snow
#

im simply not sure if a blanket statement of if the left term of what could be a binary command is a unary command, the binary command is in this case its unary variant is completely true

queen cargo
#

me neither

still forum
#

I'm trying to figure out what Arma does

#

But I ate too much and can't sit upright

queen cargo
#

<@&105622502444711936> what IS SQF doing actually here?

indigo snow
#

can it check if the code on the right side has a correct structure to return an argument?

#

e.g. all commands have the proper number of arguments present

still forum
#

Wow.. Okey.. Ignore me and bother BI devs instead

indigo snow
#

straight to the top

queen cargo
#

highly doubt i would get an answer anyway

still forum
#

So why bother them then

queen cargo
#

because maybe i am lucky? πŸ˜„

indigo snow
#

im just gonna postulate that in SQF a binary command can never have a unary command preceding it, just like a unary command cant have a nulary or value preceding it (barring parentheses)

#

the real case would be: what if there are two possibly binary commands next to each other?

still forum
#

getPos player call {}

#

That might error

indigo snow
#

e.g. ??? BINARY BINARY ??? is also invalid, but at which command does the parser error, the first or second BINARY command?

queen cargo
#

i doubt
should be parsed as
(getPos (player)) call ({})

still forum
#

"should"

queen cargo
#

<ANY> BINARY BINARY <ANY> is perfectly valid

still forum
#

no

indigo snow
#

they cant use each other as argument

queen cargo
#

see select

still forum
#

either left binary is missing right arg. Or right binary is missing left arg

queen cargo
#

ohh wait ... i see now

#

y ... invalid

indigo snow
#

yes but which one would the engine complain about

queen cargo
#

so binary command cannot follow on a command

indigo snow
#

the left or right binary command

queen cargo
#

unless it is a nullar command

indigo snow
#

a unary command can be right of a binary command

#

but not the reverse

#

and the same with nulary and unary

still forum
#

Okey.
Is assignment?
if not compile as binary
Increment priority till you find a binary command. If you don't find any parse as constant.

parse as Constant first checks if it's a unary function. If not then check variable.
if not then check for paranthesis and if you find them compile a binary again (and goes all the way to here again)
if no paranthesis then check for array []
if no array then check for code
else check for "" string
else check for '' string
else check for number

#

it finds diag_log. Which is not a binary. So it pushes the unary call to the stack and goes to next element.
it find's call. It first checks for the binary version. It finds it....

#

it parses a constant again then skips spaces. and checks if there is a binary command. There isn't. So it returns the constant instead. Which is the call unary command

#

because parse as constant only returns unaries

#

A lot of recursion as you can see. especially the "Increment priority till you find a binary command"
Because it doesn't do anything till it arives at 11

lavish ocean
still forum
#

@lavish ocean Afaik he never asked that ^^

#

Atleast I can't find it anywhere

lavish ocean
#

then i wonder what he asked for cause i didn't get it πŸ˜‰

still forum
#

He asked how the SQF parser differentiates between unary and binary call

lavish ocean
#

ah, though he randomly picked the days old discussion with the highlight

queen cargo
#

nah

#

was not following anything in here for days

still forum
#

Go back to whatever you were doing ^^ Don't be bothered by the guy that choose to bother BI minions for no reason

queen cargo
#

there is reason for it

#

we only can speculate

#

and try to get reason in that question

#

they actually can check in theory

still forum
#

Well. I answered your question. And probably future ones

queen cargo
#

well ... kind of

#

enough to get it fixed though

still forum
#

If you need more specific info ask a specific question

queen cargo
#

anyways, that tiny thing is now fixed in my parse function

waxen tide
#
_response = "text";
_action_x = _object addAction ["Engage in conversation", {hint format ["%1", _response]; removeAllActions (_this select 0)}]; // error undefined var _response
_action_x = _object addAction ["Engage in conversation", hint format ["%1", _response]]; // works
_action_x = _object addAction ["Engage in conversation", hint format ["%1", _response]; removeAllActions (_this select 0)]; // error missing ;
#

how can i fix that?

indigo snow
#

You cant do that, because the code inside {} doesnt get evaluated

queen cargo
#

i am surprised that the later two actually work

indigo snow
#

You have to provide it as a string you can format variables into

queen cargo
#

ohhh no wait, addAction also worked with string didn't it?

indigo snow
#

Yes is what im saying

queen cargo
#

hold on ... still ... hint is not returning string

indigo snow
#

No, youd format that into the code string

waxen tide
#

i want to pass TWO statements to the addaction. the hint and the removeAllActions. But i can't do that with {} because then i can't get the var into the hint.

indigo snow
#

{hint _a} != "hint ""a"""

#

you have to format it all into a deeper string

queen cargo
#
_action_x = _object addAction [
        "Engage in conversation",
        hint format ["%1", _response];
        removeAllActions (_this select 0)
    ];```
check it yourself why it is not working
you added a `;` in the array
indigo snow
#

"hint ""a""; removeAllActions (_this select 0)"

waxen tide
#

now that i actually phrased the question, yeah i just had the same idea

#

thanks!

queen cargo
#

to get the response inside, use it like this: sqf _action_x = _object addAction [ "Engage in conversation", format ["hint %1; removeAllActions (_this select 0);", _response] ];

indigo snow
#

@queen cargo str _response

#

you need the extra quote marks

queen cargo
#

if it is a string, then yes

indigo snow
#

btw the big sqf inconsistency

#

select 0 and %1 for first elements

#

its the true inconsistency i tell you none of the other ones matter

queen cargo
#

%1 is easier to implement internal probably

waxen tide
#

weirdly i didnt even notice this inconsistency

queen cargo
#

%0 would require to _arrayIndex - 1 everytime

indigo snow
#

i guess its technically correct because %1 will correspond to _formatArray select 1

#

but still

waxen tide
#
_action_x = _object addAction ["Engage in conversation", hint format ["%1; removeAllActions (_this select 0);", str _response]];
#

it prints removeAllActions in the hint

indigo snow
#

check the differences between yours and what x39 posted

#

the hint needs to be inside the string too

waxen tide
#

m(

indigo snow
#

because you need an argument in this structure: "hint ""a""; removeAllActions (_this select 0)"

waxen tide
#

yeah i figured it out, works fine now.

#

is it normal that the return value of my addAction stays the same even if i delete it?

indigo snow
#

sure, if you delete it the action index is free to use again

waxen tide
#

so i'm back at the problem of determining if an addAction is completed.

#

somehow my approach sucks.

indigo snow
#

set a variable on the object that increments?

waxen tide
#

how do i do that?

indigo snow
#

object setVariable ["asd_counter",object getVariable ["asd_counter",0] + 1]

waxen tide
#

okay turns out i underestimated what setVariable does.

#

thanks again

#

you guys are awesome

#

i can actually attach multiple vars to the object and vastly simplify my life

indigo snow
#

keep in mind it only saves locally. if its MP, you gotta add a true > <OBJECT> setVariable ["name",value,true]

#

so it syncs accross all clients and server

#

(unless you dont want that, of course)

waxen tide
#

i'm not sure it matters

#

the npc dialogues can be individual per player. actually makes sense in the context.

#

no there are actually problems with this, an NPC can't run away in terror from one player while standing still and talking to another.

indigo snow
#

yea you might want to block conversations for other players whilst a player is talking with the npc

peak plover
#
_dude setVariable ["nig_isTalking",true,true];

then have condition for talking

(_dude getVariable ["nig_isTalking",false];)
waxen tide
#

well my idea was to remove the addaction immediately if you use it?

#

more elegant.

peak plover
#

Just make sure you remove it from all clients...

#

Also I found out something interesting

#

addAction actually only checks condtion if you are pointing at the thing with the addaction

#

or atleast that's when I got the lag

waxen tide
#

thats good performance wise

peak plover
#

I added 10000 addactions to a unit and didn't lose performance until I was looking straight at him

#

well (didn't lose) means noticably

#

from 200 to 120 fps when not looking at target and when looking at target, ~10-20 fps

indigo snow
#

sooo, add them to a player to fps-bomb him? πŸ˜›

waxen tide
#

and i thought my ideas for punishing people were rude

peak plover
#

To punish players for leaving AO, add faulty functions to profilenamespace so their game will break every time they launch it πŸ˜‰

waxen tide
#

well i thought up a mission that includes attacks on the player base and limited ammo supply because the enemies obviously messed with your supply lines in case people wank too much in the base instead of doing their assignments.

indigo snow
#

use KKs server switch fnc to switch them to a different server

waxen tide
#

also i'll revoke people's licenses to operate heavy equipment.

#

hahahaha

indigo snow
#

a mission with low supplies to recover your supply lines sounds kinda cool, tho

waxen tide
#

on that thought, it would be hillarious if people actually would find a way to inject that code to other players. they could just go around and steal players πŸ˜„

peak plover
#

Hahaa

#

Hide a loop that runs every time you start

#

in like random time

#

It joins your server πŸ˜„

#

Server is ALTIS LIFE. hahha that's like worse than hell πŸ˜„

#

~"I was playing my normal milsim server and then suddenly I was in a life server with a bunch of 9 year olds"~

waxen tide
#

but also, you can send nasty people you don't like to an altis life server ...

peak plover
#

The possibilites are endless

indigo snow
#

im a fan of attaching them to the bullets they fire

blissful wind
#

I know what im going to sound like, and I know this seems crazy but i canΒ΄t run a while or for loop anymore it just wonΒ΄t run no matter the condition

indigo snow
#

well youre doing something wrong

manic sigil
#

Is there any way to model TFAR and have the vanilla radio channels play out of a specific side of audio? Group in left ear, Side in right, etc.

blissful wind
#

you can´´t go wrong with while {true} do { send hint ...

indigo snow
#

i assure you the commands work

blissful wind
#

i tried to debug it but it just wont run

indigo snow
#

so either youre editing in the wrong place, not executing, or making a different error

waxen tide
#

yes you can Trail, you can forget the ;

blissful wind
#

damn

manic sigil
#

@blissful wind ive had weird things crop up too. Variable = null; just refusing to go off when the trigger was fired, etc.

blissful wind
#

hey thanks @indigo snow didnΒ΄t realise that yet huh

indigo snow
#

editing in the wrong place?

#

youd not be the first πŸ˜›

blissful wind
#

give me the most basic while loop you can think of

#

wont run

#

dude im not that basic

#

ok i need to let the steam off from tis be back ina bit with coffee

waxen tide
#

@blissful wind where are you putting that loop is more interesting.

indigo snow
#

idk why youre calling me out then, the commands work

for "_i" from 0 to 8 do {
    systemChat format ["test_%1",_i];
};
#

^ put that in your debug console

blissful wind
#

i went through all the basics

indigo snow
#

if youre not that basic, im assuming youre not running into any errors in your RPT?

blissful wind
#

this is why its frustrating

#

it runs all fine up until the point where it enter either a while or a for

#

everything else in the script its working fine

#

like i said i did some debug

#

and it runs up until that point

#

and then any basic while or for just wont run

#

no matter how basic

#

damn

indigo snow
#

have you put the above in?

#

because then it becomes relevant what yor code looks like

blissful wind
#

doesnt run

indigo snow
#

because i double assure you the looping commands work

blissful wind
#

lol

#

i dunno

indigo snow
#

i do. show me the code bit?

waxen tide
#

@blissful wind why don't you post some code?

blissful wind
#

im just going to restart it all

#

@hard hamlet you want me to write a basic while like cmon

indigo snow
#

well yes

blissful wind
#

nvm really

#

i ´´ ll be fine

indigo snow
#

im still interested in this loop that refuses to execute

queen cargo
#

probably a script error

#

and you forgot to enable showscripterrors during arma startup

#

--> loop gets aborted due to script error and those are not shown to ya

#

check RPT log for errors

#

unless you disabled those too

blissful wind
#

@queen cargo yea, it was all working fine yesterday

#

im just rebooting all

#

@queen cargo thanks I will check the logs

#

weird stuff man

#

πŸ˜›

indigo snow
#

its not wierd, youve just made a mistake somewhere

blissful wind
#

ok

waxen tide
#

@blissful wind did you check the log?

#

C:\Users\Trailblazer\AppData\Local\Arma 3

blissful wind
#

im actually doing something else .. i ll get to it

waxen tide
#

I'm afraid you can't do that. You asked for help so you're morally obliged to try everything we say.

blissful wind
#

LOL

#

i have no marls

#

morals

#

"fuck the king"

#

πŸ˜›

waxen tide
#

well my editor has a "open log (latest)" button and i mash that often.

#

would recommend.

blissful wind
#

good tip thanks

waxen tide
#

poseidon on armaholics

#

also if you type like, "while" and hit <TAB> for autocomplete you get like this

#
while {/* condition */} do 
{
    /* STATEMENT */
};
#

kinda hard to fuck up then.

blissful wind
#

ye

#

i know

#

hats what i ve been saying

#

you cant f it up

#

but it does

#

and thats why

#

IM MAD

#

HAHAH

indigo snow
#

just mess up the code inside the loop et voila

tough abyss
#

πŸ‘Œ

indigo snow
#

common one is using sleep when suspending isnt allowed

blissful wind
#

no

tough abyss
#

eh if we're talking about fcking up im thinking local variables in diffrent scopes

blissful wind
#

for debugging i did a while true and set it to hint something back

#

basic

#

and nothing

#

nothing on chat

#

nothing anywhere

queen cargo
#

just post the code ... or stop complaining @blissful wind

blissful wind
#

its dead

#

i closed all for now but i will no problem and i wil l tell you what was wrong with it

#

right now im burnt

#

eheh

#

but lets jsut say you write that while with a remoteexec hint

#

and nothing

indigo snow
#

i promise you the looping commands work. there would be some very big hubbub if they didnt.

blissful wind
#

yea

#

im not saying they dont

#

it just isnt for me right now

queen cargo
#

user-error

blissful wind
#

relaunching

#
while {true} do {
    [alex, "its looping"] remoteExec ["sideChat", 0, true];
    };
#

its working now

#

weird but it did

waxen tide
#

i can't use global and local vars in the same script?

indigo snow
#

what? sure you can

#
_p = player;
currentTime = time;
_p sideChat str currentTime;
#

some scopes dont allow local vars, tho

#

namely the ui execution boxes (debug menu, init boxes, etc)

waxen tide
#

yeah i derped a bit i figured it out thanks

queen cargo
#

namely the ui execution boxes false
_var = "foo"; _var will work fine in the debug menu for example
problem is more: = is not returning anything which then will cause script errors if tried to print

#

diag_log call {_var = "foo"}; should also throw

tough abyss
#

is there a setting or a script that could cause AI kills not be displayed?

queen cargo
#

difficulty

tough abyss
#

ah, I assume that would be because I am running veteran?

#

in the scoreboard I can only see deaths

#

and negative points for crashing a vehicle

queen cargo
#

yup

waxen tide
#
private ["_var1","_var2"];
{hint "hello"} forEach private;
#

i guess this is supposed to not work

queen cargo
#

how should that be working?

#

private is a command (or keyword depending on context)

waxen tide
#

well yes but technically you're handing private an array of vars

#

shuts up

#

🀐

queen cargo
#

uhm ... what? πŸ™ˆ

//Method 1
private ["_var1", "_var2"];
_var1 = "foo";
_var2 = "bar";

//Method 2
private "_var1";
private "_var2";
_var1 = "foo";
_var2 = "bar";

//Method 3 (requires instant assignment)
private _var1 = "foo";
private _var2 = "bar";
#

those are equal

waxen tide
#

i understand

#

what can i say.. its late.

queen cargo
#

as lil extra: all those variants are already supported in my SQF-VM

waxen tide
#

care to elaborate?

queen cargo
#

mhh?

waxen tide
#

SQF-VM ?

queen cargo
#

also has a bot available that will execute your code

waxen tide
#

holy moly.

queen cargo
#

do not get hyped too much πŸ™ˆ it is not yet supporting the whole range of arma commands
but the basic operations are mostly possible

#

new commands are added pretty much on day2day base

#

feel free to test the bot in the channel i linked to ya
to use you just need to @SQF it

north vortex
#

Can someome help me im trying to script weapons onto my playee using chat but i dont know how to

#

Player*

rotund cypress
#

Using chat? Wot @north vortex

north vortex
#

No i meen

#

How do you script while on you player

#

Im trying to get an rpg in argo but i can equipt it with arsenal so i have to script it

north vortex
#

Nvm i figured it out but i need the name for the launcher

#

In editor i add a weapon then save to arsenal

tough abyss
manic sigil
#

If you have a trigger, oncond triggeringvariable == 1, onAct sets a bunch of variables to null, and at the end sets its own triggeringvariable to 0, would it stop itself from nulling out the other variables?

waxen tide
#

looks at his todo list

#

checks off "civilians with dialogues"

queen cargo
#

looks at his to do list
jumps off from next building

waxen tide
#

looks at X39 who just jumped of a 60cm high doghouse

#

offers X39 a β˜•

queen cargo
#

declines and climbs up that building to try again

waxen tide
#

i'm starting to not be totally retarded. i wrote like 100 lines of codes with only 3 errors inside.

#

is porud

#

can't spell proud

queen cargo
#

and done for today ...

#

fixed enough ... implemented enough ... and even worked 4 hours

#

see ya all

north vortex
#

@tough abyss i found out how you had to script player weapons in eden editor then save to arsenal and the go on muiltiplayer and load your loadout

tame portal
#

WHO

#

came up with THIS name

#

modelToWorldWorld

#

Jesus

spice kayak
#

I still get a giggle out of setDammage.

#

modelToWorldVisualWorld

spice kayak
#

Well, that kind of sucks. Default parameters doesn't work if the number isn't whole D:<

#

Ah well, that wasn't so hard to work around. Also, holy shit - having overcast on the highest completely changes this mission.

still forum
#

@ShiningRayde#2444 no. TFAR is 0% connected with ingame audio.
@queen cargo Talk about UI execution boxes not liking local vars
problem is more: = is not returning anything which then will cause script errors if tried to print
In case of Triggers and Editor UI script boxes that's the opposite. They need a void.

@ShiningRayde#2444 If you think logically.. Then yes. Could also set the trigger activation to once.

zenith edge
#

when interns add things without supervision to your project optix

#

like index's starting at 1

#

that really screwed with me on format[]

still forum
#

That was not done by "interns" That was done by core engine developers back in OFP

zenith edge
#

they mind as well be interns

still forum
#

Trust me. No.

zenith edge
#

I spent 15 minutes "spellchecking" mission code before I realized dammage was a sqf thing

still forum
#

That is indeed dumb. Probably was written wrong back in OFP. And when they fixed it they didn't want to break old scripts. Which is a good thing

zenith edge
#

but the index 1 thing

#

upset me the most

#

kept trying to use %0

still forum
#

%1 says "first element"

zenith edge
#

first elements should all be 0

still forum
#

Btw it's also %1 in Java, PHP and probably many others.

#

Do you even know why C Arrays start at 0?

zenith edge
#

there is a reason I don't like java or php

#

i know there is a specific reason they do it, but it breaks my pattern of thought

#

to go from starting at 0, to starting at 1

#

between things

still forum
#

format litterally uses %number -> array[number]

#

as the array contains the format string itself as 0'th element this works out nicely

zenith edge
#

that actually makes my happier

still forum
#

So you are actually starting at 0. But embedding the format string itself in your format doesn't make sense

zenith edge
#

format[0, 1, 2, 3] || format["", var1, var2] is what you are saying

still forum
#

I think so...

zenith edge
#

I'll accept it

#

because I can remember that

#

better than first element is 1

still forum
#

If you could start with %0 Arma would have to internally always +1 the index to get to the right element

zenith edge
#

which isn't that hard

#

lol

#

the reason we aren't writing in machine code

#

is because higher level languages are easier/faster to write and understand

#

i'd rather it do things in the backend to make things standardized across everything

still forum
#

Also for most Humans it's easier to start counting at 1. So that's what high-level Arma uses.
It's still inconsistend with select though

zenith edge
#

so you don't have to think about it on front end

#

yea, their arrays start at 0

#

that is why it took my awhile

#

i just started using it as if 0 was first element

#

and didn't understand why my outputs were off, and first element was blank

#

maybe bad coding practice not to do with known outputs, buuuuuuut

#

ingrained habit not to question the 0 index

#

but thank you, your explanation even if wrong makes me not angry at it anymore

#

also, while I do dislike java and php

#

im pretty sure their arrays start at 0

#

and most of their functions operate first element is 0

#

but I'll beleive anything negative about them

still forum
#

Yes that's true. But their string format methods start at 1

#

All other string formats I found were using {0} instead of %1.
Every one I found using % also started at 1

zenith edge
#

mm, i've never used that way so I guess maybe that is why i haven't seen it

#

I typically just add strings together

#

string = "" + val + "";

zenith edge
#

yea, I was basically following what other things are using because I realise there are all these weird optimizations

peak plover
#

That's 0.003 ms differnece

zenith edge
#

that and isEqualTo

#

etc

peak plover
#

I use isEqualTo because it stops from =/== mistakes

zenith edge
#

ive never mixed those up

#

tbh

peak plover
#

I started by mixing those up πŸ˜‰

thorn saffron
#

anybody familiar with modding benny's warfare? I want to edit it a little bit so AI does not sprint when moving to objectives.

waxen tide
#

maybe check if you can find that command somewhere in the scripts

#

i recommend an editor that can search a whole folder of files at once for a keyword

thorn saffron
#

Seems like the missions uses some magic AI management that does not use weapoints. I searched far and wide for the weapoint, speeds or behaviors, but I got nothing

waxen tide
#

got a link to the mission?

thorn saffron
zenith edge
#

it uses FSM

#

in organized FSM folders

waxen tide
#

becti_0097.Tanoa\Server\FSM\update_ai.fsm:

#

becti_0097.Tanoa\Server\FSM\update_commander.fsm:

#

becti_0097.Tanoa\Server\FSM\update_salvager_independent.fsm:

#

becti_0097.Tanoa\Server\FSM\update_worker.fsm:

#

becti_0097.Tanoa\Client\Functions\FSM\Functions_FSM_UpdateClientAI.sqf:

#

look for commandMove and doMove

peak plover
#

My question:
is it possible to read teh mission config to recieve all playable units (slots)

#

I want to get a list of playable slots (even those which are not slotted)

still forum
#

Why can't you? double-clicking doesn't do anything?

peak plover
#

Nope, that one does not open

#

Others open

#

renamed
mission to missionSQM

class MissionSQM {
    #include "mission.sqm"
};

works now...

#

trial and error... always works

#

Now I just need a script that gets all the groups for all the side and units from insdie...

peak plover
#

Ok, got one issue with this now...

#

If I don't set the name to the group

#

How can I refference to it with a script?

#

every item in the config has id = 9;

Can I somehow use this to access the item in scripts?

spice kayak
#

Maybe add it to an array then call upon that?

#

I was actually writing something, not sure if it'll work, to get a list of all the groups you have.

#
_groupsArray = [];

{
if _x side == west then {
    _group = (group _x);
    if !(_group in _groupsArray) then {
        _groupsArray pushback _group;
    };
};
} forEach AllUnits;```
#

Though, I've never written anything like that, so

#

Β―_(ツ)_/Β―

still forum
#

No you can't

peak plover
#

I want the list of all groups that are in the mission (slots)

#

ohh

grizzled spindle
#

So im making a global info stand placement script that you can buy a license for in altis life. For some reason the variable i give it should be a string but is staying as a variable is there anyway i can change this? https://hastebin.com/bisapohino.cs

still forum
spice kayak
#

Well, you know what? Fuck you, man :(

still forum
#

You too πŸ˜‰

spice kayak
#

I'm joking, but that is convenient haha.

#

I wonder, would what I wrote do the same thing?

still forum
#

@grizzled spindle What is a variable but should be a string?

peak plover
#

I guess the best I can do is check if all the groups / units have names... And tell the mission maker ( YOU GOTTA SET A NAME TO ALL UNITS ) with hintC

still forum
#

Ah I see

grizzled spindle
#

_type

#

should be the license name

still forum
#

Wow..

#

Genius

#

For one _type is a local variable that doesn't carry over into the addAction code

#

second. _type is a local variable on the SERVER and you execute the addAction on the client

#

you can use format to push it into your addAction code if it is a string or number

grizzled spindle
#

Yeah doesnt seem to like that

spice kayak
#

Yeah, I was going to say, maybe try without the underscores.

#

Like, 'vType' instead of _type.

still forum
#

No.

#

Because server != client

grizzled spindle
#

plus theres multiple

#

each sign has a different type

indigo snow
#

use the code-as-string variant of addAction

still forum
#

Why are there so many people lately that try to push local variables into addAction?

indigo snow
#

funnily enough that came up yesterday too

spice kayak
#

I'm pretty sure I had addAction issues the other day too.

#

Though it wasn't for variables.

still forum
#

not only yesterday. That's atleast the 4th time in the last 7 days

grizzled spindle
#

code as string?

indigo snow
#

I'll just copy over an example snippet

 _action_x = _object addAction [
        "Engage in conversation",
        format ["hint %1;  removeAllActions (_this select 0);", _response]
    ];
spice kayak
#

My addAction is a thing of beauty! If by beauty, you mean shit thrown at a wall in hopes of it sticking. sqf pOperator1 addAction["EMP Charge", {{execVM "emp1Script.sqf";} remoteExec ["BIS_fnc_call", 0]; playSound3D ["A3\Missions_F_Bootcamp\data\sounds\vr_shutdown.wss", pOperator1, false, getPosASL pOperator1, 5, 1, (_vEMPRange * 2)];},nil,6,false,true,"","true",0];

indigo snow
#

addAction accepts the code part as a compilable string as well

#

since its been around since OFP / SQS

delicate totem
grizzled spindle
indigo snow
#

no you gotta do away with all {}

spice kayak
#

For me, or jcbjoe?

indigo snow
#

and use format to insert local variables into the compiled string

#

well its joe whos asking the question, no?

spice kayak
#

Yeah, sorry, I thought I'd just ask.

grizzled spindle
#

I get it

still forum
indigo snow
#

just in case _x is a string, in which case it needs to be str'd (so the format argument is str _x), @grizzled spindle

delicate totem
#

@still forum I was thinking there was a command with an exact example but couldn't remember it.

still forum
#

I just posted the exact same link 9 minutes ago

indigo snow
#

you can use pushBack and then arrayIntersect the array with itself to filter out duplicates too

#

totally the best way to do this

peak plover
#

ugh, backpedalling on something said a few days ago
parseText format
is not the same as

#

formatText

#

Seems like formatText is not making str to text

still forum
#

Where is the problem? Last point in screenshot?

peak plover
#

yes

still forum
peak plover
#

That point is using formatText

still forum
#

uh duh

peak plover
#

okay, so parseText is needed for using <t>

still forum
#

Okey.. You have to provide Structured Texts to formatText

peak plover
#

Okay gotcha

still forum
#

messy stuff

peak plover
#

I now understand

#

formatText is format for structured texts

#

not a combined parseText format

#

That's my bad, misunderstood

#

Well, anyway. now mission makers will know if they fucked up setting up units

coarse atlas
#

hint format ["Skills %1", skill unit1]; trying to get the game to return the skill value of a unit, I'm pretty sure this is wrong, but not sure what XD

peak plover
#

systemChat str (skill unit1);

#

Bear in mind only returns the general skill

spice kayak
#

Curious, how would one add a spacer to mission parameters?

coarse atlas
#

dosin't return the valuse of say, aiming accuracy?

spice kayak
#

Actually, let me try something stupid.

peak plover
#

systemChat str (unit1 skill "aimingAccuracy");

#

@spice kayak

class p_headless_1
{
    title = " === HEADLESS PARAMETERS === ";
    values[] = {0};
    texts[] = {""};
    default = 0;
};
class p_headless_enabled
{
    title = "Enable Headless Client";
    values[] = {0,1,2};
    texts[] = {"NO","YES","AUTO"};
    default = HEADLESS_PARAM_ENABLED;
};

coarse atlas
#

I tried that, and it dosin't show anywhere when I enter game. am I looking in the wrong place?

spice kayak
#

Yeah, my silly idea didn't work haha.

#

Thanks, @peak plover

peak plover
#

@coarse atlas Are you using it on a unit init?

coarse atlas
#

yep

peak plover
#

it probably appears too early

#

just use hint in that case, but it will override other hints

#

chat gets reset at some point me thinks

coarse atlas
#

how do I change it to hint? just change out systemchat for hint?

spice kayak
#

I understand the first parameter, the p_headless_1, but why the second? Is that needed, and why?

peak plover
#
hint str (unit1 skill "aimingAccuracy");
coarse atlas
#

yay

peak plover
#

just use debug console so you don't have to log into the mission every time

#

load*

spice kayak
peak plover
#

very nice design

coarse atlas
#

biggest reason I'm trying to figure this out is a freind looked at a graph in the wiki(the one on Cfgaiskill) and thinks that that's the defualt settings for arma3 (and we kind of agree a 0-100 iterpolation would not be a good thing XD)

spice kayak
#

Thank you :D I don't want people to complain about mission / unit balancing, so I figured I'd let them set it how they see fit.

still forum
#

The AI system was changed very recently in dev-branch. Not sure if that made it's way to stable branch already. They removed the linear interpolation thingy

spice kayak
#

I'm loving parameters so much. They're amazing.

peak plover
#

The previous version of ace3 fiddled with CfgAiSkill, so if you are using ACE3, your ai might have gotten harder in the last month or so...

spice kayak
#

Ha, sure!

coarse atlas
#

sounds like the scripting for cfgakskill will change too then?

spice kayak
#
    class Weather {
        Title = "Weather Settings:";
        Values[] = {0};
        Texts[] = {" "};
        Default = 0;
    };
    class Spacer1 {
        Title = " ";
        Values[] = {0};
        Texts[] = {" "};
        Default = 0;
    };```
peak plover
#

CfgAiSkill means you can set the limit to what setSkill 1 will do. With ace3 I think they changed the aimingAccuracy when set to 1 be 0.7 or sth

spice kayak
#

I mean, I'm sure you didn't need it, but still haha.

peak plover
#

I really wish they would allow for commands to disable skill interpolation

#

Yeah, I might be ok with writing a few lines of sqf, but my artistic value is 0 πŸ˜„

coarse atlas
#

I don't use ACE3, XD, and arn't they just disabling it compleatly now?

spice kayak
#

Ha, I ain't artistic at all. You should see the thumbnail for this mission haha :/

peak plover
#

I don't think they are. (I hope they are)

coarse atlas
#

@still forum said it if you scroll up a bit, it's on dev branch.

#

so at the very least, it'll be here by the new DLC.

spice kayak
#

Man, speaking of DLC, I wish Arma would explore exosuits a little more. The tech has come quite a way recent years, and I'd only imagine what it would be like in Arma 3's time.

#

Actually, when is A3 set? 204x?

peak plover
#

35

#

Cleaner, readable

spice kayak
#

Oh, nice!

#

Hmm

vGuardStamina = ["GuardStamina", true] call BIS_fnc_getParamValue;
player enableStamina vGuardStamina;

Error enableStamina: type Number, expected Bool

peak plover
#

param values are numbers

spice kayak
#

Right, yeah.

#

I just got that then.

peak plover
#

you have to do

vGuardStamina = [false,true] select (["GuardStamina", true] call BIS_fnc_getParamValue);
#

Also default value from true to 1

#
vGuardStamina = [false,true] select (["GuardStamina", 1] call BIS_fnc_getParamValue);
coarse atlas
#

someone could mod in exosuits.

#

though curious, what are the next 2 DLC sceduled after laws of war again?

spice kayak
#

Ah, thanks.

#

Yeah, I forgot them too.

#

I think one is tanks.

#

Then maybe sea?

peak plover
#

combat operations and tanks

spice kayak
#

omg, my mission 100% works, error free.

peak plover
#

πŸ‘Œ

spice kayak
#

IT ONLY TOOK FOUR DAYS.

#

;_;

peak plover
#

I've been working on mine for months

spice kayak
#

Ha, well this project started on Saturday, so.

peak plover
#

It's ok πŸ˜„ I bet it's worth it

spice kayak
#

All with the idea of 'Hey, EMPs are cool, I want to make one. Okay, now I've made one, but it's broken [10 hours later] Man, I should make a mission out of this!'

#

Good luck with your's though!

peak plover
#

Great dude, soudns like a fun mission with a cool feature

spice kayak
#

I mean, I'd love to properly test mine, but I can't, sadly. I can only test what I can do myself.

#

Ha, thank you.

#

Should get a bunch of you guys to try it out :P

#

But nah, should hopefully have another mission night coming up soon. I'll let the guys try it then, which is when it'll more than likely break.

peak plover
#

I'm currently making zeus modules for my mission to allow for zeus to respawn / change respawn locations.

#

Yeah wish scripting was faster

spice kayak
#

Not going to lie though, I've enjoyed the challenge.

#

I used to program a lot in high school, and was pretty good at picking up new languages. Was actually doing pretty good, grade-wise. Sadly, due to personal reasons, I ended up flunking and not programming any more. Only recently have I dived back into A3 mission editing / creation, and decided to try the scripting side of things. It's been one hell of a ride, but it's been great.

#

Thanks to you guys too, really.

still forum
#

Sounds like Intercept πŸ˜„ #shamelessAdvertising

spice kayak
#

I think my next venture would be trying out Intros.

#

I have no idea how that works.

still forum
#

So high school programming doesn't involve C++? Sad world :/

coarse atlas
#

Hey @still forum where did you hear about interpolation of the AI skills being removed? I want to take a closer look.

spice kayak
#

Nah, I did C++ in highschool.

#

Fucking visual basic, man. haha.

#

Least, that was one of the things we did, which included C++.

#

I remember one of my earlier languages, though it's rather embarrassing haha.

#

...GML...

coarse atlas
#

so not getting rid of it, just changing it then?

spice kayak
atomic epoch
spice kayak
#

Have any particular one in mind?

atomic epoch
#

BIS_fnc_ModuleCurator

peak plover
#

Just copy the insides and make something like nig_fnc_moduleCurator

atomic epoch
#

This is the function used to start Zeus Curator. I know for starters, you need "allowFunctionsRecompile = 1;" in description.ext

spice kayak
atomic epoch
#

For my purposes, I need to change BIS_fnc_ModuleCurator spiecfically

#

I can't just copy the function

#

onto a new one

#

If you use "allowFunctionsRecompile = 1;" then I can change the function inside init.sqf. But I want to change it at mission start, which means I need to change it in description.ext. Surely this is possible, because you can define functions there

peak plover
#

@spice kayak that's awesome. The text could use a shadow, because it's hard to read (blue on especailly).
Very nice polish on the mission. loading screen like that is sick

spice kayak
#

Actually, can you set the loading screen image?

peak plover
#

Yeah

spice kayak
#

I mean, the big one, not the little thumbnail one.

peak plover
#

There's a mod for that

spice kayak
#

Because if so, that would totally be the background (without the text)

peak plover
#

full screen mission loading screens

spice kayak
#

Aw, I was hoping it could be done without a mod.

peak plover
#

I reckon you can, but you gotta hop some hoops

spice kayak
#

Oh yeah, that totally reminds me about the ticket I had to make for one of the modules.

peak plover
#

setPosATL vs setPosASL
Which should I use for unit that could be put anywhere

#

Carrier, building, top of building, etc.

spice kayak
#

Probably setPosASL, considering you said anywhere. You'd rather rely on the sealevel, a constant, over the terrain level.

peak plover
#

But won't getPosATL be correct above water, because the ground still exists?

#

All I want to do is TP players...

#

So I guess setPosATL is fine..

#

perfect.. I just wanted for zeus to be abled to set respawn position and set it on top of objects so for ex. I can spawn a bench on top of a carrier and then allow for players to respawn on the carrier

#

Also can set respawn position on top of objects in editor, by moving objects

#

My mission is slowly taking form as well πŸ˜‰

spice kayak
#

Ha, nicely done.

#

Well, I'm off to bed. Good luck and thanks for the help!

peak plover
#

Yeah, sleep tight, glad you figured your things out!

peak plover
#

Modules are like units.. they have groups etc...

#

So my question is what typeOf do I use to check if something is a unit/ has group

#

I want to use setOwner / setOwnerGroup

#

Will AllVehicles have modules?

halcyon crypt
#

it shouldn't

#

entities does though

#

vehicles should only return vehicles, nothing else

peak plover
#

ahh, I'm using addEventHandler ["CuratorObjectPlaced",{

#
if !((configfile >> "CfgVehicles" >> (typeOf _unit) >> "_generalMacro") isEqualTo "Module_F") then {
            
    // Change object owner
    _unit setOwner (owner mission_ai_controller);
};
#

I'll try this...

halcyon crypt
#

_unit isKindOf "Module_F" is probably better/easier

peak plover
#
if !((getText(configfile >> "CfgVehicles" >> (typeOf _unit) >> "_generalMacro")) find "Module" > -1) then {
#

Because there are diferent types of moduels apperntly

#

Ohh, isKindOf checks subtypes... Thanks!

#

Very very nice

waxen tide
#

So i obviously messed up by using a local variable in a global scope? but i have no clue how and where exactly. I have little experience with the namespaces.

dusk sage
#

Error position: <private ["_emotion","_neutral", "_annoye>

#

I can't see this in your code

waxen tide
#

you're correct

#

These are the 3 main files i call in conversation.sqf for the responses. they all have a bunch of privates that look like the list in the error message

#

I'm not sure which file specifically is at fault

peak plover
#

if (typename _destTarget == typename objnull) then
{
    _dest =
    [
        _destTarget,
        _dest param [1,false,[false]]
    ]
}
else
{
    if (typeName _destTarget == typeName objNull) then
    {
        _dest =
        [
            _destTarget,
            _dest param [1,false,[false]]
        ]
    }
    else
    {
        _dest =
        [
            _destTarget,
            _dest param [1,0,[0]],
            _dest param [2,0,[0]]
        ]
    };
};
#

(typeName _destTarget == typeName objNull)
are both same

#

What purpose do they have?

#

Why Jiri, why

#
_var = true;
if (_var) then {
    //runs
} else {
    if (_var) then {
        //never runs
    };
};
#

Why?

tough abyss
#

if (true) then {avert your eyes!}

peak plover
#

Blame Jiri

#

That code is incorrect, right?

ivory timber
#

Quick question, can you get like "bones" with sqf?

#

like an arm, or the torso etc with sqf

waxen tide
#

nobody has a hint for me with my problem above? I'm failing to see the issue.

little eagle
#

@waxen tide

#
private ["_emotion","_neutral", "_annoyed", "_afraid", "_switch", "bool", "attemps"];
#

This line is wrong.

peak plover
#

You can only private local variables

little eagle
#

bool is not a local variable and therefore cannot be used with private.

peak plover
#

bool, lol can that even be used?

indigo snow
#

yes

little eagle
#

bool is not a reserved keyword, so it can be used. But using globals without OFPEC tag is very bad style.

peak plover
#

Emotion system sounds cool btw

little eagle
#

Generally naming a variable after it's type (only) is bad style. Even _bool.

waxen tide
#

@little eagle thanks. I think i'm slighty too tired.

little eagle
#

nigel, this bracket placement gives me eye cancer.

peak plover
#

bis_fnc_setTask
:^)

dusk sage
#

@𝓔𝓢𝓲𝓡 π“œπ“²π“ͺ𝔃𝔂#4898 is this for an aimbot πŸ™ƒ ?

peak plover
#

Your at does not @

dusk sage
#

I see πŸ˜›

peak plover
#

refund it

little eagle
#
systemChat str ["a" in allVariables player, player getVariable "a"];

player setVariable ["a", 1];
systemChat str ["a" in allVariables player, player getVariable "a"];

player setVariable ["a", nil];
systemChat str ["a" in allVariables player, player getVariable "a"];
#
[false,<null>]
[true,1]
[true,any]

πŸ€”

peak plover
#

what the..

#

ohh boy

little eagle
#

Magic trick of the day.

peak plover
#

😨

#

Good trick

#

Tricked me

spice kayak
#

Bamboozled!

spice kayak
#

So, I was looking at ways to prevent someone from picking up all but one object, yet the only methods I've found so far to prevent inventory acess is to close the inventory window when it's open. Is there another way to handle this?

cold pebble
#

@spice kayak have a look at the 'take' EVH

spice kayak
#

Yeah, I was just looking at eventhandlers then. Was thinking of the possibility of remove all objects from the dead player, minus the uniform and FAK.

#

but EVH might work.

cold pebble
#

You could use the playerkilled EVH and strip them there also

spice kayak
#

Yeah, that's what I mean.

#

Thank you.

cold pebble
#

No problem πŸ˜ƒ

spice kayak
#

Wish there were a simple way to remove the 'Inventory' action that pops up though haha.

#

I'd just replace that with my own addAction and then it would be perfect.

cold pebble
#

😦

#

Would be too easy that way πŸ˜‰

spice kayak
#

Actually, hang on.

#

If you disable simluation on something, wouldn't that disable the interactions?

#

Actually, then I wouldn't be able to add an action either.

#

Fuck.

cold pebble
#

:/

peak plover
#

ugh, what do you need to achieve?

spice kayak
#

Ha, well, I was thinking, for the Operators, I don't want them to be able to take all the gear the Guards have, like their armor, submachine guns, etc. Instead, I want them to only be able to take a FAK, which essentially gives them one more chance to revive / heal, as they're outnumbered.

#

Shhh you. I know I said it was pretty much done, but I couldn't help myself :C

#

I have a basic idea of how it would work, though I'd have no idea how to script it.

cold pebble
#

I'd just strip vest and bag, empty clothing and add 1 FAK to clothing πŸ˜‰

peak plover
#

Ahh, don't want them to loot corpses...

spice kayak
#
GuardFAKArray = [[Guard1,FAK1],[Guard2,FAK2],[Guard3,FAK3]];

{_x addeventhandler["killed", {(_x select 1) getPos _x); _x enableSimulation false;}];} forEach  GuadFAKArray
#

something like that?

#

I'd have no idea how to actually write it.

#

Never used arrays like that before.

#

Oh, sorry, forgot to add.

peak plover
#

So, only fak will be lootable?

spice kayak
#

Yup!

#

Forgot to disablesimluation.

#

But yeah, only FAK.

cold pebble
#

You'd just need to do player add eventhandler killed in the init.sqf

#

Then removevest and removebackpack, get array of clothing items, remove them and add a FAK?

spice kayak
#

Oh yeah, I probably could just spawn a FAK on their body, instead of teleporting one.

#

duh.

#

They all wear the same clothing, so :P

cold pebble
#

πŸ˜‰

spice kayak
#

That should make it easier.

cold pebble
#

Both teams wear the same?

#

Nevermind

peak plover
#

@cold pebble , but that would make the units naked...

spice kayak
#

But I don't exactly want them to spend the time opening the inventory, going into the clothing slot, dragging the FAK out.

peak plover
#

Agh, perfect

cold pebble
#

Nigel I mean as in find what's in the clothing, remove it, add FAK

#

OH

#

Well just remove everything plop a FAK with the guy

spice kayak
#

Wouldn't they then be naked with a FAK?

#

I mean, I'm not complaining...

peak plover
#

Nah, disableSimulation, and make a new action that says "Loot" or sth like that

cold pebble
#

Well you can leave the clothing, and empty it with a forEach and the array which is the clothing items

#

Then it'd be a bit less weird

spice kayak
#

Yeah, that's what I was thinking, Nigel.

peak plover
#

less weird

#

Funny πŸ˜„

spice kayak
#

{addEventHandler["killed",{"Item_FirstAidKit" createVehicle getPos _x; _x removeAllWeapons; _x enableSimulation false;}];} forEach guardArray

#

I still hate how it's createVehicle

#

Ah yeah, let me just drive around in my FAK.

peak plover
#

πŸ˜„

#

BAZINGA

#

Use KK code as refference to create a rotating FAK πŸ˜„

#

It's like GTA (old ones)

spice kayak
#

Ha, oh jeez.

peak plover
#

❀ KK

#

Times he blew my mind..

#

😡 πŸ”«

spice kayak
#

Actually, if this was executed locally, for the Operators, would that only removeAllWeapons and disableSimulation for them, and not the guards?

#

Should probably check how those functions execute.

peak plover
#

wait... not sure if they changed this command or not...

spice kayak
#

No no, but I like it locally.

#

That way, the operators will only be able to take the FAK, as where the guards can take the ammo and weapons if they get low.

peak plover
#

πŸ‘

#

That's awesome

spice kayak
#

:D

peak plover
#

I feel like you, I always find new things to add

spice kayak
#

Yeah, I know, and I hate/love it.

#

Nothing is ever truly complete for as long as you can think.

peak plover
#

...

#

It's just what makes us human

#

If we didn't always look into the next best thing or improvements, we would still be banging rocks together

spice kayak
#

Ha, exactly.

#

So, if my scripting is correct (haha...), this might work?

guardArray = [];

{
if (side _x == west) then {
    guardArray pushback _x;
    };
} forEach allUnits;

{
_xname = str _x;
if !(isNil _xname) then {
    _x addEventHandler[
        "killed",
        {"Item_FirstAidKit" createVehicle getPos _x;
        _x removeAllWeapons;
        _x enableSimulation false;
        }
    ];
};
} forEach guardArray;
#

for some reason, isNil doesn't like _x, or even (str _x). At least, in my limited experience.

tough abyss
#

scopes

cold pebble
#

If they are on a different side, couldn't you do the initial check if they're west then then add eventhandler to player?

tough abyss
#

oh my bad not scopes

#

well maybe in some locations... such as the event handler

spice kayak
#

Well, I want this to be run from someone who isn't west, so.

#

I'm not sure if that would work.

cold pebble
#

But all that's doing is adding the EVH to a list of people on the west side is it not?

spice kayak
#

Yeah, but executing it in a local, independant-only script.

#

I want the eventhandler to only happen for the independent units.

#

'happy' fuck me

cold pebble
#

Ohhh I'm beginning to understand πŸ˜‰

spice kayak
#

Ha, sorry!

cold pebble
#

My bad

spice kayak
#

To explain it better, the only people I want the bodies disabled and unlootable for is the two units who aren't blufor.

peak plover
#

isNil {_x} does that not work

spice kayak
#

apparently isNil reads strings, not objects.

#

Least, that was the error I was having a while back using it.

peak plover
#

it can check code as well

#

check alt syntax

spice kayak
#

ah, so !(isNil {_x}) would work?

#

I'll have to try it out.

peak plover
#

Hell yeah!

spice kayak
#

First time I've used pushback too \o/

peak plover
#

Anyone have any clue how much data default zeus modules transmit to clients and if I should be careful with what I send?

#

Achievement Unlocked: pushback

#

Have you tried param yet?

spice kayak
#

Would that little performance button do something for you on the debug console?

#

ah, I believe so.

#

Wait, I've used parameters before, in the sense of adding variable, user-defined settings to the mission

peak plover
#

Does nothing for me, but I need to find out if sending an array with ~10 elements probably max 100 char is too much...

spice kayak
#

Ah, sorry, I've used BIS_fnc_getParamValue, so I'm not sure if that's what you're talking about.

peak plover
#

It's the most glorious of commands

#

it's used in functions / scripts instead of select

spice kayak
#

Ah, nope!

#

Never touched it.

peak plover
#

One day, you will find out about the glories of param, some say it's better than recieving your firstborn baby and holding it for the first time

spice kayak
#

Ha, that might be so.

#

So far, I've been mostly proud of my Parameters screen haha.

#

Also, can addEventHandler not have multiple lines of code?

peak plover
#

Yea it can, but it should not, as it will be compiled every time.

spice kayak
#

ah, so call instead?

peak plover
#

use {call myFncWhenEH} instead

#

yeah

#

eventHandlerMP will suffer hardcore with that if you just put in a function, that's like 100 lines

#

sends 100 lines every time...

spice kayak
#

Yeah, that's understandable.

#

oh

#

I'm an idiot

#

_x removeallWeapons should be removeallWeapons _x

#

so this whole time, I thought i was fixing one issue... when it was another.

#

Hmm, well, the _guardArray part works, but the addEventHandler doesn't.

#

No errors, just nothing happens.

peak plover
#

gimme code

spice kayak
#

actually, isNil is irrelevant when it's running off an array that is purely compiled of units that exist.

#

Haha.

#

Not to say that'll fix it, but it was funny.

#
[] spawn {

    _guardArray = [];
    cLootable = {
        "Item_FirstAidKit" createVehicle getPos _x;
        removeAllWeapons _x;
        _x enableSimulation false;
    };
    
    {
    if (side _x == west) then {
        _guardArray pushback _x;
    };
    } forEach allUnits;
    systemChat format ["%1",_guardArray];
    {
    if !(isNil {_x}) then {
        _x addEventHandler["killed", {call cLootable}];
    };
    } forEach _guardArray;
};
peak plover
#

is the createVehicle syntax correct?

#

"Item_FirstAidKit" createVehicle getPos player

#

does that work

#

(in debug)

spice kayak
#

Well, not getting any errors, but let me check.

#

Oh

peak plover
#

also _x is wrong lol

#

duuh

spice kayak
#

Where is it wrong sorry?

robust hollow
#

_x wouldnt be defined in clootable

peak plover
#

    cLootable = {
    _unit = param [0];
        "Item_FirstAidKit" createVehicle getPos _unit;
        removeAllWeapons _unit;
        _unit enableSimulation false;
    };
spice kayak
#

Even if it was called within the forEach thing?

robust hollow
#

clootable is called from the evh, not foreach

peak plover
#

IT's in the EH now

#

That code is like "Got this EH, none of that forEach shit anymore"

#

And he does not care about your _x

spice kayak
#

Aw, alright :c

peak plover
#

Yeah, fuckhim!

spice kayak
#

Oh yeah

#

dead people don't fall now.

#

That's creepy.

peak plover
#

eek

spice kayak
#

Also, despite enableSimulation activating, I can still interact with inventory. Was hoping that wouldn't be the case :C

peak plover
#

you can try lock (not sure 'tho)

spice kayak
#

Lock vehicle (disable mounting / dismounting) for player.

#

/lennyface

peak plover
#

add containerOpened EH to the dead unit and do code {(findDisplay 602) closeDisplay 0;}

spice kayak
#

Yeah, I figured that would work, but wouldn't that look a little odd? Like, a flickering?

peak plover
#

Should instantly close inventory when it's tried to opened

#

EH runs in unscheduled, means it happens before the frame next frame is displayed?

spice kayak
#

Ah, that might work.

peak plover
#

Try it, I've never done it 'tho so I dno

spice kayak
#

Well, instead I've just made it so that it clears their body of everything but their uniform, and puts a FAK on the ground next to the body. I guess this also allows them to 'disguise' if they want, but they'll only look the part, they won't have the weapon for it.

#

I'll just say 'it's a feature.'

spice kayak
#

Duuuuude. I've connected the platforms and shit. This is actually great.

peak plover
#

The what now πŸ˜„

spice kayak
#

Okay, so the mission area is docks, and there were quite a few higher platforms, pipes and all that.

#

I've connected some of them, allowing the operators to traverse more vertically.

#

(Orange lines mark the new paths)

peak plover
#

very nice

#

You should totally get this on the workshop πŸ˜ƒ

spice kayak
#

Ha, maybe. I'd need to playtest it first though.

peak plover
#

Yea ofcourse

velvet merlin
#

looking for some optimization advice please:

robust hollow
#
if(_dir2 > 2) then```
not optimization but nothing happens if _dir2 == 2?
#

cant tell if intentional or not.

little eagle
#

_dir2 could reuse the identifier of _dir

still forum
#

I'd prefer if the 2nd and 3rd if statements were merged into one. The Indentation is a bit too much IMO

peak plover
#

@velvet merlin is it only 1 loop total / max?

still forum
#

What do you mean by that?

#

1 loop of what? The while loop?

peak plover
#

Don't just add a loop per vehicle / unit

#

Make a loop handler for your loop and loop through all units with that... I had ~3000 units cached with no performance drop when checking for uncaching πŸ˜‰

#

Also means there is no sleep per vehicle (no clogging up scheduler)

digital pulsar
#

do you reckon engine solition to _dir = [_vehicle,_target] call BIS_fnc_relativeDirTo; would be faster?

little eagle
#

I don't understand _dir2 = 360/_dir; and _dir2 < 2

#

This seems more intuitive to me:

private _dir = [_vehicle,_target] call BIS_fnc_relativeDirTo;
private _increment = [-1,1] select (_dir > 180);

_vehicle setDir (getDir _vehicle + _increment);

instead of all the stuff in the middle.

#

Might have to flip the >, dunno

indigo snow
#

Isnt relDirTo obsolete with the new alternative getDir syntax?

little eagle
#

Yeah.

still forum
#

Converts degrees to radians @little eagle

indigo snow
#

What no

still forum
#

Maybe?

indigo snow
#

No

little eagle
#

Radiants are 0-2pi in my country, not 0-1

velvet merlin
#

@peak plover one per static gun

still forum
#

Ah! It checks if dir > 360?

indigo snow
#

degrees/180*pi - deg2rad

little eagle
#
private _dir =_vehicle getDir _target;
private _increment = [-1,1] select (_dir > 180);

_vehicle setDir (getDir _vehicle + _increment);
#

(The second pair of parenthesis are optional : ))

peak plover
#

do parenthesis kill performance?

still forum
#

Yes!

indigo snow
#

Almost 1 ms per parenthesis

peak plover
#

That's actually a lot

indigo snow
#

Its actually a lie

peak plover
#

0.0001 per 10000?

#

way too much πŸ˜‰

little eagle
#

Its actually a lie
This is a lie.

indigo snow
#

The 1 ms per parenthesis part is

peak plover
#

Its actually a lie
This is a lie.
That's a lie

indigo snow
#

Or are we diving into that logic branch again

little eagle
#

This statement is false.

indigo snow
#

Syntax error

#

Type bool, expected bool, bool

little eagle
#

Magic trick of the day.

#
10:00:31 Error in expression <_a = []; _a pushBack _a>
10:00:31   Error position: <pushBack _>
10:00:31   Error 975157240 elements provided, 708879920 expected
peak plover
#

πŸ™ƒ

indigo snow
#

Hereby proving the list of all lists can't contain itself

digital pulsar
#

does EachFrame EH work when executed on dedi?

velvet merlin
#

isnt the setup and type of conditions, and sleep design way more relevant performance wise compared to the innermost code?

little eagle
#

Yes

#

Yes to foley

digital pulsar
#

once per tick i assume?

little eagle
#

Per frame

still forum
#

@velvet merlin If the innermost code isn't even executed because of the conditions.. sure.

digital pulsar
#

wait what, dedi draws frames?

little eagle
#

No. frame != render frame

digital pulsar
#

k

still forum
#

Frames has "nothing" to do with what you see.

#

The actual rendering of an image is only about half of the frame time

digital pulsar
#

well i would usually call those game ticks

still forum
#

@velvet merlin I'd push the _vehicle getVariable ["LIB_ARTY_AI_DIR",true] right to the beginning and if it doesn't match do a longer sleep

little eagle
#

They are called frames in this game.

#

All those sleep are a ugly headache, so no one wants to touch them.

#

Foley, the Draw3D mission eventhandler wouldn't be executed on a dedicated server or headless client.

#

That is what you were thinking of.

peak plover
#

inPolygon is kinda same as inAngleSector

still forum
#

Except the AngleSector is an open sector. And inPolygon is not?

peak plover
#

Ohh, righgt

#

inPolygon is better, because it has a max

still forum
#

But FAR worse if you don't want a max.

#

Also harder to calculate compared to inAngleSector.

peak plover
#

sure

still forum
#

Though as inPolygon is in engine and inAngleSector is probably SQF that might not matter

little eagle
#

Always take the engine command over the SQF

still forum
#

#Intercept

velvet merlin
#

@still forum good point. ty

ionic orchid
#

is there any way of knowing if/when drawTriangles will make it to a release build? :/

#

drawTriangle, even

little eagle
#

If it's in the RC, then it should make it into 1.76.

#

Unless they find a problem with it.

ionic orchid
#

fingers crossed

peak plover
#

🀞

rotund cypress
#

do parenthesis kill performance?

#

πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚

little eagle
#

Depends on how many πŸ‘Ώ

rotund cypress
#

It wasn't a question

#

🀣

little eagle
#

Why the question mark then?!

rotund cypress
#

Notice the >

#

I was referring to nigels question

little eagle
#

...and I answered it.

peak plover
#
for "_i" from 0 to 100000 do {1+1+1+1+1+1+1+1+1+1+1+1+1+1}

448.333 ms

for "_i" from 0 to 100000 do {((((1+1)+(1+1))+((1+1)+(1+1)))+(((1+1)+(1+1))+(1+1)))}

485 ms

Conclusion
PARENTHESIS NEVER AGAIN

rotund cypress
#

You don't use parenthesis where it is not required of course πŸ€”

little eagle
#

I was pointing out optional parenthesis.

peak plover
#

I acutually do 😭

little eagle
#

Of course you can't get rid of required parenthesis.

peak plover
#

I put parenthesis everywhere

still forum
#

@peak plover Test again. But this time the one with parens first and then the one without

peak plover
#

// Change the size based on the amount of elements
private _hMod = ((((lbSize _ctrlList)min 10)*0.85)max 1);
``` help me
still forum
#

and then compare results

rotund cypress
#

IMO you shouldn't use parenthesis unless required

#

Thing is, you wouldn't use semi colons in python

still forum
#

Parenthesis make no difference in runtime. But help preventing errors that you don't expect

peak plover
#

parenthisis
472.333 ms
non-parenthesis
453 ms