#arma3_scripting

1 messages ยท Page 283 of 1

jade abyss
#

not rly, no

#

even with 0.1 its not rly noticable

compact current
#

Anyone know how to fix the issue with RscText being under the RscPicture in a GUI, like the layer is above it but the paa over takes the text for some reason ?

jade abyss
#

RscPic is ALWAYS above everything.

#

:/

compact current
#

What would the get around be then ?

jade abyss
#

But:
You can use RscText to use a Image/Texture

compact current
#

Because RscEdit and everything is above the RscPic

#

It like doesent make sence :/

#

ill just use the RscText for the image aswell then

#

instead of RscPic

ionic orchid
#

An annoying thing I found out...if you use RscPicture and add mouse events - when you click it the image is brought to the front

compact current
#

yea i just found that out aswell

jade abyss
#

You can also try
RscPictureKeepAspect

compact current
#

Thanks for the help, guys much apreciated ๐Ÿ˜ƒ

shadow sapphire
#

Does anyone know why my PVP scenarios don't reset between matches properly? When we start the next round, the battlefield is already destroyed, this is despite the fact that we are NOT using persistent battlefield. I've tried ending the mission on the server, on every client, still not luck.

rancid ruin
#

are you saving stuff to profilenamespace or uinamespace maybe?

#

cos those variables are stored in your profilename.vars.arma3profile or whatever the file is called

#

they persist

polar folio
#

i think he is talking about actual terrain objects. i can't remember, if they ever fixed that but there was always that bug where stuff stayed destroyed unless you restart the game or load another terrain and then reload the first. can't remember which

rancid ruin
#

ohh right yeah you need to change terrain and back again

#

at least, i ran in to the same thing when hideObjectGlobal'ing 100s of vanilla terrain objects, and that was the only way i found to un-do it

peak plover
#

@tough abyss Nice script. I really like your vehicle flip script as well. So fluid and cool

tough abyss
#

@peak plover thanks!

tough abyss
#

scripting wise, without a mod is there a method of increasing inventory size of a vehicle?

jade abyss
#

nope

peak plover
#

attachTo a box to the car, like an ammocrate on the back or sth

jade abyss
#

Erm... not sure if you can access the Crate then

rancid ruin
#

surely you could intercept it with the containerOpened event handler and then redirect it to a different object?

jade abyss
#

I meant more like: Can you access the Inventory of the Crate AT ALL

rancid ruin
#

ah yeah i dunno

tough abyss
#

@nigel#4210 the code worked!

#

It trow the zombie were player is!

jade abyss
#

@tough abyss btw. regarding EngineDmg:

_Car addEventHandler ["HandleDamage", {```
#

Not sure if it reacts to water, but worth a try.

civic maple
#

Wait, is there no alias for the Dammaged event handler?

#

because that's triggering me ):

#

A proper spelling of Dammaged

#

oh god

peak plover
#

Since OFP

jade abyss
#

dammage
damage

peak plover
#

Dammage refers to the amount of dam in the unit, aka damage or health lost...

jade abyss
#
getDammage
Description:
Returns the object damage in the range from 0 to 1. Alias of damage.```
#

Or just a simple missspelling ๐Ÿ˜„

civic maple
#

stahp pls

willow basin
#

Lovely. Please keep it ๐Ÿ˜

loud python
#

reading through BIS_fnc_3Dcredits

#
//#define DISPLAY (uinamespace getvariable "BIS_dynamicText")
//#define CONTROL (DISPLAY displayctrl 9999)

_display = uinamespace getvariable "BIS_dynamicText";
_control = _display displayctrl 9999;

#define DISPLAY    _display
#define CONTROL    _control
#

this

#

is

#

so

#

wrong

#

(The first one, at least)

meager granite
#

wrong why?

thin pine
#

Seems a bit pointless

#

Renaming _display to DISPLAY

meager granite
#

its because of first two commented out macros

#

they just added these to skip changing script itself

thin pine
#

Yeah probably a late fix

#

Yer

little eagle
#

doesn't look too bad, but the new solution errors in scheduled env. if the function is called with serialization enabled, or when any of the variables become undefined.

#

also, variables appear not to be set to private, which always makes me sad : (

peak plover
#
'cache' in ['Cache'] //false
#

I've been on a ghosthunt because of this

civic maple
#

hahahaha

#

How come I can't set the wind in-game? Using setWind when wind is forced just makes it reset, and when it's not forced the wind just goes haywire.

static spire
#

idiot question:

#
_makeairveh addAction ["<t color='#4af241'>Un-Armed</t>",{_mavU = 1;},"",6,false,true];
_makeairveh addAction ["<t color='#4af241'>Armed</t>",{hint format ["gay"]},"",6,false,true];

_loopvar = 1;

while {_loopvar < 10} do 
{
    if (_mavU isEqualTo 1) then {hint 'working'; removeAllActions _makeairveh; _mavU = 0;} else {};
};
#

everything works except the if condition

#

any idea why

#

if i set the if condition to true, it works

halcyon crypt
#

it's _mavU == 1

static spire
#

tried both ways

#

and it shoulnt make a difference should it?

halcyon crypt
#

probably not

#

well the only possibility for the if not working is that _mavU isn't 1 ๐Ÿ˜›

little eagle
#

this code is totally broken

static spire
#

thats unsuprising

#

also _mavU is defined as 0 at the start

little eagle
#

How is this executed?

static spire
#
_mavU = 0;
little eagle
#

No, the whole script

#

You cannot carry over local variables from the scope of the addAction statement or into it.

static spire
#

oh

#

well

#

rip

little eagle
#

I think your script runs in unscheduled environment and the while loop just quits after 10k iterations.

#

10k iterations all in one frame mind you

static spire
#

alright, thanks

little eagle
#

Also, you shouldn't use removeAllActions . Just remove the actions you added. You will break other mods and missions with that.

#

That else {} is horrendous too

static spire
#

it was a last resort

turbid thunder
#

True. Else is unnessecarry unless you plan on having something to execute there

static spire
#

i didnt know why it wasnt working so

little eagle
#

The whole thing is pretty pointless, no? What does this even do?

#

Besides printing "gay"

#

Still don't know how it's executed.

turbid thunder
#

Why is there even a hint format when you don't plan on inserting variables into the hint string?

little eagle
#

Yeah, that is strange too.

static spire
#

alright lads dont go full on at me im new to all this

turbid thunder
#

Well if no one ever tells you something is wrong, you cant learn either

#

Or well, "wrong" is the wrong term

#

If it works, its not wrong

civic maple
#

umm

turbid thunder
#

Hi

civic maple
#

hi

little eagle
#

You should be glad to have the mistakes pointed out. This isn't elementary school hug class here.

turbid thunder
#

@static spire dont worry too much though, when I started scripting, I did loops by constantly execVM'ing the script cuz I didnt know any better and now I made an enclose horror map on VR with fully custom AI and a waypoint system that works very nicely ๐Ÿ˜„

civic maple
#

oh god

turbid thunder
#

Jup.That was like 3-4 years ago me having no knowledge of scripting

civic maple
#

I started scripting like 4 months ago

cerulean whale
#

Sounds like a few life communities I had the horror of working with

civic maple
#

I'm writing all the scripts for my community, lots of work to do, but it's fun

turbid thunder
#

indeed it is

cerulean whale
#

Same here. Building all our stuff from the ground

turbid thunder
#

My one and only nemesis though: GUI

civic maple
#

fuck gui

turbid thunder
#

I managed to make a lil indicator icon for my horror mission but thats it ๐Ÿ˜„

cerulean whale
#

Im good with gui but when you spend ages doing one with like 50 classses then forget thr buttons

#

So bad lol

turbid thunder
#

the one thing I never understood was where to get the default classes since you need to define them somewhere but I wasnt able to figure out the default settings to set so that a basic, whatever really can work

little eagle
#

Get the all in one config of whatever the latest version is.

#

And browse that. It's easier than the ingame config viewer

cerulean whale
#

Config viewer is a pain

turbid thunder
#

"all in one config"?

little eagle
#

all in one config is the exported master config of the vanilla game.

#

Nice to look up the definitions of base classes and other stuff you want to use.

turbid thunder
#

I guess thats where I get all the GUI classes I desperatly looked for

little eagle
#

Yes. And everything else too.

nocturne basalt
#

is it an easy way of setting a maxSpeed of my vehicle?
right now Im using a custom script. It works, but the experience does tend to get a little choppy

little eagle
#

No.

nocturne basalt
#

depending on how long I let it sleep after each loop

#

ok

#

I find it weird that there is no variable to set in the cfgVehicles

little eagle
#

There was in A2. But shitty PhysX is too advanced for something so simple...

nocturne basalt
#

:\

turbid thunder
#

I guess thats why the RHS MRAP has horrible climbing abilities even for the smallest of degree that goes upwards

little eagle
#

I don't blame them. PhysX is almost impossible to deal with as modder.

#

They have a million vehicles. I only manage 3 (4 soonTM)

turbid thunder
#

Well a million is a bit much

#

variants of one vehicle probably use a copy pasted config with adjusted values for name and possible gunner positions but doesnt touch the PhysX aspect ๐Ÿ˜„ But yeah. Also, tanks randomly going at high speed is fun too

#

usually it is annoying but one time, I saw the AI just instantly speeding backwards down a road and almost flip it

little eagle
#

PhysX needs more than a config. Two vehicles with the same config behave totally different, because of their model. Which is one of the worst things about it.

turbid thunder
#

D:

#

well "because of their model" could be said about many games depending on the changes made. A kart replaced with the model of a truck for example is obviously going to act weird but I take it that even attaching something to an existing car like, spare wheels, a gun ontop ect can mess things up?

little eagle
#

Nah. The Eagle with roof hatch and the Eagle with FLW100 use the same physx.

#

But you can't "copy paste" the PhysX stuff from the vanilla Merkava to the Leopard.

#

Or from a T54 to a T90

turbid thunder
#

How come?

little eagle
#

you have to assign masses to selections in the model. And selections will be in a totally different place if the model is different.

compact current
#

This is getting annoying now, anyone have a way round it: The RscPicture overlays My RscText, ive tried structured text loads of shit, I need it to happen otherwise it defeast the purpose of having a image lol.

little eagle
#

config?

compact current
#

@cerulean whale you may know, its conner btw wouldent be suprised if youve forgot who i am lel.

cerulean whale
#

I know a few conners. ๐Ÿ˜› Where did I meet you? ๐Ÿ˜› Hue, I have the same problem. Do it as an RscEdit in GUI editor and then switch the RscEdit text after you export to RscText

#

That's what I do

compact current
#

I worked for you at Trinity before it closed, i also was with you at Havoc xD with Kirk or whatever his name was xD

cerulean whale
#

Oh lol. ๐Ÿ˜› haha xD

compact current
#

You remember ?

cerulean whale
#

Ye

compact current
#

Your at Huskies aint you ?

cerulean whale
#

Yeah

compact current
#

Nice man, hows your framework coming along ?

cerulean whale
#

Good, nearly done ๐Ÿ˜‰

compact current
#

Nice

#

What do you mean with the RscEdit crap

cerulean whale
compact current
#

Yea but in game is still stays under the Picture ?

#

@cerulean whale

cerulean whale
#

That's weird.... Doesn't happen for me. Can you send me your Dialog? It might be behind it in the config

compact current
#

The dialog or the common.hpp?

cerulean whale
#

Dialog

#

AhI see

#

You need the RscPicture to be at the top of the config

#

you see

#

The lower down it is under class controls the further it is to the front

#

think of it like paint

#

if it's at the top it's been pushed to background

compact current
#

It was the first thing i put in gui editer so its the first layer

#

thats weirds

#

Thanks anyway, ill give it a try

ionic orchid
#
getShotParents

handy batman function

civic maple
#

hahaha

static spire
#
getFriend
#

a function i need

civic maple
#

sqf_irl

cerulean whale
#

xD

tough abyss
#

The EDEN editor performance test give same results to _a distance _b; and _a distanceSqr _b;, distanceSqr is useless?

dusk sage
#

What did you test?

cerulean whale
#

DistanceSqr is squared distance. Different Algorithm to compute distance

little eagle
#

if _a and _b are undefined, then yes. they are exactly the same, performance wise : P

dusk sage
#

@cerulean whale Not really a different algorithm

#

Less steps though

tough abyss
#

@BoGuu#1044 @little eagle _a and _b are different positions.

#

I first set a randonly, then set b randonly, then check performance with a distance b and a distanceSqr b. Result is the same.

#

@little eagle no, its not undefined, sorry for the _.

#

May the the EDEN performance test is not precise for small times.

#

I use distanceSqr the most, and in some situations you need to make code more complicated to understand, Not sure if just wasted my time. ๐Ÿ˜„ For a zero gain its not worth.

dusk sage
#

distanceSqr cuts 2 steps out, that's all

little eagle
#
[0,0,0] distanceSqr [100,100,0]
//0.0078 ms
[0,0,0] distance [100,100,0]
//0.0069 ms

Difference is extremely small and always within the variation.

dusk sage
#

But not operations that take long at all

tough abyss
#

BOO HOOO! ๐Ÿ˜ฆ

#

What is the gain so?

#

From the forums: "Remember allways to use distanceSqr since its extremely more faster than distance"

ionic orchid
#

that's something that's said everywhere about everything since programming began (or at least since sqrt became available)

#

at the end of the day, it's not THAT expensive these days unless you're doing thousands upon thousands of them

#

it all depends on the platform and implementation - from the stats it just looks like they're equivalent in arma

dusk sage
#

Bit more to it than just a simple sqrt @ionic orchid

#

You can use classname and pos? @tough abyss

#

I don't think the classname alternative does

queen cargo
worthy spade
#

When does the "Ended" event handler trigger? Exactly when BIS_fnc_endMission is fired or at the end screen just before aborting?

#
_endevent = addMissionEventHandler ["Ended",{ systemChat "Mission ended"; }];
#

That doesn't display anything for me, and I'm not sure whether the event handler works or not...

jade abyss
#

@tough abyss iirc Using the Coords from createVehicle to assign a the correct Pos is not the best choice (only [0,0,0] then setPos* to somewhere else). Means -> setPosWorld/ASL = Way to go.
+Wasn't set/getPos slower than set/getPosWorld ?

vague hull
#

Is the entity killed eh only locally executed where it was assigned?

#

How about when it's created on the client? Will it be local to that certain client then?

jade abyss
#

@tough abyss I meant that:
_Car = "Class" createVehicle [0,0,0];
_Car setPosWorld _DesiredPos;
(creating the Obj at [0,0,0], then moving to the desired Pos)

willow basin
#

Hmm is there a good way to check if the client it's about to close on client? Tried with unload event on "display 46" but it doesn't always trigger.

jade abyss
#

even when you spawn stuff below surface with setPosWorld -> It will be set on ground.

#

Search the Net, there was someone who made some further tests, where spawning at [0,0,0] then setPosing it was was faster then ordinary

#

use the same?

#

Create the object at [0,0,0] then move it? Isn't that possible with SimpleOs?

#

Then just take setPosWorld or ASL from start?!

#

No clue where your prob is right now oO

tough abyss
#

@tough abyss you tried the alternative syntax of createSimpleObject?

#

@tough abyss ah, i got it.

#

What i do is record the offset on first use so if i spawn the object again there is no need to calc the offset again.

#

What i do is record the offset on first use so if i spawn the object again there is no need to calc the offset again.

#

But better should be create a list of offsets.

vague hull
#

Maybe add a wiki comment for it

#

Because that seems like q frequently asked problem

royal abyss
#

is there a short version to set enabledamage false for all objets without a ingame trigger?

#

or do i have to list all the objects then in the init

#

or can i do it with a class in gerneral ?

tulip quest
#

hi all how can i get the ammo , projectile , weapon info , as im tryign to change wich gun is a taser in altislife

#

i know with fired eventhandle but i can't seem to figure it out how to add it to myself to actualy test the gun and see the details

royal abyss
#

one sec ๐Ÿ˜ƒ

#

soo

#

u are in editor place down a trigger

#

set it to radio alpha

#

and check "repeatable"

#

then type into the init field :

#

[Open,true] call bis_fnc_arsenal

#

when u press 0 - 0 - 1 on your keyboard you should go into the virtual arsenal

#

or just the way you go to your radio normaly

#

or you put the bis_fnc_arsenal on something as addaction

tulip quest
#

player addEventHandler ["Fired",{format["PART: %1 || DAMAGE: %2 || SOURCE: %3 || PROJECTILE: %4",_this select 5,_this select 10,_this select 0,_this select 2];}]

royal abyss
#

?

tulip quest
#

im trying to use that to see the projectile etc i shoot my gun but it doesn't work

#

error:zero diviser

royal abyss
#

you want to see the projectile itself

tulip quest
#

i need the classnames of those variables for a script

#

i want that gun not to do dmg but execute a script , i got the script and all in place just need the variables

royal abyss
#

look up the tazer script then

tulip quest
#

thats why i need those variables ๐Ÿ˜ƒ

royal abyss
#

i dont have any altislife scripts...^^

tulip quest
#

i got the scripts just need to figure out the variables of the projectile, ammo , gun

#

so im trying to get those with the addeventhandler but that 1 doesn't work and not sure what i misstyped

royal abyss
#

in my mind i dont belive there is any special ammo ^^ its just a gun where the hit activates the script and the tazer is not dangarous because of a fn_handledamage ๐Ÿ˜‰

tulip quest
#

thats what i tought yet i cant get it to work with a gun from addon

royal abyss
#

yeah because u have to cant just set the dmg to 0 from a weapon u also need the script for if hit then tazed

#

let me check something

#

sooo

#

there are 2 seperate scripts

#

first you need the addeventhandler

#

for the tazed script

#

then player setvariable "istazed", false and so on

tulip quest
#

for the addeventhandler i need the gun i shoot with , ammo type , projectile

royal abyss
#

in this example the script is in the tazer.pbo itself

#

its from capps

#

u can check it out ๐Ÿ˜ƒ

loud python
#

X-question from #arma3_scenario: I want to show sometext on screen and such on mission start, but initPlayerLocal executes before the initial loading screen is gone, so it doesn't show up

#

where else can I run the code, so that it executes on mission start, but not before the player actually sees it?

#

or can I somehow pause the script until the loading screen is gone?

#

(The code doesn't run in initPlayerLocal itself, but is spawned from there)

royal abyss
#

put a sleep before?

loud python
#

sleep for how long?

#

I mean, it'd be an option, but I'd like it to not depend on the players performance

tulip quest
#

sleep is in seconds so i sugest between 120 and 240

loud python
#

for me the loading screen is about 2 seconds long

tulip quest
#

make it run in a zone then on the map ?

loud python
#

on a slower PC it might be more

tulip quest
#

trigger*

loud python
#

the trigger runs with a slight delay though

civic maple
#

gimme a sec to eat then I'll give you the proper code

loud python
#

so the player sees his character for half a second, then the screen goes black and the text shows

#

@civic maple thanks a lot ๐Ÿ˜ƒ

royal abyss
#

is it so important to be totaly at the start a trigger would be a perfect solution because most people are afk when joining lol ๐Ÿ˜„

#

atleast brain afk ๐Ÿ˜„

loud python
#

have you played the apex campaign?

royal abyss
#

yeah was alot of fun

#

made it with a friend

loud python
#

they do pretty much the same thing, but with some fancy voice acting instead of my boring text

#

start of first mission

royal abyss
#

you can do the same

loud python
#

I've had it happen to me that I saw my character for half a second or so and that was the most immersion breaking thing of the entire campaign

royal abyss
#

set the gamemode to hardcore no thirdperson ๐Ÿ˜„

loud python
#

well, I do that anyway, but that's not the point

#

I don't mean that I see my character; I mean that I see ingame stuff before a cutscene starts

#

it feels weird and poorly timed

#

I could live with that if there was no other option, but I'd prefer avoiding it in my mission

royal abyss
#

why dont make the game the cutscene ?

loud python
#

because stupid players that's why xD

#

Some people need the screen to be black if you want them to read the actual text xD

#

also it looks pretty

#

and cinematic

#

and pretty

royal abyss
#

thats why i want all my walls to be enabledmg false .... cause people tend to drive against them to drive the short way instead of enjoying the map i did ๐Ÿ˜„

tulip quest
#

so i still cant get player addEventHandler ["Fired",{format["PART: %1 || DAMAGE: %2 || SOURCE: %3 || PROJECTILE: %4",_this select 5,_this select 10,_this select 3,_this select 2];}] to work

civic maple
#

just put an AT gun on the other side of the wall

loud python
#

+1

#

that only works with walls though, but it doesn't fix my black screen problem ๐Ÿ˜ญ

royal abyss
#

why?

civic maple
#

me eatin, can't look at scripts

loud python
#

I mean, I could despawn the AA guns if there was a function like waitForPlayerToRead <text>

#

but that doesn't exist

royal abyss
#

you can start witht he black at the start let it black for the time needed and put a sleep on the text for ~10 seconds

loud python
#

there has to be some way to find out if the player has a menu open

royal abyss
#

or u accept that some people dont like to read ๐Ÿ˜„

loud python
#

NEVAAAR!

#

they need to know!

#

My lore is 2good m8!

civic maple
#

hasInterface?

loud python
#

Returns true if the computer has an interface (a real player). False for a dedicated server or for a headless client.

#

sounded very good, but it's the wrong thing =/

civic maple
#

just guessing rn, can't look anything up

#

ffs there's code blocks for a reason

loud python
#
cutText ["", "BLACK FADED", 10, true];
sleep 2;
0 = ["Operation Cobra", -1, -1, 3, 1] call BIS_fnc_dynamicText; sleep 1;
sleep 2;
cutText ["", "BLACK IN", 10, true];

0 = ["NATO Airfield", "SE of Theresia"] call BIS_fnc_infoText;
0 = ["20 Days before", "Firestorm Incident"] call BIS_fnc_infoText;
#

that's my current code

#

what I want is something like

#
waitUntil <loading screen is gone>;
cutText ["", "BLACK FADED", 10, true];
...
royal abyss
#

thats why u have to script the spawn after the text

#

or atleast after the black fade

loud python
#

What would that change?

royal abyss
#

or waitUntil {alive player && isplayer player};

loud python
#

Trying that now...

civic maple
#

also player enableSimulation false; and disableUserInput true;

#

for cutscenes

loud python
#

waitUntil {alive player && isplayer player}; doesn't work

civic maple
#

i.e. custom loading screen

royal abyss
#

ooooooooooooooooooooooooooooooooooooooor

loud python
#

interesting video, but it's kinda the wrong thing xD

#

@civic maple I don't see how a custom loading screen would help me

civic maple
#

ok, I thought you wanted a black screen with text that everyone saw

#

gtg, good luck

loud python
#

ffs not even waitUntil {!userInputDisabled}; works, even though the player clearly has no control

#

this game hates me

royal abyss
#

it hates everyone

polar folio
#

guys. do all eventhandlers (on units) survive respawn?

royal abyss
#

do arma 2 scripts work in arma 3

loud python
#

they shouldโ„ข?

#

I am abandoning my original idea

#

I am now trying to do it like in the apex campaign

#

but that's even weirder

#

you get the splash screen only on your first spawn

#

and only if it's at the start of the mission

#

was there a way to store a variable locally on the players machine only?

polar folio
#

define store

#

until the next session/mission?

loud python
#

during the mission

#

I want something to execute only on the first respawn, so I need to somehow keep tracked if the player has respawned before

polar folio
#

just use a global variable

#

global means global to all scripts on the machine it is declared on

loud python
#

ok so it stays on the local machine

polar folio
#

stuff only gets shared over the network, if you want it to or you use something like an event handler that fires on every machine. and even then it's more like creating identical clones of the variables rather then really sharing them.

loud python
#

I know, but I was kind of expecting that variable = 1 would automatically share them

#

wouldn't be the first time arma 3 did weird stuff like that xD

polar folio
#

that would be crazy to send a package everytime a variable is declared

civic maple
#

you'll need to do publicVariable "var"; to share a variable

polar folio
#

it's good to be cautious about the engine quirks but it's better to learn to read the wiki fully and learn how everything works exactly instead of assuming weird things

loud python
#

that would be crazy and that's exactly why I expect arma to do it xD

polar folio
#

if you aren't sure about locality of commands for example, take a look at the top of hte wiki page. there are network flags there specifying the MP behaviour of each command

#

pretty sure the EH page has that for each EH too

#

then there are event scripts like init.sqf which is more of a case of something running everywhere instead of actually sending packages sharing vars.

#

that will give you a good understanding about the architecture

loud python
#

The more I think about arma 3, the more I realize how amazing it is that such a relatively small game has this kind of feature

#

most of this stuff was even in arma 2

#

It has the content of a game and almost the customizability of an engine

delicate lotus
#

Is there a way to check if a AI unit knows about the location of a player group?

civic maple
#

knowsAbout?

delicate lotus
#

mmh and how can I do this with a dynamic player group which like 50 players? XD

civic maple
#

what exactly do you want to do?

delicate lotus
#

I want an artillery which fires at the players

#

but I dont want it to fire if the AI has no way to know where the player is

polar folio
civic maple
#

There's also targetsQuery for getting list of targets

polar folio
#

this allows you to actually get a value from distance between actual position and perceived postion. which could be more dynamic than a yes/no thing

delicate lotus
#

mmh okay

polar folio
#

the question woul be what you mean by "AI"

#

like the whole enemy side?

delicate lotus
#

one enemy unit would be enough

#

cuz, it would be realistic if they share the information

eternal cedar
#

I heard some things about Java support for Arma 3 modding back when the game was in alpha, has that ever become a thing?

polar folio
#

no, got discontinued

eternal cedar
#

ah :/

delicate lotus
#

Java support for modding in arma?

little eagle
#

No

delicate lotus
#

no but when I read it I can only think about its as a joke

little eagle
#

It would be the one thing that is even worse than SQF.

delicate lotus
#

java and performance XD

little eagle
#

My unpopular opinion is, that you don't need OO programming for 99% of the stuff you do with Arma.

#

The people that want it are usually those that started with C++ or Java

misty basin
#

I gotta problem with my mod. anyone wanata hop down to a voice chat and help me with it

little eagle
#

voice chat
Nah

misty basin
#

okay then

#

i'll try to explain my problem

#

you know in your inventory how you got three tabs? one for you uniform, one for your vest and another for your backpack. the icon for the back pack shows up but the icon for your vest and uniform does not

#

but when you go into virtual arsenal the mini version of the icon does display beside the name of the vest and uniform

#

how do i fix this

little eagle
#

wat. why?

misty basin
#

what do you mean why?

little eagle
#

Why would you want to change that?

#

Or "fix" that?

misty basin
#

in the inventory there is no icon that shows up

#

its anooying

little eagle
#

And the problem is that you have no idea where to start?

misty basin
#

yeah i dont know why it does work for the backpack but not for the uniform/vest

#

here i'll pull up my scrpit

little eagle
#

Ok. Here is a copy of the BIS_fnc_arsenal script:

#

It's one of the most horrible pieces of SQF ever written.

#

If you want to fix that issue of yours, you have to rewrite that function and find the line that causes it and fix it.

misty basin
#

i'm new to this bro i won't know what i'm looking for

jade abyss
#

Then start with something easy

#

If you have no clue what you do

little eagle
#

I don't know either. It's over 3000 lines. It's a mess and no one knows where to look for it.

misty basin
#

what is the line that adds the icon for the inventory

jade abyss
#

dfs znrswznub w4z

misty basin
#

cause i put this and it works for the backpack but not the vest/uniform:

#

picture = "Custom_Uniform\Data\icon_assaultpack.paa";

little eagle
#

What. Where do you "put this"?

misty basin
#

here

#

class B_AssaultPack_Base;

class Custom_Backpack_Compact_Kirk: B_AssaultPack_Base {
    author = "Brandon Kirk";
    scope = 2;
    displayName = "(JTFNATO) Assault Pack[Kirk]";
    maximumLoad = 160;
    picture = "Custom_Uniform\Data\icon_assaultpack.paa";
    model = "\A3\Characters_F_EPA\BLUFOR\backpack_kerry.p3d";
    hiddenSelections[] = {"camo", "camo1", "camo2"};
    hiddenSelectionsTextures[] = {"Custom_Uniform\Data\custom_pack_kirk_co.paa", "Custom_Uniform\Data\backpack_compact.paa", "Custom_Uniform\Data\custom_pack_kirk_co.paa"};
};
#

thats for the back pack

#

class Custom_Camo: Uniform_Base
{
author = "Brandon Kirk";
scope = 2;
displayName = "(JTFNATO) Combat Uniform [CDN]";
picture = "Custom_Uniform\Data\icon_civ_shirt.paa";
model = "\A3\characters_f\BLUFOR\b_soldier_01.p3d";
class ItemInfo : UniformItem
{
uniformClass = "Custom_Uniform";
containerClass = "Supply40";
mass = 5;
};
};

#

thats for the uniform

#

class Custom_Vest_Kirk: Vest_Camo_Base
{
author = "Brandon Kirk";
scope = 2;
displayName = "(JTFNATO) Platecarrier[Kirk]";
picture = "Custom_Uniform\Data\icon_plate_carrier.paa";
model = "A3\Characters_F_EPA\BLUFOR\equip_b_vest_kerry";
hiddenSelections[] = {"Camo"};
hiddenSelectionsTextures[] = {"Custom_Uniform\Data\custom_vest_kirk_co.paa"};
class ItemInfo : VestItem
{
uniformModel = "A3\Characters_F_EPA\BLUFOR\equip_b_vest_kerry";
containerClass = "Supply140";
mass = 15;
hiddenSelections[] = {"camo"};

        class HitpointsProtectionInfo {
            class Chest {
                HitpointName = "HitChest";
                armor = 16;
                PassThrough = 0.3;
            };
            
            class Diaphragm {
                HitpointName = "HitDiaphragm";
                armor = 16;
                PassThrough = 0.3;
            };
            
            class Abdomen {
                hitpointName = "HitAbdomen";
                armor = 16;
                passThrough = 0.3;
            };
            
            class Body {
                hitpointName = "HitBody";
                passThrough = 0.3;
            };
        };
    };
#

thats for the vest

little eagle
#

OK, now that sounds like a completely

#

COMPLETELY different problem

#

Can you show a picture of what "icon" you mean that is missing?

#

Because I think I know what you mean, but am not sure.

misty basin
#

yeah give me a sec i'll have to get in game

little eagle
#

thx

misty basin
#

how do i send pics?

little eagle
#

Upload to imgur and link

misty basin
#

k

little eagle
#

You're wearing a uniform and vest, but the icon does not appear in the inventory UI. works for backpack.

#

Correct?

misty basin
#

yeah

little eagle
#

What does that have to do with the arsenal?

misty basin
#

the icon works for in the arsenal

#

the little icon beside the name

little eagle
#

You should've just written that:

You're wearing a uniform and vest, but the icon does not appear in the inventory UI. works for backpack.
sentence and everyone would've known what the problem is

#

Ok, let's see

misty basin
#

derp srry

#

thanks btw

little eagle
#
class Custom_Vest_Kirk: Vest_Camo_Base 
    { 
        author = "Brandon Kirk";
        scope = 2; 
        displayName = "(JTFNATO) Platecarrier[Kirk]"; 
        picture = "Custom_Uniform\Data\icon_plate_carrier.paa"; 
        model = "A3\Characters_F_EPA\BLUFOR\equip_b_vest_kerry"; 
        hiddenSelections[] = {"Camo"}; 
        hiddenSelectionsTextures[] = {"Custom_Uniform\Data\custom_vest_kirk_co.paa"};
        class ItemInfo : VestItem 
        {
            uniformModel = "A3\Characters_F_EPA\BLUFOR\equip_b_vest_kerry";
            containerClass = "Supply140";
            mass = 15;
            hiddenSelections[] = {"camo"};

            class HitpointsProtectionInfo {
                ...
            };
        };
#

That is the vest you're wearing?

misty basin
#

yes

#

also it say no armour when you mouse over it in the inventory ui

#

but i game it does protect you

little eagle
#

descriptionShort="$STR_A3_SP_AL_IV";

#

can be I, II, III or V too

misty basin
#

where do i add that?

little eagle
#

That adds the string about "protection level"

#

same where model and picture is

misty basin
#

okay and the icon?

little eagle
#

Hmm. I'm not sure why it doesn't show the icon.

#

Does it show any error message in the RPT file?

misty basin
#

0.o

#

where would i find that?

little eagle
#

%LOCALAPPDATA%\Arma 3

polar folio
#

maybe you need another "picture" entry in teh class iteminfo?

little eagle
#

no you don't

polar folio
#

just guessing.

little eagle
#

; )

misty basin
#

k i'm here

#

open rpt with notepad ++?

little eagle
#

sure, any text editor

#

ctrl + f for "custom"

#

Custom_ is a strange tag btw. Looks like a placeholder for a real tag

polar folio
#

might be a good idea to move this to the config editing channel where it belongs to get the right people to look at it

little eagle
#

I think I already know why

misty basin
#

why?

little eagle
#

Can you try changing:

picture = "Custom_Uniform\Data\icon_plate_carrier.paa"; 

to:

picture = "\Custom_Uniform\Data\icon_plate_carrier.paa"; 
misty basin
#

is it like that for my backpack?

#

no its not

#

just looked

#

then should i do that for my backpack too?

little eagle
#

No, you change one thing at a time to debug something

misty basin
#

okay

little eagle
#

Just to be sure you catch what makes the difference

misty basin
#

true

#

i'll try that for the vest

little eagle
#

If this doesn't work, then you can try giving the vest the icon of the backpack. That way we could test if it's a problem with the graphic or with the config.

misty basin
#

IT WORKED BRO!

little eagle
#

the slash in front?

misty basin
#

I'll make sure to give you a shout out in the next update patch!

#

yeah

little eagle
#

Put that slash everywhere

misty basin
#

slashes for everyone!

little eagle
#

It belongs there. Without slash it searches from the root and not the addons folder

misty basin
#

what about the backpack?

little eagle
#

The C++ level uses different methods for different item types

#

They probably programmed it in a way where it uses the addons folder as backup, but only for backpacks

misty basin
#

so i should?

little eagle
#

Yeah. backslash everywhere

#

model="\A3\weapons_f\Ammoboxes\bags\Backpack_Compact";

#

even before "A3"

misty basin
#

so start every "___" with a \

little eagle
#

Not every. There are some exceptions, but from what I've seen, everything you use should have it

#

model, picture, textures

misty basin
#

okay awesome thanks

#

JTF NATO is the mod if you want to check it out on the steam workshop

little eagle
#

In theory there should be a RPT entry about a "texture" (picture really) not being found

#

Not sure though.

misty basin
#

alright thanks man

little eagle
#

yw

misty basin
#

cheers

peak plover
#

My facial expression when I open a script made by someone else.

#

My appetite for bleach has risen, as I realize that pressing escape will immediately re-open the full-screen dialogue.

meager granite
#

Show us your best script

peak plover
#

I think I should really over-look some of my own scripts. Because I do would not wish these feelings on anyone.

#

You would feel just as bad

#

Using indentation is important.

#

What's the 'proper' way of using indentation?

#
if (true) then {
       script
};
if (true) then
{
       script
};
if (true) then {script};
spring ravine
#

I know people that do both, I prefer the second one as it is easier on my eyes.

#

I personally only use the third one on really short lines that are repeated

peak plover
#

I've been using the first one. However if it's a simple line of code or just exitWith {} I tend to use the 3rd

cedar kindle
#

the first one is by far more popular

young current
#

Or have random amount of indentations on each line!

cedar kindle
#

don't forget to mix spaces and tabs

young current
#

^^

austere granite
#

first one i like lots more

#

i have a tendency of also using the last if it's just a one line thing

cedar kindle
#

yea that's pretty normal

#

unless the line becomes very long

peak plover
#

haha the spaces and tabs and random indetations ๐Ÿ˜„

austere granite
#

it's usually in cases where i expted a return

_return = if (_condition) then { call fnc_bla } else { fnc_bla2 };
Where i dont'want to use select because it'll execute both

#

i still gotta check if param still always executes the default return

#

[1, 2] params [["_one", call fnc_someSlowAssFunction]];

It'll always call that function, even though the param is present

polar folio
#

what's objectively wrong with the second way? looks way more readable to me

eternal cedar
#

java and performance XD ( @delicate lotus )
What if I actually told you that the execution speed of Java programs has improved by a lot

#

actually I bet that it's almost as fast as e.g C++ in some scenarios

still forum
#

True words.
The Java SQF implementation would definetly perform better than current SQF. It was only ditched for security Reasons. Some Java Functions are even still in the engine right now I think. But not accessible.. Maybe it will come back some day

peak plover
#

It says infinte while loops are not allowed. Why is this?

eternal cedar
#

Don't have too much experience with SQF, but I assume that you run it on the main thread and therefore it's gonna freeze up the main thread

still forum
#

Thats indeed what it does.
infinite while loops are not allowed because they would freeze your game. Instead unscheduled while loops are limited to 10k iterations

little eagle
#

infinite while loops are allowed in scheduled environment. In unscheduled environment there is a 10k iterations limit, but you would lock up the game anyway with infinite loops there.

peak plover
#

Alright. Mine is in scheduled because it's been running way longer.

tough abyss
#

Hay Guys, i have a problem. I got my own arma 3 main menu. I want that my "loadingscreen" is not a picture, i want it to be a video. Thats my picture: class LoadingStart: RscPicture
{
idc=2310;
text = "general\vid.ogv";
autoplay = 1;
loops = 10;
x="0 * safezoneW + safezoneX";
y="0 * safezoneH + safezoneY";
w="1 * safezoneW";
h="1 * safezoneH"; it doesnt work with the video. Its just black

scarlet spoke
#

I'm not sure whether it's even possible to use a video in the loading screen...

tough abyss
#

In bohemia wiki they wrote its the same as with picture, just use this code: text = "general\vid.ogv";
autoplay = 1;
loops = 10;

#

I dont really understand xd

still forum
#

Maybe it just doesn't work for loading screen? Because that one may be special?

tough abyss
#

hm. Ok ๐Ÿ˜ฆ So i will go with an paa file.

still forum
#

I don't know if thats the case. Just assuming stuff

rancid pecan
#

hello
problem ๐Ÿ˜ฆ
The picture is distorted

civic maple
little eagle
rancid pecan
#

๐Ÿ˜ฆ Where do I need to publish it?

little eagle
#

?

civic maple
rancid pecan
#

@civic maple soory anden

civic maple
#

np

rancid pecan
#

@little eagle How did it go? ๐Ÿ˜ฆ ๐Ÿ˜ƒ

little eagle
#

I just used texview2. The other tool is annoying to use

rancid pecan
#

I jpg to dds and paa ?

#

I am doing wrong

little eagle
#

No, straight to paa

meager granite
#

save jpg as png, then use pal2pace from TextView2 (BI Tools)

little eagle
#

save as

meager granite
#

(not sure if you can do jpg straight to paa, never ever needed that)

little eagle
#

sure you can. I just did

rancid pecan
#

okey i am download textwiew 2

#

i am try thanks everybody

#

tga to paa >>> its true ?

tough abyss
rancid pecan
#

imagetopaa error>> Fail to process

little eagle
#

use texview2, not imagetopaa.

#

Ste001, that menu at the end?

tough abyss
#

Naw the loading bit

little eagle
#

I'd use a dialog instead.

tough abyss
#

Hm okay, how would you format the font like he has on the initializing bit

little eagle
#

by adding controls to the dialog. probably a RscStructuredText one where you can use html like tags for formatting

tough abyss
#

Oh nice I didn't realise you could do that, can you import fonts using controls?

little eagle
#

Not without changing some configs (needs addon.pbo, not mission), but Arma has a bunch of Fonts

tough abyss
#

Okay great thanks pal

#

@little eagle is he using his own image as the background or is that effect achieved messing around with the editor do you reckon?

little eagle
#

It might be one of the images of the loading screens already in Arma, but I can't recognize all of them.

#

You would add a RscPicture to your dialog and give it that texture

#

CfgFontFamilies
in the config viewer has all available fonts

tough abyss
#

Yea of course, I think it is because it looks familiar. Thanks mate been a big help ๐Ÿ‘Œ

little eagle
#

class CfgFontFamilies
{
class LucidaConsoleB
class TahomaB
class EtelkaMonospacePro
class EtelkaMonospaceProBold: EtelkaMonospacePro
class EtelkaNarrowMediumPro
class PuristaBold
class PuristaLight
class PuristaMedium
class PuristaSemibold
class RobotoCondensed
class RobotoCondensedBold
class RobotoCondensedLight
};

tough abyss
#

You wouldn't know where the loading screen textures are located would you?

little eagle
#

ui_f.pbo I'd guess

tough abyss
#

Okay bud I'll check it out thanks

little eagle
#

"\A3\Ui_f\data\GUI\Cfg\LoadingScreens\LoadingStripe_ca.paa";

#

"\A3\Ui_f\data\GUI\Cfg\LoadingScreens\LoadingNoise_ca.paa";

#

"\A3\Ui_f\data\GUI\Cfg\LoadingScreens\Loading_01_co.paa"

#

ui_f_data.pbo is the PBO file

#

It's basically LoadingNoise_ca.paa on a black background as far as I can tell

tough abyss
#

Looks about right to me ๐Ÿ‘Œ thanks again brother

compact current
#

Is it possiable to call a function on a specific player, using there player uid ?

dusk sage
#

Yes, not directly though

#

You'll have to find their player object from their uid first

still forum
little eagle
#

What will I find if I open that function?

#
/*
    Author: Nelson Duarte

    Description:
    Returns object belonging to given UID

    Parameter(s):
    0: STRING - The UID of object

    Returns:
    OBJECT
*/
// Parameters
private ["_uid"];
_uid = _this param [0, "", [""]];

// The shooter
private "_unit";
_unit = objNull;

// Go through all units and find matching UID
{
    if (getPlayerUid _x == _uid) exitWith
    {
        _unit = _x;
    };
} forEach allUnits + allDeadMen;

// Return
_unit;
#

eh, it's alright. But relying on + priority being above binary commands is pretty ugly

austere granite
#

can also use allPlayers instead of (allUnits + allDeadMen)

little eagle
#

Yeah. That should make it quicker.

austere granite
#

count instead of forEach will save you another tiny bit of time ๐Ÿ˜„

#

#countindex2017

little eagle
#

// The shooter

#

...

austere granite
#

๐Ÿ˜„

civic maple
#

will it?

#

why would count be faster?

austere granite
#

no _forEachIndex is the reason basically

civic maple
#

well then

little eagle
#

It's a tiny bit less stuff to do in C++ land

#

But it's more limited over all

#

also, the new breakOut syntax would be faster too

austere granite
#

new syntax? :3

dusk sage
#

new D:?

austere granite
#

ima look it up later i guess

little eagle
#

return value

#

1.5 something

#

Since Arma 3 v1.47, breakOut can be used to return a value. It is the closest SQF comes to having "return" like operation.

#
params [["_uid", "", [""]]];

scopeName "main";

{
    if (getPlayerUID _x isEqualTo _uid) exitWith {
        _x breakOut "main";
    };
} count allPlayers;

objNull
dusk sage
#

then*

#

๐Ÿ˜›

little eagle
#

You think it makes a difference? I think it's pretty much the same

dusk sage
#

the exitWith will cause overhead trying to exit the scope, which you will exit regardless

little eagle
#

then has the alternative syntax to check IF then CODE vs IF then ARRAY

#

there is just IF exitWith CODE

night frigate
#

So... I want something to happen when a player joins (mission start or JIP), and then, 60 seconds later, something else to happen. is it a terrible idea to use sleep in initPlayerLocal.sqf?

compact current
#

Thanks guys, i just used remoteexeccall with the uid passed as a param and then a if statment checking if the uid is equal to the players uid then do.... etc

dusk sage
#

@little eagle After precompilation?

#

Even so, the way the engine is checking types wouldn't be a large overhead, vs exiting scope

little eagle
#

preprocessing does not get arround these type checks

#

Even so, the way the engine is checking types wouldn't be a large overhead

#

Well, I'm not so sure about that

tough abyss
#

@little eagle I'm getting an error when I run the server that it can't find my loading.paa, is this the right way to call it? Baring in mind that my LoadingScreen.hpp is in dialog folder and my loading.paa (the texture) is in dialog/images

        class BackgroundEffect: Life_RscPicture {
            colorBackground[] = {0,0,0,1};
            idc = -1;
            text = "images\Loading.paa";
            x = 0 * safezoneW + safezoneX;
            y = 0 * safezoneH + safezoneY;
            w = 1 * safezoneW;
            h = 1 * safezoneH;
        };
    };```
#

Ah fixed all good

dusk sage
#

Sorry, compilation*

tough abyss
cerulean whale
#

Can you do a for statement and have it increment by a set value? (As a pose to 1)

#

Got it, step does it

queen cargo
#

it is right in front of you @tough abyss
No entry 'mpmissions\__CUR_MP.Altis\description.ext\RscTitles\LoadingScreen.duration'

#

the UI you created is required to have a duration field

#

due to the way you create it

#

just add a field duration = 32000; and you should be fine ...

#

though, after 32000 seconds, it will be hidden

dusk sage
#

@cerulean whale yep

#

for "_i" from x to y step z

#

oh didn't see your second message

#

๐Ÿคฆ

cerulean whale
#

Lol

tough abyss
#

In my hpp file @queen cargo ?

queen cargo
#

yes

#
    idd = 4750;
    name = "LoadingScreen";
    movingEnable = 0;
    duration = 32000;```
tough abyss
#

Thanks for pointing that out pal I'll get into it now

tough abyss
#

Does anyone know the x,y,w,h numbers for a full screen? I'm trying to put a loading screen in but it doesn't span whole screen

queen cargo
hearty plover
#

Anyone have a link to a good example of a game clock? Something similar to a count-down timer, which can be reset, puased, started, stoped, etc.

#

Trying to write a general purpose timer.. D:"

queen cargo
#

what exactly you have in mind @hearty plover ?

hearty plover
#

@queen cargo Well, I need a timer, which can work like this [TIME TO RUN] call timerStart.sqf and can be stopped or puased with, [] call timerStop.sqf and timerPuase.sqf

#

Also, It needs to be server side, and synced to all players...

#

As I plan on taking the data and using it to cut a display to each client..

#

Fuck this all sounds stupid.. D:

queen cargo
#

RscText
some update task
a variable with the start time
and some calculation to get the latest time via current - start

#

fairly simple actually ...

#

required steps:

  • display "timer" dialog
  • create a "timer" variable and publicVariable it
  • create a "running" variable and publicVariable it
  • create a backgroundjob (eg. onEachFrame, Draw3D, spawn, ...) to update the timer dialog by simply doing timer settext (TIME - startTime)
  • tell the backgroundjob to terminate when the timer is paused
#

something like that

#

exact steps could be different ... but that should get you started

hearty plover
#

That's actually really helpful.

#

Thanks @queen cargo

queen cargo
#

would write it down if i had the time ... but trying to fiddle around with avalondock2 ...

#

fucking styling -.-

tough abyss
#

Can i cancel a moveTo command aplyed on a agent?

cold quartz
#

Is there an alternative to or a known method for doing something similar to nearestTerrainObjects[[0,0,0],["tree"],100000,false,true]? I'm able to run that on different size worlds and get a list of all the trees but on heavily forested maps (xcam_taunus for example), the array it tries to build takes up too much memory and crashes ARMA. I've tried looping through sections of the map in a for x = 1 to 4 { for y = 1 to 4 kind of deal hoping that if I used a smaller radius, I'd be able to go through the map in sections but the memory usage just grows and grows until it crashes whereas I kind of expected it to grow and linger until the script completed. Any thoughts?

hearty plover
#

Line 6 of the above is missing a semi-colon according to Arma3...

#

I am guessing it's something wrong with my nested if statements, but am unsure of what I am doing wrong.

cold quartz
#

I'm not completel familiar with the syntax, or if it's different for cpp files but in sqf, I think the if's require a then

#

if (condition) then {}

hearty plover
#

That was it, also, Hastebin flagged that as CPP for some reason...

#

Dunno why

#

D:

dusk sage
#

Don't forget you can't use indexers like array[0] ๐Ÿ˜ƒ

cold quartz
#

Re: my issue. Or does anyone know a way to force memory used by a script to clear? I 'spawned' my for x, for y nearestTerrainObjects[[xdistance, ydistance,0] hoping that if it ran in a different 'thread' that the memory would be released when the thread completed ... though I haven't yet tried nil'ing the thread handle ... I'll try that.

dusk sage
#

@cold quartz I'm not sure what you're hoping for. And use 'thread' loosely, even if you are spawning/execVM. When you refer to memory usage, are you storing results, etc?

cold quartz
#

1 sec, I'll post code

dusk sage
#

If you are going to await execution, there is no need to be spawning it

cold quartz
#

That was a test

#

I was crashing arma and trying out different ways to get the process' memory usage to stop growing

dusk sage
#

o.o

cold quartz
#

Originally, there wasn't any spawning, it was all in the context of the single script but I figured, 'maybe' if I spawned it, it would clear when it fell out of scope.

dusk sage
#

Stop doing nested for's with pushBack ๐Ÿ˜„ ?

#

You are within a for scope regardless

cold quartz
#

Yea, but when it reaches a certain size, I'm attempting to clear the array they're getting pushBack'd into...or at least I thought that's what I was doing?

cold quartz
#

Elegant, thanks! By looking at yours, I think I helped to identify the primary flaw in mine. I'm essentially duplicating and possibly triplicating every tree w/ my hugely overlapping search radiuses. I also think I answered my 2nd question too. On the iteration, I was trying to set the array to nil or [] to free up the memory after each 'batch' of 100 but that wasn't reflected in the processes tab for ARMA's memory usage. Once I spawned it then eventually nil'd the spawn handle, the memory usage increased and decreased like I expected.

spring dune
#

Hmmm

#

Maybe it's strange Q but...

#

Any possibility to make multiple case...

rancid ruin
spring dune
#

I need multiple string or such...

rancid ruin
#

explain yourself man

spring dune
#

For example:

case "name":
        {
                _patch = "\PATH\PATH\" + (_name_array select 0) + "_" + "check1" + ".paa";
        };
dusk sage
#

what's the issue?

tough abyss
#

TIP: _agent moveTo getPosATL _agent; make the agent cancel the current moveTo command.
Tested in Eden Editor.

spring dune
#

Can i do this or not?

rancid ruin
#

what you wrote won't do anything because the syntax is wrong

spring dune
#

So, i would separate each case right?

rancid ruin
#
switch (_uniformClass select 2) do {
    case "name1": { // do something };
    case "name2": { // do something };
    default { // default do something };
};
#

like that?

#

we don't know what you're trying to do though

queen cargo
#

@rancid ruin switch (_foo) do { case "str1"; case "str2": { /*work to do*/ }; };

#

uh ... wait

rancid ruin
#

i'm so confused

queen cargo
#

syntax error

#

in it

#

fixed*

#

ohh ... wait ... wrong annotation

#

but your approach is wrong @spring dune

#

gah ... should get some sleep ๐Ÿ™ˆ sorry @rancid ruin for false annotation

rancid ruin
#

example 2 sums up switch cases pretty well

_color = switch (side player) do {
    case west: { "ColorGreen" };
    case east: { "ColorRed" };
};

this sets the variable _color to a string, depending on if the player's side is west or east

spring dune
#

Sorry for noobish Q. Sleepless night... Blah blah blah...

I just asking because some of classnames have different parts

For example:
rhs_uniform_emr_patchless
rhs_uniform_msv_emr

select 2 = emr and msv here...

#
switch ((_uniformClass)select 2) do
    {
        case "emr":
        {
                _patch = "\PATH\" + (_###_name_array select 0) + "_" + "EMR" + ".paa";
        };```
#

It's a part of...

queen cargo
#

looks weird ... and wrong to me

#

example input for _uniformClass and _name_array ?

spring dune
#

2000 symbols limit there... argh...

queen cargo
#

use pastebin dude ๐Ÿ™ˆ

spring dune
#

Huh... Sorry. Will do

queen cargo
#

that just spamms the channel

spring dune
#

Edited.

#

So, how i can merge some of "select 2" with different value?

dusk sage
#
} forEach getArray (configFile >> "span class="re5"> CfgVehicles" >> getText ( configFile >> "span class="re5"> CfgWeapons" >> uniform _unit >> "span class="re5"> ItemInfo" >> "span class="re5"> uniformClass") >> "span class="re5"> hiddenSelections");
#

oh my lord god

queen cargo
#

so ... what would an example input to that function look like now?

spring dune
#

Don't ask me really about this. Not mine code. Just trying to change switch structure.

queen cargo
#

what for?

#

if it works, do not change

#

though ... it is damn horrible code

dusk sage
#

_############!

queen cargo
#

he just hid the tag @dusk sage

spring dune
#

Ofc. )

dusk sage
#

oh

#

right ๐Ÿ˜Ÿ

spring dune
#

So... The Q same...
Any ways to combine cases with different values called by one Select?

queen cargo
#

so ... as said ... if it works @spring dune then do not change
if it needs to be extended ... well ... need example input for the call to the script to even understand anything on it (as it seems completly ridiculus to me ... could be the time)
if it just needs to be changed for the sake of cleaness ... rewrite :3

#

you do can have multiple cases executing the same code

spring dune
#

I'm trying to rewrite. And this is first step:

  • expanding of switch

Like that right?

switch (_condition) do {
    case "string1";
    case "string2": { hint "string1 or string2" };

etc.
};```
queen cargo
#

exactly

spring dune
#

Just wasn't sure about... Sorry guys. And ofc โ€” Thank you! ๐Ÿคฆ ๐Ÿ˜‚
P.S. Imma true noob.

queen cargo
#

just always check the wiki ๐Ÿ˜›

#

it is pretty well written in most cases

#

and now bring me a beer
i have a UI-Editor to rewrite ...

spring dune
#

I did, @queen cargo . My mind just stuck.

Which one?

queen cargo
#

full rewrite as i am fucking annoyed by the mistakes i made due to missing knowledge about WPF ... and some required concept with it

#

it just makes it a badass piece of shit to debug

spring dune
#

Looks like really useful thing... ๐Ÿ‘
But I can't fully estimate appreciate it. Not my level. ๐Ÿ˜‚

cold quartz
#

Neat app. I don't really mind wpf but I hate styling controls.

rancid ruin
#

there's some errr CSS in your SQF

spring dune
#

if > then > else > else... I mean.

#

@rancid ruin I see now what u talkin' about

dusk sage
#

no @spring dune

#

make another switch

spring dune
#

@dusk sage that sounds bad... ๐Ÿ˜ฆ

queen cargo
#

if else else? Oo

dusk sage
#
case "g3": 
{
    switch (_uniformClass select 3) do {
        case "": {};
        case "": {};
    };
};
queen cargo
#

it is either this or this ?this?

#

ahhh i see what you tried

spring dune
#

this or this or this...

queen cargo
#

if elseif else

dusk sage
#

๐Ÿ˜›

spring dune
#

Yup, @queen cargo

queen cargo
#

that does not works in SQF due to the way if works

#

if there would be a single-line accepting if else

#

then it would work just like in any other lang

spring dune
#

Yeah, that's why i'm askin'

dusk sage
#

I also just noticed this

#

if (((_uniformClass) select 3)=="span class="re5"> mc"||"tan") then

#

That won't work for more than one reason

queen cargo
#
if (index == 0)
    return 0;
else if(index == 1)
    return 1;
else
    return 2;

is actually

if (index == 0)
{
    return 0;
}
else
{
    if(index == 1)
    {
        return 1;
    }
    else
    {
        return 2;
    }
}
#

but as the first is not possible in SQF

#

you are stuck with the second

#

or with switch

spring dune
dusk sage
#

This is all horribly broken

#

First off

queen cargo
#

just use switch darling ....

dusk sage
#

You cannot do

queen cargo
#

and ...

dusk sage
#

_x == 1 || 2

queen cargo
#

hell ...

#

yes to @dusk sage

dusk sage
#

Secondly you haven't escaped the " in your strings

#

even pastebin is confused

queen cargo
#

actually he has ... pastebin just fucks up sqf

dusk sage
#

"span class="re5"> mc"

queen cargo
#

ohh ...

#

ye

#

youre right

#

this will fuck your arse if it hits you

dusk sage
#

pastebin gone nuts because it's all bonkers

#

๐Ÿ˜„

queen cargo
#

nah ... because it thinks SQF escapes like this \"

#

how wrong they are ๐Ÿ˜ˆ

dusk sage
#

๐Ÿ˜›

#

ohhh

#

I see

spring dune
dusk sage
#

the span class

#

pastebin is doing it

spring dune
#

Yup, it's broken again...

dusk sage
#

hahahaha

spring dune
#

Watch snapshot above

dusk sage
#

You can't do || here

#

_x == 1 || _x == 2

#

Not

queen cargo
#

though ... it would be great if a programming language would just work like that

dusk sage
#

_x == 1 || 2

#

haha

spring dune
#

Yup, i saw your message about this.

@queen cargo Hah. )

dusk sage
#

or you know

#

_x in [1, 2]

#

๐Ÿ˜„

spring dune
#

So, which will work here?

#

_x in [1, 2]This one?!

dusk sage
#

Not being rude, but are you reading what's being said

#

You can do

#

_x == "something" || _x == "something2"

#

Or

#

_x in ["something", "something2"]

spring dune
#

Now i understand you. ) Thanks a lot for patience! ๐Ÿ˜Š

dusk sage
#

๐Ÿ‘

cerulean whale
#

Anyone know why isNil is returning false when a variable IS defined?

#

e.g. isNil backpack player

dusk sage
#

Full code?

cerulean whale
#

when backpack player is B_carryAll_base

#

I am just looking in debug

#

ill sc

dusk sage
#

Also

cerulean whale
#

oh dw I have a workaround

dusk sage
#

Anyone know why isNil is returning false when a variable IS defined?

cerulean whale
#

just if backpackPlayer != ""

dusk sage
#

If a variable is defined, it is not nil

cerulean whale
#

I meant true

#

๐Ÿ˜›

#

because backpack player is "" if there is none

dusk sage
#

which means you have

#

isNil ""

#

or isNil "something"

#

So unless something is defined

#

๐Ÿคฃ

cerulean whale
#

I thought if backpack player was undefined (you have no backpack) it was set to nil

queen cargo
#

isNil returns true because the "backpack" is not defined as variable in current namespace

cerulean whale
#

but it's set to ""

queen cargo
#

isNil will check the variable in the string

dusk sage
#

It will literally be

queen cargo
#

not if the string is empty

dusk sage
#

isNil "B_carryAll_base"

#

You'd need to define B_carryAll_base in MNS

queen cargo
#

count backpack player == 0 or backpack player == ""

#

will do what you want

cerulean whale
#

THE REASON IT DIDN'T WORK. Is because when you have no backpack it is set to ""

#

I did that arleady @queen cargo....

queen cargo
#

THE REASON is false

#

just lucky

#

thats all

dusk sage
#

Why would it return nil

#

It returns a string

#

It wouldn't make sense for it to return nil

cerulean whale
#

because you have no backpack. I didn't realise that at the time @dusk sage

queen cargo
#

isNil is not for string comparison
thats why you are using the wrong thing here

cerulean whale
#

@queen cargo I don't think you get what I am saying

#

I DIDN'T REALISE IT LEFT IT AS A BLANK STRING WHEN YOU HAVE NO BACKPACK

queen cargo
#

i do not think you get what i am trying to communicate to you

cerulean whale
#

I entirely get it

#

ik what isNIl is

queen cargo
#

COOL THEN STOP CAPS LOCK

#

still you use it wrong

#

isNil would also return false for backpack carried

cerulean whale
#

You aren't seeing my point even though I explain it. isNil {Undefined Var} would return true. isNil "Backpack " would return false

queen cargo
#

what you wanted to have is isNil code --> isNil {backpack player}

cerulean whale
#

Well, isNil backpack player works just fine. because backpack player is always a string

queen cargo
#

and you do not listen which is even worse

cerulean whale
#

whether you have a backpack or not

#

meaning it is useless

#

isnil is useless with backpack because it is always a string, even if no backpack exits

dusk sage
#

๐Ÿฟ

queen cargo
#

...

#

okay ... i will quickly explain it in length

#

with code examples

#

why your whole attempt and understanding of IsNil is wrong

#

as linking to te page did not helped

jade abyss
#

isNil "" = false
because: "" == string

queen cargo
#

and you seemed to ignore the context i tried to transfer to you @cerulean whale

dusk sage
#

@jade abyss isNil "anything", might not return false though

cerulean whale
#

Exactly @jade abyss That is my point here. @queen cargo I understand what you are showing me but it is irrelevant to my situation...

jade abyss
#

What do you mean with "anything"

#

"anything" = String ๐Ÿ˜„

dusk sage
#

<insert something here>

#

๐Ÿ˜„

cerulean whale
#

and isNil in the first place is useless in this situation therefore I do not need it....

jade abyss
#

Yep

#

if(backpack player isEqualTo "")then{bla}; <- works

queen cargo
#

//backpack player => B_carryAll_base is set for all theese examples

isNil backpack player; //=> will be true```
```B_carryAll_base = "something";
isNil backpack player; //=> will be false```
```isNil {backpack player}; //=> will be false```
jade abyss
#

Don't think so, but okay. Carry on.

cerulean whale
#

@jade abyss Which I did about 20 seconds after asking the question, and I don't really why this conversation is still happening lol

jade abyss
#

(since one is ConfigClass and the other one is a Variable, but okay)

#

Wondering also Ben^^

cerulean whale
#

Yeah, changing b_carryAll_base as a var has no effect on the configClass

#

I was wondering how that worked as well lol :/

dusk sage
#

what do you mean D:?

#

Yeah, changing b_carryAll_base as a var has no effect on the configClass

queen cargo
#

also lost context here

#

going back to coding ...

jade abyss
#

If that would work... oh my... it would fuckup whole Arma^^ So... no, i don't think thats even possible

cerulean whale
#

Look at his example. He sets a var but then uses backpack player negating the var

queen cargo
#

๐Ÿคฆ

dusk sage
#

Negating the var?

cerulean whale
#

negating the effect of setting the variable in the first place

dusk sage
#

I don't understand what you mean

jade abyss
#

@queen cargo Sry, but what you wrote was Schwachsinn aller feinster Sorte ๐Ÿ˜„

jade abyss
#

๐Ÿ˜„

queen cargo
#

no @jade abyss ... they are separated examples and explain what he did in most basic SQF possible

cerulean whale
#

He sets a variable... and doesn't use it, yet changes it in both examples. Yet in the examples it apparenly changes the result. It's weird. ๐Ÿ˜›

queen cargo
#

that is because IsNil is not checking the string

#

the string is taken as variable name

#

and the variable under the name in the string of isNil is checked for being nil

jade abyss
#

Would it make sense? Not rly.

cerulean whale
#

No, the string of backpack player is a string taken from configClass

jade abyss
#

wait wait Ben.

#

isNil is checking for "_VarName"

queen cargo
#

var = ""; isNil "var"; and var = nil; isNil "var"; is essentially what i put there

#

as that is what it is doing

#

exactly @jade abyss

dusk sage
#

You don't understand what isNil does then @cerulean whale ๐Ÿ˜„

jade abyss
#

still, i got one question:

dusk sage
#

Everything X39 has said is 100% right

jade abyss
#

WHY THE FUCK DO WE TALK ABOUT THAT?

queen cargo
#

because @cerulean whale is not understanding

#

and i try to share knowledge

jade abyss
#

Who the F would check isNil for a backpack AND Who the F would assign a Var with the name of a Backpack ffs oO

#

That makes no sense at all

cerulean whale
#

@dusk sage It checks if a variable is undefined..... What he is doing is this ```SQF
B_carryAll_base = "nil"
isNil backpack player

dusk sage
#

backpack player returns a string

#

lets say "something"

cerulean whale
#

Exactly my point^^

dusk sage
#

isNil "something"

#

That checks if something is defined

queen cargo
#

okay ... lets fiddle it down further ...

jade abyss
#

again: Why? This is a case that might happen... ... .. erm... never?

dusk sage
#

By doing B_carryAll_base = "nil", you are defining it in missionNamespace, so it is not nil

cerulean whale
#

@dusk sage let me get his example

#
B_carryAll_base = nil;
isNil backpack player; //=> will be true

B_carryAll_base = "something";
isNil backpack player; //=> will be false

isNil {backpack player}; //=> will be false
dusk sage
#

Yep, that makes total sense

cerulean whale
#

How does canging the variable effect the result because it doesn't check the variable, it checks the string returned from backpack player

dusk sage
#

Okay

#

Look

#

isNil "myvar"

#

Checks if myvar is defined

#

Nothing else

jade abyss
#

myvar = "Bla";

dusk sage
#

If you define myvar ^

#

Then it will return false

jade abyss
#

isNil "myVar" = false

queen cargo
#
//typeName _player ==> "OBJECT"
 _backpack = backpack _player;
//typeName _backpack ==> "STRING"```
from wiki:
`isNil STRING` `isNil CODE`

further from wiki: 
```Tests whether the variable defined by the String argument is undefined, or whether an expression result passed as Code is undefined. 
The command returns true if the variable or the expression result is undefined (i.e. the expression result is Void), and false in all other cases.```
dusk sage
#

But