#arma3_scripting

1 messages Β· Page 311 of 1

little eagle
#

me?

split coral
#

Was it that you were missing?

little eagle
#

thanks. I'll see if it's useful or not

austere granite
#

Hngggg

#

Seems gut

vapid frigate
#

i've done that manually with nested controlGroups.. so it is possible without it

austere granite
#

Yea same here, works fine but was always annoyed that something like this didn't exist yet

vapid frigate
#

yeh

austere granite
#

Just one of those things that would seem so likely to have

#

At least controlsGroupCtrl command made it a lot easier to work with them

vapid frigate
#

yeh and control setVariable ...

#

used to have invisible labels to store extra data lol

little eagle
#

Some control types are not suitable for use inside of Controls Table. These include e.g. control containers (Controls Group and Controls Table) ...

#

RIP

vapid frigate
#

may not need a controls group?

#

i think the rows might effectively be controls groups?

#

well i guess depends what you're doing.. but you can have multiple controls in each row

#

looks like the commands are all in dev branch only ctAddRow, ctAddHeader, ctClear, ctCurSel, ctSetCurSel, ctRowControls, ctHeaderControls, ctRowCount, ctHeaderCount, ctSetValue, ctValue, ctSetData, ctData, ctFindRowHeader, ctFindHeaderRows, ctRemoveRows, ctRemoveHeaders, ctSetRowTemplate, ctSetHeaderTemplate

split coral
#

double RIP then

little eagle
#

needs too many unknowns for controls table

vapid frigate
#

yeh ok.. guess i'd use nested controlsgroups

rotund cypress
#

But that is how the ControlsTable works as well if I'm not mistaken? @vapid frigate

vapid frigate
#

seems the controlstable uses a template that it reuses for each row

#

which wouldn't easily work with what commy is doing

#
  • it doesn't exist yet
rotund cypress
#

What is he doing?

vapid frigate
#

that pic

rotund cypress
#

What is that?

vapid frigate
#

game options with colour pickers i guess

rotund cypress
#

oh

little eagle
#

I'd make something like the google color picker, but that'd be even more complicated on the inside

austere granite
#

In some cases it would probably be useful still

#

i got some cases where i'd use it, but others where i'd go NOPE

simple fiber
#

HANZ

split coral
little eagle
#

Yes.

#

Not as complicated. Just RGB, because it's meant for the average user.

#

But basically this

rugged basalt
#

Is there a way to detect if client loaded all scripts?

#

Im asking because my server is tried to call function on client that was not yet initialized

#

I would like to wait until all players called their scripts and then execute thiss function

vapid frigate
#

can put the name of the function in a 'watch' in the debug console

#

it should come up your script (and a bit extra).. if it's blank, it doesn't exist

rugged basalt
#

what about getClientStateNumber?

#

does in-game mean all scripts are loaded?

#

@vapid frigate what?

still forum
#

Set a variable on the player after the functions initialized like player setVariable ["scriptsDone",true,true] and then you can check that serverside

#

Depends on how you are "loading" your scripts

rugged basalt
#

most by execVM

#

and execVM is asynchronous yup?

vapid frigate
#

probly better to use CfgFunctions or PREP.. then they all exist at the start

still forum
#

Well.. I suggest changing the way you are "loading" your scripts then... Yes it is. And I think async scripts only start after the briefing screen.

little eagle
#

Yeah. Use preInit to define the functions.

vapid frigate
#

execvm runs .sqf files though.. so nothing should need to be 'loaded'

still forum
#

CfgFunctions are initialized before the briefing screen. so better use that.
or preInit but without execVM.

rugged basalt
#

ok thanks

little eagle
#

The functions in CfgFunctions are defined in preInit "internally"

rugged basalt
#

I'll try to use CfgFunctions for now

little eagle
#

The less race conditions you create,the easier it is to follow the code.

#

And doing more scheduler threads only means more race conditions.

rugged basalt
#

yeah I would like to keep it stable

little eagle
#

Lecks, even if you use execVM, the script could depend on other functions.

vapid frigate
#

yeah, true

#

the script should start running but won't necessarily work

rugged basalt
#

script is waiting for data from server after function execution

little eagle
#

But it should also complain about undefined variables in scheduled environment, so at least you will be told...

rugged basalt
#

so there should be enough time for other scripts to initialize

little eagle
#

"should be" : D

rugged basalt
#

script uses pre-defined cfgFunctions anyway

#

so they're in preinit

vapid frigate
#

i'd probably remoteExec from the server after it's done its thing in that case

rugged basalt
#

it is remotexec from server

#

but server sometimes sends command too fast and client didnt load that function yet

#

that's why I'll try cfgFunctions

vapid frigate
#

yeh ok.. hopefully that'll solve it

rugged basalt
#

I can always make a small sleep delay

tough abyss
#

Remoteexec the functions in array. Last item in the array is a true variable.
That you can do waitUntil {(last item in array)}
That way you know client has all the functions

Or just add the functions to the missionfile

rugged basalt
#

yeah I added them to cfgFunctions

#

also did a 5 second sleep for server to remoteExec just to be 100% sure

#

stupid keyboard, sorry for typos. Need to replace it

loud python
#

I have a question

#

I have a variable life_isknocked that is local on one machine

#

Given a Unit, I need to check the value of that variable on the machine that the unit is local to / of the player who controls that unit

#

also, how does setting a variable on a unit work?

#

do getVariable and setVariable automatically set it on the machine were the unit is local, or is is that local to the machine were it is executed?

still forum
#

just player setVariable ["life_isknocked",true,true] last true makes it global

loud python
#

okay, that answers both questions

still forum
#

then you can use _unit getVariable "life_isknocked from any client

brazen sparrow
#

does anyone know how to restart (press esc -> Restart) a mission in the editor via sqf?

#

or sqf to start a mission in 3den

cloud cove
#

I have a question for the DMS I would like the vehycule spwan no gas have you a ling of scrip that I must add and or I must add it(Γ©ditΓ©)

still forum
#

Uhm.. English please?

#

vehicle spawn no gas? setFuel 0 ?

tough abyss
#

@cloud cove DMS is built for exile. Probably better support then asking here. This more related to generic arma.

blazing zodiac
#

God damn I hope they fix flyInHeightASL for the jets dlc

#

Would be kinda funny to still have it broken in a dlc specifically for fixed wing craft

tough abyss
#

shit

#

i was looking for something like forgetTarget

kindred lichen
#

Hey, does anyone know a call to "Get" an array of spawn locations available to a side in game?

#

I'm trying to add AI to a player's respawn vehicles randomly, so when they respawn, they can grab a squad to go with them.

#

I don't want to have a "recruiting" function, because it sort of breaks immersion.

#

We use ACE, so it's easy to join a squad of AI and take command of them.

peak plover
#

How do I get ALL the possible seats in vehicle

#

Empty would be great

#

nvm, I think fullcrew [vehicle ,''] works

jovial ivy
#

@peak plover Are you wanting to like, get all available seats with their positions? Or just find the first empty seat

peak plover
#

I wanted to get all empty seats

#

_usedSpots = fullCrew [_vehicle,''];
_allSpots = fullCrew [_vehicle,'',true];
_emptySpots = _allSpots - _usedSpots;
#

I ended up using this

jovial ivy
#

Is that workin for ya?

peak plover
#

I'll try in a few hours when I get my script running and into arma

#

Trying to make a script that has an AI drop off people in a helicopter

#

oooh thanks

#

That is exactly what I needed

jovial ivy
#

Actually. This would work beter I suppose. Really depending on your needs and how you choose to modify it(the sytax for emptyPositons = _unit emptyPositions _position) ```
waitUntil { ([vehicle, "Cargo"] call Client_GetEmptySeats) == 0 };

Client_GetEmptySeats = {
_vehicle = _this select 0;
_check = _vehicle emptyPositions (_this select 1);
_check
};

#

You shouldnt need the function actually. All you would need is: waitUntil { (vehicle emptyPositions "Cargo") == 0 };

night frigate
#

Any way to change the loaded magazine when setting loadouts for AI in the editor (by using the Edit Loadout option to get to Arsenal)?

peak plover
#

first magazine added ?

little eagle
vapid frigate
#

too much errors

#

i haven't seen any in 1.68.. we also use ace on 40-50 player ops

little eagle
#

Oh, I'm sure it's riddled with errors.

vapid frigate
#

at least he used the template

peak plover
#

It forces the template. You start with the template

vapid frigate
#

oh ok lol

merry ibex
peak plover
#

He only change the title

vapid frigate
#

looks like he signed up to github just to make that contribution

worthy spade
#

Just reduce the errors damnit.

peak plover
#

I actually have a ace error in the main menu, forgot what it is, but after leaving a server and going to the main menu, there is a script error

#

bethesta studio pls fix

little eagle
#

spectator?

vapid frigate
#

name looks wrong?

#

would usually be ace_weather_rain in ace

rancid ruin
#

hey @little eagle what's your AGM_COH mod on github?

vapid frigate
still forum
#

And It's called ACE_weather_rain Woops no it's not

still forum
#

PublicVariableEH's are always missionNamespace

vapid frigate
#

it's GVAR(ACE_Rain)

#

that would be ace_weather_ACE_Rain

still forum
#

Well.. It's just a normal ACE script that's executing there. No Idea why Battleye complains

vapid frigate
#

is it talking about the ACE_WIND_PARAMS part then?

#

rather than the ACE_rain part

#

have you added that to your filter?

still forum
#

Well.. It's postInit.. So no. No uiNamespace

placid root
#

hey:) does anybody know why my lightsource is flickering all the time? (attached to a flying plane)

#

_light = "#lightpoint" createVehicleLocal [0,0,0]; _light setLightBrightness 0.1; _light setLightAmbient [1, 1, 1]; _light setLightColor [1, 1.0, 1]; _light lightAttachObject [plane, [0,0,0]];

jade abyss
#

Lightsources to a Vehicle/moving object = Bad idea.

#

They won't hold Position properly and lag around

placid root
#

ok then chemlight it is πŸ˜›

jade abyss
#

yep

little eagle
#

@rancid ruin
Template for company of heroes mod. Not finished and unlikely to be ever finished.

#

JIP (Optional):

String or Boolean - If true, function generates a unique ID for the message and the message itself is added to the JIP queue and executed for every JIP. If a non-empty string is given, it is treated a custom ID of the message and the message itself is added to the JIP queue overriding any remoteExecCall message with the same ID. Otherwise, no ID is generated and no message is placed into the JIP queue. [default: false] (see also Example 7 on how to remove previously set function from JIP queue)

#

So I guess it appears 100 times in the JIP quene.

#

Since it generates a new JIP id since it uses "true".

rancid ruin
#

did you have something specific in mind for that COH mod or were you just testing?

little eagle
#

I wanted to make a template first and then maybe do stuff. CoH1 is pretty dead though.

#

So hard to motivate. And I don't have unlimited time, so I rather do Arma. πŸ˜ƒ

rancid ruin
#

yeah fair enough

#

coh doesn't have many players but there is a strong core of like 500 people who are hardcore coh1 people

#

OMG mod is still played regularly

hollow lantern
#
if (rank _caller >= "SERGEANT" && _state isEqualTo "doDeSpawn") then``` can someone explain me why this generates an error? ```sqf
if (rank _caller <= "SERGEANT" && _state isEqualTo "toLab>
12:37:23   Error position: <<= "SERGEANT" && _state isEqualTo "toLab>
12:37:23   Error <=: Type String, expected Number,Not a Number
12:37:23 File C:\Users\Aebian\Documents\Arma 3\missions\[A]_Cuda.Woodland_ACR\itsAebian\lab_gate.sqf, line 11
12:39:18 Error in expression <s ["_state", "_obj"];``` I followed https://community.bistudio.com/wiki/a_greater=_b this
indigo snow
#

yea but something can't be greater or less than a string ("SERGEANT")

hollow lantern
indigo snow
#

hence it gives an error

#

= can only compare numbers

hollow lantern
#

hmm then I need to translate it to numbers

little eagle
#
!(rank _caller in ["PRIVATE", "CORPORAL"])
#

I guess

indigo snow
#

Or that one

little eagle
#

Oh, that is nice

#

Use that.

hollow lantern
#

hmm nice thanks you two

indigo snow
#

do you understand why it gave you an error now, too?

hollow lantern
#

yes you cant compare integers with strings

#

or numbers in general

#

I know I just didn't read the wiki enough πŸ˜„

indigo snow
#
Error <=: Type String, expected Number,Not a Number

This part of the error tells you exactly where it's failing, for future reference

little eagle
#

Well, you tried to compare two strings. And
"PRIVATE" >= "SEARGEANT"
is simply undefined.

#

@indigo snow CoH is a fun game and one of the best RTS, but splitting the community with the shit that CoH2 is killed it.

#

Sry I meant to tag oneoh -_-

high vigil
#

Hi guys, whats the best way to limit darter range to X meters ?

#

"efficient way"

#

this is how far i got and failed

#

[] spawn { while {getConnectedUAV player} do { _drone = _vehicle isKindOf "UAV"; _range = missionNamespace getVariable "GAMEPLAY_DARTER"; _ctrl = UAVControl _drone; _seat = _ctrl select 1; if (_seat == "driver" || _seat == "gunner") || _range < getPos Player then { player connectTerminalToUAV objNull; titleText ["Signal to UAV is LOW"]; }; }; };

rancid ruin
#

@little eagle yeah coh2 is shit, we're on the same wavelength with that πŸ˜„

#

someone in this channel once said they were working on a coh-like RTS mode for arma...can't remember who it was though

#

cos i would definitely like to help with that project

glass temple
#

How could I do a ratio?

jovial ivy
#

coh as in company of heroes?

little eagle
#

Yes

jovial ivy
#

@glass temple Whatcha mean?

#

Ah. I saw that floating around a while back. Never got up to getting it.

#

Isn't it kind of like Men of War Assault Squad 2?

glass temple
#

Basically calculate ratios in arma.

jovial ivy
#

Use distance @high vigil

little eagle
#

raΒ·tio
noun
the quantitative relation between two amounts showing the number of times one value contains or is contained within the other.

#
10/24

???

dusk sage
#

50 dogs/elephant

jade abyss
#

Bananas

dusk sage
#

10 commy2/SQF

little eagle
#

Maybe there is a secret meaning of "ratio" I'm not aware about.

#

Like how Bambis aren't deer these days.

tender fossil
#

What's the best editor to write SQF (in your opinion)? I'm making lots of small mistakes that result in endless errors, and I'm wondering if there is a text editor that would notice these syntactic errors (like missing ; or missing "do" in switch statement)

scarlet spoke
#

eclipse with SQDev

#

@tender fossil

#

But that may be my favorite because I wrote that plugin myself πŸ€“
However it should do the trick for you πŸ˜‰

tender fossil
#

There's Eclipse plugin for SQF? Woah πŸ˜ƒ

#

I'll definitely try it out, thanks for the tip!

scarlet spoke
#

You're welcome

#

Don't forget to join our discord (link in the linked post) so we/I can help you ther if you encounter any difficulties πŸ˜ƒ

jovial ivy
#

You're with a star. Fancy lol

scarlet spoke
#

Damn xD

still forum
#

I'm using Atom. Lots of people are using Sublime

#

Oops should read first.

#

Only Editors I know that support syntax checking are Eclipse with SQDev and Arma Studio

dusk sage
#

VSc aswell

tender fossil
#

@still forum Has syntax checking version of Arma Studio been released yet?

still forum
#

yes.. was included in the alpha. But Arma studio is not usable for writing code yet. As autocomplete is mostly useless. Atleast I need Autocomplete to write SQF. Other people may not

tender fossil
#

Checking out the Eclipse SQDev now... Do I need to do something in order to enable syntax checking?

wintry wave
#

Sublime ftw

scarlet spoke
#

Nope it works out of the box...

tender fossil
#

Thanks for @scarlet spoke, we got the issue solved by taking a closer look πŸ˜ƒ

#

Then the next question in the endless series: How do I delete a line drawn with drawLine?

queen cargo
#

Wait a frame?

hollow lantern
#

Can someone explain for me EH? I want to add a MPHit EH to an Object to trigger an explosion if it has been hit atleast two times. sqf _obj addEventHandler ["MPHit", {params ["", "", "_damage"]; if (damage _obj > x ) then {/* Explosion here */}}]; was my tryout but for sure its wrong

jovial ivy
#

@queen cargo Draw line is a map function which doesn't have to be ran each frame. (from what I can tell)

#

@hollow lantern _obj addEventHandler ["MPHit", { _object = _this select 0; _hits = _object getVariable "hitTimes"; if(isNil "_hits") exitWith { _object setVariable ["hitTimes", 1]; }; if(_hits == 1) exitWith { //Explode the object. The if statements says that if it has been hit once, then explode since it just got hit again(meaning it was hit twice) _object setVariable ["hitTimes", 0]; }; _object setVariable ["hitTimes", (_hits + 1)]; }];

hollow lantern
#

oh nice thanks

hollow lantern
#

are addMPEventHandler only triggered in MP? I tried that locally on a unit but the EH was not fired

jovial ivy
#

I can only assume so. Just use _unit addEventHandler [];

subtle ore
#

hey quick question here, so whenever I use configClasses to return a bunch of classes based off of a base, it obviously returns the config entries. For weapons I just grab the _generalMacro variable for each entry. But for items it's totally different, for each item the _generalMacro is always "Item_Base_F" any ideas?

jovial ivy
#

What are you wanting to grab?

vapid frigate
#

configName ?

subtle ore
#

already tried, keeps returning the config entry @vapid frigate

#

@jovial ivy I'm trying to grab the classname.

vapid frigate
#

configName is the class name

jovial ivy
#

Well. Items are stored with CfgWeapons but im assuming you know that

subtle ore
#

Right that's why I'm so confused. @jovial ivy Indeed i do

vapid frigate
#
Result is "CfgVehicles"```
subtle ore
#

Hmmmm...weird. Letme try this again and I'll report back.

vapid frigate
#

i would use that anywhere instead of "_generalMacro"

#

no idea what _generalMacro is/does tbh

subtle ore
#

Meh, I saw it worked only for the weapons anyways lol.

vapid frigate
#

ok just looked it up.. String: in Arma 3. Has no purpose whatsoever. It is generated automatically by BI developer tools for debugging See here for explanation

subtle ore
#

Generated automatcially? Are you sure?

vapid frigate
#

so it'll only work for mods created with BI developer tools

#

(possibly not mikeros?)

subtle ore
#

Hmm..I don't think that's totally accurate. But alright, since I know to identify units with modifications you need that defined to something custom like "mid_mySuperAwesomeUnit_F"

#

kind of concept

vapid frigate
#

so yeah.. good chance it's not accurate

subtle ore
#

They seriously need somebody to go through and double check everything documentated, could be misleading for some items.

vapid frigate
#

you don't need it to identify units

#

typeOf _unit, or if you have the config entry, className (configFile >> "cfgVehicles" >> _class)

#

the latter is sorta useless using it like that because it just returns _class

subtle ore
#

I mean, think realistically though. Do you really want to do that for each unit you want to use from an addon? Especially if you have to make an array of them all for a function or something

vapid frigate
#

as opposed to what?

#

configText (configFile >> "cfgVehicles" >> _class >> "_generalMacro") ?

subtle ore
#

I think we're talking about two different things all together. I was talking about in a addon defining the unit's classname

vapid frigate
#

yeah maybe we are sorry, thought u were after the classname of a config

subtle ore
#

Nata my friend, no worries though.

vapid frigate
#

you might want configSourceMod / configSourceAddonList / configSourceModList ?

#

that tells you what mods created/contributed to classes

subtle ore
#

Right, are items packed individually?

vapid frigate
#

usually not

subtle ore
#

Wait what? You're telling me in terms of where the items are defined you can't tell the difference between weapons and items?

hollow lantern
#
//  _null = [(thislist select 0)] execVM "thisScript.sqf";

params ["_noob"];

if (unit isEqualTo _noob) then {} ``` Question is will the code after ``then {}`` will only run for the unit that activated the script?
vapid frigate
#

not necessarily.. a pbo can have both items and weapons

#

and vehicles, etc

#

if that's what you mean

#

@hollow lantern yeh, only clients (or servers) that run it

subtle ore
#

@hollow lantern Depends if it's true or not....tehehe.

#

Well, no. I mean in terms of how BI has sorted it all out. like in the configSourceMod Example : configSourceMod (configFile >> "CfgVehicles" >> "Car"); "Returns A3"

hollow lantern
#

yeah I just have a script that displays a text via "\a3\missions_f_bootcamp\Campaign\Functions\GUI\fn_SITREP.sqf"; and I don't want the text to be shown to everyone

vapid frigate
#

that's telling you what mod it's defined in.. in that case Car is defined in the base A3 mod

#

depends what you want to do

#

are u trying to categorize cfgWeapons/vehicles?

subtle ore
#

Well yes, I'm using that in combo with configClasses.

vapid frigate
#

unfortunately i don't think it's as easy as reading the mod/addon it's from

subtle ore
#

I didn't particularly want to do that in the first place, I had used this method before.

vapid frigate
#

because if it says RHS_M4, that doesn't really tell you if it's a weapon/item

jade abyss
#

dafuq are you guys trying to do?

subtle ore
#

rifles have a rifle parent

jade abyss
#

Only read half of it and my headache increased^^

subtle ore
#

Grab a bottle of aspirin Dscha, it's only going to get worse.

jade abyss
#

Nothing left -.- Need to wait 4more hours -.-

subtle ore
#

What? You already consumed your aspirin or is it the overdose warning that is getting to you? πŸ˜›

jade abyss
#

4 more hours until i can get a new pack of Ibo.
Anyway, too much offtopic. So again:
Dafuq are you guys trying to achieve?

subtle ore
#

Lool, I'm trying to sort items from weapons :/

#

"(configName _x) isKindOf['Item_Base_F',configFile >> 'CfgWeapons']" configClasses(configFile >> "CfgWeapons");

jade abyss
#

_list sort true;
Problem solved, next one.

hollow lantern
#
/*
author: @Aebian
description: doomed!
returns: message!
//  _null = [(thislist select 0)] execVM "doomed.sqf";
*/

params ["_noob"];

if (unit isEqualTo _noob) then {

titleCut ["", "BLACK OUT", 2];
    [
    ["Urgent Message:","font = 'PuristaSemiBold'"],
    ["","<br/>"],
    ["You failed so bad!","font = 'PuristaMedium'"],
    ["","<br/>"],
    ["Leave the battlefield!","font = 'PuristaLight'"]
    ]  execVM "\a3\missions_f_bootcamp\Campaign\Functions\GUI\fn_SITREP.sqf";
    }``` Anyone knows why this is not working? Unit is BLUFOR, trigger is set to activation BLUFOR and on repeatable
jade abyss
#

whats "unit"?

#

+omg, trigger? -.- no, cmon... no trigger

jovial ivy
#

There isn't a ; at the last bracket.

#

Just so ya know.

hollow lantern
#

yes a trigger Dscha, deal with it. And well I want the text just to be presented to the guy who activated the trigger

#

because the script runs in mp

jade abyss
#

"deal with it" erm... nope.

vapid frigate
#

@subtle ore #define IT_HANDGUN 2 #define IT_SCOPED 0 #define IT_RIFLE 1 #define IT_LAUNCHER 4 #define IT_BINOCULAR 4096 #define IT_ITEM 131072 _allWeapons = "(getNumber (_x >> 'type')) in [IT_HANDGUN, IT_RIFLE, IT_LAUNCHER ]" configClasses (configFile >> "CfgWeapons");

#

if they're items, they'll also have an _x >> "ItemInfo" >> "type"

#

which will be one of these:

subtle ore
#

Oh....what in the hell. Cool.

vapid frigate
#
#define IIT_SCOPE 201
#define IIT_RAIL 301
#define IIT_BIPOD 302
#define IIT_HEADGEAR 605
#define IIT_UNIFORM 801
#define IIT_VEST 701
#define IIT_NIGHTVISION 616```
subtle ore
#

Yes yes, wow. Thanks.

vapid frigate
#

don't know if those macros will actually work in the quotes.. i use it a bit different

#

might need to just use variables or put the numbers in

jade abyss
#

No need to use the #defines. Only the the numbers work also.

vapid frigate
#

yeh, just a lot harder to read πŸ˜ƒ

jade abyss
#

Yeah

#

_HANDGUN = 2;
_SCOPED = 0;

#

etc. bla

subtle ore
#

🀷 Works, I'll go back and make it look beautifal in the end lol.

vapid frigate
#

i still use a manual list of things to put into 'misc' and 'medical' categories.. not sure if you can detect that

#

they generally use a random one of those IITs

subtle ore
#

Yeah that's odd.

#

Woops

#

Okay, even weirder. The only thing that method returns is: ["UniformItem","VestItem","HMDItem","HeadgearItem"]

vapid frigate
#

i can give you my code for categorizing stuff if you want, but it's not pretty

subtle ore
#

Shoot

vapid frigate
#

i hope commy doesn't see this

subtle ore
#

you don't see anything

#

configProperties vs configClasses? 🀷

jovial ivy
#

@vapid frigate _magazines pushBAck -_-

vapid frigate
#

this was written before pushback

#

before configClasses i think too

#

err nvm can't have been before configClasses

subtle ore
#

what's the difference between the two? configProperties and configClasses ?

vapid frigate
#

configClasses would probably work better i guess? not sure

subtle ore
#

πŸ€”

vapid frigate
#

A bit slower than configClasses but allows to access inherited entires.

#

depends if you need those entires

subtle ore
#

entries like what?

#

Like parents? Er?

vapid frigate
#

it sounds like configClasses would only give you the classes that were defined in that config, not it's parents?

#

not sure

subtle ore
#

I'm not really sure what entires would detail 🀷

vapid frigate
#

so would probably make no difference for CfgWeapons, but could make a difference for cfgWeapons >> "MX_Rifle_F"

subtle ore
#

in terms of code performance or just grabbing information in general?

vapid frigate
#

both, configproperties can grab more information (including variables, and inherited classes), but is also slower

subtle ore
#

Right.

vapid frigate
#

i think configClasses would probably be more efficient and get everything u need in this case

#

but i cbf changing/retesting it since i just do it in preinit and it takes <1sec anyway

subtle ore
#

yeah that works

vapid frigate
subtle ore
#

That makes sense

#

Alright, so I did a little test thing here. _allItems = configProperties[configFile >> "CfgWeapons","(getNumber(_x >> 'type')) in [131072]",true];

#

returns everything and adds everything just fine, one problem. Get this litle pop up "/acess is not a class ('type' acessed)

vapid frigate
#

ah ok, because _x can be a variable, not a class

subtle ore
#

Well I would assume it's just checking for that specific number though?

vapid frigate
#

_allItems = configProperties[configFile >> "CfgWeapons","isClass _x && {(getNumber(_x >> 'type')) in [131072]}",true];

subtle ore
#

Ahhh..yes I see now

#

I assumed as much

hollow lantern
#
 if (_wep isKindOf ["CannonCore", configFile >> "CfgWeapons"]) then{}``` I guess (or hope) that will also trigger on a weapon that has the parent CannonCore?
vapid frigate
#

depending what _wep is, yeah

hollow lantern
#

select 1 --> weapon

#

thx

subtle ore
#

Okay, yet another question if any of you might want to enlighten me on this one. I want to find out the faction type for each of these uniforms, headgear, etc. Any ideas? Faction and side variables don't work they all default in the config viewer and in a ingame run

vapid frigate
#

i only know of 'side' on uniforms

subtle ore
#

keeps defaulting to 3

vapid frigate
#

that's civs

subtle ore
#

Right, but even if I use a blufor uniform it's always 3?

vapid frigate
#

hmm shouldn't be

subtle ore
#

Letme do another run

vapid frigate
#

actually, can see where i do it around line 227 on that pastebin

#

it gets the CfgVehicle part of the uniform that the CfgWeapon is pointing to, and gets the side from that

subtle ore
#

Interesting, okay.

#

So very very odd. I got it to return this: [0,1,3,2,7]

#

all those being sides 0_o ... 7?!?

vapid frigate
#

hmm.. 7 is ENEMY i think?

#

keep in mind you'll be getting items with scope=0 and 1

#

which likely aren't designed to be used

subtle ore
#

Right, I understand that. Some even with scope=2 like RHS

hollow lantern
#

can someone point me in the right direction? sqf if (vehicles isKindOf ["rhsusf_m1a1tank_base", configFile >> "CfgVehicles"]) then{} I can't run isKindOf on an array. What should I use instead? General idea is to only run the script on a specific vehicle with given parent class

#

vehicles returns an array but there could be more then one M1 on the map πŸ˜„ So a select is nope

subtle ore
#

vehicle returns all vehicles. It's an array

#

{
if (_x isKindOf ["rhsusf_m1a1tank_base", configFile >> "CfgVehicles"]) then{
    };

} forEach vehicles;
vapid frigate
#

if (({_x isKindOf ["rhsusf_m1a1tank_base", configFile >> "CfgVehicles"]} count vehicles) > 0) then{}

subtle ore
#

that works too 🀷

hollow lantern
#

\o/

vapid frigate
#

yeh depends what u wanna do

#

midnights will run once for each vehicle

#

mine will run once (if any are true)

hollow lantern
#

well I add an event handler on the tanks πŸ˜„

#

fired eh

subtle ore
#

So..probably forEach then @vapid frigate ?

vapid frigate
#

probably don't wanna use vehicles at all?

#

just the tank that's passed in to the EH?

subtle ore
#

Unless there are a shit ton of tanks?

vapid frigate
#

@hollow lantern do you want to check all the tanks on the map, or just the ones that fire?

hollow lantern
#
if (_x isKindOf ["rhsusf_m1a1tank_base", configFile >> "CfgVehicles"]) then{

_x addEventHandler ["Fired", {
 _wep = _this select 1;
  if (_wep isKindOf ["CannonCore", configFile >> "CfgWeapons"]) then {
 _veh = _this select 0;
 _vel = velocity _veh;
 _dir = _veh weaponDirection _wep;
 _veh setVelocity [
 (_vel select 0) + (_dir select 0) * -5,
 (_vel select 1) + (_dir select 1) * -5,
 (_vel select 2) + (_dir select 2) * -5
 ];
 };
 }];
 };
 } forEach vehicles;```
#

every tank on the map '

vapid frigate
#

ah ok yep, then midnights one

#

i don't think that's quite right.. should start with a {

#

but hard to tell with that lack of indenting

subtle ore
#

Woah the formatting 0_o

vapid frigate
#
{
    if (_x isKindOf ["rhsusf_m1a1tank_base", configFile >> "CfgVehicles"]) then{

        _x addEventHandler ["Fired", {
            _wep = _this select 1;
            if (_wep isKindOf ["CannonCore", configFile >> "CfgWeapons"]) then {
                _veh = _this select 0;
                _vel = velocity _veh;
                _dir = _veh weaponDirection _wep;
                _veh setVelocity [
                    (_vel select 0) + (_dir select 0) * -5,
                    (_vel select 1) + (_dir select 1) * -5,
                    (_vel select 2) + (_dir select 2) * -5
                ];
            };
        }];
    };
} forEach vehicles;```
#

was just missing the { at the start

hollow lantern
#

uh formatting thx

#

hmmmmm ```sqf
if (_x isKindOf ["rhsusf_m1a1tank_base", config>
0:05:09 Error position: <isKindOf ["rhsusf_m1a1tank_base", config>
0:05:09 Error Generic error in expression
0:05:09 File C:\Users\Aebian\Documents\Arma 3\missions[A]_Cuda.Woodland_ACR\initServer.sqf, line 15```` so he has some problems with _x

#

weird

vapid frigate
#

can't really say if it's the _x

#

if it's inside a foreach _x is each thing in the array

#

in this case each vehicle, one at a time

jovial ivy
#

Are you wanting to check if its that specific tank, or just any tank>

hollow lantern
#

specific tank that has the parent class rhsusf_m1a1tank_base

#

which would include the M1A1 and M1A2 in all variants

#

because they all have as parent rhsusf_m1a1tank_base

vapid frigate
#

did you add the missing { to the start?

#

from what you pasted

hollow lantern
jovial ivy
#

Are you getting the error above? Or what is happening.

vapid frigate
#

ah it looks like for that syntax, you can't use the vehicle directly

jovial ivy
#

Oooh your right.

vapid frigate
#

need to use ((typeof _x) isKindOf ["rhsusf_m1a1tank_base", configFile >> "CfgVehicles"]

#

or _x isKindOf "rhsusf_m1a1tank_base"

hollow lantern
#

your typeOf solution worked

#

nice

subtle ore
#

hey @vapid frigate I don't seem to understand how you did vests though? They don't have any info like the uniforms do

vapid frigate
#

should have iteminfo > type ?

subtle ore
#

facepalm god I'm stupid, sorry.

vapid frigate
#

don't have a side though afaik, only uniforms do

subtle ore
#

Refresh me on what afaik means again, but I didn't realize that lol.

vapid frigate
#

as far as i know

subtle ore
#

Oh okay.

#

Well all the ones in the CfgVehicles do have sides

#

the ones in CfgWeapons obviously dont

vapid frigate
#

yeh, i only used cfgvehicles for uniforms/backpacks

#

not all vests, etc will have a vehicle

#

they're just for if you want to place them in the editor easily

subtle ore
#

Are you sure?

vapid frigate
#

yeah, have made many vests/helms without vehicles

#

only uniforms/backpacks need them

subtle ore
#

shucks

vapid frigate
#

backpacks don't have weapons too.. just the vehicle

subtle ore
#

Right

rancid ruin
#

anyone experimented with making loot spawning systems?

#

wondering what the sure fire fastest way to spawn weaponholders + contents in say 20% of buildings on altis would be, before mission start

subtle ore
#

take a look at Bangabob's script if no one else has to offer anything

vapid frigate
#

i dunno if that would be a good way to do it.. might need to be in populated areas/nearby buildings

#

would be a lot of objects to do the entire map

subtle ore
#

could be a probability

#

plus you could just disable simulation for the weapon holders that are a distance from the player

vapid frigate
#

yeh, but that's not as performant as them not being there in the first place

subtle ore
#

What? You mean spawn them in as they go?

vapid frigate
#

yeh, that's what most of those survival things seem to do

#

poorly/slowly in most cases

subtle ore
#

🀷

rancid ruin
#

i've spawned weaponholders in every building position in every building on altis before, didn't notice any performance drop

#

this is in single player mind. and it took about 10 minutes

subtle ore
#

10 MINUTES? MY GOD

rancid ruin
#

i know it does make more sense to spawn stuff as the mission goes on and people move around the map, just would like to find the most efficient way to do it pre-start

#

10 mins is nothing bro, i made a script to sample height data at a stupid resolution, took like 30 mins haha

subtle ore
#

That isn't okay though 😱

jovial ivy
#

You could just create a variety of zones. And when a player enters it, spawn loot in that area.

#

Instead of handling it all on start.

#

And either wait for the zone too be low on loot, or when there are no players to respawn/despawn loot.

rancid ruin
#

problem with that is, that you could create zones around locations for example, but a good % of buildings on altis are nowhere near locations

#

and doing it by map grid seems a bit meh cos the building density could vary hugely between zones

jovial ivy
#

Indeed. So instead of basing it on locations, just create like a giant grid of zones. Instead of using the base grid system.

vapid frigate
#

could use a quadtree

jovial ivy
#

But idk, spawning items is something I wanted to look into

rancid ruin
#

have a tinker with it, it's good fun to watch in action

#

i've tried like 3 or 4 different methods but nothing seemed to be great

#

it just seems to work about 50x quicker to do X amount of spawns pre-init rather than mid mission

vapid frigate
#

you running it unscheduled mid-mission?

#

that's probably the main difference i think

rancid ruin
#

tried unsched and sched

#

think appearance wise, spawning a few different threads in different towns actually worked best out of the methods i tried so far

#

i was going to aim for tying it in to my persistent database, so loot would cycle every couple of days

#

but it's just a ridiculous amount of data to keep track of for little real benefit

vapid frigate
#

it would prevent having to have everything kept track of in game though

#

could do it when ppl get within 10m of a building even

#

but yeah.. i think building ids change when BI updates the map.. so it'd be pretty difficult

#

probly have to use a hash based on class/position or something for the key

rancid ruin
#

i've never used building IDs and BI haven't recommended people to use them for about a year i think

#

you'd need to keep track of which buildings have loot, and how much, etc. so doing it all in one big go at mission start does have certain benefits imo

#

just fire and forget, that's what i'm aiming for

vapid frigate
#

have you tried it in MP? might be slow joining the mission too

#

because it'd have to transmit the thousands of objects to each client

rancid ruin
#

i don't really care about multiplayer, all i do is dick around scripting for singleplayer

jovial ivy
#

Right well I got loot spawning working. Now to optimize it πŸ˜›

jovial ivy
placid root
#

hey:) anybody know why there is an error? des_car_2 addEventhandler [ "GetIn", { if (driver (_this select 0) == player) then { (_this select 2) action ["Eject", _this select 0]; hint "You are not the busdriver!" }; if (driver (_this select 0) == des_npc_1) then {des_car_2 lock 3}; };[#] ( missing ] ) ];

indigo snow
#

Discord mightve eaten your underscores, but you should probably switch this to _this

placid root
#

no there is an underscore

#

des_car_2 addEventhandler
[
"GetIn",
{
if (driver (_this select 0) == player) then { (_this select 2) action ["Eject", _this select 0]; hint "You are not the busdriver!" };
if (driver (_this select 0) == des_npc_1) then {des_car_2 lock 3};
};[#] ( missing ] )
];

simple fiber
#

The best way to know if there is one is to -showScriptErrors + Your logs

#

We are not wizards

#

There is no voodoo magic to find bugs or something

vapid frigate
#

@placid root think the error is the ;

#

["", {};] isn't valid

tame portal
#

^

#

uhhh

#

maybe

#

why?

#

yes

#

yeah i noticed that a french community is hosting it πŸ˜„

#

Yup

#

i havent touched the mission in like a couple of months now πŸ˜„

#

can only hope malden will have some nice areas

#

you think it looks polished? πŸ˜„

#

well yeah thats what i kinda aimed for

#

quick pvp mode

placid root
#

@vapid frigate nice thx. it really was the additional ";"

icy mauve
#

Hey just a quick question: Is it possible to send commands from inside Arma to somewhere else? Like a bridge to external tools?

rancid ruin
#

yeah

#

loads of extensions for different languages and stuff

vapid frigate
#

yeh, via an extension (dll), or i guess via httpLoad to an extent

icy mauve
#

So it should be possible to send commands to a third-party tool like Overwolf or Logitech LED API?

vapid frigate
#

yeah

#

as an example, TFAR/ACRE2 communicate with teamspeak

icy mauve
#

right, totally forgot about them.

#

Nice, I was maybe planning to add Perkey-RGB-Keyboard support to Arma.

#

no idea about Roccats or Razer's API but Logitech should work fine.

rancid ruin
#

you could probably do that pretty easily with existing extensions, without having to write your own

#

there's a nodejs rpc extension for arma 3 somewhere

#

if you're ok with javascript

icy mauve
#

that would be even better as I have no Idea of any c-languages

#

ye I'm okay with js

rancid ruin
#

bound to be node packages for overwolf/logitech/you name it

rancid ruin
#

yeah think so

#

not sure if it's updated for 64 bit though

icy mauve
#

thats probably gonna take a while right?

vapid frigate
#

doesn't look like it's been updated in a long time

#

so possible it won't happen at all

icy mauve
#

I'll reply to the forum, maybe I'll get an answer.

vapid frigate
#

looks like it's open source

#

so you could probably copy the code into the 64 bit template and rebuild it

icy mauve
#

Oh right. I'll look into it when I'm done with my current projects I guess.

#

Thanks for your help guys!

rancid ruin
#

come on man do it today

#

do it right now

vapid frigate
#

another potential option is intercept.. it hooks back into arma so you can run script commands directly from other languages

#

but same issue.. hasn't been updated lately

icy mauve
#

@rancid ruin Sorry, too many projects. A-Levels this and next month, an App for Overwolf and two Websites.

rancid ruin
icy mauve
#

@brazen sparrow thanks! nice!

vapid frigate
#

easiest way really would probably be to use the C# template for what u wanna do.. would just need to reference something like https://github.com/zzattack/Logitech-LCD and have a couple of lines of code to change the display

#

then you're not relying on anything else

icy mauve
#

@vapid frigate not LCD, LED

little eagle
#

If you do this for yourself, then it would be way easier to just use JoyToKey. Arma already supports like 20+ of these XBOX keys and sticks and shoulder keys and whatever.

rancid ruin
#

think he's talking about those keyboards which light up

#

he wants to get arma talking to the lights

little eagle
#

Yeah. Just rebind them to the XBOX keys using joy to key and use that ingame.

vapid frigate
#

guessing he actually means the LCD display on G15 etc.. which is probably a bit more complex

brazen sparrow
#

im active when im wake πŸ˜›

rancid ruin
#

has anyone got arma talking to a rasperry pi yet? that's where most game/hardware mods end up right

bleak gazelle
young current
#

@bleak gazelle might try #creators_recruiting and generally speaking bringing money to modding is sucky move.

bleak gazelle
#

i will try

icy mauve
#

@vapid frigate Nope.... LED LIghting

subtle ore
#

anything I'm missing here? _magazines = (configFile >> "CfgWeapons" >> _x >> "magazines"); "Error Generic Error in expression"

tame portal
#

@young current Because you get your breakfast for free right lol

#

People getting paid to do stuff is the most normal thing

jovial ivy
#

@subtle ore _magazines = getArray (configFile >> "CfgWeapons" >> _x >> "magazines");

#

Since there are multiple types of mags for some weapons.

subtle ore
#

Oh my god. My brain is so fucked this morning, thanks for waking me up

#

Jeez,

jovial ivy
#

I wouldn't have noticed either lol. Only reason I knew it because I spent 10 minutes figuring that out last night.

subtle ore
#

Lol

tame portal
#

@subtle ore your code threw an exception because you're basically asking for a config at "magazines" which is a array though

#

So it throws generic expression error

#

always gets a config

subtle ore
#

@tame portal I know, I was being dumb.

tame portal
#

πŸ‘Œ

bitter bough
#

Is there a way to view a log of script errors being thrown clientside?

subtle ore
#

.rpt files are stored in the game directory yeah

#

as long as you don't have -noLogs as a launch parameter

#

Er, rather your documents area

#

C:\Users\YourUserName\Documents\Arma 3

jovial ivy
#

Are there keybinds in the BIS_fnc_guiEditor or something?

subtle ore
#

There are shortcuts, not sure why you are calling the function if you have acess to the debug consoile or something?

jovial ivy
#

True I suppose.

subtle ore
#

like CTRL + SHIFT + S saves your project, and CTRL + S you can define the export type etc

#

the wiki shows all the shortcuts

bitter bough
#

@subtle ore the issue is that script errors arent showing up in the logs. it's only displaying in the little black error box clientside

subtle ore
#

🀷

#

Not sure why

naive needle
#

Does the command "BIS_fnc_selectRandom" consider the order of a array?πŸ€”

rancid ruin
#

you should be using selectRandom

#

and also what do you mean? it's random

jovial ivy
#

_wep = weaponsLoot call bis_fnc_selectRandom; hides

#

Oh and @rancid ruin What do you think is a generally good time for loot spawning to take?

rancid ruin
#

can't remember exactly what my scripts took

#

it was a good few minutes for putting a weaponholder with stuff in every available position on about 50% of buildings on altis

#

i'll test them when i'm at my pc

jovial ivy
#

I'll have to test altis real fast.

rancid ruin
#

fuck stratis, go ham

jovial ivy
#

Haha

rancid ruin
#

altis or nothing

jovial ivy
#

Fair enough. Leme run it real fast

naive needle
#

so its not shuffle the array ?

rancid ruin
#

you mean does it modify the array you pass to it?

#

selectRandom returns one element, selected randomly, from the array you pass it

jovial ivy
#

Oh goodness this is a lot of loot.

jade abyss
#

selectRandom = select something Randomly
NOT
selectRandom = i shuffle the whole array and then select an random entry. Result will be a shuffled array.

naive needle
#

example : [//Level 1 ["TRYK_U_denim_hood_nc",0.07], ["TRYK_U_denim_hood_mc",0.07], ["TRYK_U_hood_nc",0.07], ["TRYK_U_B_PCUGs_OD_R",0.07], ["TRYK_U_B_PCUGs_gry_R",0.07], ["TRYK_U_B_PCUGs_BLK",0.07], ["TRYK_U_B_PCUGs_OD",0.07] //Level2 ["TRYK_shirts_DENIM_RED2",0.15], ["TRYK_shirts_DENIM_ylb",0.15], ["TRYK_shirts_DENIM_ylb_Sleeve",0.15], ["TRYK_shirts_DENIM_R_Sleeve",0.15], ["TRYK_shirts_OD_PAD",0.15], ["TRYK_U_pad_hood_Blk",0.15], ["TRYK_U_pad_hood_Cl",0.15], ["TRYK_U_denim_jersey_blk",0.15], ["TRYK_U_denim_jersey_blu",0.15], ["TRYK_U_B_Denim_T_WH",0.15] ]

rancid ruin
#

], ] no no

naive needle
#

so level 1 is not 0-50 and level 2 50-100 , right ?

#

cant explain it xD

rancid ruin
#
_array = [//Level 1         
["TRYK_U_denim_hood_nc",0.07],
["TRYK_U_denim_hood_mc",0.07],
["TRYK_U_hood_nc",0.07],
["TRYK_U_B_PCUGs_OD_R",0.07],
["TRYK_U_B_PCUGs_gry_R",0.07],
["TRYK_U_B_PCUGs_BLK",0.07],
["TRYK_U_B_PCUGs_OD",0.07]         //Level2 ["TRYK_shirts_DENIM_RED2",0.15],
["TRYK_shirts_DENIM_ylb",0.15],
["TRYK_shirts_DENIM_ylb_Sleeve",0.15],
["TRYK_shirts_DENIM_R_Sleeve",0.15],
["TRYK_shirts_OD_PAD",0.15],
["TRYK_U_pad_hood_Blk",0.15],
["TRYK_U_pad_hood_Cl",0.15],
["TRYK_U_denim_jersey_blk",0.15],
["TRYK_U_denim_jersey_blu",0.15],
["TRYK_U_B_Denim_T_WH",0.15]];

_random = selectRandom _array;
// _random is ["TRYK_U_pad_hood_Cl",0.15]
naive needle
#

yea, but it will nit shuffle it, right ?

jovial ivy
rancid ruin
#

_array will still be _array

naive needle
#

k

rancid ruin
#

if you want to select a "level 2" one or a "level 1" then have separate arrays for them

naive needle
#

no its only for me to seperate these items of rare

jovial ivy
naive needle
#

nvm forget it

jovial ivy
#

The interesting part is, there was only a 25% chance per loot spawn spot πŸ˜›

rancid ruin
#

is that 14k weapon holders?

peak plover
#

@jovial ivy spawning all that loot on altis

#

Might cause performance issues

jade abyss
#

"might" ^^

jovial ivy
#

Oh it did lol. I dropped 20 frames

peak plover
#

I suggest a caching system or a dynamic loot spawn system where loot is only near players and everything that's not near players is cleaned up

jovial ivy
#

Yeah. I created it on a grid like system. Basically, it just bases it on any markers you create via the editor. I suppose I could auto-generate them but I was just messing around. The system itself does detect players and what not.

peak plover
#

I like the dynamic simulation grid system. It's so cool

jade abyss
#

Just a q:
Why do you cycle through all zones and check in each zone, if there is player in it?

#

Why not make it the other way around -> Check every player in wich zone he is -> Set those to a "blacklist" -> Cycle through all zones -> If not in _Blacklist array -> Delete everything inside it.

#

(at least, thats how i did it)

peak plover
#

(Y)

jade abyss
#

boobs

peak plover
#

πŸ‘

#

(xYx)

#

taped boobs

#

kind of

jade abyss
#

🀦 Enough spam πŸ˜„ Let Dylan answer

jovial ivy
#

Would it make a performance different? You would think looping through 3 zones might be a bit better then looping through 40 players πŸ˜›

jade abyss
#

Just reread what you wrote there πŸ˜„

#

You currently check 3x 40 Players

#

instead of
1x 40 -> then zones

jovial ivy
#

facepalms

#

Rip

jade abyss
#

=}

#

thats what you get, for not asking me for an advice πŸ˜‚

jovial ivy
#

To be fair I was writing this at 4 in the morning πŸ˜„

jade abyss
#

No excuse!!!

#

+one hint: Why do you execVM everything?! oO

#

make a function of that stuff, you use it more than once

#

Doesn't matter, even then.

#

For Deving/Testing
my_fnc_Function = {MyCode};

blabla
call my_fnc_Function;

jovial ivy
#

Indeed. Im gonna keep using the excuse I was up at 4 in the morning πŸ˜‰

jade abyss
#

I mean, its your code. Do what you want, i just mentioned what I think is bullcrap^^

#

(Advantage of having the code directly in it -> Only one file open πŸ˜„ )

jovial ivy
#

Very true.

jade abyss
#

Anyway, just some ideas from my side =} gl hfwith it

jovial ivy
#

Oh I sure will. It was just a project to have fun with.

jade abyss
#

Thats how i always started. "oh, this could be fun".

#

2 month later: "Why did i started doing that anyway? fk it"

jovial ivy
#

Indeed. Sounds like most projects I start haha

deft zealot
#

anyone knows a documentation of supported elements for RscHTML?

queen cargo
#

Biki

#

Alternativ is the full mil sim wiki of vb

#

Most of the stuff also applies to the rv engine and arma 3

subtle ore
#

Wait whaaaatt..forgetTarget is actually a real command?

tough abyss
#

ctrl + f forgetTarget

peak plover
#

Wouldn't reveal 0 work as forget?

still forum
#

reveal only updates if the revealAmount is higher than the already present amount

#

knowledge value*

jovial ivy
#

When you realize you were posting in the server admins channel and not scripting, 🀦

jovial ivy
#

_worldSize = if (isNumber (configfile >> "CfgWorlds" >> worldName >> "mapSize")) then {getNumber (configfile >> "CfgWorlds" >> worldName >> "mapSize");} else {8192;}; is this the best way to get the map size?

vapid frigate
#

or _worldSize = worldSize; ?

jovial ivy
#

What about maps without worldSizes? From what I read about VR doesn't have one. Stratis seems to not have one either(hence having the else 8192)

vapid frigate
#

VR = 8192

#

same with stratis

jovial ivy
#

Yeah I know. I realised that πŸ˜› - Any other maps with that known size? Im having to make sure it adapts to custom maps.

vapid frigate
#

i doubt there'd be any recent ones at least.. not sure if worldSize will fall back for older maps properly

#

guessing it would

#

you could just say it adapts to 'correctly configured custom maps' πŸ˜ƒ

#

or add if (_worldSize == 0) then { _worldSize = 8192 };

#

assuming it's 0 if it doesn't work

#

most the posts talking about issues were before that command existed too (July 2015)

jovial ivy
tulip cloud
#
// Ammunition for others
_id = [
/* 0 object */                            player,
/* 1 action title */                    "Replenish Ammunition",
/* 2 idle icon */                        "pictures\machinegunner.paa",
/* 3 progress icon */                    "pictures\machinegunner.paa",
/* 4 condition to show */                "cl_classPerk == 'ammo' && (cursorObject distance _this) < 5 && alive cursorObject && !(cursorObject getVariable ['ammo_restored',false]) && (side cursorObject) == playerSide && (cursorObject isKindOf 'Man')",
/* 5 condition for action */            "!(cursorObject getVariable ['ammo_restored',false])",
/* 6 code executed on start */            {cl_lastActionTarget = cursorObject;},
/* 7 code executed per tick */            {},
/* 8 code executed on completion */        _mg_code,
/* 9 code executed on interruption */    {},
/* 10 arguments */                        [],
/* 11 action duration */                1,
/* 12 priority */                        500,
/* 13 remove on completion */            false,
/* 14 show unconscious */                false
] call BIS_fnc_holdActionAdd;
cl_actionIDs pushBack _id;

This allows a player to replenish another player's ammo. How do I change the 0 Object from Player to Emplacement so I can replenish an emplacement's ammo with the same script?

vapid frigate
#

if it refils the other players' ammo, it's probably not 'player' you want to change

#

might just need to remove && (cursorObject isKindOf 'Man') or change it to a more suitable one

#

player is the local player (the one doing the action)

jovial ivy
#

Man. I didnt realize how big altis was until I switched my new loot spawning scripts over to it. Took like 5x longer to generate all possible loot zones πŸ˜›

tulip cloud
#

perfect was able to solve it! (I hadn't scrolled to the right to see the isKindOf checks

simple fiber
#

@jovial ivy I already took a look ;)

jovial ivy
#

At the previous file? Or the one I just linked.

simple fiber
#

The one you linked yesterday

jovial ivy
#

Oh. The one I just linked is a lot different. The one i linked yesterday was just a one or two zone thing. This one automatically creates zones for any map.

simple fiber
#

I see

#

That's cool.

#

Couldn't you use the predefined grids tho ?

jovial ivy
#

Probably. Its more fun my way πŸ˜‰

simple fiber
#

Lol ;). I was wondering because I want to do a massive dynamic object spawning grid based.

#

Also I could make it work with hideObject to win those 3 frames

jovial ivy
#

Mine basically uses the grid system. It just replicates it.

simple fiber
#

I'll see what I can do after reworking the xcam editor

#

Nice exemple btw

rugged basalt
#

does init.sqf on dedi run only when in-game?

#

not in briefing?

little eagle
#

I don't think so, why would it?

placid root
#

hey guys, can someone help me with the inplementation of a gunshot? is have this execution sceen set up:

#

victim disableAI "MOVE"; victim setDir (getDir executioner); victim setPos (executioner modelToWorld [0,0,0]); victim switchmove "Acts_ExecutionVictim_Loop"; executioner switchmove "Acts_Executioner_StandingLoop"; sleep 11.7; executioner switchmove "Acts_Executioner_Forehand"; victim switchmove "Acts_ExecutionVictim_Forehand"; executioner playMove "Acts_Executioner_Backhand"; victim playMove "Acts_ExecutionVictim_Backhand"; executioner playMove "Acts_Executioner_Kill"; //gunshot here! victim playMove "Acts_ExecutionVictim_Kill"; executioner playMove "Acts_Executioner_Kill_End"; victim playMove "Acts_ExecutionVictim_Kill_End"; victim playMove "Acts_ExecutionVictim_KillTerminal"; //victim enableSimulationGlobal false;

rugged basalt
#

because I have some script in init.sqf that executes only on server

#

and on dedi it executes after briefing

#

I also use spawn to delay it a bit

#

maybe spawn causes this

#

honestly I want it to be executed in-game only and that behaviour pleases me

#

but I wonder why

little eagle
#

Maybe. You could debug with some diag_log

rugged basalt
#

nope, i love this

#

I also wonder how getClientState works on dedi

little eagle
#

time doesn't pass during briefing, so maybe you have a sleep that gets suspended until the mission starts and time becomes > 0

rugged basalt
#

yeah i have sleep

#

thanks for the explanation

#

does getClientState on dedi return dedicated server state or clients game state?

little eagle
#

getClientState(Number) isn't really something you need imo

rugged basalt
#

I used it in local MP scripts to suspend until in-game

#

I wanted my own timer to start after briefing

#

but as you said about sleep

#

I could use sleep 1 and it will work same as getClientState > 9

#

with 1 second extra delay

tender fossil
#

How do I use eachFrame EH? I've tried to get it to work without result

simple fiber
#

^

halcyon crypt
#
["someId", "onEachFrame", {
    hintSilent format["%1 (%2)", _this, diag_tickTime];
}, "Hello world!"] call BIS_fnc_addStackedEventHandler;
simple fiber
#

Use hint instead for maximum ear rape

halcyon crypt
#

πŸ˜„

#

edited the snippet to make the onEachFrame part more obvious ^^

bright coral
#

@rugged basalt
How about uiSleep?
getClientState is nice to check if briefing is shown (I personally add some entries with code tags to the diary where an admin can load mission progress from a SQL database before the mission actually starts...)

tender fossil
#

Thanks again! πŸ˜ƒ

rugged basalt
#

@bright coral thanks for input but how it's related to my question about getClientState on dedi?

bright coral
#

It is the same as on a client

#

I thought you were asking because of the sleep πŸ˜ƒ

digital hollow
#

Is there something like an eventhandler for unit behavior, for example when a unit enters COMBAT state?

#

if no, would it be good to check behaviour every ~10s through onEachFrame EH?

simple fiber
#

@tough abyss It is never too late

#

Come on dude

#

They plan to support Arma for at least 2 years

#

They probably could add EH

#

Well you can edit the FSMs yourself and add an 'event' but anyway

#

It is not hard

placid root
#

does soneone know if the locality eh will fire if it is attached to a map lying on the ground and being picked up by a player?

rugged basalt
#

@bright coral it's good behaviour for me because I need script to be started in-game only (it's bomb)

placid root
#

ok with inventory objects a trigger with !alive bla worls fine

digital hollow
#

Looking through ACE functions, I'm having trouble finding how to break a wheel reliably in multiplayer. Can anyone point me in the right direction?

#

I'm using setHitIndex to set everything except HitHull to full damage, but another player still sees wheels intact and can drive it.

little eagle
#

You need to execute the command on the machine where the vehicle is local. Has nothing to do with ACE.

digital hollow
#

ah, I'll look at where it's running. thanks.

blazing zodiac
#

@little eagle Is there anyway to disable ACE medical completely from in the mission file without removing the medical pbos?

little eagle
#

No.

blazing zodiac
#

I like it personally, just wanted to add the option to disable for people that don't want to use it.

little eagle
#

Well there is no ingame option to disable it, because it relies on config changes that cannot be changed on the fly without moving around files.

#

debug console in VA

#

That's just the extended debug console of CBA

#

prev and next button too

#

No.

rotund cypress
#

CTRL + A - Backspace

little eagle
#

^ tbqh

simple fiber
#
  • Focus click
little eagle
#

Yes.

rotund cypress
#

Why wouldn't it work? @tough abyss

little eagle
#

Focus is automatically set to the edit box.

simple fiber
#

Not if you exec the script or if you type in another box

little eagle
#

ctrl + a, not ctrl + s

rotund cypress
#

Ctrl + A

#

Not ctrl + s

#

No

#

🀦

little eagle
#

No it isn't. Ctrl a + backspace lmao

rotund cypress
#

It works

#

Yes it does

#

You are doing it wrong

little eagle
#

🀦

#

"How do I Ctrl+A?"

rotund cypress
#

You using RscDisplayDebugPublic?

#

@little eagle +1

#

🀦 🀦 🀦 🀦 🀦 🀦

#

Then of course that is the reason

#

lmao

#

lol

jade abyss
#

🀦

little eagle
#

🀦

rotund cypress
#

If you don't mind me asking, what debug console are you using @tough abyss? Please do not tell me you are using infistars

#

One you made yourself?

#

Can I see?`

#

Also, if you want Ctrl + A to work, maybe copying RscEdit from config in ui_f in Addons will work

#

But then again, I'm not sure if that has anything to do with it

little eagle
#

I think ctrl + A only works in ST_MULTI edit boxes.

rotund cypress
#

^^ might be

#
        class CA_Version: RscEdit
        {
            style="0x01 + 0x200";
            y="1 *                     (        (        ((safezoneW / safezoneH) min 1.2) / 1.2) / 20) + safezoneY";
            font="EtelkaMonospacePro";
            idc=12146;
            x="25.5 *                     (        ((safezoneW / safezoneH) min 1.2) / 32) +         (safezoneX + (safezoneW -                 ((safezoneW / safezoneH) min 1.2))/2)";
            w="5.5 *                     (        ((safezoneW / safezoneH) min 1.2) / 32)";
            h="1 *                     (        (        ((safezoneW / safezoneH) min 1.2) / 1.2) / 20)";
            sizeEx="0.55 *                     (        (        ((safezoneW / safezoneH) min 1.2) / 1.2) / 20)";
        };
        class CA_Player: RscEdit
        {
            style=512;
            font="RobotoCondensedBold";
            y="1.25 *                     (        (        ((safezoneW / safezoneH) min 1.2) / 1.2) / 20) + safezoneY";
            idc=12145;
            x="18.5 *                     (        ((safezoneW / safezoneH) min 1.2) / 32) +         (safezoneX + (safezoneW -                 ((safezoneW / safezoneH) min 1.2))/2)";
            w="7 *                     (        ((safezoneW / safezoneH) min 1.2) / 32)";
            h="0.5 *                     (        (        ((safezoneW / safezoneH) min 1.2) / 1.2) / 20)";
            sizeEx="0.55 *                     (        (        ((safezoneW / safezoneH) min 1.2) / 1.2) / 20)";
        };
#
class RscEdit
{
    style="0x00 + 0x40";
    font="RobotoCondensed";
    shadow=2;
    sizeEx="(            (            (            ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
    colorBackground[]={0,0,0,0};
    colorText[]={0.94999999,0.94999999,0.94999999,1};
    colorDisabled[]={1,1,1,0.25};
    colorSelection[]=
    {
        "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])",
        "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])",
        "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])",
        1
    };
    canModify=1;
    tooltipColorText[]={1,1,1,1};
    tooltipColorBox[]={1,1,1,1};
    tooltipColorShade[]={0,0,0,0.64999998};
};```
#

Thats for the RscDisplayDebugPublic

little eagle
#

0x40 is ST_MULTI iirc

jade abyss
#

```cpp
config
```

rotund cypress
#
#define ST_MULTI          16
#define ST_NO_RECT        0x200 // this style works for CT_STATIC in conjunction with ST_MULTI

@little eagle

little eagle
#

ok

#

NO_RECT is "no rectangle" ?

rotund cypress
#

Haha not too sure πŸ˜„

#

Why would you use that instead of RscDisplayDebugPublic?

#

Okay, so how do you execute this code then?

#

A function which is not compiled final?

#

Fair enough

#

["whateveriwannado"] remoteExec ["QS_fnc_call", 2];?

#

Rx = remoteexec?

#

so what i wrote above?

#

And how do you check for errors?

#

if theres no errors it executes wherever

little eagle
#

server rpt

rotund cypress
#

Yes, but I assume he meant if there is no errors it executes wherever, do you mean just that the engine won't run it if there is an error?

little eagle
#

Execution just stops when there is an error encountered and if there is an error during compile, the command reports {} I think.

rotund cypress
#

Yes, I know that, but when he said that it sounded like he had some own kind of thing to check that

little eagle
#

Yes, QS has secret tools everyone desperately wants and he's not sharing.

rotund cypress
#

Didn't mean that, but okay ^

#

🀣

#

oh try block

#

How can it be almost useless?

#

just change ctrl properties to make it work

little eagle
#

Just add a button that does ctrlSetText ""

#

I thought you made that yourself? Why not add it yourself.

hollow lantern
#

is there something like a radius command? I have a truck with addAction and want to kill units within a radius of lets say 15 meters around the truck when the addAction is triggered

jade abyss
#

inArea Β―_(ツ)_/Β―

#

Or distance

hollow lantern
#

hmm inArea seems good

jovial ivy
#

nearObjects / nearestObjects would work.

hollow lantern
#

hmm yeah that too

#

yeah, thanks guys

jade abyss
#

Yeah, nearEntities sounds more usefull for that

jovial ivy
jovial ivy
#

So, allPlayers inAreaArray "marker";

jade abyss
#

one sec, prolly brainfart

#

Yeah, nvm. Leave it as it is. Its doing its job =}

jovial ivy
#

Yeah. Plus wouldn't allPlayers have to loop through more technically? (as you said yesterday) - As it has to loop through like 100+ zones

jade abyss
#

?

#

"Plus wouldn't allPlayers have to loop through more technically?" <- ?

jovial ivy
#

Derp.

#

Nevermind- Im being silly

jade abyss
#

erm, okay?

#

And for the next time, we will learn, that

if(!(_x in _zoneBlacklist)) then
{
};```
is better than
```sqf
if(!(_x in _zoneBlacklist)) then {
};```
jovial ivy
#

No no no πŸ˜‰

jade abyss
#

yes yes yes πŸ˜‰

#

No Commy! Not you! You use Macros

little eagle
#

wrong

jovial ivy
#

My brackets can be wherever they so please. πŸ˜‰

jade abyss
#

"I talked them, they want in the nextline. They don't feel well in the same line"

#

"Its a fact"

jovial ivy
#

Lies.

jade abyss
#

nono, i said "its a fact" behind it. So its true.

jovial ivy
#

How about. if(!(_x in _zoneBlacklist)) then { //Super long code is here};

jade abyss
#

For ppl like you, there is a special place in hell.

jovial ivy
#

Haha

#
 if(count(missionNamespace getVariable Format["%1_zone_holders", _x]) == 0) exitWith { _x call Loot_StartZone; };
``` Hue hue hue
#

Oh I wanted to ask. What was the way to get the nearest spawnable position for say a vehicle?

hollow lantern
#
15:34:39 Error in expression <"_target", "_caller",  "_id", "_args"];
_args params ["_device"];


KI_fnc_devic>
15:34:39   Error position: <_args params ["_device"];


KI_fnc_devic>
15:34:39   Error Undefined variable in expression: _args
15:34:39 File C:\Users\Aebian\Documents\Arma 3\missions\[A]_Cuda.Woodland_ACR\itsAebian\tDevice.sqf, line 14
/*
    author: @Aebian
    description: none
    returns: nothing
    //  _null = [HEMTTA4, SOBJ] execVM "itsAebian\device.sqf";
*/

params["_vehicle", "_object"];

_null = _vehicle addAction ["Trigger Device",KI_fnc_device,_object];


params ["_target", "_caller",  "_id", "_args"];
_args params ["_device"];


KI_fnc_device = {

{ _x setDamage 1; } forEach ( _device nearEntities ["Man", 10]);

};``` any ideas? shouldn't that work?
indigo snow
#

well, no, _args is nowhere defined

tough abyss
#

^^^

indigo snow
#

as in, that second params is unlogical

#

no new arguments, and _this is documented to be only 2 long

hollow lantern
#

if I just pass 1 I could use select 3

indigo snow
#

yea but thats outside of the addAction command

#

all those arguments are passed into KI_fnc_device

#

you've only added the command there

tough abyss
#

Also, KI_fnc_device is defined after the addaction is used. Will that cause an issue?

indigo snow
#

it probably does, since it'll point at a NIL value

little eagle
#

It won't if you do:
{_this call KI_fnc_device}

#

instead of
KI_fnc_device
directly

indigo snow
#

can arrays contain nil?

little eagle
#

Yes, b ut you cannot use local variables

#

undefined local variables in scheduled environment

indigo snow
#

mhm. but yea looks like that function needs to be defined ealier and the two params bits should actually be inside that function instead of outside it

hollow lantern
#

allright

#

yep worked

tough abyss
#

Wouldn't this accomplish what you want?

/*
    author: @Aebian
    description: none
    returns: nothing
    //  _null = [HEMTTA4, SOBJ] execVM "itsAebian\device.sqf";
*/

KI_fnc_device = {
    _device = _this select 0;
    { _x setDamage 1; } forEach ( _device nearEntities ["Man", 10]);
};

params["_vehicle", "_object"];

_null = _vehicle addAction ["Trigger Device", { [] spawn KI_fnc_device; }, _object];
hollow lantern
#

device is select 3 as the other ones are reserved for target caller and id

#

but that would also work if I would just pass one argument along

#

@tough abyss ^

willow basin
#

When I reverse "_revDummy", it also affects "dummy". Any idea how I could prevent this?

    ARM_fnc_addDummy = {
        dummy pushBackUnique _this;
        private _revDummy = dummy; reverse _revDummy;
        hint str(dummy);
    };
    "1" call ARM_fnc_addDummy; // ["1"] dummy === _revDummy
    "2" call ARM_fnc_addDummy; // ["2","1"] dummy === _revDummy
    "3" call ARM_fnc_addDummy; // ["3","1","2"] dummy === _revDummy```
tough abyss
#

Use smart things, not dummies.

native hemlock
#

That's because they both "point" to the same array

willow basin
#

Ahh thanks, never noticed that SQF uses pointers (thought it's always copy) o.O. Then my problem is quickly solved. Does this only apply to arrays or also other types?

little eagle
#

Only applies to arrays.

#

Well.

_player = player;
_unit = _player

_unit and _player also point to the same thing.

#

But doesn't apply to numbers or strings or bools.

subtle ore
#

Quick question here. I had been taking a look at the addScriptedEventHandler function. I was wondering if I did something like "arsenalClosed" would it be local to the player who closed the arsenal or the box that was closed? Or neither? ex: [missionNamespace, "arsenalClosed", {hint "Hello World"}] call BIS_fnc_addScriptedEventHandler;

little eagle
#

It would only execute on the machine where the eventhandler was added and only if the arsenal was closed on the local machine.

subtle ore
#

Okay, that makes sense. So if I were to do [myArsenalBox, "event", {hint "Hello World"}] call BIS_fnc_addScriptedEventHandler; it'd be local to the arsenal then?

little eagle
#

"event" would have to a valid event and whether or not this works with myArsenalBox instead of missionNamespace I can check in a moment...

subtle ore
#

Right, I copied the example. I understand there are different types.

little eagle
#

Nope it would not.

#

This is where the event is called and it's only called on the mission namespace, not the current arsenal box objects namespace.

subtle ore
#

so either way, the box would exist in the missionNamespace is what you're saying?

little eagle
#

No, the event is called with the missionNamespace. First argument in BIS_fnc_callScriptedEventHandler.

#

So only scripted eventhandlers attached to the mission namespace are used.

#

Other ones are nowhere used and therefore doing:
[myArsenalBox, "event", {hint "Hello World"}] call BIS_fnc_addScriptedEventHandler;

#

would never be executed.

#

And it doesn't look like the currently used object is passed as argument, so you're out of luck.

subtle ore
#

Wow, well then.

hollow lantern
#

can someone give me an example how to proceed with conditions? I tried:

_null = _vehicle addAction ["Trigger Device",KI_fnc_device,_object,"","","","",{vehicle player isEqualTo _vehicle}];```
and
```sqf
_null = _vehicle addAction ["Trigger Device",KI_fnc_device,_object,"","","","","vehicle player isEqualTo _vehicle"];``` the first one says that he needs a string the second one request a bool. 
I also tried:
```sqf
_null = _vehicle addAction ["Trigger Device",KI_fnc_device,_object,"","","","","{vehicle player isEqualTo _vehicle}"];```
jovial ivy
#

()

hollow lantern
#

I tried that also let me check again

dusk sage
#

Not all the parameters are strings either @hollow lantern

hollow lantern
#

@dusk sage damn I see

little eagle
#

"vehicle player isEqualTo _vehicle"
is correct

#
{vehicle player isEqualTo _vehicle} call ace_common_fnc_codeToString

would work too.

dusk sage
#

πŸ’€

little eagle
#

That late already?

hollow lantern
#

hmm yeah as I use ACE. sqf _null = _vehicle addAction ["Trigger Device",KI_fnc_device,_object,2,true,false,"","vehicle player isEqualTo _vehicle"]; according to the wiki it should work but its still telling me type bool expected string hmmmmm

little eagle
#

_vehicle is undefined.

#

Also you forgot the arguments parameter

hollow lantern
#
/*
    author: @Aebian
    description: none
    returns: nothing
    //  _null = [HEMTTA4, SOBJ] execVM "itsAebian\device.sqf";
*/


KI_fnc_device = {

params ["_target", "_caller",  "_id", "_args"];
_args params ["_device"];

{ _x setDamage 1; } forEach ( _device nearEntities ["Man", 10]);

};


params["_vehicle", "_object"];

_null = _vehicle addAction ["Trigger Device",KI_fnc_device,_object,2,true,false,"","vehicle player isEqualTo _vehicle"];```
#

its defined

little eagle
#

4th one is priority and on your example it's the third one which should be "arguments" (ANY)

hollow lantern
#

without the condition it works

little eagle
#

No, it doesn't.

#

_vehicle is undefined inside the condition scope and your arguments of addAction are wrong.

#

Also _null = does nothing

hollow lantern
#

I removed everything after the _object and my addAction works...

little eagle
#

Yes, because the third parameter is missing.

#

So if you delete everything, but the first two, it will obviously work

#

[title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition]

hollow lantern
#
_null = _vehicle addAction ["Trigger Device",KI_fnc_device,_object];```
#

that works

little eagle
#

["Trigger Device",KI_fnc_device,_object ??????? ,2,true,false,"","vehicle player isEqualTo _vehicle"]

#

that works

Yes, because the third parameter is missing.
So if you delete everything, but the first two, it will obviously work

hollow lantern
#

And _object are the arguments ?!

#

or I don't get it

little eagle
#

fml I hate this grey font

#

Still

#

_vehicle is undefined

hollow lantern
#

just because the priority thing (3rd param) is missing? lol .... lol okay I'll check

jade abyss
#
_null = _vehicle addAction ["Trigger Device",KI_fnc_device,_object,2,true,false,"","vehicle player isEqualTo _vehicle"];```
☝  makes no sense
little eagle
#

No, that has nothing to do with that.

jade abyss
#

_null = _vehicle addAction [ <-- that, Why?

little eagle
#

Also

params ["_target", "_caller",  "_id", "_args"];
_args params ["_device"];

...

params["_vehicle", "_object"];
#

Why two params???

jade abyss
#

oO

hollow lantern
#

but I don't get why my _vehicle gets the addAction if I just use sqf _null = _vehicle addAction ["Trigger Device",KI_fnc_device,_object]; I mean _vehicle there seems to be defined

little eagle
#

The _vehicle in "vehicle player isEqualTo _vehicle" is undefined

#

The _vehicle in _vehicle addAction is defined...

hollow lantern
#

so I can't use them there hmm okay

little eagle
#

No, you need to pass every local variable as argument.

#

because that condition is executed every frame or with whatever delay and local variables only exist in their scope. And the condition is a completely different instance.

jade abyss
#

OR make the local Var "_vehicle" in the addAction to a global one (e.g. MyTag_vehicle)

subtle ore
#

Quick question here, I'm having a hard time finding a base class for facewear. Ideas?

jade abyss
little eagle
#

The base class is called None for almost all of them.

jade abyss
#

Searching: "class classnameYouSearch:"

little eagle
#

πŸ‘†

jade abyss
#

GrepWin (or similar tools) -> 101% needed tools!

#

Otherwise you go more mental

subtle ore
#

Ah ha.

hollow lantern
#

Totalcmd ftw

jade abyss
#

hm, who likes it can use it. I don't/won't. Personal opinion.

hollow lantern
#

yeah

dusk sage
#

@hollow lantern Use _target instead of _vehicle, or use the new radius param

little eagle
#

"_this in _target"

hollow lantern
#
20:56:06 Error in expression <
_object = _this select 0;
_object setVariable ["hitTimes", 0];
_hits = _ob>
20:56:06   Error position: <setVariable ["hitTimes", 0];
_hits = _ob>
20:56:06   Error setvariable: Type Array, expected Namespace,Object,Group,Display (dialog),Control,Team member,Task,Location
20:56:07 Error in expression <
_object = _this select 0;
_object setVariable ["hitTimes", 0];
_hits = _ob>
20:56:07   Error position: <setVariable ["hitTimes", 0];
_hits = _ob>
20:56:07   Error setvariable: Type Array, expected Namespace,Object,Group,Display (dialog),Control,Team member,Task,Location

according to the wiki my setVariable and get Variable should work. I tried this:

_obj addEventHandler ["HitPart", {
_object = _this select 0;
_hits = _object getVariable "hitTimes";
if(isNil "_hits") exitWith { _object setVariable ["hitTimes", 1]; };
if(_hits == 1) exitWith {
for "_i" from 1 to 2 do {
createVehicle ["Bo_GBU12_LGB",[(getPos _obj select 0)+ (_i*cos (_i*17.5)),(getPos _obj select 1)+ (_i*sin (_i*17.5)),0],[],0,"CAN_COLLIDE"];
};
_object setVariable ["hitTimes", 0];
};
_object setVariable ["hitTimes", (_hits + 1)];
}];``` But that looks fine in my eyes
vapid frigate
#

looks too flat to me

tame portal
#

{
i
dont
know
what
you
mean
}

vapid frigate
#

you're using _obj in createvehicle, but it doesn't exist there @hollow lantern

#
  • pls learn to use TAB πŸ˜›
hollow lantern
#

hmm I tried to change that in intelij but he reverted and removed all tabs so yeah I need to fix that

#

hmm I could use _object I see

#

doesn't work either,

_obj addEventHandler ["HitPart", {
_object = _this select 0;
_hits = _object getVariable "hitTimes";

    if(isNil "_hits") exitWith { _object setVariable ["hitTimes", 1]; };
    if(_hits == 1) exitWith 
    {
    for "_i" from 1 to 2 do 
        {
    
        createVehicle ["Bo_GBU12_LGB",[(getPos _object select 0)+ (_i*cos (_i*17.5)),(getPos _object select 1)+ (_i*sin (_i*17.5)),0],[],0,"CAN_COLLIDE"];
        };
                            
        _object setVariable ["hitTimes", 0];
    };
        _object setVariable ["hitTimes", (_hits + 1)];
}];```
vapid frigate
#

no errors?

hollow lantern
#

of course, the one above

21:32:41   Error position: <getVariable "hitTimes";
if(isNil "_hits">
21:32:41   Error getvariable: Type Array, expected Namespace,Object,Group,Display (dialog),Control,Team member,Task,Location
21:39:50 Error in expression <bject = _this select 0;
_hits = _object getVariable "hitTimes";
if(isNil "_hits">
21:39:50   Error position: <getVariable "hitTimes";
if(isNil "_hits">
21:39:50   Error getvariable: Type Array, expected Namespace,Object,Group,Display (dialog),Control,Team member,Task,Location
21:39:52 Error in expression <bject = _this select 0;
_hits = _object getVariable "hitTimes";
if(isNil "_hits">
21:39:52   Error position: <getVariable "hitTimes";
if(isNil "_hits">
21:39:52   Error getvariable: Type Array, expected Namespace,Object,Group,Display (dialog),Control,Team member,Task,Location
21:43:12 Error in expression <bject = _this select 0;
_hits = _object getVariable "hitTimes";
if(isNil "_hits">
21:43:12   Error position: <getVariable "hitTimes";
if(isNil "_hits">
21:43:12   Error getvariable: Type Array, expected Namespace,Object,Group,Display (dialog),Control,Team member,Task,Location
21:43:12 Error in expression <bject = _this select 0;
_hits = _object getVariable "hitTimes";
if(isNil "_hits">
21:43:12   Error position: <getVariable "hitTimes";
if(isNil "_hits">
21:43:12   Error getvariable: Type Array, expected Namespace,Object,Group,Display (dialog),Control,Team member,Task,Location
21:43:13 Error in expression <bject = _this select 0;
_hits = _object getVariable "hitTimes";
if(isNil "_hits">
21:43:13   Error position: <getVariable "hitTimes";
if(isNil "_hits">
21:43:13   Error getvariable: Type Array, expected Namespace,Object,Group,Display (dialog),Control,Team member,Task,Location
21:43:30 Error in expression <bject = _this select 0;
_hits = _object getVariable "hitTimes";
vapid frigate
#

once is enough πŸ˜ƒ

#

looks like for some reason it thinks _object is an array, not object

#

the biki says ```This EH returns array of sub-arrays [[...],[...],...[...]]. Each sub-array contains data for the part that was hit as usually multiple parts are hit at the same time (see HitPart_Sample).

#

so SQF _obj addEventHandler ["HitPart", { { _object = _x select 0; _hits = _object getVariable "hitTimes"; if(isNil "_hits") exitWith { _object setVariable ["hitTimes", 1]; }; if(_hits == 1) exitWith { for "_i" from 1 to 2 do { createVehicle ["Bo_GBU12_LGB",[(getPos _object select 0)+ (_i*cos (_i*17.5)),(getPos _object select 1)+ (_i*sin (_i*17.5)),0],[],0,"CAN_COLLIDE"]; }; _object setVariable ["hitTimes", 0]; }; _object setVariable ["hitTimes", (_hits + 1)]; } foreach _this; }];

#

or SQF _obj addEventHandler ["HitPart", { _object = _this select 0 select 0; _hits = _object getVariable "hitTimes"; if(isNil "_hits") exitWith { _object setVariable ["hitTimes", 1]; }; if(_hits == 1) exitWith { for "_i" from 1 to 2 do { createVehicle ["Bo_GBU12_LGB",[(getPos _object select 0)+ (_i*cos (_i*17.5)),(getPos _object select 1)+ (_i*sin (_i*17.5)),0],[],0,"CAN_COLLIDE"]; }; _object setVariable ["hitTimes", 0]; }; _object setVariable ["hitTimes", (_hits + 1)]; }];

#

depending on whether you want one for each hitpart, or 1 for the hit overall

hollow lantern
#

well the object just needs two hits to explode so I guess the second approach will do it. Thanks!

hollow lantern
#

can I pass a local variable of a script to an EventHandler somehow?

still forum
#

put it into a global variable.. Or you can compile format it if your variable is a number or string

hollow lantern
#

its a created unit (object)

#

ok