#arma3_scripting

1 messages · Page 370 of 1

timber ridge
#

lol, gonna make a trello board for that, guys, if needed

tough abyss
#

Nope.

timber ridge
#

just ask me $beingpolite

dusk sage
#

🤔 ?

little eagle
#

I'd rather have people be honest than polite.

timber ridge
#

not in US, you won't, commy

#

unless you get to know someone closer, in time

cunning nebula
#

honesty is not directly related to politeness

tough abyss
#

@tough abyss The reason was there was too many problems with ArmA 3 hating instant weather changes

#

and there was no feasible way to simulate rate of change in a way that didn't cause frame-skipping.

cunning nebula
#

in other words: you dont have to be honest to be a dick

tough abyss
#

So it got written to the point of the A3 engine screwing me over a few times.

#

skipTime -24; skipTime 24; and all that hacky crap

little eagle
#

But you have to be not-honest to be polite.

cunning nebula
#

not necessarily

#

I can say "this and that is wrong" without saying "you suck because you did it wrong"

#

I could even say "most of it is pretty nice, but that one detail is wrong"

tough abyss
#

There is no answer to why use

select
timber ridge
#

try to work in a corporate env for some time, you'll get to know the workarounds of communication pretty quickly

tough abyss
#

The wiki has an example thats it.

little eagle
#

Nothing about GeekGuys code was pretty or nice.

tough abyss
#

Not my code...

#

It was LARs

little eagle
#

The one you posted then.

cunning nebula
#

the wiki tells you pretty exactly what the differences are I'd say

still forum
#

@tough abyss Already told you forEach would be better for what you are doing

tough abyss
#

all the nested selects don't make it pretty commy2

little eagle
#

This is also why optimization afterwards sucks. Double the work, if not more to replicate the same behaviour.

tough abyss
#
if !( ( _itemType select 1 ) isEqualTo "VehicleWeapon" ) then {};
#

I could make it so much easier by just moving that to 1 other line

#

and give it meaning.

still forum
#

Why don't you do that?

halcyon crypt
#

still going on about the same thing? 😁

still forum
#

No. We solved it 16 minutes ago

halcyon crypt
#

I get the feeling you don't work in Software Development. No offense.
@tough abyss I kinda remember you saying that you work in software development but that's not showing either

tough abyss
#

better ?

halcyon crypt
#

might be confusing you with someone else but in any case it's not showing 😛

tough abyss
#

@still forum

still forum
#

looks better

#

But fnc_linkedItems now does something completly different from what it did before

#

before it pushed the items into an array using pushback. Now it only returns the items.
You still need to put them into the array they were pushed to originally

tough abyss
#

Oh right.

#

derp.

#

It's got to add stuff to the array.

still forum
#

you can just use append for that now

#

Although....

#

No.. I don't think append works.. You have an array of configs now. You still need to run configName on them to get the classname

#

easiest way "(isText( _x >> 'Item' )" configClasses _this) apply {configName _x;}

little eagle
#

What's the point of line3?

still forum
#

also in fnc_linkedItems you have one ( too many

#

true.. line3 doesn't need to exist.

little eagle
#

Same for 8

cunning nebula
#

what is a "Catagory" ?

little eagle
#

A category in a catalog.

cunning nebula
#

so a catagory is a catalag ?

little eagle
#

It is now.

still forum
#

catalagory

#

catalogory gore

little eagle
#

gore

#

💉

tough abyss
#

is apply forEach?

little eagle
#

No, apply is apply and forEach is forEach.

tough abyss
#

Seems to behave in similar manner.

#

Or well.

little eagle
#

True. Both are loops.

tough abyss
#

One does things to arrays

#

and the other just loops through them.

little eagle
#

Both execute a code block for every array element and put that in _x.

tough abyss
#

Why did we need another forEach?

#

why not just expand the forEaches syntax?

little eagle
#

apply has a return value that is different from forEach.

tough abyss
#

Ah yeah that little detail

indigo snow
#

what would you think an apply syntax for forEach would look like?

tough abyss
#

Still why not just make forEach behave like apply?

cunning nebula
#

there are a lot of these and they're all a bit different

indigo snow
#

what if you dont want to modify the original array?

cunning nebula
#

just choose the one that fits best

tough abyss
#

forEach

little eagle
#

Still why not just make forEach behave like apply?
Because forEach already has a return value and you'd break old code.

tough abyss
#

Hmmm odd little bit triva that one.Return Value:
Anything - will return the value of last executed statement

little eagle
#

It's true.

still forum
#

And because different things serve different purposes.
Why not just use a Spork for everything?

icy raft
#

What is love? I can't find it anywhere but I know that the variable is there in global.

tough abyss
#

apply Array - resulting array

#

So 1 returns the array

#

one returns on the final element in an array

little eagle
#
private _return = {0} forEach [""];
_return // 0
still forum
#

@icy raft wut? Baby don't hurt me?

indigo snow
#

forEach does stuff with the elements of an array, apply makes changes to the elements in the array itself

tough abyss
#

So fashing forEach into apply would involve a lot of other commands at once

cedar kindle
#

apply is more commonly known as “map”. you loop an array and return a new array based on what the code returns for each element

tough abyss
#

so apply simply reduces the amount of instructions

indigo snow
#

not really, array set [_forEachIndex, _x*2];

little eagle
#

Or pushBack

indigo snow
#

itll still be faster

cedar kindle
#

allPlayers apply {name _x} // array of all player names
get it?

tough abyss
#

Yeah 1 performs operators on the array

indigo snow
#

yes and it will return a copy of the modified array instead of modifying the original one, cuel

tough abyss
#

as well as chnage it

little eagle
#

_configs apply {configName _x} // array of classnames

#

^^

tough abyss
#

the other just loops through the array

cedar kindle
#

ofc

still forum
#

We should just combine apply, count, forEach into one!
applyCountForEach. Returns array of the new array that apply would create, the number of elements in that new array. and the return value of the last execution

cunning nebula
#

I don't know

little eagle
#

You forgot select

indigo snow
#

also the code block must return nil or a number

cunning nebula
#

it something about not reading the wiki

tough abyss
#

could have just used forEach ["mode",[array]];

cunning nebula
#

and having it explained here instead

tough abyss
#

😛

cedar kindle
#

lul

little eagle
#

could have just used forEach ["mode",[array]];
But that's hideous.

#

Not that that has ever stopped anyone.

tough abyss
#

^

indigo snow
#

refer to the stuffing code in the configClasses string earlier today

tough abyss
#

Being nested probably is much slower too

#

apply I guess ensures it's not a double nested operation

indigo snow
#

if you need to include a mode keyword you might aswell make that keyword... a command

little eagle
#

fullCrewDriver
?

indigo snow
#

modeltoworldworld

#

im for it

tough abyss
#

I think I need to focus on my scripting in terms of bread and butter

#

what commands are the bread and butter of the SQF language.

little eagle
#

if

#

then

indigo snow
#

=

little eagle
#

else

#

==

tough abyss
#

arrays.

little eagle
#

!

cunning nebula
#

setDammage 😃

tough abyss
#

arrays

indigo snow
#

dammage

little eagle
#

haha

tough abyss
#

data manipulation is a key one.

cunning nebula
#

noo

#

not damage

little eagle
#

setPosASL2

cunning nebula
#

dammage

tough abyss
#

data*

cunning nebula
#

the real thing

little eagle
#

comment

#

!

indigo snow
#

setPosASL2 is hilarious

tough abyss
#

Yeah I know commenting from studying C

cedar kindle
#

they could’ve called them map and filter which most languages call them. but I guess map is easy to mistake for the ingame map

indigo snow
#

commy means the comment command

#

its literally less than useless

little eagle
#

Yet some people argue for it.

cedar kindle
#

how else would you write comments in init boxes 😉

indigo snow
#

i use its side behaviour to modify my external script behaviour

#

if my custom parser reads comment it shuts down my pc

#

which i need since my power key is broke

little eagle
#

Same way you do it with the comment command, just without the comment command, cuel

indigo snow
#

yea they recently allowed normal //comments in those boxes

cedar kindle
#

oh cool. it was a joke btw

indigo snow
#

QS, you could just have the string by itself

#

dont argue silly with me in an arma scripting channel

tough abyss
#
/*
***********************************************************
Filename: Some_interesting_fnc.sqf
Author: GG
Date: 10/10/2017
Description: Does something I haven't throught of yet.
***********************************************************

>>>-------Parameters -------<<<

*/
little eagle
#

But you don't need the comment command in the first place. Just put the string there and you get the same result

comment ""; used to be the only way for comments to be accepted in Debug Console, dont hate what you dont understand
That's wrong.

tough abyss
#

Learn lots of good habits from C

#

Poor mans type facing

rotund cypress
#

Thats the most horrible header I've seen in my life 🤣 @tough abyss

indigo snow
#

dont make this a challenge

little eagle
#
private _a = 1;

"add random amount";
_a = _a + random 5;
private _a = 1;

comment "add random amount";
_a = _a + random 5;

Literally useless.

tough abyss
#

@rotund cypress

#

Whats wrong woth it?

rotund cypress
#

Looks cluttered

still forum
#

@indigo snow = is technically not a command.
@cedar kindle you also have to keep in mind that new command names break all code that uses the same name as variables map is IMO a name that would probably be used as variable name by some people.

cedar kindle
#

why are you entering the file name as a comment ?

#

yeah there’s that aswell

still forum
#

But I think the engine doesn't even care if you have variables called the same as commands

tough abyss
#

@rotund cypress Agreed

still forum
#

besides nular's

icy raft
#

@still forum Don't hurt me, no moar...

cedar kindle
#

silent error?

little eagle
#

It complains about using a reserved variable, dedmen

icy raft
#

Maaan, this is fun to read. Yall end up killin each other

little eagle
#

On screen error with enableScriptErrors.

still forum
#

It complains yeah..

little eagle
#

?

indigo snow
#

arma scripting is srs bsns

still forum
#

But if you disable that error.. Might it actually work?

little eagle
#

No.

still forum
#

like
modelToWorld = "mytesty";

#

Are you sure tho?

tough abyss
#
/*

*************************************************************
* Filename: Some_interesting_fnc.sqf                        *
*                                                           *
* Author: GG                                                *
*                                                           *
* Date: 10/10/2017                                          *
*                                                           *
* Description: Does something I haven't throught of yet.    *
*************************************************************

>>>-------Parameters -------<<<




*/

Better ?

little eagle
#

Yes.

icy raft
#

[] call BIS_fnc_error

rotund cypress
#

Using a script command for a variable will most certainly cause a syntax error.

indigo snow
#

disable the error or disable showing the error?

#

hiding it wont make it go away

halcyon crypt
#

are we seriously going to discuss file header styles? 🤔

tough abyss
#

Anyone know if you can #define reference script commands?

rotund cypress
#

Also, >>>-------Parameters -------<<<, why?

#

@tough abyss yes, shouldnt be a problem

still forum
#

The engine knows something that doesn't have two arguments can't be a binary command.. A variable would have 0 arguments.. So technically the engine could let you use the names of binary commands as variable names

cedar kindle
#

what’s the point of having the file name as a comment?

still forum
#

@tough abyss you can #define anything

indigo snow
#

preprocessing happens before evaluation

tough abyss
#

#define DOBAD(t)  skipTime t
indigo snow
#

sure

little eagle
#

what’s the point of having the file name as a comment?
Punishing yourself by having to write down redundant information

still forum
#

It's essentially(almost) the same preprocessor as in C @tough abyss

tough abyss
#

Nah just copy paste them.

rotund cypress
#

@little eagle easy to find

tough abyss
#

Make a header file with all your headers

little eagle
#

copy pasting is a form of writing

tough abyss
#

paste them.

#

Well in Linux you can do some cool stuff with bash

rotund cypress
#

But @tough abyss don't see why you have a semi colon at end of your define.

tough abyss
#

which will auto-generate headers

indigo snow
#

oh yea thats bad practice, the semicolon

cedar kindle
#

easy to find how? you’d just search the file name

little eagle
#

Defines shouldn't end with a ;

indigo snow
#

doesnt break it, just bad practice

tough abyss
#

So you could effectively remap

indigo snow
#

or the old guard will make snide remarks

tough abyss
#

the entire engines scripting commands

#

with macros?

indigo snow
#

yes

tough abyss
#

to obscure shit?

still forum
#

yes

indigo snow
#

even make macros generate macros that turn into commands

#

go wild

#

thats how most obscuration stuff in arma works

#

except the one where they modify the PBO header

icy raft
#

Should I start lighting up the pires?

still forum
#

@tough abyss Take a look at OOP script.
It's just a FUQTON of macros to make scripts look like OOP

tough abyss
#

Sounds dirty

indigo snow
#

it is dirty

cedar kindle
#

had a fun time reading that thread

indigo snow
#

but some people like it that way

#

some people say that about the CBA / ACE macro situation, too i guess

#

although that isnt obfuscation

rotund cypress
#

Shooting yourself in the foot when using something like that 🔫

indigo snow
#

theres probably a very niche application for it that you technically would never need in arma

tough abyss
#

AI are dumb why are AI dumb?

#

BIS make neural network AI agents

indigo snow
#

arma AI is pretty smart, just a lot gets demanded of them

#

and they dont deal well when the server is under a heavy load

tough abyss
#

Walking through a door...

#

Is impossible for them.

#

Ever played with as a kid one of the bump bots?

indigo snow
#

is that the ai being dumb or a bug?

little eagle
#

both?

indigo snow
#

always

tough abyss
#

Runs into the wall then randomly selects a redirection and tries again.

#

Thats arma 3 AI in buildings

indigo snow
#

ill give you that they cant handle buildings very well

tough abyss
#

They can't handle anything well, exploring a roadblock script I wrote

#

worked beautifully aligned all the roads correctly

#

etc.

#

Guess what.

little eagle
#

The pathfinding is really bad in this game too.

tough abyss
#

The dumb Tigris drove into them.

indigo snow
#

depends what you ask. theyre hard to wrangle into specific behaviour, but easy to do well on a broad scale of tasks

#

not sure how to english that correctly

tough abyss
#

And the AI goes, oh look a wall.

#

"Bump" select random direction

#

"Bump"

#

Ruins a lot of arma 3's experience.

#

I feel if BI was to implement neural net AI

#

the A3 engine probably wouldn't handle it as they need multi-threading

#

far more than what the A3 engine is capable of at this time.

cunning nebula
#

neural net AI would demand their own channel on discord to flame about how stupid the players are

little eagle
#

They need better pathfinding, one that doesn't get them stuck or make them walk through walls. and especially one that handles driving.

cunning nebula
#

current AI tries the same but their only way of expressing that is by putting a bullet in your face

tough abyss
#

People also like to glitch into walls.

#

A3 is terrible at that.

#

Just get on the right angle and glitch through a wall and shoot someone.

little eagle
#

Yes, but AI walks effortlessly through walls you can't vault through yourself.

tough abyss
#

Where is my vault over key.

#

Apart from ACE3

little eagle
#

v?

tough abyss
#

ACE3 should have new movement animations

#

Climbing should be built into ACE3 instead of Enhanced movement

little eagle
#

There is climbing in ACE.

#

Not as op as in enhanced movement though, but you can climb on hesco barriers easily.

#

ctrl v by default I think.

#

That makes it look smooth for the player : )

#

Should be using AGLToASL to not be jittery on rough terrain...

cedar kindle
#

that would be abused to no limit

little eagle
#

camera doesn't move when changing to 3rd person.

#

camera beiing the model selection

#

All I need is the change of that position. It's like a definite integral, where the integration constant doesn't matter in the end.

#

Both in 3rd and in 1st person mode the change of position of the animation is the same as the camera moves during that animation.

#

I could make it relative to the feet too, but then the camera would jump and the feet were smooth...

subtle wigeon
#

Can anyone help me flesh out some errors on a script?

subtle ore
#

:scream:

slender halo
#

@subtle wigeon show us your script

subtle wigeon
#

ok, its over 2000 charactiers, trying to find a way to host

slender halo
#

pastbin, hastebin, gist github

subtle wigeon
slender halo
#

what's your error ?

subtle wigeon
#

_allaiUnits is no declared
_x is not declared
_actioned is not declared
sa_fnc_getnearenties may be used before assigning a value

#

And the script doesnt work

indigo snow
#

i see the first one being defined, and _x does not need defining

#

without knowing your actual error, im guessing SA_fnc_getNearEntities returns garbage

slender halo
#

there is no hoisting in sqf, you should move SA_fnc_getNearEntities before the spawn

indigo snow
#

im assuming from the tag setup that the function actually lives in cfgFunctions?

slender halo
#

jsut to be sure

indigo snow
#

otherwise, yea

slender halo
#

and as cptnnick said, SA_fnc_getNearEntities might return a tree or a house

#

not ia only

indigo snow
#

wouldnt necessarily spawn no declared errors, by which im assuming he means errors with nil

subtle wigeon
#

Originally the SA_fnc_getNearEntities was not in the scripts, but a functions folder

#

linking it via config.hpp

indigo snow
#

config.cpp? is this an addon?

subtle wigeon
#

im updaing our game template and trying to streamline stuff

#

no addon

#

// SA: Squad Join
[] execVM "SA\scripts\sa_squad_join.sqf";

indigo snow
#

missions use description.ext, not config.hpp, you know this right? e.g. your function is defined in game?

subtle wigeon
#

in the init.sqf

indigo snow
#

do you have your exact error, btw?

#

what you gave doesnt help a whole lot

#

aggresively debugging values in the script to your .rpt file also works wonders with debugging

subtle wigeon
#

17:11:34 |============================= Leqa intel =============================|
17:11:34
17:11:34 No speaker given for
17:11:34 Error in expression <squad_action_id",nil];
};
};

} forEach _allAiUnits;
sleep 10;
};

};

};

17:11:34 Error position: <_allAiUnits;
sleep 10;
};

};

};

17:11:34 Error Undefined variable in expression: _allaiunits
17:11:34 File C:\Users\Jason Reed\Documents\Arma 3 - Other Profiles[SA]Reed\mpmissions\SA%20Ghost%20Template%20Tanoa%209%2e5%20Reed.Tanoa\SA\scripts\sa_squad_join.sqf, line 48
17:11:42 Mission id: 5381f18895dfa8a461f27a027342ccc6f7ef985a
17:11:43 Empty word in sentence ''
17:11:43 unable to connect anim. source "Hit" to hitpoint "HitGear" in O_Plane_Fighter_02_Stealth_F
17:11:43 Array tex in bin\config.bin/CfgVehicles/Plane_Fighter_01_Base_F/Damage/ not even
17:11:43 B_Plane_Fighter_01_Stealth_F: gear_f_hook_down - unknown animation source hook
17:11:45

austere granite
#

and if it's not a lot of values systemChat even

cinder night
#

Hey all have any of you had a problem in arma with moveinDriver before? It seems ever so often when players get out of the vehicle they no longer have an option to get back into the drivers position rolling_eyes

indigo snow
#

from this i propose your function return is garbage

#

check if it actually works

subtle wigeon
#

ok ill check and post results

#

thanks for the help

slender halo
#

you should use a class to filter, this will even grab bees and footprints
_allObjects = nearestObjects [_position, [], _radius];

indigo snow
#

shouldnt really cause a nil issue though

queen cargo
#

So much wrong in that code 😭
Please start using params for beginning... Rest cannot help due to mobile and horrible structure

subtle ore
#

The evaluation is the worst

#

If statement galore

indigo snow
#

sure its objectively horrible but that doesnt matter because the error happens before that ever runs 😛

subtle ore
#

🤔 I have a feeling it will be more than that down the line

#

Wait whaaa? An error on line 35? Oh wait, there is one giant fucking if statement

#

For whatever it's worth (the above not a good example) constructive criticism is essential to learning

queen cargo
#

Should extract missing commands out of that and add them in next release of sqf-vm
Will provide better information on the subject

ionic orchid
#

is there a decent alternative to initPlayerServer to getting a connecting player (since the wiki goes on and on about how using it is a Bad Thing™)

frank ruin
#

What I'm doing wrong.

frank ruin
#


//Double check
if (_bad == 1) exitWith {};```
#

It shows the hint message

#

But executes the rest of the script

#

Even when I have it exitwith underneath.

tough abyss
#

Prob either variable scope or case sensitive issue with classnames. SQF IN is case sensitive

frank ruin
#

But it popped up with the hint.

#

So it found the item in my inventory in and said can't smuggle.

#

Yet it executes the actually teleporting of the player.
Which is shouldn't ...

#

It should abort the script when the person has explosives on him.

tough abyss
frank ruin
#

Perhaps I should exitwith the foreach aswell

little eagle
#

Show the full thing.

frank ruin
#
"NLAW_F",//Pcml missile
"ATMine_Range_Mag",//Explosive
"APERSMine_Range_Mag",//Explosive
"APERSBoundingMine_Range_Mag",//Explosive
"SLAMDirectionalMine_Wire_Mag",//Explosive
"APERSTripMine_Wire_Mag",//Explosive
"ClaymoreDirectionalMine_Remote_Mag",//Explosive
"SatchelCharge_Remote_Mag",//Explosive
"DemoCharge_Remote_Mag",//Explosive
"IEDUrbanBig_Remote_Mag",//Explosive
"IEDLandBig_Remote_Mag",//Explosive
"IEDUrbanSmall_Remote_Mag",//Explosive
"IEDLandSmall_Remote_Mag",//Explosive
"IEDUrbanBig_Remote_Mag",//Explosive
"ClaymoreDirectionalMine_Remote_Mag",//Explosive
"HandGrenade",//Explosive
"MiniGrenade",//Explosive
"SmokeShellBlue",//Explosive
"HandGrenade_Stone",//Explosive
"RPG32_F",//Explosive
"RPG32_HE_F",//Explosive
"RPG7_F",//Explosive
"1Rnd_HE_Grenade_shell",//Explosive
"3Rnd_HE_Grenade_shell",//Explosive
"TrainingMine_Mag", //Explosive
"APERSMineDispenser_Mag" //Explosive
];

diag_log format["Uniformitems: %1",uniformItems player];
diag_log format["Vestitems: %1",vestItems player];
diag_log format["Backpackitems: %1",backpackItems player];

/* outdated
{if(_x in _deletelist) then {hint"You can't smuggle explosives on the bus... are you crazy?!";_bad = 1;};} forEach Items player;
*/

{if(_x in _deletelist) exitWith {hint"You can't smuggle explosives on the bus... are you crazy?!";_bad = 1;};} forEach uniformItems player;
{if(_x in _deletelist) exitWith {hint"You can't smuggle explosives on the bus... are you crazy?!";_bad = 1;};} forEach vestItems player;
{if(_x in _deletelist) exitWith {hint"You can't smuggle explosives on the bus... are you crazy?!";_bad = 1;};} forEach backpackItems player;


//Double check
if (_bad isequalto 1) exitWith {};

if (life_spawn_point isEqualTo []) then {  ///// 

other teleportion code ```
little eagle
#

_bad is undefined.

frank ruin
#

But I define it as ;_bad = 1

#

in the exitwith

little eagle
#

That is a child scope. It's undefined in the main scope.

frank ruin
#

So if I'm correct my exitwith scope in foreach is only 'local' to the foreach entity.

little eagle
#
// main scoe
call {
    // child scope
    _var = 1;
};

_var // undefined
frank ruin
#

So when it finds an explosive it stops the foreach but executes the rest.

little eagle
#

The problem is not with exitWith, it's with the variable being undefined.

frank ruin
#

So if I define it in the start as _bad = 0;

tough abyss
#

You should really look at that link. It describes your problem etc

little eagle
#

Yes.

#

So if I define it in the start as _bad = 0;
Do this.

astral tendon
#

does the setCaptive is supouse to make a unit being hand cuffed?

little eagle
#

No.

frank ruin
#

So that _bad is a private special variable within the foreach

#

Which only exists in that scope

#

Unless I define it as a private in the start of the file

astral tendon
#

so i am missing a command?

little eagle
#

It only exists in the child scope, because it was never defined in the main scope.

frank ruin
#

mmm

little eagle
#

That's how SQF works and it's retarded. Welcome to Arma.

indigo snow
#

Private vars travel down but not up

tough abyss
#

Not retarded at all

little eagle
#

And then there's people defending it.

tough abyss
#

Alot of stupid stuff with SQF, but variable scope really isn't one of them.

still forum
#

It's the same in C++ and other scripting languages.. private variables do not travel up in scope. Because that's the whole sense behind private variables

#

or local variables

tough abyss
#

Lack of a mutex lock & natve hashtable variable type is slightly annoying

frank ruin
#

Don't have a background of other coding languages. 😉

still forum
#

can easilly make your own mutex tho. I use waitUntil for it in TFAR.
native hashtable? #Intercept!

frank ruin
#

Was there actually some good documentation out for your basic.cfg network settings?

little eagle
#

dick

still forum
#

dico

tough abyss
#

Have noticed issues with remoteexec and trying to implement a mutex lock. When client sends multiple in same frame.
Yeah best part of intercept imo, is ability to add new sqf commands (on my todo list)

frank ruin
#

Wiki is not really what I would call specific nor precise...

still forum
#

I just call unscheduled scripts via remoteExec.. No race conditions..

#

@frank ruin for network settings #server_admins But basically.. Leave them default unless you have specific problems

tough abyss
#

Dedmen had it happen in unscheduled enviroment, can repo when client disconnects network to spam requests & reconnects before gets booted from network.

still forum
#

😮 wtf

tough abyss
#

But anyway doesn't matter

frank ruin
#

Well not specific problems ... was more looking for better optimization wise ...

indigo snow
#

If there was an obvious way bis would just implement it

still forum
#

@brazen hazel Just mentioning you to bookmark your name. To remind me tomorrow to check that you have been banned

little eagle
#

Evidently.

still forum
#

yes you do.

#

yes

#

mari_processor = true

#

fixed.

little eagle
#

mari_processor is undefined.

#

define it

indigo snow
#

You guys are even gonna go as far as helping here?

little eagle
#

Dunno, depends on your script. I guess you messed with the mission and deleted an important object or something.

still forum
#

@brazen hazel Some people are actually really too mentally retarded to see that the message says that the variable is undefined. And you seem to be one of them.

little eagle
#

Mean.

still forum
#

Honest.

#

Good night. Have fun

little eagle
#

D-did you just edit this message just to add the dot?

still forum
#

yes

frank ruin
#

@little eagle & @tough abyss Cheers for the info, it's working as it should now.

little eagle
#

Did you write the script, Hyper?

#

You should contact the person that wrote the script.

rancid ruin
#

WHY

jade abyss
#

Lifer ¯_(ツ)_/¯

rancid ruin
#

QUICK GET HIM

jade abyss
#

You think he cares about it? lmao

#

uhuuu, smartass over here =}

little eagle
#

🚒

jade abyss
#

At least... i know what the Problem is and how to fix it and ... erm... you ... don't

still forum
#

Maaaan.. I want to go to bed.. But I know I won't be able to read up on this because that idiot is gonna end up being banned :/

jade abyss
#

Probably 😄

#

Nope

indigo snow
#

Dscha has arrived its already too late

rancid ruin
#

i'll help you if you paypal me #350

jade abyss
#

#350 to Chirs!

rancid ruin
#

i am chirs

jade abyss
#

I am Chirs!

rancid ruin
#

enjoy ban scrub

indigo snow
#

no i am spartacus

jade abyss
#

And there goes the typical "I am a lifer, i got no idea from anything and won't help anyone else but i want that problem solved for me because i am a simple minded derp"

little eagle
#

Who's Mari?

jade abyss
#

Mari-Jane

still forum
#

@jade abyss Can you ban people or do we need to wake up the allmighty?

jade abyss
#

Already poked =}

#

I HEREBY CALL YOU

#

ALL MIGHTYYYY

rancid ruin
#

honestly why would someone help you lol

peak plover
#

🤢

jade abyss
#

COME AND RELEASES US FROM THIS PAIN

#

OH ALLMIGHTY

#

*bows*

little eagle
#

I blame this on Trump.

open vigil
#

Bye Bye

rancid ruin
#

what an asshole

jade abyss
#

😂

peak plover
#

Actually autistic

jade abyss
#

👋 @Hyper4u#3154

#

See, it worked

indigo snow
#

Witch hunts are bad

jade abyss
#

Just call for the Allmighty

still forum
#

Thank you. Now I can go to bed

open vigil
#

🙇

jade abyss
#

And when allmighty got no time, @open vigil appears

#

😂

still forum
#

Huh? FM is allmighty 😮

jade abyss
#

No!

open vigil
#

Nah, just Omnipresent

little eagle
#

🔨 time

jade abyss
#

I think you missspelled impo... anyway

#

Back to other stuff =} hf girls o7

little eagle
#

189.2 hours in the last 2 weeks

#

13 and a half hours of Arma a day, anyone would go insane.

jade abyss
#

normal

peak plover
#

😂

open vigil
#

Only 13? 😉

jade abyss
#

5am

open vigil
#

See what I mean... 5 more minutes...8 hours later...

jade abyss
#

😄

open vigil
#

o7

jade abyss
#

o7

peak plover
#

What is o7

still forum
#

7o

#

@peak plover salut-e

jade abyss
#

o7 = o7

little eagle
#

salute

peak plover
#

\o7

#

😦

jade abyss
#

?! \ ?!

little eagle
#

8===D

still forum
#

\(O_O)/

jade abyss
#

Wrong arm

#

better^^

#

nasty dedmen

peak plover
#

\o7 - Dab on them lifers

jade abyss
#

Nigel

#

Could you do me a favor?

#

Like.. erm... jump from a roof or drown yourself?

peak plover
#

hahahaha

jade abyss
#

Is that a yes?

#

😂

peak plover
#

That's an affimritive 'sir

still forum
#

you mean... "dab your head in water" ?

#

😄

jade abyss
#

Good girl

little eagle
#

Guys guys!

#

b2t

jade abyss
#

if(getMentalState commy2 == "boring")then{for "_i" from 1 to 100000 do {slap Commy2}};

#

better?

still forum
#

if (getMentalState commy2 == "boring") then {while {alive commy2} do {slap commy2;}};

jade abyss
#

Even better!

#

Wait!

still forum
#

missing params

indigo snow
#

that command wouldnt have a get in sqf

#

minus style points

jade abyss
#
if (getMentalState commy2 == "boring") then
{
    while{alive commy2 } do
    {
        slapWithLargeTrout commy2;
    }
};
still forum
#

😄

jade abyss
#

uh, just wanted to test TAB in the Code Area

#

(TAB not Dab!)

still forum
#

reminds me of something that starts with m and ends in IRC

indigo snow
#

converts to 4 spaces
i see, discord

little eagle
#

Would I die first or would the while die first after 10k iterations?

jade abyss
#

Exactly, Dedmen =}

#

Does it matter?

#

Macrommy2

open vigil
#

I’m still awake....

still forum
#

That question is too meta

jade abyss
#

5am

still forum
#

me too

jade abyss
#

Same here, also awake

little eagle
#

mirc?!

jade abyss
#

Macrommy2 also

cunning nebula
#

almost

jade abyss
#

Tell your Brother to get ya a Coffee 😄

peak plover
#

_name = "commy";    // 1000 seconds

//vs

#define COMMY        (["commy"] param [0,"commy"])
private _name = COMMY;    // 0.0000000000000000000000000001 ms
#

Can you notice a difference ?

#

using macros and param will increase script execution time

cunning nebula
#

hmm coffee....

indigo snow
#

thats more zeros than floating points allow

little eagle
#

You need parenthesis around your macro if you use a binary command like param.

jade abyss
#

Badummmm

little eagle
#

bedankt

jade abyss
#

🤦

austere granite
#

superior language strikes once again

little eagle
#

Missing my Wehrmacht soldier emoji from Slack.

austere granite
#

🚳

#

never forget the bicyclecaust

astral tendon
#

how do i chage the music of the call BIS_fnc_endMission;?

astral tendon
#

i followed the wiki but the song still playing

#

["win",true,false,false] call BIS_fnc_endMissionServer;

#

this is my endind

subtle ore
#

can't

astral tendon
#

why...

subtle ore
#

¯_(ツ)_/¯

astral tendon
#

["win",true,true,false] call BIS_fnc_endMission;

#

this works

#

but this dosent

#

["win",true,true,false] call BIS_fnc_endMissionServer;

#

but what happens if i use the frist one only in a server?

subtle ore
#

Oh god I am facepalming so hard right now

astral tendon
#

dont hurt your face, i know i suck

subtle ore
#

Local versus Server

#

endMissionServer ends it on the server for everyone

#

the endMission ends it for anyone who is local to where it's being executed at

astral tendon
#

so if i put that on a trigger that means it going to work to everyone?

subtle ore
#

god damn it, again with the triggers? 🤦

astral tendon
#

they work ¯_(ツ)_/¯

subtle ore
#

You know that's a lie

wispy lynx
#

Hey all! So I have a script that spawns an AI unit and assigns waypoints for it to move around, but when the AI unit makes contact with an enemy, the AI unit will shoot a couple times, then continue moving to next waypoint. Question: How can I get the AI unit to advance/prosecute enemy contacts, then resume previous waypoints? I have set the AI unit's behaviour to "open fire" but that doesn't seem to change contact behavior.

rotund cypress
#

Does it not already do that automatically? If there is any issues on the way, it deals with that and then carries on? @wispy lynx

wintry eagle
#

I don’t know a terrible amount about scripting, but you could check out mods like VCOM AI and see how they’ve built it. They’ve done a decent job at beefing up the AI. @wispy lynx

cunning nebula
#

try using search and destroy waypoints

#

instead of move

rotund cypress
#

Too bad there is no AI eventhandlers 😦

wispy lynx
#

The AI unit moves around, but when it sights an enemy unit (player or another enemy AI) it will fire a couple of shots, then continue moving to next waypoint. It does not continue to engage or advance (unless the target is in the same direction as it's next waypoint). The assigned waypoints are Search and Destroy. Essentially it acts like it's more interested in waypoints than enemy contacts, despite having all behaviors directed at engaging any contact it encounters (setCombatMode "RED").

astral tendon
#

what about their group behavior?

#

usualy when they are on aware they already do that

wispy lynx
#

behavior and combat mode are set to "aware" & "RED".

#

is there a way to script a new waypoint for the ai unit when it makes contact, where the new waypoint is at the last known location of the enemy contact, I'm thinking a SAD waypoint, and then the AI unit returns to original waypoints when enemy is killed or the "inserted" SAD waypoint completes?

icy raft
#

Hmmm..... How the hell do I get a ctrl text color?

#

You can set it, but not get it 😦

tough abyss
#

@astral tendon You can.

#

Just take the BI function and modify it

astral tendon
#

you mean the actual file?

tough abyss
#

Yes

#

Copy it

#

modify it

tough abyss
#

@astral tendon Line 81:

_musicList = if (isnull curatorcamera) then {["EventTrack02_F_Curator","EventTrack01_F_Curator"]} else {["EventTrack02_F_Curator","EventTrack03_F_Curator"]};
zenith totem
#

Anyone got any ideas for a performance friendly way of parsing a string and replacing this with _target

fallow radish
#

Gday all 😃 I am looking for a good music intro script any one know of any?

zenith totem
#
playMusic "cfgMusic class"
fallow radish
#

add this to the init line correct>?

simple solstice
#

well you need to add the cfgmusic classname

fallow radish
#

all good got it working

#

activated by a trigger 😄

little eagle
timber ridge
#

@GeekGuy884 wait a sec... in your example, why not use a ternary op instead of if else ?

#

or wait, maybe I forgot that... oh dear, SQF does not support ternary op??

tribal crane
#

It doesn't need it, "if" is already an expression.

timber ridge
#

it's crappy in terms of syntax and takes way too much space for simple conditionals such as his

#

imagine this:
!!curatorcamera ? {["EventTrack02_F_Curator","EventTrack01_F_Curator"]} : {["EventTrack02_F_Curator","EventTrack03_F_Curator"]};

tribal crane
#

If it makes you feel better, "if" is actually a noise word; the engine could just take "BOOL then CODE" and "BOOL then ELSETHINGY".

timber ridge
#

or his example could be simplified to even:

_musicList = {["EventTrack02_F_Curator", isNull curatorCamera ? "EventTrack01_F_Curator" : "EventTrack03_F_Curator"]};

still forum
#

@Inlesco#5178 SQS has ternary op

timber ridge
#

@still forum amazing.

#

I never understood SQF's then keyword usage... is it because it's easier for the parser/interpreter or it's just a design choice for no actual reason other than making things different from most pop langs and practices?

still forum
#

It is required

#

Game has nulary,unary,binary commands.
so command variable variable
as if (condition) {code}
would be doesn't work.

#

binary commands are variable command variable

#

"would be doesn't work" ... What a genius

timber ridge
#

binary commands are named like that because [var comm var] is basically [0 1 0] where var = 0 & comm = 1 ? 😄

still forum
timber ridge
#

oh yeah, forgot. thx for the reminder.

cunning nebula
#

Too bad there is no AI eventhandlers :frowning:
Oh god, that would be so helpful.

tough abyss
#

there kind of is

#

if you look at the danger.fsm there are 9 "EventHandlers" which can be used to execute whatever you like based on what threat the AI is in

#

also there should be other stuff in the formation.fsm i think

timber ridge
#

@tough abyss but these EHs aren't exposed for any use externally, right? or can you somehow subscribe to them while they're inside Danger.fsm and others?

tough abyss
#

you can open the danger.fsm and add whatever you like to it

#

but agreed, some hooks would be neat in there, placed by BI so not every mod modifying the danger.fsm is overwriting the other

timber ridge
#

well, I guess @cunning nebula had public EHs in mind, not those isolated in some obscure AI behavior file

tough abyss
#

yea

timber ridge
#

I guess you can expose those private EHs from danger.fsm by only having access to C++ code of the game or can there somehow some hooks to be made by mods?

tough abyss
#

fsm contains just sqf and some structure markup stuff

#

one sec

#

one could add a small snippet in the danger.fsm that reads from a class where ppl could register their functions they want to be executed

timber ridge
#

@tough abyss so basically you have a class AiBehaviorHooks in ai_behavior_hooks.cpp which registers some methods which, if they exist, will be executed by danger.fsm if placed inside in its respective "states"?

tough abyss
#

that would be sort of the idea

#

but then, every mod that wants to use this system would need to be dependent on that AIhook mod

thick sage
#

How would I add a HighCommand programatically in SQF?

timber ridge
#

not sure how would that work, I'm not a CPP programmer, but it'd be an interesting approach to try.

#

I'm not sure how callbacks would work in this case, passing all of the args to the external class method...

tough abyss
#

for arma we can just define parameter classes which can be expanded upon by any addon, it's not really executable code in there

#

there is a predefined set of params those EH can deliver, it would make sense to pass all those to the called functions no matter if they need it

#

the functions then can define their inputs depending on what they need

torn juniper
#

@little eagle @tough abyss I had wanted to try and replicate the missileIncoming EH for AI to players to also fire for players firing a lock on rocket. Right now I can't find a solid method without bogging down with loops. Hence maybe being able to modify the EH with extended eventhandlers via CBA but I don't think it would be that cut and dry

tough abyss
#

is that EH really only for AI?

#

i kind of doubt that, but never used it before soo

torn juniper
#

Yea

#

:/

tough abyss
#

are you sure its not only a locallity problem?

torn juniper
#

Same code works for ai but not players

tough abyss
#

i've never heard of EHs threating AI or players diffrently

#

with players you are always in MP and the player firing is never local to your machine

torn juniper
#

Ill give it another shot tomorrow but it specifically says AI in EH description

tough abyss
#

while AI can very well be

torn juniper
#

Triggered when a guided missile locked on the target or unguided missile or rocket aimed by AI at the target was fired.

thick sage
#

e.g, would this work?

hc1 = "HighCommand" createVehicle [0,0,0];
hc2 = "HighCommandSubordinate" createVehicle [0,0,0];

hc1 synchronizeObjectsAdd [hc2];
hc2 synchronizeObjectsAdd [hc1];


player synchronizeObjectsAdd [hc1]; 
hc1 synchronizeObjectsAdd [player];

player hcSetGroup [squad];
torn juniper
#

Seems odd that its AI only though - Hence why I was wondering if there was configs somewhere

#

That I could look at the eh code

tough abyss
#

i think EHs are pure engine c++

still forum
#

Never used High Command. Don't even know how the modules work

#

@tough abyss yes

torn juniper
#

Thought so

still forum
#

Besides scriptedEventHandlers

torn juniper
#

😦

#

Ill do more testerinos tomorrow

tough abyss
#

i think it could be worth, it would baffle me if it was for AI locks only

still forum
#

nothing AI in there tho

#

You can just insert your own scriptedEH's into danger.fsm and just call them though

#

but you will need to overwrite danger.fsm

tough abyss
#

see a few messages above 😛

still forum
#

👍

torn juniper
#

Ill have to recheck it

#

I hope I got it wrong vs not working for players

#

Would make it easier lol

tough abyss
#

i mean isn't the incoming sound played for player fired missiles too?

#

and shown on the radar aswell

cunning nebula
torn juniper
#

Looking for a solution for all vehicles

cunning nebula
#

@torn juniper what are you trying again ?

torn juniper
#

missileIncoming EH for players

cunning nebula
#

to warn the player of missiles ?

tough abyss
#

@cunning nebula may add those "EHs" from the danger.fsm

comment "1  DCFire";
comment "2  DCHit";
comment "3  DCEnemyNear";
comment "4  DCExplosion";
comment "5  DCDeadBodyGroup";
comment "6  DCDeadBody";
comment "7  DCScream";
comment "8  DCCanFire";
comment "9  DCBulletClose";```
cunning nebula
#

oh now i get it

torn juniper
#

Wiki says its AI only, I tested and it only worked for AI, hope it was an error vs not working

cunning nebula
#

an EH that fires when a player uses missiles ?

torn juniper
#

Yea

#

At something, via lockon

#

Not just fired, I could use fired eh for that

cunning nebula
#

hmm you just need a command to know what the weapon is locked on to

torn juniper
#

If the eh doesnt work for players, yea

#

😦

tough abyss
#

to add a minor explenation, those "EHs" are DangerCauses (DC) which can be used in the danger.fsm to make AI react diffrently to those situations

#

would be neat to expose those to nativ SQF

cunning nebula
#

interesting

still forum
#

So you can receive the EH's inside danger.fsm but not in normal sqf?

thick sage
#

I am getting an error in the High command module when I change the side of the player. How would I read the code of the HC module to understand if there is anything I can do to fix it?

timber ridge
#

@tough abyss perhaps you've got some time to make a prototype for the aforementioned extended AI EH hooks from danger.fsm?

#

pseudocode would surely be enough, so others can follow and maybe contribute themselves

still forum
#

If you get an error it probably shows you the file the error is in right? Just view that file @thick sage

thick sage
#

A3\modules_f\hc\data\scripts\HC_GUI.sqf. How would I go to this file? Is it on a pbo, or just somewhere on the computer?

still forum
#

pbo

#

modules_f ...

#

Did you never unpack a Pbo?

thick sage
#

Only on the operation flashpoint.

#

way back

#

but, I got it, thanks.

tough abyss
#

@still forum they are not real EHs in the danger.fsm but the danger.fsm gets the dangercause as input by the engine which then can be used inside the danger.fsm

#

but you can see how its setup here

#

@timber ridge could you remind me in the evening? currently in the office

timber ridge
#

@tough abyss sure, but I guess there's a functionality on discord to set a reminder in X hours just like on Slack, no?

tough abyss
#

no idea 😄

peak plover
#

need a not for that

#

bot

timber ridge
peak plover
#

You can just create your own server for free and have all the bots there

#

There's actually some decent music bots etc. So you can listen to youtube on the phone with screen off

tough abyss
#

that would be inside the danger.fsm

#

inside that class are functions listed which are executed, any mod can add functions to that class

#

the input params are just given into those functions as they come by the engine from the danger.fsm

#

that would enable AI mods to coexist

#

right now any AI mod changing the danger.fsm is killing the one loaded before

icy raft
#

Help! I'm freaking disabling serialization but it still gives me error and controls don't get created (?)

file: fn_diag_SelectionScreen_init.sqf
called by: onLoad

`
#include "..\IDD.h"
#include "..\IDC.h"

disableSerialization;

_display = (findDisplay IDD_SELECTIONSCEEN);

_policeOverlay = _display displayCtrl IDC_SELECTION_SCREEN_OUTLINE_POLICE;
_civOverlay = _display displayCtrl IDC_SELECTION_SCREEN_OUTLINE_CIVILIAN;
_medOverlay = _display displayCtrl IDC_SELECTION_SCREEN_OUTLINE_MEDICAL;

ctrl_policeExtraGlow = _display ctrlCreate ["RscPicture", IDC_SELECTION_SCREEN_OVERLAY_GLOW_EXTRA + 1];
ctrl_civExtraGlow = _display ctrlCreate ["RscPicture", IDC_SELECTION_SCREEN_OVERLAY_GLOW_EXTRA + 2];
ctrl_medExtraGlow = _display ctrlCreate ["RscPicture", IDC_SELECTION_SCREEN_OVERLAY_GLOW_EXTRA + 3];

ctrl_policeExtraGlow ctrlSetText "glow_single.paa";
ctrl_civExtraGlow ctrlSetText "glow_single.paa";
ctrl_medExtraGlow ctrlSetText "glow_single.paa";

ctrl_policeExtraGlow ctrlSetPosition (ctrlPosition _policeOverlay);
ctrl_civExtraGlow ctrlSetPosition (ctrlPosition _civOverlay);
ctrl_medExtraGlow ctrlSetPosition (ctrlPosition _medOverlay);

ctrl_policeExtraGlow ctrlSetTextColor [1,0,0,1];
ctrl_civExtraGlow ctrlSetTextColor [0,1,0,1];
ctrl_medExtraGlow ctrlSetTextColor [0,0,1,1];

ctrl_policeExtraGlow ctrlCommit 0;
ctrl_civExtraGlow ctrlCommit 0;
ctrl_medExtraGlow ctrlCommit 0;
`

What the hell am I doing wrong?

#

It still give me the NAMECONTROL doesn't support serialization error

#

Jelp

still forum
#

is that the whole scriptfile?

icy raft
#

That's the whole script file

#

It's called from a Display with an onLoad EH on it's root

#

Called from onLoad = "_this call PL_fnc_diag_ScreenSelection_init";

#

the IDC_WHATEVER are macro defines in the headers

still forum
#

uhm

#

why do you pass _this?

icy raft
#

Just in case. It theoretically passes the caller Display, but it passed a controlNull for whatever reason (display still gets created with everything correct though)

still forum
#

"just in case"

#

Yes.. it passes a display. And you can't do that without disableSerialization

#

Also.. if you don't pass _this.. it will still pass _this. But without error

icy raft
#

I have disableSerialization put in there, but gets ignored and gives error on any control.

still forum
#

no it doesn't

#

You pass a display to the call before you call disableSerialization

#

the _this is a display

#

Do you know how variable scopes work in SQF?

icy raft
#

Yep

still forum
#
_myVar = "test";
call {
//you can access _myVar in here
};

right?

icy raft
#

But I'm not getting the error in the function params params

#

My first error is in _policeOverlay = _display displayCtrl IDC_SELECTION_SCREEN_OUTLINE_POLICE;

#

Sorry

#

No

#

It's in ctrl_policeExtraGlow = _display ctrlCreate ["RscPicture", IDC_SELECTION_SCREEN_OVERLAY_GLOW_EXTRA + 1];

still forum
#
_this = "test";
call {
//so.. can you access _this here?
};
icy raft
#

@still forum _this get's overriten with nil

still forum
#

no it doesn't

icy raft
#

The thing is, I'm not using _this for anything

still forum
#

Why do you pass it then?

#

remove the _this

icy raft
#

Just removed _this, same exact error

#

_this is there cos I forgot about it

still forum
#

Good. Step 1 done 😄

icy raft
#

Because I was using it before, not anymore

still forum
#

I think your problem is that you are saving into a global variable

icy raft
#

Not any impact....

still forum
#

Do you really need these as globals ?

still forum
#

Uhm...

#

Why didn't you say that directly?

icy raft
#

I prefer them that way, so I can manipulate them more easily

still forum
#

Well. as the message says you can't.

#

You can however store them in an array

icy raft
#

uiNamespace set/getVariable thing then?

still forum
#

says uiNamespace doesn't work

#

but array works

icy raft
#

Gonna give it a go to the array thing

#

Alrighty, serialization problem dealt with

#

Now... Not a single control gets created

#

Updated file:

`
#include "..\IDD.h"
#include "..\IDC.h"

disableSerialization;

_display = (findDisplay IDD_SELECTIONSCEEN);

_policeOverlay = _display displayCtrl IDC_SELECTION_SCREEN_OUTLINE_POLICE;
_civOverlay = _display displayCtrl IDC_SELECTION_SCREEN_OUTLINE_CIVILIAN;
_medOverlay = _display displayCtrl IDC_SELECTION_SCREEN_OUTLINE_MEDICAL;

ctrl_selectionScreenGlow = [];
ctrl_selectionScreenGlow pushBack (_display ctrlCreate ["RscPicture", IDC_SELECTION_SCREEN_OVERLAY_GLOW_EXTRA + 1]);
ctrl_selectionScreenGlow pushBack (_display ctrlCreate ["RscPicture", IDC_SELECTION_SCREEN_OVERLAY_GLOW_EXTRA + 2]);
ctrl_selectionScreenGlow pushBack (_display ctrlCreate ["RscPicture", IDC_SELECTION_SCREEN_OVERLAY_GLOW_EXTRA + 3]);

(ctrl_selectionScreenGlow select 0) ctrlSetText "glow_single.paa";
(ctrl_selectionScreenGlow select 1) ctrlSetText "glow_single.paa";
(ctrl_selectionScreenGlow select 2) ctrlSetText "glow_single.paa";

(ctrl_selectionScreenGlow select 0) ctrlSetPosition (ctrlPosition _policeOverlay);
(ctrl_selectionScreenGlow select 1) ctrlSetPosition (ctrlPosition _civOverlay);
(ctrl_selectionScreenGlow select 2) ctrlSetPosition (ctrlPosition _medOverlay);

(ctrl_selectionScreenGlow select 0) ctrlSetTextColor [1,0,0,1];
(ctrl_selectionScreenGlow select 1) ctrlSetTextColor [0,1,0,1];
(ctrl_selectionScreenGlow select 2) ctrlSetTextColor [0,0,1,1];

(ctrl_selectionScreenGlow select 0) ctrlCommit 0;
(ctrl_selectionScreenGlow select 1) ctrlCommit 0;
(ctrl_selectionScreenGlow select 2) ctrlCommit 0;
`

#

Execute (while display shown): hint str ((ctrl_selectionScreenGlow select 0) isEqualTo controlNull);

Output: true

hint str (ctrl_selectionScreenGlow select 0);

Output: No control

#

FIXED!!!

little eagle
icy raft
#

Everything works 😄

little eagle
#

Making it public helps 🤦

little oxide
#

@little eagle A select in line 26, and check if array is not empty, can make it more optimized ?

little eagle
#

You mean L16?

little oxide
#

Inside the waituntil

little eagle
#

Which array can be empty? I don't follow.

little oxide
#

When you checking if the player are connected in game with the allPlayers variable,You using a forEach

I think a select is a little bit more fast

still forum
#

I guess checking if the array is empty. Instead of forEaching. Which no. It's not faster. forEach does that internally too.

little eagle
#
private _unit = allPlayers select {getPlayerUID _x == _uid} select 0;
!isNil "_unit"
#

Like this?!

little oxide
#

Yeah for example

little eagle
#

Imo this one looks prettier, but it doesn't have the exitWith, so it always iterates through all players and doesn't stop when it finds one.

#

It's scheduled, so meh.

fallow radish
#

anyone here used ZBE caching script before? know how to get rid of the debug in top right corner?

cunning nebula
#

3. Set desired options in userconfig (\Arma 3\userconfig\zbe_cache\zbe_cache.hpp)

#

i'd look there

fallow radish
#

@cunning nebula I am using the script version

cunning nebula
#

so ?

#

that doesn't make the variables any different

#
zbe_aiCacheDist = 1000; //At what distance is AI cached/uncached?
zbe_cache_debug = 1; //Debug hint/RPT? 1 on 0 off
zbe_vehicleCacheDistCar = 100; //At what distance should empty cars be cached?
zbe_vehicleCacheDistAir = 1000; //At what distance should empty aircraft be cached?
zbe_vehicleCacheDistBoat = 1000; //At what distance should empty boats be cached?
zbe_minFrameRate = -1;//If the FPS drops below this number, then prevent AI from uncaching. -1 is for suggested setting (if (isDedicated) then {_fps = 15} else {_fps = 30};).
#

set zbe_cache_debug to 0

fallow radish
#

cheers

little eagle
#

But does yours work, @cunning nebula Curator_F is no class in A3, modules need createUnit, not Vehicle and you have waitUntil in unscheduled environment.

cunning nebula
#

who said I'm creating a module ?

#

😉

#

don't need no module

little eagle
#

Also _player is an array and not an object. It seems to me that your code has the right ideas, but doesn't work atm.

cunning nebula
#

could be, i wrote it at work a while ago, havent really tested it

little eagle
#

See? I tested mine and it works.

#

I based it on yours.

#

don't need no module
But the curator logic is required and it is a module. I don't see how you can circumvent these hard coded requirements.

cunning nebula
#

far as I know, zeus just needs a curator entity

#

I never had to create a module for that

#

and that part I have tested before

little eagle
#

The curator entity / logic has the classname ModuleCurator_F and doubles as the editor module.

little eagle
#

What about the other issues? sleep in unscheduled?

#

Mine works, maybe curator_f also works. Will test and report later.

cunning nebula
#

im sure yours works

#

curator_f however does work

#

that much I know for sure

#

the rest is the result of a lack of coffee

#

😉

little eagle
#

Yeah, there would be two ways and I like curator_f more (no group).

fallow radish
#

zbe_aiCacheDist = _this select 0;
zbe_minFrameRate = _this select 1;
zbe_debug = _this select 2;
zbe_vehicleCacheDistCar = _this select 3;
zbe_vehicleCacheDistAir = _this select 4;
zbe_vehicleCacheDistBoat = _this select 5;

little eagle
#

But there still other issues.

#

there're

fallow radish
#

main.sqf

#

I dont believe I need the addon if I am using the script correct?

cunning nebula
#

thats the whole point of the script-version, right ?

fallow radish
#

correct

#

I dont see the options in the script version to disable debug

cunning nebula
#

well

#

how do you run the script ?

fallow radish
#

I have also tried adding zbe_cache_debug = 0; inside of the main.sqf

#

init

cunning nebula
#

sure but how exactly

#

the line

fallow radish
#

if (isServer) then {[1000,-1,true,100,1000,1000]execvm "zbe_cache\main.sqf"};

cunning nebula
#

good, then simply change true to false

fallow radish
#

ahr rgr 😄

#

@cunning nebula thanks buddy

astral tendon
#

my brain farted, i forget how to make this script work, can you guys help me in this one?

distant egret
#

Use _x ?

astral tendon
#

i did, still gives error

distant egret
#

Show your new code

#

Also you end with a ]

astral tendon
#

the hole code is this

#
_car = _this select 0;
if ({!alive _driver}) then {moveOut _x forEach _crew;}];```
#

im trying to figure it out

robust hollow
#

where is _crew defined

#

or _driver...

#

or the end } on ur foreach

#

({!alive _driver}) why the {}?

little eagle
#

if expects BOOL, not CODE.
forEach needs CODE.
_crew undefined
_driver undefined

#

3 opening { and only 2 closing }

subtle wigeon
#

ok i have gotten rid of the function with the help of pierremgi

#

if (!isDedicated) then {

[] spawn {

    while {true} do {
    
    _allAIUnits = allUnits select {_x distanceSqr getpos player < 900};  
        if (count _allAiUnits > 0) then {{
            if( side player == side _x && alive _x && group _x != group player && leader player == player && _x isKindOf "Man" && vehicle _x == _x && (leader _x != _x || count (units group _x) == 1) ) then {
                if(isNil {_x getVariable "sa_join_squad_action_id"}) then {
                    _actionId = _x addAction ["Join My Squad", { 
                        if(isNil {(_this select 0) getVariable "sa_original_group"}) then {
                            (_this select 0) setVariable ["sa_original_group",group (_this select 0)];
                        };
                        [_this select 0] join player; 
                        (_this select 0) removeAction (_this select 2);
                        (_this select 0) setVariable ["sa_join_squad_action_id",nil];
                    }, nil, 0, false];
                    _x setVariable ["sa_join_squad_action_id",_actionId];
                };
            } else {
                if(!isNil {_x getVariable "sa_join_squad_action_id"}) then {
                    _x removeAction (_x getVariable "sa_join_squad_action_id");
                    _x setVariable ["sa_join_squad_action_id",nil];
                };
            };
#

if( side player == side _x && alive _x && group _x == group player && leader player == player && _x isKindOf "Man" && vehicle _x == _x && _x != player ) then {
if(isNil {_x getVariable "sa_leave_squad_action_id"}) then {
_actionId = _x addAction ["Leave My Squad", {
if(!isNil {(_this select 0) getVariable "sa_original_group"}) then {
[_this select 0] join ((_this select 0) getVariable "sa_original_group");
(_this select 0) setVariable ["sa_original_group",nil];
} else {
[_this select 0] join grpNull;
};
(_this select 0) removeAction (_this select 2);
(_this select 0) setVariable ["sa_leave_squad_action_id",nil];
}, nil, 0, false];
_x setVariable ["sa_leave_squad_action_id",_actionId];
};
} else {
if(!isNil {_x getVariable "sa_leave_squad_action_id"}) then {
_x removeAction (_x getVariable "sa_leave_squad_action_id");
_x setVariable ["sa_leave_squad_action_id",nil];
};
};

        } forEach _allAiUnits;
        sleep 10;
        };

    };

};

};

#

still getting a not declraed error

cedar kindle
#

use code tags or even better pastebin

astral tendon
#
_car = _this select 0;
if (!alive driver _car) then {{moveOut _x} forEach crew _car}
}];
#

now i made that work

#

god i hate when my brain decide to stop working

little eagle
#

All you need is practice for 1 to 36 months.

astral tendon
#

And allot of coffe

simple solstice
#

And a working brain

#

Also, patience

subtle wigeon
little eagle
#

_x distanceSqr getpos player

#

Why not:

#

_x distanceSqr player

#

?

#

Seems unnecessarily complicated considering you could just add the action to the player and avoid the removeAction and the loop all together by checking the cursorTarget.

subtle wigeon
#

example? trying to improve this script, as it stopped working after last update

little eagle
#

I'll write something...

subtle wigeon
#

thank you very much

#

here is another version Pier and GOM helped with but still couldnt get to work

cunning nebula
#

@astral tendon dont use moveOut, at least not alone

#

also unassign them from the vehicle

astral tendon
#

why?

cunning nebula
#

because otherwise they might try to get back in

#

its still assigned to them

#

in your situation a simple leaveVehicle command would probably do

astral tendon
#

the truck is locked

cunning nebula
#

if that is quick enough

#

ah

#

I'd still do it

#

@subtle wigeon that just a script to allow you to recruit units ?

subtle wigeon
#

Yes, correct. It allows you to recruit and dismiss units

cunning nebula
#

its much more complex than necessary and rather bad for performance.

#

addAction allows you to include a condition

#

that way you wont need that loop

subtle wigeon
#

this something pier and gom hlped me with

little eagle
#

I have not tested this...

cunning nebula
#

aye, that is a much cleaner solution

subtle wigeon
#

I just cant figure how to make it work, meaing I am not sure if i out the bits of code in the right places

#

commy2 Thamks going to test now. If i understand.

#

// postInit / initPlayerLocal.sqf

#

this means place in player local init, must be ran post init?

little eagle
#

You put it either in initPlayerLocal or any postInit = 1 function.

#

Dun't matter. All it needs is player to be not null still.

subtle wigeon
#

this will work with mulitplater and dedicated sever, as that is where it will be going

little eagle
#

Yes, it's supposed to work in MP.

#

As I said, untested, cause this laptop doesn't run Arma. :/

subtle wigeon
#

lo,l, testing right now

cunning nebula
#

hmm @little eagle I think your version would allow him to recruit buildings 😉

little eagle
#

Didn't know there are buildings on WEST side.

cunning nebula
#

don't see any side checks there

little eagle
#

Right. Oh, well forgot about it.

cunning nebula
#

what is the isNil for btw ?

tough abyss
little eagle
#

Hatred and the will to dominate (unscheduled environment)

cunning nebula
#

isn't the condition unscheduled by default ?

little eagle
#

The statement in addAction is scheduled, the condition is unscheduled.

cunning nebula
#

ah right, looked at the wrong part of it

little eagle
#

side check should be added, as well as isKindOf CAManBase to not have the action show on vehicles. But doing that is easy once the thing is working.

cunning nebula
#

though im not sure if that is needed

#

why does the action have to happen superfast ?

little eagle
#

I don't trust doing group checks, then have the script suspend for a second and then have the join when the condition could've been flipped to false already.

#

This is why the arsenal mission errors on low fps and why the config viewer errors on low fps... You get tired of unreliable code after a while.

cunning nebula
#

oh yeah, in case the soldier suddenly turns into a building when you use the action. good point

little eagle
#

Haha, I like you.

cunning nebula
#

you never know 😉

little eagle
#

Exactly!

cunning nebula
#

and I thought I had addActions completely figured out by now ^^

subtle wigeon
#

no

#

addMissionEventHandler ["entityRespawned", {
  _unit = _this select 0;
  if (local _unit && isPlayer _unit) then {
   call "function of choice"
  };
}];

#

needs to be used

little eagle
#

What for?

subtle wigeon
#

dedicated and mulit enviroment

little eagle
#

What does it do?

subtle wigeon
#

it would call the squad join script or function when plyers respawned

#

as of now when I die with your script it doesnt work when i respawn

little eagle
#

You mean add the action to the respawned player?

subtle wigeon
#

yes sir

cunning nebula
#

addactions die with you

little eagle
#

This should remedy the issue.

subtle wigeon
#

will test

tough abyss
#

Just as I was about to add my own 😄

little eagle
#

Don't trust the Frenchie.

#
+scopeName "Main";
+private _fnc_errorAndClose = {
+    params ["_msg"];
+    deleteVehicle _logic;
+    [_msg] call EFUNC(common,displayTextStructured);
+    breakOut "Main";
+};

breakOut lol

subtle ore
#

dirty cba developer

distant egret
#

About a week ago @cunning nebula posted some code for spawning Zues mid game, but I'm getting an error with it.`
18:47:27 UnExpected call of CreateVehicle for 'curator_f', pos(0.000000.2,10.005997.2,0.000000.2). Vehicles with brain cannot be created using 'createVehicle'!
This was the Code:


addZeusEH = addMissionEventHandler ["PlayerConnected", {
    params ["_id","_uid","_name","_jip","_owner"];
    private ["_cur"];
    if !(_uid in zeusuids) exitWith {};
    waitUntil {
        sleep 1;
        ({_uid isEqualTo getPlayerUID _x} count allPlayers) > 0
    };

    _player = allPlayers select {_uid isEqualTo getPlayerUID _x};
    _cur = "curator_f" createVehicle [0,0,0];
    _cur addCuratorAddons activatedAddons;
    _player assignCurator _cur;
    _cur addCuratorEditableObjects [allMissionObjects "all",false];
    _player setVariable ["cur",_cur,true];

}];
removeZeusEH = addMissionEventHandler ["HandleDisconnect", {
    params ["_unit","_id","_uid","_name"];
    deleteVehicle (_unit getVariable ["cur",objNull];)
}];```

I'm currently just testing with ``testCur = "Curator_F" createVehicle [0,0,0];`` But I'm getting the above error. Am I missing something or?
Thanks.
little eagle
#

I also had issues with what he made, so I wrote this instead base on it ^

distant egret
#

thx

#

idk how it works for him though then xD

little eagle
#

It can't honestly. He's using sleep and waitUntil in unscheduled environment.

#

_player = allPlayers select {_uid isEqualTo getPlayerUID _x};
And this line reports an array, not the player.

distant egret
#

true... didn't see that...

#

Yea I just gisted it last week and wanted to test it today so xD

#

but thx for your gist

little eagle
#

I really like the idea of perpetuating repetitive tasks like this in gists and building a knowledge of SQF howto's.

distant egret
#

But a "Curator_F" needs to be created by server right?

#

Or does it not matter

little eagle
#

I think it's ModuleCurator_F, not Curator_F, but I have no explanation of why both exists as game logics.

distant egret
#

ah yea ModuleCurator_F

little eagle
#

The code I posted spawns them on the server and they then get transferred to the client by using assignCurator.

distant egret
#

yea and when client disconnects he removes them

little eagle
#

Curator logics are always local to their assigned player.

#

Yup, cleanup.

#

You could also create one at the start of the mission for every white listed id. But I guess this is better? I don't know. It shouldn't really matter.

distant egret
#

idk if they will appear on the role sheet?

little eagle
#

The modules? Doubt it. They're sideLogic and not civilian or any other playable side.

distant egret
#

true yea.

little eagle
#

They're also not playableUnits or whatever the command is.

distant egret
#

ah Target Exec doesn't like // just noticed.

little eagle
#

Yeah, it also doesn't report the return value. TargetExec is from CBA and was made before the recent changes to the debug console.

distant egret
#

Yea but the server exec was from BI them self right?

#

same for global

#

so I thought you guys use the same mechanics.

little eagle
#

Yea but the server exec was from BI them self right?
Yes.

#

so I thought you guys use the same mechanics.
Well Pabst did, until the BI ones were changed.

loud python
young current
#

you should always ask <INSERT PREFERRED SEARCH ENGINE> first anyway. 😜

loud python
#

but now I am having a different problem

#

I want a soldier to sit on a wall with the "InBaseMoves_SitHighUp1"

#

but he just hovers above the wall

#

any idea how I could fix that?

still forum
#

setPosASL him further down

loud python
#

no easier option?>

#

when I place him into the wall in eden editor he just pops back up

still forum
#

this setPosASL ((this getPosASL) vectorAdd [0,0,-0.2])

#

Don't know how to disable snapping.. But I'd guess there is some way

loud python
#

now he falls to the ground

little eagle
#

attachTo?

loud python
#

would require finding the wall first

#

too much work for just one animation

#

I guess I'll just remove that guy xD

#

thanks for the help anyway

still forum
#

if he sits still -> disableSimulation

loud python
#

I'll try that

#

now he's completely frozen xD

still forum
#

exactly

#

But is he still in his animation pose?

loud python
#

I didn't expect it to look that awkward

still forum
#

😄

astral tendon
#
      <cFC8932>Commanders Intent:<-co>  Prevent any disturbances that may interrupt food delivery. Prevent civilian casualties.
      <cFC8932>Concept of Operation:<-co>  Platoon 3 will deploy by boat along with UNOSOM personnel to the food distr. point where they will secure a perimeter and maintain order.   
      <cFC8932>Coordinating instructions: <-co>  Command will coordinate with UNOSOM Cmdr.```
#

what kinda of text is that?

#

those code and stuf?

little eagle
#

Looks like hex rgb colors to me.

#

FC8932