#arma3_scripting

1 messages · Page 593 of 1

exotic flax
#

So I don't understand what I've done wrong caz as far as I'm aware I've done everything correct...
I pointed out what is wrong and why... And the wiki gives all the information needed, although reading and understanding it are 2 different things.

winter rose
#

@onyx sun you should also use the -showScriptErrors exe flag (or Launcher option) to see the errors the game reports in real time

exotic flax
#

But if I understand your example correctly you want to teleport all people in a trigger to a random position (defined by R1 to R5, which I assume are marker names):

// set list with marker Names
_location = selectRandom ["R1", "R2", "R3", "R4", "R5"];
{
   // move _x (player object in thisList) to marker position
   _x setPos getMarkerPos _location;
} forEach thisList;
onyx sun
#

@winter rose thanks i didnt even know that was a thing
@exotic flax Thanks for that im still learning heaps coding in general apologise if i was abrupt before. i was getting rather frustrated with it but thanks heaps.

final storm
#

is there any way to change drivingWheel value in a script?

exotic flax
#

drivingWheel value
???

final storm
#

I want to change the steering direction of a car once the player gets out of it

#

not sure if this is the right place to ask sorry

exotic flax
#

well, you ask for a scripted solution, so it's the correct place

#

although I don't think there's a script/command/function for it

final storm
#

Ok thanks

flat elbow
#

mmh i am trying to fiddle with binarizing a PBO, i open the folder with addon builder and do the stuffs, it says success but the final PBO miss some files, i am puzzled

#

ok it seems there's a not complete list of files included by default in the options

gloomy aspen
#

Could anybody elaborate on this for me? Ive been searching the BIKI for hours and cant find what im after

this addEventHandler ["HandleDamage", {_this select 0}] call ACE_captives_fnc_setHandcuffed;}]; this allowdamage false;

This didnt work,

The idea, is to have it so when an AI is shot (on a dedicated server) they A.) Take no damage and B.) Surrender

digital hollow
#

Your braces and brackets are all messed up.

radiant nimbus
#

And fill it with a new map

#

Got an inspiration... But can't test it yet

ebon citrus
#

@gloomy aspen

this addEventHandler ["HandleDamage", {[_this select 0, true] call ACE_captives_fnc_setHandcuffed; false;}];```

If im not entirely wrong
#

Also, you might want to use

ace_captives_setSurrendered instead of handcuffed

still forum
#

afaik handleDamage expects a number, not a boolean

glass zinc
#

(200 - (200 / 1.6 ) = 75) How do i get the other side of this equation without having to repeat the calculation? IE the 125

winter rose
#
private _value1 = (200/1.6);
private _value2 = 200 - _value1;
```like this? @glass zinc
glass zinc
#

ah that would work thanks

vague geode
#

Is there a way to supress certain log entries/log messages from being put into the logs or give them a certain cooldown after which another entry/message of the same kind can be put in there? I am asking because I have a bunch of Server: Object 2:15801 not found (message Type_169) and Server: Object 2:10717 not found (message Type_274) entries in my server logs but no clue what they are, what causes them nor how to prevent these "errors" from happening and they don't seem to cause any problems in the mission itself but my log files get ridiculously large (>250MB) which one, makes is hard to look through them to find anything but those messages and two, may cause problems itself e.g. with the performance.

winter rose
#

no - but you can stop logs entirely through a launcher option @vague geode

#

or, iirc, the -noLogs option

vague geode
#

@winter rose Yeah, I know that but that way I couldn't see if anything else has/causes an error. Do you have any idea what those entries mean or what is causing them?

winter rose
#

not really no. Maybe I could make a tool to filter log messages, if this tool doesn't exist already

vague geode
#

Dedmen, you were very helpful in the past so if you read this maybe you have any wild guesses on what these log entries mean or what their cause is?

still forum
#

I explained them on BIF a few days ago

vague geode
#

Do you have a link so that I can take a look?

still forum
#

no, some of my recent posts somewhere

ebon citrus
#

@still forum false is usually understood by most logic as 0

#

I remember having used it in evenhandlers before as replacement for 0

#

And if 0 cant be replaced by false in sqf in logic, then there is room for improvement

austere granite
#

parseNumber(false)

ebon citrus
#

That's just extra

austere granite
#

Better to it extra on the SQF side

#

Than just doing constant checks

ebon citrus
#

Booleans are smaller than any useful integer

#

That's why passing a boolean is always better than 0 or 1

#

0 = false
1 = true

#

Because that's literally the binary value of them

#

0000 0000 = 0 = false

#

0000 0001 = 1 = true

#

N8t exactly an equal

#

As booleans are one bit

#

Not a byte

still forum
#

false is a completely different datatype

#

i know how usual programming works, but I also know how SQF works

ebon citrus
#

But converting a boolean to an integer happens seamlessly

winter rose
#

not in SQF

still forum
#

and SQF numbers are float, not int

ebon citrus
#

So that's an oversight by the developers

still forum
#

quite sure thats intentional

ebon citrus
#

Then it's a stupid way of doing it

#

Cannot think of a single reason not to have them be interchangeable

austere granite
#

so

winter rose
#

strict mode ¯_(ツ)_/¯

austere granite
#

handleDamage expects a number of damage to return

ebon citrus
#

You can pass 1 for true and 0 for false, right?

austere granite
#

like 0.1

winter rose
#

no

ebon citrus
#

While 1?

austere granite
#

or 0.2

still forum
#

Returning "false" from a piece of code that should return the amount of damage from 0-1 doesn't make much sense does it?

ebon citrus
#

Really?

still forum
#

How much damage? False!
no. How much == number

austere granite
#

Yes unless it's been changed and Im retarded?

ebon citrus
#

False = 0

vague geode
#

I think I found it. It's the following one, isn't it? https://forums.bohemia.net/forums/topic/229614-zues-spawned-objects-error/?tab=comments#comment-3410185

Do you have any tips how to fix it? Is there anything I can write into their init field to stop that from happening?
My mission is a Warlords mission and I guess those log entries are caused by the vehicles and NPCs I have placed and synced to the warlords sector or warlords resonse team modules now since they only spawn once the sector they are linked to (or a neighbouring sector in case of the response teams) gets targeted.

ebon citrus
#

It literally means no

austere granite
#

But im 99% sure handleDamage is a float of damage to return

still forum
#

yes that looks like it

ebon citrus
#

How much damage? No

winter rose
#

False = 0
@ebon citrus no, for the last time! 😅

austere granite
#

Which is a terrible way to do it

#

Because you're not just asking "yes or no" with that return

still forum
#

It literally means no
"How much damage do you want to receive?"
"no"
what?

austere granite
#

You're asking a float value

#

How much damage do you want to receive?... YES

ebon citrus
#

It doesnt matter

austere granite
#

Yes it does

winter rose
#

*boom*

still forum
#

It does though

ebon citrus
#

False is always 0

austere granite
#

It's not always 0

winter rose
#

not in SQF, so nope

still forum
#

no

winter rose
#

false is false, 0 is 0

ebon citrus
#

What is the binary representation of 0?

#

What is the binary representation of false?

#

I rest my case

austere granite
#

its 0.0

winter rose
#

O.O

still forum
#

What is the binary representation of false?
in SQF?
8 byte vtable ptr
4 byte refcount
4 byte padding
1 byte bool

winter rose
#

e.g 0 == false is not permitted in C#

still forum
#

Neither in Java nor in Go
in lua 0 == false is false

winter rose
#

while in JS…

#

let's not talk about that

exotic flax
#

don't ask PHP

austere granite
#

Maybe there's a node.js package to determine if 0 is false with javascript (I dont know JS, i just know the hilarious "is_even" packages with a metric somethingload of downloads

#

Anyway the <bleep> do i know, but I think in general it's just bad to just false/true as return when it's a function that actually handles a float value

radiant nimbus
#

I need to write massive amount of coordinates to a text file, atm I'm using diag_log but it's not as fast as I would like. Does any other way come to anyone's mind

#

Basically I'm making a height map of the entire map

still forum
#

wow I just answered that a few hours ago

#

just need to remember where

rare sigil
#

anyone know how to set the camera bank (roll) in a script? I can't seem to find this option

winter rose
#

camSetBank/camPrepareBank are non-functional indeed

#

you could use setVectorUp

brave jungle
#

BIS_fnc_UnitPlay stops if the unit dies correct?

winter rose
#

I believe so

brave jungle
#

I think it does too was just making sure its been a while since i've made a mission

#

😄

rare sigil
#

thanks Lou, i'll give it a try

gloomy aspen
#

@ebon citrus Thank you! Your script works in SP, but theres a really weird side effect ...

In any mission where that script is in the unit ini, on a dedicated server the playable character slots are removed entirely? I have no idea how to troubleshoot that as its such an odd issue

ebon citrus
#

@gloomy aspen change false for 0

#

As demonic pointed out

#

Dedmen*

gloomy aspen
#

That may well be down to a mod problem actually, so will run with a vanilla mission and see if thats the issue

#

Ah will do, thanks 🙂

ebon citrus
#

Also, if you want it to work on player units, you need to look into remoteExec and what locality means in arma 3

#

Since the handledamage event handler is fired where the object is local

#

Or rather needs to be defined where the object is local for it to work

gloomy aspen
#

Okay, will delve into the BIKI and see what I can learn, thank you for your help! 🙂

ebon citrus
#

@gloomy aspen
Here' some readin material

#

Im sure the veterans here can point to even more reading

winter rose
burnt sapphire
#

Hmm?

ebon citrus
#

Thanks Lou!

rare sigil
gloomy aspen
#

@ebon citrus turns out it was a mod issue not a script issue ... Whilst I will definitely look into the stuff you linked there, I can say that the script you provided works on both AI and players on a dedicated server! Thanks again, I really appreciate it!

#

FYI it works without changing from 'false' to '0'

#

Also thanks @winter rose too 🙂

#

And @still forum 🙂

#

and anybody else who helped!

burnt sapphire
tough abyss
#

Could someone explain how to count civilian players in a trigger boundry? Ive got this https://pastebin.com/WK78fhQ3
and just cant get it to work at all

warm hedge
#

How do you execute this? And doubt \\ works to comment...

tough abyss
#

yeah I figured \ that was just bad pastebinning on my part, its called in the trigger with
[thisTrigger] execVM "functions\fn_countCivs.sqf"; when a Bluefor player enters the trigger

warm hedge
#

And how it doesn't work?

#

Errors? Not expected behaviour?

tough abyss
#

unless it always returns 0 for any side except bluefor

warm hedge
#

Because your trigger only detects BLUFOR?

tough abyss
#

ah

#

would you look at that it works

turbid crag
#

Does anyone know why the first one doesn't work, but the 2nd one does? If so, is there a fix/workaround?

//When in an RHS Bradley
private _turret = player call CBA_fnc_turretPath;
vehicle player loadMagazine [_turret, "RHS_weap_M242BC", "rhs_mag_70Rnd_25mm_M242_APFSDS"];

//When in an RHS Abrams
private _turret = player call CBA_fnc_turretPath;
vehicle player loadMagazine [_turret, "rhs_weap_m256", "rhs_mag_M829A3"];
ebon citrus
#

What are you trying to do?

turbid crag
#

My ultimate goal is to remove the scroll wheel interactions to reload and put them into ACE
Currently I'm trying to find how I can switch ammo types

#

To remove the scroll wheel interactions I have set the "show " attribute of "LoadOtherMagazine" and "LoadEmptyMagazine" in "CfgActions" to be togglable with a CBA setting (requires a game restart ofc)

#
class CfgActions {
    class None;
    class LoadMagazine: None {};
    class LoadEmptyMagazine: LoadMagazine {
        show = "call compile getText (configFile >> 'CfgActions' >> 'LoadEmptyMagazine' >> 'settingLoadEmptyMagazine')";
        settingLoadEmptyMagazine = "profileNamespace getVariable ['showLoadEmptyMagazine', 0]";
    };

    class LoadOtherMagazine: LoadMagazine {
        show = "call compile getText (configFile >> 'CfgActions' >> 'LoadOtherMagazine' >> 'settingLoadOtherMagazine')";
        settingLoadOtherMagazine = "profileNamespace getVariable ['showLoadOtherMagazine', 0]";
    };
};

I use macros to define stuff, so it's not exactly the same, but it works.

#

The problem is if I set "show" to "0", I can't reload most RHS vehicles with an ACE addon called "ACE Interaction Menu Expansion" (AIME).
It works for vanilla vehicles and from certain mods, including the Abrams from RHS USAF, but AIME does not work for most if not all RHS AFRF vehicles and the RHS USAF Bradley for example.

zealous widget
warm hedge
#

Flag texture path I suppose

zealous widget
#

C:\Users\acer\Documents\Arma 3 - Other Profiles\Babura\missions\sesnaestabitkubije.woodland_acr\texture.paa

#

Like this or?

warm hedge
#

sesnaestabitkubije.woodland_acr\texture.paainstead

zealous widget
#

photo size matters?

warm hedge
#

Must be power of 2

#

So for a flag, 256x128, 512x256, 1024x512, something like that

zealous widget
#

Alright,thanks im going to try now

#

It works for mp or i need some special code or something?

warm hedge
#

IDK about 3den Enhanced

narrow pollen
still forum
#

get all objects owned by owner?

winter rose
#

@narrow pollen what do you want from the "reverse command"? put the number and get the player?

narrow pollen
#

Player object from owner id

winter rose
#

allPlayers select owner _x == id I suppose

#

@narrow pollen

fleet stirrup
#

Is there any reverse of laserTarget in ARMA? There is always the option of me iterating through every unit and checking, but I feel like there should be a much easier and more efficient way of doing so.

Essentially, I am trying to get a consistent object reference to the laser target that a unit fires, even if they turn their laser off and back on again.

exotic flax
#

do you mean something like isLaserOn?

#

forget that... that will just check if the laser is on... not if a target is lased on

#

After a quick search on the wiki I can't find any function which returns a list of units which are currently lasing a specific target...

Although you could run a script which sets a variable in missionNamespace the moment a target has been lased by a single unit, and use setMissileTarget to keep it a target for missiles (depending on what you want to do with it)

fleet stirrup
#

Hmm, that is a possibility. Essentially I need to know which unit is using the laser designator. Not the easy solution I wanted, but I could try putting an event handler for Fired on every unit, and keep a track of who is in charge of which target

#

Alternatively, I am only going to need to do this once upon selection of a laser, and it can be done on the client side so maybe this is premature optimisation

flat elbow
#

so i have a script that seems to keep bugging out, i basically have an heli that should go from A to B, unload people with fastrope and go back, i have a trigger on the fastrope position set as skip waypoint to let the heli come back, whenever I (as the last player) switch the position using the ACE interaction, the condition count (crew heliTransport) <= 4 gets triggered even if the trigger itself says that the condition must be satisfied for 20 seconds, any clue of why?

#

well correction it does not throw the "on activation" but the waypoint gets skipped

flat elbow
#

discard what i said it seems a script issue

astral tendon
#

Is there a script to disable mines? like how you would normally do with the action menu.

#

Find it its

player action ["deactivate", player, cursorObject]
leaden shuttle
#

Anyone know where I can find the script IDs for all arma 3 facewear like G_Balaclava_TI_G_tna_F

winter rose
#

on the wiki @leaden shuttle

#

(I cannot link rn, on mobile)

leaden shuttle
#

Is it the Fandom wiki?

winter rose
leaden shuttle
#

Okay thank you very much

#

@winter rose I am looking for facewear for all faction in paticular where can I find that?

winter rose
#

@leaden shuttle ↑

#

Contact items not present

leaden shuttle
#

Thanks

austere silo
#

once again i ask for your support, i have that script what i want to execute ingame (previosly it was in the init (attributes) of the object):

#

test.sqf is a script what i made for test...that is all whats in it:

            _this animate ["panel_2_hide", 1, true];
            _this animate ["panel_3_hide", 1, true];
            _this animate ["panel_4_hide", 1, true];```
#

for sure i miss something here

winter rose
#

@austere silo use animateSource instead

what would be the issue?
place in init:```sqf
if (isServer) then { this execVM "test.sqf"; };

austere silo
#

thank you Mr. Montana, you are the MVP here!

viral basin
#

hey, how do i disable a specific item in the RscTree? I looked up the tvSetPictureRightColorDisabled command and read that it changes the color when the item is disabled. Or does item mean the whole tree?

jaunty zephyr
#

I have a question about sendSimpleCommand .
I want an AI driver to reverse. No players are present on the vehicle.
So I'm setting effectiveCommander to a non-driver AI on the same vehicle, and use sendSimpleCommand in a PFH.
This works... sometimes . On some occasions however the car does not budge or - adding insult to the injury! - starts creeping forward.
Sometimes it helps if I nudge the vehicle backwards using setVelocity once, and then it keeps driving backwards.

Is there any knowledge out there about what other issues might affect sendSimpleCommand beside the effectiveCommander?

inb4

  • are there waypoints -- no, none.
  • is the driver in the same group as a player? -- no
  • vehicleMoveInfo returns ["STOP", "NONE"]
ionic anchor
#

any know if there is a way to disable the endgame spectator map so that the normal map can open

unique sundial
#

@jaunty zephyr try vehicleMoveInfo to see if your commands are getting through

winter panther
#

probably a stupid question, but I'm pretty new to Arma 3 scripting. I have a script that needs to use global variables (assigned from the editor), but that could be assigned or not. What's the shortest way to do something like "_myVariable = globalVariable ?? null". I mean, assign that variable if it's defined, or null if it's not.

#

trying to use a global variable that hasn't been defined results in error, unless you do a isNil check

warm hedge
#
if (isNil "globalVariable") then {};```?
winter panther
#

hmm I was looking for a shorter way to do it, without so many "if" and "else". But I guess SQF doesn't have operators like "?" and "??"

warm hedge
#

I don't know what language you're talking about, but most likely no

winter panther
#

pretty much any language, C#, javascript, etc

warm hedge
#

I've no experience with other than SQF ¯_(ツ)_/¯

ebon citrus
#

@winter panther switch-do? SQF version of switch-case. Or you can just if-else

winter rose
#

@winter panther no ternary in Arma, no '??' JS operator either

winter panther
#

yeah I ended up using if/else, adding the variables to an array if they exist

winter rose
#

there is```sqf
[falseStuff, trueStuff] select boolean;

winter panther
#

how does that work?

#

is "boolean" a condition statement?

still forum
#

no '??' JS operator either
not yet 😉

winter rose
#

yes

private _code = [{ hint "dead"; }, { hint "alive"; }] select (alive player);
call _code;
cunning crown
#

(you can put anything inside the array obv.)

winter panther
#

ah nice, thanks

ebon citrus
#

@winter rose can you use boolean for select?

cunning crown
#

not yet 😉
@still forum I'm pretty sure you already have that in one of your custom build/version, don't you? 😄

ebon citrus
#

The biki says it takes a number

still forum
#
(1 == 1) && ({ hint "dead" } else { hint "alive" } select alive player)
cunning crown
winter rose
#

@ebon citrus yup

ebon citrus
#

Oh wait, there is alternative syntax

winter rose
#

plenty of 'em

ebon citrus
#

So boolean is fine for a shorthand for number here, but not elsewhere 😂

still forum
#

So boolean is fine for a shorthand for number here
no its not

ebon citrus
#

No wonder they scrapped sqf for Enfusion

still forum
#

its a boolean, not a number

#

Its not a number, its a special syntax that takes boolean

ebon citrus
#

boolean: Boolean - true => 1, false => 0

still forum
#

No

#

not in arma

ebon citrus
still forum
#

Its not a shorthand for a number

ebon citrus
#

Says right there

still forum
#

its a special seperate implementation that takes a boolean

#

its not a number shorthand

ebon citrus
#

Yes, so it's a shorthand for an index number here

still forum
#

no

#

That's what I'm trying to say, that its not that

ebon citrus
#

Hold on

winter rose
#

there is a special alternative syntax here, it's not "using a boolean instead of a number"
there is a specific syntax for a boolean, that's it

still forum
#

its implementation is
if (condition) then {array[1]} else {array[0]}

ebon citrus
#

So in the context of select, this is wrong?
true => 1, false => 0

winter rose
#
private _a = true + true; // throws error
still forum
#

So in the context of select, this is wrong?
Yes.
true selects the second element, false selects the first element

#

its not a "shorthand for a number"

ebon citrus
#

What?

still forum
#

its a special case

ebon citrus
#

So is it wrong or not in the context of select

still forum
#

what you said is wrong

#

true is not 1, and false is not 0. They are booleans, a different datatype

ebon citrus
still forum
#

I think we went over that yesterday

ebon citrus
#
Alternative Syntax

Syntax:array select boolean
Parameters:
array: Arrayboolean: Boolean - true => 1, false => 0

Return Value:Anything - a reference to array element given by its index (false - 0, true - 1)```
cunning crown
#

Doesn't mean that false/true is a number, just that false will take the element 0 in the array, and true the element 1

ebon citrus
#

So in this context, it's a shorthand for 0 and 1?

still forum
#

no... As already said half a dozen times

#

also in what world is "true" short for "1" its like.. 3 characters more

ebon citrus
#

So False != 0 in this case?

still forum
#

yes

ebon citrus
#

In literally any respectable programming language and also in any respectable cpu based on binary-memory

winter rose
#

like SQF is respectable 😁

still forum
#

Go, Java, C#, Lua... we already talked about that yesterday

#

I don't think we need to rehash that whole convo

ebon citrus
#

Yes!

#

Exactly

cunning crown
#

Well it's done this way, it has always been like that and it probably cannot change due to backward compat, there is no point arguing how it works, it just works (sometimes) and it's good enough ¯_(ツ)_/¯

winter rose
#

I mean, there is a Bohemia Dev telling you that boolean != number, so that's it :p

ebon citrus
#

But i CAN use false to represent the first index, a.k.a. 0, in this case?

winter rose
#

only in this select syntax yes

still forum
#

in that case yes

jaunty zephyr
#

@unique sundial nah, "BACK" command is not getting through it seems - vehicleMoveInfo gives me "STOP" in the first array index

ebon citrus
#

Alright

#

That's what i was saying

#

@winter rose a "Bohemia Dev" was also telling me this:
also in what world is "true" short for "1" its like.. 3 characters more

winter rose
#

in C, I believe 😬

#

@winter rose a "Bohemia Dev" was also telling me this:
also in what world is "true" short for "1" its like.. 3 characters more
…where? @ebon citrus 😅

still forum
#

quite sure in C its also longer

#

actually do I see that right that C doesn't even have a boolean type?

jovial nebula
#

correct

still forum
ebon citrus
#

Here

#

It's more work to differentiate Bools from integers/floats than to not

jovial nebula
#

actually do I see that right that C doesn't even have a boolean type?
You C #

winter rose
#

indeed - couldn't find it in search o__o

well yeah, in C, if (1) {}

#

@jovial nebula hey, it's MY job to do the jokes!!

cunning crown
#

indeed - couldn't find it in search o__o
Me neither, guess Discord doesn't want us to use the search function anymore 😕

jovial nebula
#

forgive me, i understand that was too much😂

ebon citrus
#

And sorry for being so bickering

still forum
#

It's more work to differentiate Bools from integers/floats than to not
from integers, in assembly maybe.
Besides that I disagree 🤔

ebon citrus
#

I've had so much help from this server and i kind of feel ashamed for how much i bicker over small things

tough abyss
#

There are many reasons I don't want to work in C anymore, the lack of bools is a small part of the massive list of landmines the language has.

ebon citrus
#

You cant get over it?

still forum
#

even in assembly. Usually you want 2==true/if(2) too, but in assembly when you consider a bool to be one bit, that'd be false

ebon citrus
#

It might be just me, but i always connect bools to 0 or 1+

#

Could be because C was my first language

tough abyss
#

Well it was mine too but we live in the world of algebraic data types and functional programming, raising the level of abstraction has been a continuous process since the 70s.

winter rose
#

and JS keeps adding confusion

ebon citrus
#

All datatypes eventually boil down to binary

jovial nebula
#

yeah but i mean you are working on a language (sqf) that is not even a programming language

winter rose
#

JS. is. a. pain.

[] == false; // true
if ([]) { 'a' } else { 'b' }; // result: 'a'
ebon citrus
#

Making them more complicated than necessary is just extra work

#

Mmmh

#

Sqf feels like prigramming only in the logic

jovial nebula
#

JS. is. a. pain.

[] == false; // true
if ([]) { 'a' } else { 'b' }; // result: 'a'

What about the true===1? Lol

ebon citrus
#

But fortunately i have Python under the belt which is a script aswell

jovial nebula
#

Python is not a scripting language i mean

ebon citrus
#

Well...

cunning crown
ebon citrus
#

I use python mostly as a scripting language

#

Writing in C and scripting in Python

#

Anyways, enough bickering, i have a movie to watch

jovial nebula
#

Gg

ebon citrus
#

Chya

jaunty zephyr
#

@unique sundial oh, and in the case of the vehicle creeping forward, it actually got the BACK in vehicleMoveInfo . weird..

dapper mist
#

any idea of a way to make a script that would unload all vehicles at an unload waypoint for landing craft

ebon citrus
#

Scripted waypoints

jaunty zephyr
#

wouldnt setWaypointStatements on the unload waypoint be sufficient

dapper mist
#

oh?

#

I'm meaning for unloading like 3 trucks/apcs from a LCU-mk10 lander

#

I'm wanting to do a beach landing, players arrive in ribs and small landers or helos and their vehicles arrive via the larger AI driven lander

#

the only way I've found to land vehicles is using Achilles' supply drop module, but that can only handle 1 vehicle at a time

plush breach
#

Hey, just putting a message on here as to if anyone knows of any good and informative explanations of how to create an introduction cutscene for a mission. I've looked everywhere and have yet to be successful in finding the desired outcome. Any help is greatly appreciated.

#

(Also, I'm looking to make a proper intro cutscene as I'm aware that their is the UAV style that is built into 3Den editor but I'm looking a camera style cinematic to script into my mission).

winter rose
#

@plush breach and no crossposting #rules

plush breach
#

oh right sorry

#

but thanks non the less

winter rose
#

yw - enjoy the wonderful but somewhat painful tool!

plush breach
#

yeah from the vague tutorials on youtube it does come across quite a nuisance to use. I'll just brute force the camera script, work at it until it works.

tough abyss
#

What's best practice for evaluating a single condition for a large amount of units?

#

I'm writing an FSM and I'm not sure what the best way to write out "if any of these units have detected an enemy, return true"

#

I know there's a trigger for that, and that's what I'm using, but this is mostly a question for personal reference

#

I'm guessing it'd be forEach

#

something like

_enemyDetectedArray = [];
{
_enemyDetected = _x call BIS_fnc_enemyDetected;
_enemyDetectedArray pushBack _enemyDetected;
} forEach arrayofunits;

and then for when I want to eval

if (true in _enemyDetectedArray) then { [code] };```
#

Dunno if there's a better way or if I've got it, though

#

||This is all psuedocode obviously pls don't yell at me for syntax errors||

winter rose
#
_theUnits findIf { behaviour _x == "COMBAT"; } != -1;
#

@tough abyss

tough abyss
#

Oh, I was not aware of findIf! Thank you very much @winter rose

#

That makes things way simpler clownJoy

slender schooner
#

heyho people of the arma scripting world
i have a question
I m fairly new to arma 3 scripting. I do have programming experience and so on, but i m quite new to arma scripting.
I m currently working on a small admintool with gui and stuff. Its meant for being used on our altis life server.
On to my question
Is it possible to get the value of a variable that is set on another player, like, the life_hunger variable for example?

#

and maybe even edit that variable remotely?

winter rose
#

yes, see get/setVariable

slender schooner
#

aight

slender schooner
#

i m currently looking into getVariable, but i dont find a way to grab a variable from another player, am i maybe looking at the wrong place?

tough abyss
#

??? object getVariable "variable"

#

object in this case being the player you want to grab the variable from

slender schooner
#

can this be the clientOwner id or must it be the unit?

#

and, i see that i still have a lot to learn then

#

i tried that solution, but it didnt want to work.
I created the variable
testVar = "TestValue";
and then queried it, via the unit that i m currently controlling

_tempVar = player1 getVariable "testVar";
hint format ["%1", _tempVar]

It returned
<null>

lost copper
#

Cause you should use for object namespace

player1 setVariable ["testVar", "testValue"];
digital hollow
#

When sending CBA serverEvent, would it be beneficial network usage to pass it object netId instead of the object?

velvet merlin
#

is there a way to determine the object detail (video objects setting) via sqf?

#

the problem is on very low the targets on a training range are no longer rendered. so need a way to determine if thats the case and skip it

clear roost
#

Hell everybody 🙂 I was wondering if someone could help me figure out how to find the class names of custom compositions. I can find the vanilla arma compositions under the Config Viewer > CfgGroups > Empty > (tons of pre-made compositions).

violet gull
#

@velvet merlin There's a config setting you can pull

velvet merlin
#

how can you read that?

violet gull
#

CfgVideoOptions

#

I'll give the code in a sec.

warm hedge
#

kju's not asking for that. It won't get current video setting

#

And I think there's no way to get current video settings

winter rose
#

@velvet merlin you can force an object drawing, but I am not sure if it overrides object quality - can set FeatureType help, or does the object disappear anyway?

digital jacinth
#

iirc it will disappear into the fog of the terrain view distance

velvet merlin
#

will try FeatureType. good idea

frigid lodge
#

Hey everyone, I'm making a admin menu and I have hit a bit of a brick wall, I'm trying to a search box to search for player names and when I type in pasta for instance it doesn't show any results dispute me being the list box heres the code for the search return https://sqfbin.com/qajahowisutasalenuzu

frigid lodge
#

Just figured it out nvm

winter panther
#

Should i make all my variables in sqf private? I noticed the scope is limited to the main execution block, you can't use functions declared at the top of your file inside other blocks, unless they are global or you pass them as parameters

#

Is making global stuff bad?

winter rose
#

it's less adequate yes

#

the "more private" you can do the better

slender schooner
#

a private variable is gone after the script finished executing, no?

winter panther
#

Can other mods access those global variables?

#

a private variable is gone after the script finished executing, no?
@slender schooner its gone after the code inside your scope ends

warm hedge
#

Other MODs, and other everything could access to every global variables

winter rose
#

this is why it is important to prefix your public variable with a tag

winter panther
#

Thanks

warm hedge
#

e.g I can (should) use PLP_variable and Lou can (should) use LOU_variable so we won't do unexpected use/update/such other actions to variables

astral dawn
#

ACE/CBA has some macros to automate this

slender schooner
#

does it make sense to nil a private variable?

astral dawn
#

for what?

winter rose
#

only if it won't get deleted before long and holds a lot of data in memory

slender schooner
#

i mean, does it completely dissapear, or does it stay in the cyber realm still set but inaccessible

astral dawn
#

i mean, does it completely dissapear, or does it stay in the cyber realm still set but inaccessible
it disappears of course, just like it does when it goes out of scope

slender schooner
#

i once wrote some dumb stuff in python in a private variable, in a function that held a lot of data, like, 300MB. After execution, that ram wasnt being opened again, so the code used up those 300MB extra ram

#

i had to manually unset it to get the ram back

winter rose
slender schooner
astral dawn
#

i once wrote some dumb stuff in python in a private variable, in a function that held a lot of data, like, 300MB. After execution, that ram wasnt being opened again, so the code used up those 300MB extra ram
IIRC, some variables in Python are actually references to data and are treated as such, perhaps it was one of them?

slender schooner
#

what i did was load files into the program, and then encrypt them, and write them back down

#

but the last file that was loaded was about 300MB, and it didnt get unloaded

#

mayhaps i just wrote some sucky code that wasnt working as expected

#

but now i know

dapper mist
#

Suggestion for anyone skilled enough to script this, the supply drop option from Achilles but able to fit multiple vehicles into a single cargo vehicle
Like the British LCU mk10 can carry 3 APCs in game but the Achilles script will only load 1

flat elbow
#

is there a way to have A3 print the functions that are being called? I want to call a missle strike from a mod but i don't know what function does that

winter rose
#

nope

flat elbow
#

what is the best approach then?

winter rose
#

find out how it is called, or look up CfgFunctions

ebon citrus
#

@dapper mist have you thought if making one yourself?

#

Pretty simple, infact it would be

#

Im not sure about achilles, but all you would need is some simple logic and attachTo-script with the right offsets

#

You could even do some fancy animations, if you like

#

But the core-idea is very basic

#

If you haven't done it by next week, i'll make an example for you

#

Im going to head out to Lapland on wed, so cant do it right now

winter rose
#

if you haven't done it by next week…
Beware 👀

ebon citrus
#

Already occupied by another OP till tue morning

#

Tue evening*

#

Might have time on wed morning to make it

#

We'll see

#

@winter rose what's up?

winter rose
#

The sky?

ebon citrus
#

That's subjective

#

Give me something in global space

winter rose
#

Up and down only matter in a reference indeed

#

If you haven't done it by next week, i'll make an example of you
Muhahaha

ebon citrus
#

True, but there are still objective things with up and down, if we consider it in the context of humans

#

The question is, do we assume your head as up and your feet as down, or the direction of the downward force of gravity as down and opposite of it up?

#

You would also have to account for the rotation of the earth warping the direction which you consider down compared to that which is the direction of gravity

winter rose
#

is up the Z or the Y axis?

ebon citrus
#

But we can all agree that Australia is down

#

Down-under

flat elbow
#

heh i think it's a sequence, when you do it by hand you get an interface, select the position, open the silo and fire it

ebon citrus
#

I prefer z-up

craggy wraith
#

Lou, Any chance you could look at some code for like 30 seconds just wondering if I've placed it right ?

#

only one line

winter rose
#

30s, one line? You overestimate me

#

Shoot ^^ if anyone has the answer he will answer @craggy wraith

craggy wraith
#

I cant post in file in here can I pm?

winter rose
craggy wraith
#

ermmmm hahaha never used that before I will copy some of the text 😂

#

top part

winter rose
#

@craggy wraith ```sqf (see channel's pinned message)

craggy wraith
#

Thanks buddy 🙂

ebon citrus
#

🧐

#

Im watching

tough abyss
#

Hey, could you guys direct me to a series or links that could put me on the right path to start SQF? I've tried looking through videos and it's a majority of "do this and that and this" without much information on what it actually does. I do have experience with Python, Lua, and JavaScript so the basis of programming isn't something I need to start with. I just need to understand the server model and syntax and a few others to get started.

winter rose
tough abyss
#

Thanks.

craggy wraith
#

Lou is that your way of saying its ok 😂 😂 I like it!!

winter rose
#

@craggy wraith I didn't do anything?

craggy wraith
#

The pinned post saying "your code" good. Meaning you checked the code and it's good?

winter rose
#

no, I mean use the sqf highlight so we can read it properly 😄

craggy wraith
#

Ohhhhhh 🤣🤣🤣🤣🤣

#

lou how does this thing work 😂

glass zinc
#

what is the difference between rocket core and rocket base?

dapper mist
#

@ebon citrus I'm totally hopeless with scripting, animating and modelling I can do

ebon citrus
#

I see

#

I'll take a look on wednesday

#

I should have a little bit of time to whip up an example

winter rose
#

lou how does this thing work 😂
it's explained in the pinned message!1! @craggy wraith

craggy wraith
#

I tried it but wouldn't highlight it 🤣🤣🤣 I'll try again shortly

thorn saffron
#

Is there a way to detect if projectile killed somebody via direct hit, explosion and submunitions? I'm spawning ordinance and I would like to log if it killed any enemies.

winter rose
#

indirectly, by killed EH on units @thorn saffron

thorn saffron
#

🤔 I guess I could add temporary EH to units in the area, but problem is they might get killed by something else and return a false positive.

ebon citrus
#

You can also get the shooter

#

Then just verofy that the shooter was the one you needed

thorn saffron
#

I'm spawning the ordinance

ebon citrus
#

Interesting scenario

thorn saffron
#

Yeah, totally. The incredibly new idea of scripted artillery strike...

ebon citrus
#

@winter rose what does the EH say when someone is killed by game-logic or fire-support?

#

No, im not talking about that

thorn saffron
#

🤔 I think I could spawn a game logic/dummy unit, parent the shots to that and then check for kills

ebon citrus
#

I am a master of cabbage trebouche

#

Im not sure if that's how it works

#

I cant say for sure right off the bat

#

It's an edge-case

winter rose
#

@ebon citrus game logics can't kill you 🤔
But if you use setDamage, objNull is your killer
if you use a spawned ordinance, objNull is your killer too but the ammo is provided

ebon citrus
#

Game logic as in "setDamage"

#

Alright

#

You answered it already

winter rose
#

game logic with a gun 🙀

ebon citrus
#

@thorn saffron check if killer is objNull

#

And also ammo is valid

still forum
#

setDammage meowtrash

ebon citrus
#

I hate that

#

I always hit my toe on it

winter rose
#

that's also the first in-game suggestion 😄

ebon citrus
#

Also, since when were MP EH a thing?

winter rose
#

OFP:R iirc

thorn saffron
#

I think that tracking the kills on dummy unit will be more reliable than adding killed EH. Might be better on performance too

ebon citrus
#

I never noticed them

#

Do they work?

winter rose
#

no no, they were added broken hue hue hue
Yep

ebon citrus
#

As in, are they reliable in determining if a remote unit was damaged?

#

Hey, give me some slack

#

Or killed

#

Mphit and mpkilled

#

Instead of making EH's where the unit is local and remoteExecing to server a script to tell it the unit was hit

winter rose
#

They work, they can be added from everywhere, I think that's "all" there is about them
tbh, I haven't played with them in a long time

ebon citrus
#

Im having a go once i come back from lapland

winter rose
#

the wiki knows more than me about them yep

ebon citrus
#

I have some applications in mind

#

I dont believe that

#

I thought you were the biki

thorn saffron
#

Hmm... it seems that there is no command for getting all the kills of a unit. At least I couldn't find one for SP

winter rose
#

@thorn saffron nope, none (maybe use "score")

#

The wiki usually knows more than I do, because I write there if I know something there isn't 😬

thorn saffron
#

yeah, but it's a number, I would prefer the actual units.
I think I might need to use the killed EH

#

or combine it with my dummy unit instagator

velvet merlin
#

possible to disable the ambient anims of soldiers via sqf?

#

like when they are standing around doing those weird hand/leg/head movements

#

there is a config mod to disable that, but not sure if it can be done also via scripting

ebon citrus
#

Can be, not sure how right now

#

You could always brute it with switchmove

thorn saffron
#

Fun fact: if you change the projectile parent when it's fired from a vehicle, then there is a good chance it will hit and explodify the original parent

ebon citrus
#

I remember having managed to bork the idle by accident

#

The what?

#

Uhh, yeah, like if you change it immediately after being fired?

thorn saffron
#

yup

ebon citrus
#

I assume it wont collide with the parent initially

thorn saffron
#

nope

ebon citrus
#

But if the parent is changed, the bullet is now inside the barrel

thorn saffron
#

just a funny little thing

ebon citrus
#

Which it WILL collide with, since it's no longer a child of said barrel

#

Makes sense, though

thorn saffron
#

yup, it was funny to see the plane assplode itself

ebon citrus
#

Solid

#

The funny things in life

winter rose
#

@velvet merlin painfully, with animation EH

velvet merlin
#

😬

winter rose
#

…yep!
iirc, I believe agents don't have these, but I might very well be mistaken

spark rose
#

hey gents. If i want to pick up a unit and cause it to appear somewhere else, is there a command for that? Essentially teleport a unit? I want the player to have a randomized start at the beginning of the game (using case).

#

oh nevermind!

#

setpos...............

#

wow i am dumb

#

thanks, me!

halcyon crypt
#

so dumb 😜

flat elbow
#

ok so i am trying to make a ship fire and the ship have a script to do that, it stuck on this line +(_Vehicle getVariable "Cruise Waypoints" select {_x select 1}) and i am not sure how it is supposed to work, afaik the +() will just return a number, the select {_x select 1} would return the second element of every array (_x should be the iterator), right?

fair drum
#

anyone know how to register a dead man's switch on an AI to trigger?

#

[ACE]

#

cause I know players have to manually activate it but don't know if AI have to

surreal peak
#

Note site is not HTTPS so you will have to click advanced then let me on site if using chrome. Hope im not breaking any rules this time apparently I dont know how chrome works :p

still forum
#

Note site is not HTTPS
It is, thats why you need to do that

surreal peak
#

wait im dumb. It is HTTPS. Why do I need to click the things? Ah, probably cause certificate invalid

fair drum
#

ty sir

#

cause i was just using a createVehicle with a bomb to do it but I want my players to find the switch and deal with it

flat elbow
#

is there a way to have an optional missing parameter between two others? like i want to get a [attacker, positionAttacker, number] and the positionAttacker if it's not supplied will be deduced automatically, yet i still want to be able to set the number, if i call it like [attacker, , 3] i get an invalid number in expression error

exotic flax
#

Just like every other program language it's not possible to do that...

#

Either set null/false to use default, or switch the 2md and 3rs param

#

Depending on the function of course

ebon citrus
#

Not inbetween, no. In Python you could use keyword arguments and just Null the values you dont need to use and use logic to check whether they have a value or not

ebon citrus
#

Just to clarify, i am not aware of keywords in SQF

flat elbow
#

that's incorrect, in other languages you can use assignments in a function call, like function(x=1, y=2)

#

and IIRC you can also skip parameters if there's no confusion in some, like if the 1st is a number 2nd is a string and 3rd is a struct, you can only specify a number and a struct as it's clear what you are assigning

#
if (getText (configfile >> "CfgVehicles" >> typeOf _ship >> "vehicleClass") == "HAFM_Submarines") then {_startingDepth = _ship animationPhase "senkou"; //Save starting depth 
};

[other stuff]

if (getText (configfile >> "CfgVehicles" >> typeOf _ship >> "vehicleClass") == "HAFM_Submarines") then {_ship animate ["senkou", _startingDepth]; // Return to previous depth
};```

I get:

2:02:52 Error in expression <arines") then {_ship animate ["senkou", _startingDepth];
};>
2:02:52 Error position: <_startingDepth];
};>
2:02:52 Error Undefined variable in expression: _startingdepth


I don't get why tho
#

oh dumb me the scope 🤦‍♂️

flat elbow
#

if someone use hellenic armed forces mod (HAFM), i have made a wrapper script to control the AI ship launch of cruise missles so you can use it to create scene effects or call it for ship to surface missle bombing support, https://pastebin.com/S4AMLi2E feel free to let me know if you have any suggestion, the script is copyless so please feel free to copy, modify, include in anything, etc.

flat elbow
digital hollow
#

Is it possible to get the parent rope object of a ropeSegment?

warm hedge
#

No AFAIK

#

Parent from segments is also no AFAIK, sadly

west grove
#

question tyme. can we use setObjectTexture somehow on proxy models?

#

I have a model that has a proxy for another model, and I would love to change the texture of that one.

#

the model that is proxy'd in has hidden selections

brave jungle
#

Seem to have an issue with lbClear not clearing on a EH (LBSelChanged), however the rest of the code after it works.

((findDisplay 348567) displayCtrl 2100) ctrlSetEventHandler ["LBSelChanged","VKN_Template_Tool_selectionChange = true; lbClear 2101; lbClear 2102; [] spawn VKN_fnc_sideChanged;"]; //Side LB
((findDisplay 348567) displayCtrl 2101) ctrlSetEventHandler ["LBSelChanged","VKN_Template_Tool_selectionChange = true; lbClear 2102; [] spawn VKN_fnc_sideChanged;"]; //Faction LB

It'll set the variable and spawn the function, but not clear the listboxes, any ideas? They do exist and its the top most dialog.

winter rose
#

wrong ids? (I know, "stupid" question)

brave jungle
#

See i thought that too, but I can add elements to it perfectly fine

#

My next option was to loop lbDelete

#

To see if that would work

#

But I have enough loops in this system already haha

vague geode
#

Is there a way to change the kill log messages because whenever a player gets killed by AI on official servers it only says "<Player name> got killed" in the chat while in my mission it always says "<Player name> got killed by <NPC name> (AI)"...

winter rose
#

nope… well, you can disable it and replace it with systemChat

#

@vague geode ↑
see showHUD

vague geode
#

@winter rose Ok, thanks.

tough abyss
#

How would I remove a respawn position using a trigger? i read the wiki and tried using myRespawn call BIS_fnc_removeRespawnPosition; but the respawn position doesnt get removed.

winter rose
#

what is "myRespawn" in your code?

tough abyss
#

its the variable name of respawn position

winter rose
#

code?

tough abyss
#

Thats whats called in the trigger exactly

winter rose
#

where do you define "myRespawn"? is it the module's name?

tough abyss
#

its defined in the variable name of the respawn module

winter rose
#

that's why it can't work

#

that's quite different

tough abyss
#

so how would I remove a respawn position?

#

I figured it out. Thanks Lou

high silo
#

So im trying to optimise how I spawn Quick Reaction Forces, and limit the amount of lag it puts on the server. Any tips on improving this code?

_QRF001= [[1722.74,15187.6,0], EAST, ["LOP_SYR_Infantry_SL", "LOP_SYR_Infantry_MG", "LOP_SYR_Infantry_AT", "LOP_SYR_Infantry_AT", "LOP_SYR_Infantry_Rifleman", "LOP_SYR_Infantry_AT_Asst", "LOP_SYR_Infantry_Corpsman", "LOP_SYR_Infantry_MG"], [], [], [], [], [], 273.660] call BIS_fnc_spawnGroup;
    _wp1 = _QRF001 addWaypoint [[1717.08,15165.8,0],0];
    _wp1 setWaypointType "GETIN NEAREST";
    _wp1 = _QRF001 addWaypoint [[1639.13,14465.6,0],0];
    _wp1 setWaypointType "GETOUT";     
        _wp1 = _QRF001 addWaypoint [[1627.14,14266.3,0],0];
    _wp1 setWaypointType "SAD"; 
    
_QRF002= [[1702.79,15201.10], EAST, ["LOP_SYR_Infantry_SL", "LOP_SYR_Infantry_MG", "LOP_SYR_Infantry_AT", "LOP_SYR_Infantry_AT", "LOP_SYR_Infantry_Rifleman", "LOP_SYR_Infantry_AT_Asst", "LOP_SYR_Infantry_Corpsman", "LOP_SYR_Infantry_MG"], [], [], [], [], [], 273.660] call BIS_fnc_spawnGroup;
    _wp2 = _QRF002 addWaypoint [[1705.93,15193.9,0],0];
    _wp2 setWaypointType "GETIN NEAREST";
    _wp2 = _QRF002 addWaypoint [[1782.48,14520.1,0],0];
    _wp2 setWaypointType "GETOUT";     
    _wp2 = _QRF002 addWaypoint [[1627.14,14266.3,0],0];
    _wp2 setWaypointType "SAD"; 
    
_QRF003= [[1703.11,15173.9,0], EAST, ["LOP_SYR_Infantry_Crewman", "LOP_SYR_Infantry_Crewman", "LOP_SYR_Infantry_Crewman"], [], [], [], [], [], 273.660] call BIS_fnc_spawnGroup;
    _wp3 = _QRF003 addWaypoint [[1700.81,15169.5,0],0];
    _wp3 setWaypointType "GETIN NEAREST";
    _wp3 = _QRF003 addWaypoint [[1627.14,14266.3,0],0];
    _wp3 setWaypointType "SAD"; 
#

This spawns two Squads that load into 2 trucks and head to target.
And 1 squad that loads into a tank and heads to target.

flat elbow
#

is there a way to get via script the network quality of a client (bandwidth, latency etc.)?

#

@high silo i would (but i just came back to A3 after years so pardon me if I don't get things right on first try) try to use the spawn instead of call so the function will run in a scheduled environment

#

so the spawning of the units will be non-blocking for the thread

high silo
#

Will have a look

#
_QRF003= [[1703.11,15173.9,0], EAST, ["LOP_SYR_Infantry_Crewman", "LOP_SYR_Infantry_Crewman", "LOP_SYR_Infantry_Crewman"], [], [], [], [], [], 273.660] spawn BIS_fnc_spawnGroup;
    _wp3 = _QRF003 addWaypoint [[1700.81,15169.5,0],0];
    _wp3 setWaypointType "GETIN NEAREST";
    _wp3 = _QRF003 addWaypoint [[1627.14,14266.3,0],0];
    _wp3 setWaypointType "SAD"; 
#

Like that?

winter rose
#

no, spawn returns the script handle, not the function's result

#

still call, but the whole thing surrounded with spawn e.g

[] spawn {
  private _QRF003 = [[1703.11,15173.9,0], EAST, ["LOP_SYR_Infantry_Crewman", "LOP_SYR_Infantry_Crewman", "LOP_SYR_Infantry_Crewman"], [], [], [], [], [], 273.660] call BIS_fnc_spawnGroup;
  private _wp3 = _QRF003 addWaypoint [[1700.81,15169.5,0],0];
  _wp3 setWaypointType "GETIN NEAREST";
  _wp3 = _QRF003 addWaypoint [[1627.14,14266.3,0], 0];
  _wp3 setWaypointType "SAD";
};
#

@high silo ↑

high silo
#

ahh will try that

#

Around the whole sqf or each induvial group

winter rose
#

where is this code located?

high silo
#

.sqf in the mission file

winter rose
#

and how do you call it?

#

execVM?

high silo
#

Ya

winter rose
#

no need to use spawn or anything then

high silo
#

How do you mean?

#

I'm trying to minimise lag, will that not help?

warm hedge
#

Using spawn/execVM will make more lag, more like they're used to make a lag

high silo
#

So theres no way to cut down on lag, with the way im using atm?

warm hedge
#

https://community.bistudio.com/wiki/Scheduler
Probably little “complicated” thing but yeah... long story short, you can use call compile preprocessFile "yourScript.sqf" instead to make less (no) lag. However in this case if the script is super complicated, the game will freeze a while to process the code

high silo
#

So rather then:

execVM "Scripts\Meeting1\QRF\SendQRF.sqf";

It would be

call compile preprocessFile "Scripts\Meeting1\QRF\SendQRF.sqf";
#

?

warm hedge
#

Will do

flat elbow
#

wait what do you mean by "spawn will make more lag"?

#

the scheduled environment is made for the purpose of not impacting the normal running of other things, so the function may take longer to be completed but the rest of the server functions will not be/will be less affected by that, no?

winter rose
#

I believe "lag" as in "you call this function, but the effects are showing 10s later"

flat elbow
#

uhm i understood it as "calling this slows the server down", as he said he wants to limit the amount of lag it puts on the server.

winter rose
#

ah well, spawning units is spawning units, there is no magical +10FPS command then (unfortunately)

flat elbow
#

but you can spawn them in chunks and reduce the hit on the server

#

not the final one but if you spawn them at chunks you let the server complete the initialization of the old ones so it does not have to process 200 initializations at once

astral dawn
#

Plus the game must synchronize the data about created object for all clients which I believe also takes processing resources.

flat elbow
#

how do I prevent the dumb AI from leaving the helicopter? for no reason at all the pilot leave the helicopter and when i order the skip of the hold waypoint the helicopter of course do not take off

#

as the pilot is away doing his business for whatever reason

#

(and no i can't lock it since players have to enter)

winter rose
#

well… I guess the pilot doesn't leave by himself, out of the blue?

flat elbow
#

yes, the mission start, my planes takes off, the helicopter closes the back door and the pilot leaves the helicopter

#

like "F this i'm going to take a milkshake" and walk away

winter rose
#
driver _myHelicopter linkItem "B_Milkshake_F";
flat elbow
#

heh

ebon citrus
#

Attached this EH to a unit and upon opening the inventory where there is no container, the _container parameter is Null (since inventory is overriden). The problem is that isNull _container returns false, despite _container being null

#

what gives?

#
_this addEventHandler ["InventoryOpened", {
    params ["_unit", "_container"];
    _Nca_container = _container;
    if (isNull _container) then{ //<---returns false even though _container is null
    _Nca_container = "GroundWeaponHolder_Scripted" createVehicle position player;
    };
    
    [_unit, _Nca_container] spawn Nca_fnc_showInventoryDialog;
    true; // <-- inventory override
}];```
#

Arma bug?

#

here is the exact return:
[R Alpha 1-1:1 (S.S),<NULL-object>]

#

is <NULL-object> not recognized as Null by isNull?

winter rose
#

yes, it is objNull

ebon citrus
#

but it's not according to isNull

#

it's also alive, since !alive doesnt work on it

#

what magic is this 😅

winter rose
#
systemChat typeOf _container```?
ebon citrus
#

GroundWeaponHolder

#

WHAT?

#

but it's passed as follows

#

[R Alpha 1-1:1 (S.S),<NULL-object>]

winter rose
#

what do you mean, "passed as follows"?
did you systemChat str _this?

ebon citrus
#

Nca_fnc_showInventoryDialog gets the following [R Alpha 1-1:1 (S.S),<NULL-object>]

#

Is this some naming thing?

#

that the groundWeaponHolder is null until you place something in it?

#

[R Alpha 1-1:1 (S.S),23763434b80# 18700: dummycap.p3d]

#

seems to be so

#

maybe for cleanup purposes

#

why would you designate something still in use as "null"

winter rose
#

it gets deleted as soon as it is empty/not used yes

#

to avoid memory leaks

ebon citrus
#

so it's better to have null-pointer than memory leak?

#

im just asking

winter rose
#

it's an object that gets deleted - and yes it's better
(not a null-pointer in RAM, though)

ebon citrus
#

but marked for cleanup?

winter rose
ebon citrus
#

what exactly is the purpose of a null-object in arma?

winter rose
#

objNull is the "null" value for Object type, that's it

ebon citrus
#

ok

#

why does isNull not work in this?

winter rose
#

it does

ebon citrus
#

it doesnt

#

take the example and try it, just remove the call to the function

winter rose
#

it does
just that between the check and the dialog, it may have been deleted

#

GroundWeaponHolder is an object that is to be created and filled immediately - else it gets deleted if empty.

ebon citrus
#

this here part returns false: (isNull _container)

#

but if i plonk a "systemChat str(_container)" above it, it's still null

#

so it's null before the isNull check, but then it's not null

#

but immediately after it's null again

#

or is this object named null by mistake, despite not being null for isNull

winter rose
#
this addEventHandler ["InventoryOpened", {
  params ["_unit", "_container"];
  systemChat str isNull _container;
  systemChat str typeOf _container;
  systemChat str isNull _container;
}];
```is this what you mean?
#

@ebon citrus, repro plz

ebon citrus
#

repro?

winter rose
#

about your isNull/not null

ebon citrus
#

repro?

#

also, mistake in your example

winter rose
#

that's what I get with a```sqf
isNull _container
typeOf _container
str _container
isNull _container

ebon citrus
#

true; // <-- inventory override

#

dont forget

winter rose
#

repro = reproduction of the issue

ebon citrus
#

your example is incorrect

#
this addEventHandler ["InventoryOpened", {
  params ["_unit", "_container"];
  systemChat str isNull _container;
  systemChat str typeOf _container;
  systemChat str isNull _container;
  true; // <-- inventory override
}];```
winter rose
#

same with true - it works

ebon citrus
#

doesnt work for me

winter rose
#

¯_(ツ)_/¯

flat elbow
#

so i can't lock the driver in position? damn AI

winter rose
#

@flat elbow mods? scripts? milkshake?

#

question for you too @ebon citrus btw - no mods?

ebon citrus
#

[R Alpha 1-1:1 (S.S),<NULL-object>]

#

still the same

#

yep, mods

#

CBA is only scripted mod, though

winter rose
#

still the same
@ebon citrus with my example?

ebon citrus
#

with my example

flat elbow
#

it's a chinhook from RHS that is placed on USS freedom aircraft carrier

winter rose
#

@ebon citrus then try mine

ebon citrus
#

sure, in a moment

flat elbow
#

the mission start, you count 20 to 30 seconds, the driver get out never to be seen again

#

i even tried to moveInDriver him without luck

winter rose
#

try with the helicopter on land? maybe he's "scared" of the carrier

flat elbow
#

yea things on the land works

winter rose
#

there is otherwise no reason for an AI to leave a helicopter, unless it is heavily damaged

flat elbow
#

if I disable his path, would he still leave the heli?

winter rose
#

IDK… perhaps

ebon citrus
#

ok, after the function spawn the object is null

#

before it it's not null

#

so something cleans it up when the function is called

winter rose
#

that's what I meant, yes

ebon citrus
#

ok, so how can i stop it from being cleaned up?

#

can i give it a name?

winter rose
#

it is unscheduled in the EH, then spawn happens, the object gets cleaned up
I don't think you can prevent that
you could, however, replace it with the _Scripted version within the EH

#

(and don't forget to delete it afterward)

ebon citrus
#

that brings a problem

#

i need to check if a groundweaponholder has anything in it before i spawn a new one

#

to determine if i need a new one or not

winter rose
#

yeah?

#

weapon/magazine/itemCargo work

ebon citrus
#

cant be asked

#

i'll jsut check if it's null in the function

#

thanks for the help

flat elbow
#

frontal lobotomy of the driver seems to have done the trick but as soon as i skip the waypoint and reenable it he starts the engine then leaves the helicopter

#

to say that i'm frustraded by the AI would be an understatement

winter rose
#

try with a vanilla chopper?

flat elbow
#

if I delete the chopper and place everything again it will start to work for a while, after a while the problem (or any of the other 5 problems that i have solved) will pop up again

#

i would not believe it either if i had not seen it myself

tiny wadi
#

Can I use EpeContactStart to set the force of the collision to zero

#

or to ignore the collision alltogether?

#

I would use disableCollisionWith but I dont know what the object may be colliding with is the problem

vague canopy
#

is there a script to spawn a c130 and add a paradrop waypoint when a trigger is hit

peak bridge
ebon citrus
#

im having some issues with actions

#

i have the following script:
where Nca_openInventoryObject is the target inventory and _className is the classname of the item to be picked up
player action ["TakeMagazine", Nca_openInventoryObject, _className];

#

the animation plays just fine, but the item is not picked up

#

the following code works to drop said item, but the picking up doesnt work

#
player action ["dropMagazine", Nca_openInventoryObject, _className];```
rustic plover
#

What???

23:27:42 Error in expression <r_option", 0];


private _tableHeight = ‭0.816‬;

private _boxOffset = 2;

p>
23:27:42   Error position: <‭0.816‬;

private _boxOffset = 2;

p>
23:27:42   Error Incorrect number in expression

What wrong with this?

private _tableHeight = ‭0.816‬;
winter rose
#

nothing at all, the error is most likely on another (previous) line

#

unless… you copy/pasted that and there is some invisible character shenanigan going on here @rustic plover 😄

rustic plover
#
if (!isNil "mission_commander_confirmed") exitWith {};

mission_commander_confirmed = false;

// Вместо 0 можно поставить значение по умолчанию
private _option = missionNamespace getVariable ["mission_trigger_option", 0];

// Высота стола
private _tableHeight = ‭0.816‬;
...
#

It's really something strange...

ebon citrus
#

Ok, takemagazine doesnt work

#

is there a command to remove a single magazine from cargo?

#

i can only find "clear" commands

#

which remove ALL items of a type

rustic plover
#

unless… you copy/pasted that and there is some invisible character shenanigan going on here @rustic plover 😄
@winter rose yes, it was an invisible character. WTF, i just copied from win calculator :D

ebon citrus
#

windows calc "." is weird in some languages

#

not sure if it was the case here

winter rose
#

Ok, takemagazine doesnt work
correct

is there a command to remove a single magazine from cargo?
no (unfortunately)

rustic plover
#

No, dot was mine. Calc had me comma

winter rose
#

ah yes, it depends on the locale (Windows setting)

ebon citrus
#

so... count all magazines of a type in cargo, then remove all of them and add back one less?

winter rose
#

yep

#

also, beware of half-filled magazines…

ebon citrus
#

what a brown situation 😅

#

why cant takeMagazine work

winter rose
#

¯_(ツ)_/¯

ebon citrus
#

this is gonna take a bit

winter rose
#

and when you don't set a mag class, the game says "I don't know CfgMagazines.<empty>" !

#

and since there is no takeItem…!

ebon citrus
#

ehhh...

#

im just pulling all items of a type, storing them in an array, and then adding them all back with one less of the class that was taken

#

dropMagazine works fine

#

fortunately

#

im making my own takeMagazine

#

with blackjack and professionals

#

i'm not sure if that word counts as profanity

winter rose
#

it can to some, so we try to avoid it (to my regret, as I like using the expression)

ebon citrus
#

Done

#

there, i made a Nca_fnc_takeCargo

#

it's not perfect

#

because BI doesnt let me find out how many rounds magazines in inventories have

#

but meh

ebon citrus
#

DROPWEAPON DOESNT WORK!

#

ok, NM another command

winter rose
#

@ebon citrus AllCaps

can you try TakeDropMagazine/TakeDropWeapon?

ebon citrus
#

which one is that?

#

to take or to drop?

winter rose
#

these are two undocumented action - that's the action's name, really

ebon citrus
#

"TakeDropMagazine" does nothing

winter rose
#

TakeDropMagazine (maybe it is take/replace)

ebon citrus
#

it probably takes extra parameters that i dont know of

#

i tried player action ["TakeDropMagazine", Nca_openInventoryObject, _className];

#

ok, so dropWeapon works unless the target is a player

#

if the target is a player, you need to removeWeapon and addweapon

#

because, you know

#

you cant DROP into a unit's inventory

#

even if that unit is dead

#

but you can DROP into their backpack

#

BI is being too humane

#

i am somewhat displeased by the recent developments (trying to avoid profanity)

winter rose
#

slightly inconvenienced*

#

please, make an effort! 😄

ebon citrus
#

well, i am equally displeased

#

ha!

#

i'll make my own drop-function!

#

with blackjack and professionals!

#

wait, is blackjack profanity? Its gambling 🤷‍♂️

#

often involves gambling

#

yeah no, it's not profanity

spark rose
#

hey all. Trying to addaction to an AI character so that it will give the player(s) intel

#
informant addAction  
 [
     "Talk to Informant", //title
     {
        cutText ["There is an enemy convoy that will be moving soon. I've marked the location on your map.","PLAIN",1]; //script
     },
     nil,     //arguments
     1.5,     //priority
     true,     //showWindow
     true,     //hideOnUse
     "",     //shortcut
     "true",     //condition
     10,     //radius
     "false",     //unconcious
     "",    //selection
     ""     //memoryPoint
]; 
```sqf
#

on start I get "error, type string expected bool" with the hash mark in front of addAction

#

but it seems correct

#

thoughts?

peak bridge
#

don't put "" on the false

spark rose
#

many thanks friend!

tough abyss
#

How does one apply enableEngineArtillery false; to remove artillery computers from all mortars/vics?

winter rose
#

just like that

tough abyss
#

Ive tried it just like that and does nothing in my sqf

winter rose
#

Effect: Local

tough abyss
#

If its being executed locally, shouldnt it mean it reads my sqf properly? or am I misunderstanding the local term

winter rose
#

"local" means "on the machine that runs the code only"

tough abyss
#

on the machine = my client?

winter rose
#

client, server, wherever the code is run

tough abyss
#

🤔 Im still not catching on, If im running the .sqf in my mission folder and test running the mission, shouldnt it be executed locally then?

winter rose
#

how/where do you run it?

#

I swear, if you tell me these are modded vehicles that are not impacted by the command…

tough abyss
#

shakes scarily one second

#

no were good its the vanilla mk6 🤣

#

and I just put the sqf in with
enableEngineArtillery false;
then proceeded to run the mission in eden editor
and have it do nothing

#

I think im missing a fundamental understanding part of the scripting

winter rose
#

I just put the sqf in
how, where? tell me

#

talk to me! we can get through it together!

tough abyss
#

mission folder dad

#

right underneath the mission.sqm

winter rose
#

so you place a script named "myScript.sqf"

tough abyss
#

i called it arty.sqf 🤣

winter rose
#

aaand how do you call it?

tough abyss
#

🤔

winter rose
#

🔨

#

an SQF file is not automatically called, except for some event scripts ^^

tough abyss
#

so copying and pasting enableEngineArtillery false; into a sqf by itself dosnt work is what your telling me 😿

warm hedge
#

Copy and paste into a sqf (except some special ones) does nothing!!

winter rose
#

yep

place it in init.sqf, it will run by itself 😉

tough abyss
#

so would a execVM work?

winter rose
#

yep

tough abyss
#

🤔 ok thanks for the help ill try not to break things

#

i put it in the init.sqf first and it worked immediately I feel so stupid now

winter rose
#

don't worry you're realising just now that's how people learn 😉

#

better ask and feel stupid for 5 minutes than not ask and be stupid for the rest of your life 🙃

tough abyss
#

Hm, yea I guess thats true, Would you also by chance know the name of a scripting command that sets the time for ammo vehicles/crates to rearm?

winter rose
#

the "reammo refilling rate" ?

#

I believe there is nothing like that,
but you can play with setVehicleAmmoDef to set vehicle's weapons amount in a 0..1 range

tough abyss
#

hm I read that, but I believe
setAmmoCargo Aligns better, as this is for warlords and people will sit next to an ammobox/vic regardless, of the magazine capacity in vehicles. Also Im not sure how to implement this correctly, Because vehicles in warlords arnt preplaced in eden, I cant just use vehicleName

winter rose
#

setAmmoCargo only refills the ammo truck with "ammo load"

tough abyss
#

🤔 might as well try SetAmmoCargo then, but the original problem still remains, vehicle name isnt applicable here and I Dont think substituting for a classname would work

winter rose
#

correct, it won't
which ammo trucks do you want to refill?

#

(and when)

tough abyss
#

Hemmet ammo and csat ammo, and as soon as their spawned in by warlords system.(i.e players calling one in)

winter rose
#

wait, they aren't filled when spawned? 😄

tough abyss
#

No they are, but they are TOO FULL (dont want to see missles flying from one side of the map to the other without the need to change ammo trucks)

#

as it is now you can have a singular ammo truck refill all vehicles indefinetly without issue

winter rose
#

they should not be able to do so "indefinitely" - so maybe this is part of the WL system

#

and if so, any command would conflict with the WL system refilling them

tough abyss
#

🤔 never knew that too many hours in official WL servers. i guess bm-21's cant be used for now

#

In practice though, is their a way around needing a classname to alter vehicles in that manner? could be useful for removing/adding weapons and other vile things

winter rose
#

maaaybe something like that```sqf
private _trucks = vehicles select { getAmmoCargo _x > -1 };

halcyon crypt
#

Is there any way to run code parallel? I'm apparently losing my mind since I thought spawn did that but it doesn't ^^

#

Been too long

warm hedge
#

spawn does

halcyon crypt
#

I'm thinking more in terms of threads. 1 spawn runs parallel to unscheduled but multiple spawns run in a single "thread" apparently

warm hedge
#

No

halcyon crypt
#

Are you sure? I didn't see any time improvement when splitting the code in 2, 4, 8, 16 spawns

#

Like from start to until all spawns are scriptDoneed

warm hedge
#

Time improvement what?

robust hollow
#

1 spawn runs parallel to unscheduled
i dont believe thats correct. as i understand it, unscheduled code freezes everything else until it completes.

halcyon crypt
#

True

robust hollow
#

technically, the more spawns you have the longer it takes for them all to complete, because there are more threads trying to get their piece of the 3ms per frame allocated to the scheduler.

warm hedge
#

Ah I always confuse unscheduled and scheduled

#

What exactly did you do?

halcyon crypt
#

Scanning the map terrain in cells of 100x100

warm hedge
#

I mean what is the code?

winter rose
#

Ah I always confuse unscheduled and scheduled
maybe a mnemotechnic way:
Scheduled = Schedule = timed/planned 🗓️
@warm hedge

halcyon crypt
#

Please excuse the commented code, on my phone, via ssh ^^

winter rose
#

should it be uncommented?

halcyon crypt
#

Yep

#

Ignore all comment tag thingies and that's the code ^^

warm hedge
#
private _mapBounds = [] call ALiVE_fnc_getMapBounds;
private _sectorSize = 1000;
private _subSectorSize = 100;

private _width = round(_mapBounds / _sectorSize) * 1000;

private _jobs = 4;
private _t = _jobs / 2;

for "_x" from 0 to _t - 1 do {
    for "_y" from 0 to _t - 1 do {
        private _handle = [_width / _t, _subSectorSize, [_x * (_width / _t), _y * (_width / _t)]] spawn TEST_fnc_analyzeTerrain;
        _scripts pushBack _handle;
    };
};

waitUntil {
    for "_i" from (count _scripts) to 0 step -1 do {
        if (scriptDone (_scripts select _i)) then {
            _scripts deleteAt _i;
        };
    };

    (count _scripts) == 0;
};```Uncommented things out
halcyon crypt
#

👌

warm hedge
#

And once again, what did you expected for this code, how it should behave and how isn't?

halcyon crypt
#

it's behaving fine but if spawns ran parallel it should've ran faster basically halving the runtime with 2 jobs, etc

warm hedge
#

It should slower

robust hollow
#

depending on what happens in TEST_fnc_analyzeTerrain I'd say you could just call it and forget waiting for script handles entirely.

halcyon crypt
#

As it is yes but I'll need to do stuff with the results eventually

#

analyzeTerrain basically tests 5 points in a cell for it's terrain type

#

So yeah I'm trying to optimize it so that mission loading times stay somewhat reasonable and I'd basically need parallelism for that 😋

#

The code itself can be optimized further but I was trying out the spawns last

robust hollow
#

assuming you dont need scheduled commands, executing the whole thing unscheduled would complete the fastest, though the game might freeze for a moment. otherwise i believe a single spawn would be just as fast, if not faster than multiple.

#

alternatively you could save the results of an analyzed terrain so it doesnt need to happen every time the mission starts, but that may not be quite what you're after.

halcyon crypt
#

Caching is one of the things to look at but I'm still at the early stages

#

Wait, it's probably the sufaceIsWater call that's holding it back 🤦‍♂️

#

I'll test some more tonight I guess ^^

vague geode
#

I know that you can draw e.g. triangles and polygons on the map with findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", { /*code*/ }]; but is there a way to draw the same markers (or copies of them) on the mini map, too?

winter rose
#

(I suppose IDD_CUSTOMINFO_MINIMAP, 311)

vague geode
#

@winter rose Ok. I tried both findDisplay 133 displayCtrl 51 and findDisplay 160 displayCtrl 51 (for UAV Terminals) but neither worked...

winter rose
#

133?

#

ah yes, IDD_MINIMAP
tried 311?

vague geode
#

@winter rose I don't think so, but I will try it later.

winter rose
#

that's the customInfo minimap, so I suppose so
maybe 133 was the id before the custom info panels

robust hollow
#

this is what i have

((uinamespace getVariable "RscCustomInfoMiniMap") displayCtrl 101) ctrlAddEventHandler ["Draw",{}];
vague geode
#

Ok, followup question: Where can I find what the different displayCtrl IDs stand for? I searched for them all over the wiki but couldn't find anything...

robust hollow
#

look at the control you want to use in the config viewer

vague geode
#

Ok, will look at that as well.

winter rose
granite zealot
#

Anyone every compared setting texture vs animateSource for something like a blinking light ? My guess would be texture setting should perform way better and result in less network traffic

real tartan
#

is there a way to check if animation exist ? I want to check if I can use animation from mod, and not select it when mod is not loaded

#

isClass maybe ?

warm hedge
#

Probably, though I don't think that's a case...

robust hollow
#

could check if the state is in a moves class
eg: isClass(configfile >> "CfgMovesMaleSdr" >> "States" >> "AadjPcrhMstpSrasWpstDdown")

warm hedge
#

Ah, thought you're talking about animations of vehicles

robust hollow
#

in the case of a vehicle it might be eg:
isClass(configfile >> "CfgVehicles" >> "I_MRAP_03_F" >> "AnimationSources" >> "Door_LF")

#

idk. odds are it is defined in a config somewhere

granite zealot
#

Can't you just use the config viewer if the Animation has a proper source defined ?

warm hedge
#

?

robust hollow
#

not for the purpose of checking in a script, no

granite zealot
#

Ahh, I thought he just wanted to know

real tartan
#

@robust hollow "CfgMovesMaleSdr" is base one used also for mods ? what about these: "CfgMovesMaleSdr_TC3", "CfgMovesMaleSdr_TC4"

warm hedge
#

TC somethings are really not things

robust hollow
#

i dont know, i guess so. the states in the TC classes seem to be vehicle crew states mostly. you'd need to check the mod you're using as to what class it is defined in (most likely CfgMovesMaleSdr).

real tartan
#

@robust hollow

_animations = ["c7a_bravotleskani_idle5", "Acts_CivilIdle_1"] select { isClass(configfile >> "CfgMovesMaleSdr" >> 
"States" >> _x) };
warm hedge
#

I think this should work

robust hollow
#

pretty sure acts arent states though

#

apparently this one is 🤔

winter rose
#

Acts = Animation Cutscene

robust hollow
#

turns out most of them are 🤦‍♂️

warm hedge
#

Every of them are

robust hollow
#

some are "actions". whatever the difference is.

winter rose
#

which ones? thonk

robust hollow
#

or, they're in the actions class atleast

#

idk what im on about.

#

configfile >> "CfgMovesMaleSdr" >> "Actions" >> "Acts_CarFixingWheel_actions" for example. its not an animation i dont think so ill just pretend i didnt see them in there 👍

warm hedge
#

¯_(ツ)_/¯

winter rose
#

idk 😄

vague geode
#

@winter rose allDisplays returns [Display #0,Display #313,Display #70,Display #46,Display #49,Display #12] so findDisplay 311 displayCtrl 51 ctrlAddEventHandler ["Draw", { /*code*/ }]; doesn't work.

robust hollow
#

get the display using the uinamespace variable

vague geode
#

That doesn't work either.

winter rose
#

is the mini map open?

robust hollow
#

((uinamespace getVariable "RscCustomInfoMiniMap") displayCtrl 101) does work in debug for me right now.

vague geode
#

Ok, I will try again.

robust hollow
#

i notice you're trying ctrlidc 51 though

burnt cobalt
#

what would you guys reckon is the best way to determine if a weapon is a cannon?

#

my best shot so far (but I wonder if it might miss a lot of modded cannons) ```sqf
_isCannon = "cannon" in toLower (configName (inheritsFrom (configfile >> "CfgWeapons" >> _weapon)));

warm hedge
#

Check nameSound IMO

burnt cobalt
#

@warm hedge ha, thanks. i wonder why i didn't go for that 😇 🤔

warm hedge
#

I know this might be a stupid way either 😛

burnt cobalt
#

i had issues with RHS that i didn't have in vanilla. just realized that the RHS cannon in question inherits from the 120_mm cannon, the 'inheritsFrom' is returned differently but 'namesound' is identical in the weapon config so it seems to be the better way

vague geode
#

@robust hollow No, doesn't work.

robust hollow
#

r u trying to use the map ctrl?

#

like, the minimap map ctrl

vague geode
#

I used exactly what you sent me: ((uinamespace getVariable "RscCustomInfoMiniMap") displayCtrl 101) ctrlAddEventHandler ["Draw", { /*code*/ }];

robust hollow
#

so when u say it doesnt work, is it that the event doesnt fire or the ctrl isnt found?

still forum
#

controls have draw handlers?

#

ah they do 🤔
Would've just added it onto the display itself

vague geode
#

@robust hollow It is that the marker isn't visible on the minimap after running the code.

robust hollow
#

but the ctrl is found and the event is added?

#

@still forum

onDraw

    Use on: Map
    Fired on: Fires when the map is drawn (can occur more than once per second).
    Returns: Returns the map control.
#

doesnt say about working on displays 🤔

vague geode
#

@robust hollow No entirely sure but the return is 0 instead of -1 so I guess it is.

robust hollow
#

ok so its a problem with the event code, not with how the event is added.

still forum
#

oof

vague geode
#

@robust hollow No, the event code is definatly working since I use the same event code to draw the marker on the normal map (findDisplay 12).

robust hollow
#

this marker is made with drawIcon?

vague geode
#

No, drawTriangle and drawPolygon.

robust hollow
#

both commands work for me. in your event code do you reference the ctrl idc directly or do you use the ctrl parameter provided by the event?

vague geode
#

I use the ctrl parameter provided by the event.

robust hollow
#

mm, well idk why it isnt working then.

#

want to paste the event code?

vague geode
#

It is just _this select 0 drawTriangle [/*...*/]; and _this select 0 drawPolygon [/*...*/];...

winter rose
#

ever heard of params our Lord and Saviour? ^^

vague geode
robust hollow
#

have you tried that example on the minimap ctrl? does it work for you?

winter rose
#

@vague geode Wiki gonna be corrected 👀

vague geode
#

@winter rose Ok, how else should I do it then?

winter rose
#

see the wiki 😉

#

it's not mandatory, it's more Best Practices

high silo
#

So.. Im trying to get it where when a heli lands near a AI group, they run and get in it. Then when get to there LZ they dismount. I need to be able to repeat this with several groups of AI. Any tips?

exotic flax
#

make an array of AI groups, loop over them and execute the scripts to have the heli do the transport

high silo
#

The heli will be flown by a player thats the issue

exotic flax
#

trigger -> if heli present, move AI, repeatable

high silo
#

I set up a trigger with if any player is present, then on activation

_Tr1 = T1 addWaypoint [[6888.06,1112.54,0],0]; 
_Tr1 setWaypointType "GETIN NEAREST";
#

but that didnt wanna work

#

And I cant do it on a specific heli, as idk which helicopter the player will pick