#arma3_scripting

1 messages · Page 436 of 1

still forum
#

I was asking if it returns array of strings

#

and everyBackpack should return the backpack container

#

that you can then read from using the cargo script commands. Like if you read from a box

wary vine
#

ill check it out now

#

that works great, does the same thing for for uniforms and vests ?

#

everyContainer found it

little eagle
#

I am starting to wonder whether the BIKI has actually saved me time, or cost me.
In the very beginning it helps. But then comes the point where you realize that pretty much everything is wrong somehow.

wary vine
#

i only found out you can use find for strings xD was reading Biki the other day xD

meager heart
#

or outdated

wary vine
#

"asshole" find "ass"

little eagle
#

0

wary vine
#

xD

tough abyss
#

@commy2 I agree, at some point you are looking for more information and just realise that there's alot of stuff missing.

#

It's great for beginners, though

little eagle
#

But I didn't say missing. Plain wrong.

wary vine
#

where I have it its more like

toLower("asshole") find toLower("ass") ```just to be safe
winter rose
#

@little eagle let's edit it then? what is the current problem with the wiki

little eagle
#

Pick a page and I tell you. Also hyperbole.

winter rose
#

(used to drink hypersoup btw)

#

setDir?

little eagle
#

The accepted heading range is from 0 to 360

#

Try
player setDir 400

meager heart
#

next pls setFlagSide

winter rose
#

I know it works, and will return (about) 40

little eagle
#

It also contradicts example 2 with < 0.

#

So this sentence is wrong.

winter rose
#

see KK's August 28, 2013 comment

#

it can be seen as "widely accepted", too
but let's rephrase it, it's an old page after all

little eagle
#

Sure, but the description is still wrong. And he's basically rambling about floats being floats.

#

Nothing to do with setDir.

winter rose
#

fair enough

#

let's edit the description then

little eagle
#

Pick another page?

#

This is fun.

meager heart
#

i did ^

winter rose
#

setFlagSide

meager heart
#

yep

#

also flagOwner

#

that is build in CTF system, nothing on wiki about it

still forum
#

@wary vine to get uniform/vest use uniformContainer/vestContainer/backpackContainer

little eagle
#

Not sure as I never used setFlagSide, but the description talks about " where unit is local ", but the command takes a flag as argument not a unit. Is it supposed to say "object"?

wary vine
#
    {
      private _container = _x select 1;
      private _cargo = [backpackCargo _container,weaponCargo _container,itemCargo _container,magazineCargo _container];
      systemChat format ["%1",_cargo];
    }forEach (everycontainer _x);
``` seems to work
tough abyss
#

Added: New "pixelPrecision" parameter (0(default AUTO), 1(ON), 2(OFF))
Added: New ctrlSetPixelPrecision script command
These were added on the 12th of January. Does anyone know what they do?

winter rose
#

would Sets object heading. Angles are measured in degrees clockwise from north, and regular range goes from 0 to 360 (0° = N, 90° = E, 180° = S, 270° = W). Negative angles represent a counter-clockwise angle. suit you then @little eagle

little eagle
#

"range goes from 0 to 360" is the wrong part.

#

It has no range.

still forum
#

@lone glade knows I think

wary vine
#

setDir can be -360 to 360 tho right ?

still forum
#

@winter rose Range automatically get's clamped to 0 to 360

little eagle
#

It can be any number.

still forum
#

which is also kinda wrong still. Because 361 doesn't become 360

little eagle
#

1874981 would be valid

winter rose
#

-∞ to +∞

wary vine
#

right quick comp csgo game then will be back

still forum
#

The range is from 0 to 360. Anything outside that range is passed through (abs range) modulo 360 😄

wary vine
#

oh @still forum got it sorted last night

winter rose
#

not clamped, let's just example 2 speak for itself

#

we don't -have- to specify it can accept more, but a note can be welcome.

little eagle
#

Technically the command has no range, as it reports no numbers. It has a domain from -inf to inf, or however maxed out floats should be represented. getDir has a range from 0 to 360.

still forum
#

But specifying what exactly it does wouldn't hurt.

wary vine
#
          const SteamID = require('steamid')
          let sid = new SteamID(`${json3[i].id}`);
          sid.instance = SteamID.Instance.DESKTOP // 1
``` converts another instance of steam64 id into the one i needed
still forum
#

(abs range) & 360 is what it does. That's even SQF script

wary vine
#

wilth node anyway

winter rose
#

also, this command if from OFP era. chances are that its wiki page hasn't really been well updated ever since

little eagle
#

It was always wrong.

winter rose
#

it had its charm

#

a bit less readable if more details are present though

#

but the whole wiki isn't wrong, mostly old commands that are not revised

#

and if it's wrong, change it – that's what I do

little eagle
#

Go ahead, that's a good thing to do.

wary vine
#

hmm

#

has the biki got an api or something I can hook into on my bot ?

#

so i can search for commands from my discord xD

still forum
#

yes it has one. mediawiki API

wary vine
#

OOOOOOH

still forum
#

But not all commands are on the wiki

wary vine
#

meeeeeeeeeh

#

I started my api last night -.-

tough abyss
#

So who should we contact if a command is missing?

wary vine
#

will allow classname to displayName conversions ..

#

just working out the best way to store it.

still forum
tough abyss
#

ctrlSetPixelPrecision is missing

#

It has a ingame description, though I am not sure I understand that.

still forum
#

Isn't that dev-branch only?

tough abyss
#

That's true, but if it's not added now it will never be...

still forum
#

Nah... Not true ^^

#

There are few wiki editors. And there are even fewer people on dev branch.
So the chance that you have a wiki editor on dev-branch which also writes UI scripts so he knows what that does... Kinda low

tough abyss
#

True, the only reason I haven't added it is that I am not 100% sure what it does.

#

and the ingame description is as useful as always

obsidian chasm
#

Any of you guys used VCOM AI and can give me the best way to see if its actually working? lol i.e AI behaviour differences

tough abyss
#

When it works, you'll notice it immediatly.

winter rose
#

setDir edited 😄

tough abyss
#

Well done;)

obsidian chasm
#

I mean it looked a bit different, one guy ran away...

#

i dont know the ai enough sadly to tell

meager heart
#

best way to see if its actually working?
press escape, if there is VCOM menu, it's working

little eagle
#

Good. It could also be mentioned in the description how it uses the remainder of division by 360 if larger absolute values are used.

winter rose
#

example 2 does the job I think

still forum
#

I agree commy. Lots of parts of the wiki are bullshit.
According to the wiki the new findIf command on dev-branch is a Arma 1 and Arma 2 and TKoH command.

little eagle
winter rose
#

nooo

#

@still forum you're wrong (refresh 😋 )

#

but a bad copy/paste indeed.

still forum
#

you hate findIf too?

tough abyss
#

I am actually wondering why the process of adding commands to the wiki isn't automated.

errant jasper
tough abyss
#

So?

errant jasper
#

The time spent to automate the process might take longer than doing it manually.

#

Especially now since Arma 3 and SQF is nearing the end.

tough abyss
#

You are generally correct, but I don't believe that in this case.

little eagle
#

So it could've saved months is what you're saying?

tough abyss
#

It's not about saving time alone, it's about providing complete information by having an automated process.

errant jasper
#

commy2, it depends on what exactly is automated. If it is just the fact that a command has been added, how long does it take to create an empty command entry?

little eagle
#

Few minutes?

tough abyss
#

So what's the reason so many commands were missing there locality information when added to the wiki? It's surely not time.

errant jasper
#

Cause somebody has to test them?

little eagle
#

Not even the devs knew how sqf would work in the end I assume.

tough abyss
#

@errant jasper So you want to tell me, a dev at BIS writes a command and doesn't know whether it broadcasted over the network?

little eagle
#

Ever tried addWeapon in MP lol?

errant jasper
#

To be honest wouldn't surprise me. But unless they have some annotation about locality that you could automatically extract from source code it is hard to automate.

little eagle
#

Automation would give us a complete list at least. There still a ton of ui commands missing on the wiki.

tough abyss
#

I agree.

little eagle
#

I wonder who's idea findIf was.

peak plover
#

🤔

tough abyss
#

Guess BI is doing some heavy sqf scripting again to bring some new platform update, so they need to squeeze out all the performance they can get to make it run acceptalbe

winter rose
#

SQF is getting ported towards Enfusion, right? or will it simply be legacy support

little eagle
#

The command saves one if per iteration. That's nothing compared to what fixing some internals could achieve.

tough abyss
#

Noone knows...

errant jasper
#

Time wise, 2mins for 2000 commands is 4000 minutes, around ~30 hours. So it would have been wise to automate it some years back. Now I am not sure - again time wise only.

But anyway, I agree with you guys that having a complete list of commands is a major benefit.

still forum
#

@tough abyss So what's the reason so many commands were missing there locality information when added to the wiki? It's surely not time. Because there is no automated way of getting that information

tough abyss
#

As I said, in my opinion it's not about time saving, but providing complete information. Also, who says we are talking about commands only

little eagle
#

sqf was pretty much dead since 1.78, so it's surprising to see findIf. It's so obscure.

still forum
#

Automation would give us a complete list at least. Which we already have

#

Guess BI is doing some heavy sqf scripting again to bring some new platform update, so they need to squeeze out all the performance they can get to make it run acceptalbe The performance game is already over.

#

SQF is getting ported towards Enfusion, right? or will it simply be legacy support @winter rose DayZ said they will completly remove all SQF.
But right now it looks like legacy support.

winter rose
#

I meant "Arma4" future engine, a mix of Enfusion and IDK what else

still forum
#

@tough abyss Also, who says we are talking about commands only Well.. What else?

lusty canyon
#

damn i was just getting the hang of sqf, now you tell me its dead. so what should i learn now to hit the ground running on arma4?

still forum
#

@winter rose Yes. ANd I said the same.

winter rose
#

oh ok then

still forum
#

@lusty canyon Enscript. Or C#. Or just wait a couple more months atleast

tough abyss
#

@Dedmen A complete config viewer with a proper way to search for example

still forum
#

Already done by the community.

#

What else..?

peak plover
#

I have a system

#

Where I can make as many teams as I want

#

How do I display a custom amount of sides as scores the best?

#

Would it too bad to show all of them? Might clutter screen

little eagle
#

The current config viewer is bunk. A better and especially faster one could be scripted easily.

still forum
#

#Intercept config viewer :3 🤤

tough abyss
#

True that. It looks and feels like it was written in 18th century

#

Well, it was actually..almost

peak plover
#

That look ok, and are informative

queen cargo
#

@still forum that actually Sounds like a good idea

tough abyss
#

@peak plover Guess you would need to write your own GUI for that.

#

#Intercept config viewer What's that?

peak plover
#

Yeah @tough abyss . My question is more about GUI design

#

What part of screen should I use?

queen cargo
#

A theoretical construct @tough abyss

still forum
#

Especially with Intercept's custom UI controls. You could make something really proper.

peak plover
#

I think if I just print the player team and top 2 teams on screen, it would be good enough

queen cargo
#

Custom ui now is a thing?

austere granite
#

Does anyone of you high IQ individuals know how to make a bombing script that actually drops the bombs in the proper moment for it to hit a proper target

#

With different height / appraoches and so on.

queen cargo
#

Though... Outside Config viewer should be better @still forum

peak plover
#

CCIP?

austere granite
#

My dive bombing works "fine" ( https://www.youtube.com/watch?v=IUiryLv3n5o ) because it'll basically jsut fall straight down, but I'm having a hard time figuring out at which distance to drop bomb when i'm flying at other heights. It's an edit of the CAS module

peak plover
#

The calculations should be in there

#

It's the pre jets dlc ccip

#

You can also just make the plane fly over and spawn the bomb in

still forum
#

It's not a thing yet.
Outside config viewer with the ability to directly load your -mod string and all your mods would be cool AF.
But without a online web thingy variant not many people will use it.
Make a web variant with many popular mods available. And include a diff viewer. And also include dev-branch updates and also archive older versions.
Boom.

queen cargo
#

a web variation probably would be dead-ass slow

#

simply due to the nature of how it has to work

tough abyss
#

I'd personally prefer an ingame viewer, but with SQF that's gonna be slow.

young current
#

nice of you guys to volunteer to write a new, better and faster one.

austere granite
#

👍🏻

#

is it a plane, is it a bird, no it's a config viewer

little eagle
#

sqf one could be fast enough.

tough abyss
#

Really? The one we have now slows down drastically with CUP and some other mods

#

But then again I don't know how it's written

little eagle
#

Because it's written poorly.

tough abyss
#

Sounds like job for the CBA team 😉

little eagle
#

It uses the scheduler. That's all one needs to know. Imagine one with proper caching and manual scheduling.

tough abyss
#

They should have rewritten it when they released Eden

queen cargo
#

"propert caching"
ehh ... wut? you want to load the whole config into SQF to defeat ... well ... the purpose of configs?

little eagle
#

True.

#

I said proper, X39

queen cargo
#

that is why i want you to explain what you mean by that

#

because as i see that, there is no "proper" here

little eagle
#

Itching

lusty canyon
#

speaking of cfgs can someone write me a script to extract all the cfgcomposition classnames into an array

still forum
#

configProperties [configFile >> "CfgComposition", "isClass _x", true] apply {configName _x};

tough abyss
#

CfgGroups*

#

Doesn't iterate through the subclasses though

still forum
#

Both of what you just said. Are not what he asked to do.

lone glade
#

someone mentioned me?

still forum
#

Yes

#

pixelGrid UI stuff

#

what that is/does

lusty canyon
#

sweet thanks @still forum

lone glade
#

it's a pixel precise grid compared to screen size percentages

wary vine
#

isnt safeZone still the way to go for uis ?

still forum
#

No ^ :disgusted:

lone glade
#

safezone for anchoring + pixelGrid for pixel precision

still forum
#

Isn't that what you used for Arsenal?
Question was what the new script commands are

lone glade
#

ooooooh

still forum
#

I think pixelGridPrecision?

wary vine
#

xD i use safezone for everything xD

lone glade
#

hahahahahaha

#

NOT DOCUMENTED BITCHES

#

runs

tough abyss
#

it is

still forum
#

so you also don't know?

tough abyss
austere granite
#

That command does not exist

lone glade
#

no

still forum
#

Thought you tested that out once

#

@austere granite liar

lone glade
#

those commands / new config entries don't seem to be documented

austere granite
#

"What is not documented does not exist"

#

as proclaimed by BIS wisdom

#

So it does not exist and that is the Truth

little eagle
#

amen

still forum
#

I thought you tried it out and maybe found out what it is

lone glade
#

I tested it and never found what it did

#

oh, and findif is nowhere to be found in changelogs yet

still forum
#

I guess that was added with #

tough abyss
#

It was in one of the dev changelogs

still forum
#

no it wasn't

lone glade
#

nope

#

only 2 commands were added on dev so far:

and ctrlSetPixelPrecision

tough abyss
#

Really? Nevermind then

lone glade
#

first one is documented the second one isn't

#

well 3 if you count findif

#

but it's not in the changelogs huehuehue

little eagle
#

> findIf

lone glade
#

BIG FAT COMMY LIES RIGHT THERE

tough abyss
#

Does # support boolean value now?

lone glade
#

what does?

wary vine
#

well fuck

lone glade
#

nope

little eagle
#

array1 # parseNumber true/false

wary vine
#

everyContainer seems to be returning grounds for vests/uniforms inside a container

lone glade
#

is an alias for array select index

#

yes @wary vine

#

that's intended

wary vine
#

balls

#

not what I wanted xD

tough abyss
#

but using it with parseNumber defeates the purpose doesn't it?

lone glade
#

don't use # then, there's 0 reasons to use it

winter rose
#

btw where is # page?

little eagle
#

Purpose is elevated command priority.

still forum
#

Doesn't exist

#

Because you cannot create pages with that name

little eagle
#

Kill all parenthesis.

lone glade
#

@little eagle because adding parenthesis is too hard apparently

still forum
#

@winter rose Don't make that page 🗡

winter rose
#

😋

tough abyss
#

@little eagle Alright, thanks for the info. I though it was meant to be a shorter version than select

lone glade
#

had to make a new command that has the same speed as select 🗞

winter rose
#

but I wannaaa

little eagle
#

Don't believe everything you read on the internet, Revo.

lone glade
#

is pretty much an alias of array select index that doesn't work with macros and has higher priority

wary vine
#

was trying to out put something like

crateName 
    Items.
    containerName
        items .
    containerName
        items 
    containerName
         items
#

if you kinda get what i mean

little eagle
#

that doesn't work with macros
implying

lone glade
#

it's not implying

still forum
#

even breaks macros

lone glade
#

it breaks macros 😄

still forum
#

Already known and reported in BIF feedback thread

lone glade
#

@wary vine you can sort them by type of container and use vest / uniform / backpackContainer

#

you don't need to use everyContainer

errant jasper
#

So it is an alias for select, or just to select integer index? Can you do (I'm on stable) this: myArray # {[_x] call IsFluxCapacitor}

lone glade
#

nope

#

just array select index

little eagle
#

is the best

lone glade
#

findif on the other hand is super duper useful and not in the changelogs

#

like, wtf

obsidian chasm
#

So does VCOM just blanket every AI, including them spawned with triggers, or do I need to add something to them to make them spawn using vcom AI?

still forum
#

@obsidian chasm every AI automatically.

obsidian chasm
#

huh I am so unsure whether it worked, theres no option in my menus but i did it how i was told

wary vine
#
private _containers = _object getVariable ["containers",[]];
{
  private _item = _x;
  private _itemType = ([_x] call BIS_fnc_itemType) select 1;
  private _itemDisplayName = ([_item] call Life_fnc_fetchcfgdetails) select 1;
  if ((toLower _type) in ["vest","uniform","backpack"]) then {
    //Check the cargo of this item...
  };
}forEach _containers;
``` this is what i mean ..
obsidian chasm
#

i also read this on their steam page "I thought there used to be a settings menu for VCOM, I saw that it was removed from in-game because of other mod support but now where can I adjust settings? "

errant jasper
#

@lone glade "findif on the other hand is super duper useful and not in the changelogs" BIS is testing your vigilance.

tough abyss
#

Probably in th e CBA setting menu

obsidian chasm
#

im not sure i have that either..

#

uh oh lol

little eagle
#

"Addon Options" iirc

lone glade
#

y u no use modul anymor ?

obsidian chasm
#

nvm i do

lone glade
#

gib moduml back

obsidian chasm
#

on main menu at least

tough abyss
#

Eden >> Settings >> Addon Options

little eagle
#

Esc -> OPTIONS -> ADDON OPTIONS

#

or this ^

#

Not my fault it's all caps.

errant jasper
#

WHAT??? Oh... SURE HE CAN

little eagle
still forum
#

Stop trumping other peoples expectations commy

tough abyss
#

Of course they haven't found evidence 😉

lone glade
#

"we have self investigated and have found no evidence of wrongdoing"

#

I have self investigated ace arsenal and found no less than 0 bugs in it, best ace module to date guys, everyone says it, I got the bliggliest module

wary vine
#
_object = cursorObject;
private _containers = _object getVariable ["containers",[]];
private _someIndex = 0;
{
  private _container = _x;
  private _cargo = (backpackCargo _container) + (weaponCargo _container) + (itemCargo _container) + (magazineCargo _container);
  {
    private _item = _x;
    private _itemType = ([_item] call BIS_fnc_itemType) select 1;
    private _itemDisplayName = ([_item] call Life_fnc_fetchcfgdetails) select 1;
    if ((toLower _itemType) in ["vest","uniform","backpack"]) then {
      private _InsideContainers = everyContainer _container;
      systemChat format ["%1 -- %2",_itemDisplayName,_InsideContainers];
      private _currentIndexedContainer = _InsideContainers select _someIndex;
      _someIndex = _someIndex + 1;
    };
  }forEach _cargo;
}forEach _containers;```
#

as long as everycontainer returned in the same order as the array

little eagle
#

_type is undefined.

lone glade
#

that and everyContainer doesn't

errant jasper
#

Wouldn't "found no less than 0 bugs in it" imply that you found at least 0, but potentially infinite?

lone glade
#

NO BUGS, THE BEST PEOPLE SAY IT

errant jasper
#

I approve of your goal to "MAKE ARSENAL GREAT AGAIN"

lusty canyon
#

NO CHAOS, ONLY GREAT ENERGY!

little eagle
#

Pretty sure the meaning of "no less than" (atleast) is different from "not less than" (more or equal).

lone glade
#

^ this traitor works for jhina and is trying to sabotage our GREAT PROJECT

#

large hand movements

obsidian chasm
#

@tough abyss yup, no addons at all in there..

#

i know 100% i have cba, vcom etc

tough abyss
#

and when you start the mission? Have you got some options then? I believe when a mod is not using CBA ehs it's not properly initialising the settings in Eden

obsidian chasm
#

none at all

still forum
#

addons in there only show up if they use CBA settings. I think CBA itself doesn't. So it doesn't show up. And apparently vcom also doesn't use it

obsidian chasm
#

configure addons is greyed out, however I did have TFAR which showed perfectly in addons

#

so i dunno, not a big deal if VCOM is blanketing my AI

#

im just too dumb to notice a difference with ai lol

tough abyss
#

Gimme a sec, just downloaded the mod

#

@still forum CBA joint rails does use the menu

still forum
#

CBA JR is configurable? 😮

little eagle
#

keybinding, but not the settings.

tough abyss
#

Nevermind, I was looking at the controls....

#

Vcom doesn't seem to use an ingame menu for its settings.

little eagle
#

Who said it does?

lone glade
#

implying
hheheheheheheheheh

#

oh wait, i'm french so it has to be the stereotypical
honhonhonhonhonhon

little eagle
#

:white_flag:

tough abyss
#

🥖

lone glade
#

i've heard that enough times that I can safely not get triggered by it

little eagle
#

🏳

wary vine
#
_object = cursorObject;
private _containers = _object getVariable ["containers",[]];
private _someIndex = 0;
{
  private _container = _x;
  private _cargo = (backpackCargo _container) + (weaponCargo _container) + (itemCargo _container) + (magazineCargo _container);
  {
    private _item = _x;
    private _itemType = ([_item] call BIS_fnc_itemType) select 1;
    private _itemDisplayName = ([_item] call Life_fnc_fetchcfgdetails) select 1;
    if ((toLower _itemType) in ["vest","uniform","backpack"]) then {
      private _InsideContainers = everyContainer _container;
      {
        if ((_x select 0) == _item) then {
          systemChat format ["%1 -- %2",_item,(_x select 0)];
        };
      }forEach _InsideContainers;
    };
  }forEach _cargo;
}forEach _containers;
``` so I kinda have this working, but if there are 2 of the same item, its duplicates it
still forum
#

🤦

#

What

#

Did someone hack my account? I didn't post that

#

;U

lone glade
#

post what?

still forum
#

the facepalm emoji that was posted right above my "what" message

lone glade
#

huehuehue

still forum
#

Z͌̈́a͊̈́l͊̿g̏̉͆o̾̚̚S̝̬ͅc̬r̯̼͇i̼͖̜p̲̘̘t̠͖̟ :U

wary vine
#
15:28:40 "B_Carryall_oli -- B_Carryall_oli"
15:28:40 "U_OrestesBody -- U_OrestesBody"
15:28:40 "V_BandollierB_cbr -- V_BandollierB_cbr"
15:28:40 "V_BandollierB_cbr -- V_BandollierB_cbr"
15:28:40 "V_BandollierB_cbr -- V_BandollierB_cbr"
15:28:40 "V_BandollierB_cbr -- V_BandollierB_cbr"
``` the output when I diag_log
little eagle
#

Only one explanation: brain bugs.

wary vine
#

dw im a dumbass

#

xD

#
        if ((_x select 0) == _item) exitWith { 
          diag_log format ["%1 -- %2",_item,(_x select 0)]; 
        }; 

``` switched out that part
#
15:37:10 "Carryall Backpack (Olive)"
15:37:10 "[]"
15:37:10 "Carryall Backpack (Olive)"
15:37:10 "[""FirstAidKit"",""FirstAidKit"",""150Rnd_762x54_Box_Tracer"",""30Rnd_9x21_Mag"",""30Rnd_9x21_Mag"",""30Rnd_9x21_Mag"",""30Rnd_9x21_Mag"",""30Rnd_9x21_Mag"",""30Rnd_9x21_Mag"",""30Rnd_9x21_Mag"",""30Rnd_9x21_Mag"",""30Rnd_9x21_Mag"",""150Rnd_762x54_Box_Tracer"",""HandGrenade"",""HandGrenade"",""30Rnd_9x21_Mag""]"
15:37:10 "PDW2000 9 mm"
15:37:10 "Jacket and Shorts"
15:37:10 "[]"
15:37:10 "Slash Bandolier (Coyote)"
15:37:10 "[]"
15:37:10 "Slash Bandolier (Coyote)"
15:37:10 "[""HandGrenade"",""HandGrenade"",""HandGrenade"",""HandGrenade"",""HandGrenade"",""HandGrenade"",""HandGrenade"",""HandGrenade""]"
15:37:10 "Guerilla Uniform"
15:37:10 "[""HandGrenade"",""HandGrenade"",""HandGrenade"",""HandGrenade""]"
``` bit hacky, but seems to work
vapid drift
#

So I have a module that fires a function :

#
while { true } do {
    systemChat "fired";
    { [_x, true] call TFR_fnc_divingGoggles; } forEach playableUnits;
    sleep 5;
};```
#

It doesn't loop on the server though... am I missing something basic?

#

It only fires once

tough abyss
#

There a script that let's me set an altitude that automatically deploys parachutes and removes most of the steering?

winter rose
#

@vapid drift what is TFR_fnc_divingGoggles? pastebin plz

vapid drift
#

It's just a simple script that swaps out the goggles but it functions as intended

#

Look at this by itself:

#
while { true } do {
    systemChat "fired";
    sleep 5;
};```
winter rose
#

so the loop has effect, but only once?

vapid drift
#

Correct

#

I assume I'm missing something simple

little eagle
#

Check the rpt file.

vapid drift
#

@little eagle Sorry, where?

little eagle
#

%LOCALAPPDATA%\Arma 3

winter rose
vapid drift
#

Ah ok

winter rose
#

try that to be sure:

[format ["Hello there - General Kenobi: %1", time]] remoteExecCall ["hint"];
vapid drift
#

roger

lusty canyon
#

is the player obj scope accessible from addaction / EHs, or do i have to pass args?

little eagle
#

"player obj scope" 🤔

lusty canyon
#

just player inside an addaction

vapid drift
#

@winter rose So I modified the code and ran it as you suggested:

while { true } do {
    [format ["Hello there - General Kenobi: %1", time]] remoteExecCall ["hint"];
    { [_x, false] call TFR_fnc_divingGoggles; } forEach playableUnits;
    sleep 5;
};```
#

I only get one hint "Hello There - General Kenobi: 0"

still forum
#

@vapid drift A loop might quit if you have a script error inside it.
Also it's called TFAR if you mean the mod

#

If you remove the call to that TFR function. Does it work then?

winter rose
#

^ this

vapid drift
#

Ok... lol touche

#

It runs fine when I remove the call to my function

little eagle
#

Paste TFR_fnc_divingGoggles

winter rose
#

so TFR_fnc_divingGoggles doesn't exist or brings up an error

maybe put a waitUntil { not isNil "TFR_fnc_divingGoggles"; }; somewhere before the loop

vapid drift
#

The function calls, doesn't generate errors, and runs the way I would expect it to

#

wait

#

🤦

little eagle
#

:>

still forum
#

Duh...

little eagle
#

I think he figured it out.

still forum
#

"It's not the error. It works fine"

vapid drift
#

Ugh confirmed, I wasn't thinking about the fact that I was calling a loop lol

#

when I spawned it, it all works fine

#

Thanks for helping me out though guys, really appreciate it

little eagle
#

I don't think this script works with respawned units.

#

Like when respawnTime is 0 for example, it runs into a race condition and locks out the respawned unit forever. Same with the scheduler letting the script rest too long.

#

The whole thing should only be one loop without the unnecessary object namespace stuff.

random estuary
#

@dim terrace Which official Arma 3 map has ponds?!

surfaceIsWater is working with ponds as far as I remember```
still forum
#

None

random estuary
#

Was just pointing the lack of fresh water ponds out.
I use

_overWater = ((getPosASLVisual player) select 2 <0);```
To check if player is in water
fleet wind
#

How can i get a Boolean from a config file? there is getText,getnummber,getarray but is there any way to get a Boolean??

little eagle
#

There are no booleans in config.

drowsy axle
#

@fleet wind Just use 0,1 for true/false with the getNumber

fleet wind
#

Ive got this in a config illegal = true; wo sill getNumber 1 work ? @drowsy axle

drowsy axle
#

I wouldn't use True/False with getText because it makes reading it easier.

fleet wind
#

Or do i have to change it all in the config?

little eagle
#

Depends on the header file and whether or not you used mikero's tools to binarize it.

fleet wind
#

Needs to be a string to use gettext anyway....

still forum
#

@fleet wind true is a string

little eagle
#

By default i gets converted to a string "true", but it could turn to 1.

fleet wind
#

ahhh Thanks!

obsidian chasm
#

Is there anyway to make the AI helicopter count the gunners as 'transport' since when people are on the guns the AI seems to ignore the transport unload timer and just land and takes off straight away

meager heart
#

you can try count players in heli, instead of "gunners as 'transport'"...

obsidian chasm
#

i think its just the dumb helicopter ai being dumb again

#

it wont obey my transport unload

#

ffs

#

arma really feels like it wants to fight you all the way

little eagle
#

"transport unload timer" 🤔

obsidian chasm
#

already done it

#

and has been working for ages

#

but now suddenly died

meager heart
#

unload timer - probably waypoint delay...

obsidian chasm
#

i mean the current timer is 300 - 300 - 300 and even then it just lands, takes off immediatly

#

whereas before it'd stay on the ground for the duration

wary vine
obsidian chasm
#

well apparently changing the waypoint to careless, despite it never being on careless before and working..fixed it. Thanks arma lol

tough abyss
#

question, wll this script open arsenal when they spawn or give them their last loaded loadout

#

{
player addMPEventHandler ["MPRespawn", {
["Preload"] call BIS_fnc_arsenal;
["Open",true] spawn BIS_fnc_arsenal;
titleText ["<t color='#CC0000'>Arsenal Script by J. </t><br/><t color='#CC0000'>33rd Peacekeeper Company</t><br/><t color='#58D68D'>-Press ESC to exit Arsenal-</t>", "PLAIN DOWN", -1, true, true];
playSound "Hint";
}];
} remoteExec ["bis_fnc_call",0,true];

still forum
#

looks like it will open the arsenal

tough abyss
#

ah

#

ok

still forum
#

The "Preload" is useless btw

tough abyss
#

alright

little eagle
#

This will open the arsenal for every player every time any player respawns.

tough abyss
#

shit

#

ok

#

good thing i havent used it

little eagle
#

Where is this script?

tough abyss
#

i was planning on using it on my arma 3 zeus server

#

i wanted to make sure it worked or not before han

little eagle
#

Put this into initPlayerLocal.sqf:

params ["_unit"];

_unit addEventHandler ["Respawn", {
    ["Open",true] spawn BIS_fnc_arsenal;
    titleText ["<t color='#CC0000'>Arsenal Script by J. </t><br/><t color='#CC0000'>33rd Peacekeeper Company</t><br/><t color='#58D68D'>-Press ESC to exit Arsenal-</t>", "PLAIN DOWN", -1, true, true];
    playSound "Hint";
}];
tough abyss
#

that open it up just for the dead/respawned player

#

?

little eagle
#

What else would you want?

tough abyss
#

nah was just making sure lol

little eagle
#

The answer is "yes".

tough abyss
#

alright

wary vine
#

hmm i seem to be having an issue with rscTextMulti

#

structured text is working with hintSilent

#
  _info ctrlSetStructuredText parseText format["<t size='1px'>%1</t>",_structuredText];
  hintSilent parseText _structuredText;
#

and the control is found

#
class Life_RscText {
    x = 0;
    y = 0;
    h = 0.037;
    w = 0.3;
    type = 0;
    style = 0;
    shadow = 1;
    colorShadow[] = {0, 0, 0, 0.5};
    font = "RobotoCondensed";
    SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
    text = "";
    colorText[] = {1, 1, 1, 1.0};
    colorBackground[] = {0, 0, 0, 0};
    linespacing = 1;
    tooltipColorText[] = {1,1,1,1};
    tooltipColorBox[] = {1,1,1,1};
    tooltipColorShade[] = {0,0,0,0.65};
};

class Life_RscTextMulti: Life_RscText
{
    linespacing = 1;
    style = 0 + 16 + 0x200;
};
class Lega_Market_ListingInfo_Description: Life_RscTextMulti
{
  idc = 9512;
  x = 0.699032 * safezoneW + safezoneX;
  y = 0.2734 * safezoneH + safezoneY;
  w = 0.124775 * safezoneW;
  h = 0.4224 * safezoneH;
};

#

the 2 related base and the control.

little eagle
#

Any reason why people always recreate these configs instead of just using the config export function to create a header file so they can use the same base classes available in addon config?

wary vine
#

i dont know, just always used life_rsc classes

wary vine
#

Sorted .

#

was using the wrong control in the end.

lone glade
#

jesus christ....

#

how to trigger me in one gif

wary vine
#

why ?

lone glade
#

there's too many reasons to name

wary vine
#

-.-

#

its not finished yet btw xD

little eagle
#

Weird prices.

wary vine
#

xD

#

i got a few people to spam things on the market the other day xD

#

to try and find bugs, and fill the market with real listings.

#

instead of my just duplicationg rows xD

#

the general functionality is there atm , just working on a few more things, including the ui

lone glade
#

I can already spot a bug 😄

tough abyss
#

@wary vine Looks sweet 😉

lone glade
#

but does it look good in 1360x768 from 8 feet away? HUEHUEHUEHUE

little eagle
#

Still mad?

tough abyss
#

What happened oO

lone glade
#

ACE Arsenal meme

little eagle
#

barely

lone glade
#

all will be fine once stats are released

wary vine
#

@lone glade what bug ?

lone glade
#

the combo box you click is empty at first

#

instead of being "all" (I suppose)

wary vine
#

yeah its not finished yet 😉

#

im doing things 1 by 1 xD

#

then finalizing the dialog, then finishing touches like that

lone glade
#

making UI elements is easy, making them work together is hell

wary vine
#

yup

little eagle
#

The only fun part.

lone glade
#

I still hate dedmen for making me rewrite the stats API

#

but then again it's much better now and it only took me a day

#

AM STILL ANGRY

little eagle
#

ACE arsenaal is shit. Doesn't even have dynamic search.

lone glade
#

make a PR ™

little eagle
#

Why do I have to save everything?

lone glade
#

you broke ace and cba by removing modules

little eagle
#

How To Ruin Everything

wary vine
#

😛

hearty plover
#

Anyone here working with MCC and ASR AI OR ALiVE and ASR AI.

still forum
#

all 3. Why?

hearty plover
#

Well.

#

I am trying to pick a combination for AI Macro and AI Micro.

#

I don't really want the bloat of MCC

#

And Like the idea of ALiVE but I also don't need massive persistant missions with dynamic spawns.

#

I just want the AI I place on the map, to work with each other.

#

Better than normal, if that makes sense.

still forum
#

I don't use MCC for AI.
Did you look at vcom AI yet? Heard that does good stuff.
Also that's #arma3_scenario 😉

hearty plover
#

It's not bad

#

But it makes the AI do some weird Macro things

#

AI does very well in open areas, and does some awkward stuff in closed areas.

#

I though about trying VCOM with ASR-AI if it fixes that.

#

As VCOM is mostly a squad level AI suite.

#

But what's important is I setup a ton of my AI via scripts, and want to make sure my AI choice plays nice with that.

#

For example, scripted waypoints, etc.

#

One such example is a QRF being spawned and sent toward a position.

outer fjord
#

Every time I use VCOM I pretty much only use 1-3 features. It tends to focus to much on 100% control of the AI instead of just nudging them in the right direction. Don't really use ASR-AI anymore because a lot of features such as suppression, concealment, ect is used by vanilla.

neon snow
#

How can I check what type of weapon is selected now(atmissile, aamissile etc)?

next lily
#

currentWeapon (vehicle player)?

neon snow
#

@next lily but it will return the name of the weapon, could I have a weapon type?

next lily
#

It'll return the name of the weapon. Are you looking for the sort of 'config' path or parent classes?

neon snow
#

Well, in the config for jets, there is a class MFD in which there is a condition, for example will draw reticle if aamissile is selected, or bomb or gun etc. I would need that in sqf , to disable pip screen when the at missile isnt selected

next lily
#

You can try toying around with either currentWeapon or you could even substitute that for currentMagazine. Those both return a string, which is the name of the relevant data.

#

Be that the weapon you have selected or the magazine.

neon snow
#

Ok will do, thank you

rose hatch
#

Quick question... So the Arduino IDE has this first line preview feature when selecting curly braces and multi-line nested code:
https://i.imgur.com/hPtJVbR.png

#

Does notepad++ have a similar feature? No idea what it would be called, so can't really use google here

queen cargo
#

one could implement that into arma studio
though ... what purpose? nobody using it anyways

rose hatch
#

I use notepad++ for general coding stuff outside of arma and I really like that feature in the arduino IDE

#

But it's sort-of arma related, because I still use notepad++ for some arma scripting

unborn ether
#

I prefer using sublime.

ionic orchid
#

I use visual studio code

safe forum
#

How I can approve my dll in Battleye?

meager heart
#

The "Preload" is useless btw
without preloading, configs will be parsed when you open arsenal first time... (vanilla arsenal)

queen cargo
#

And that is why I more or less stopped developing arma.studio 🤷‍♂️

meager heart
#

Maybe some PR agency will helps 😀

peak plover
#

Can I add string?

cloud thunder
#

Add string to string? yes.

peak plover
#

oK thanks

#

Also

#

Does it make sense to make ui elements in 3rd person or not?

#

Should it say 'your score' or 'my score'

small iron
#

UI elements in third person?

peak plover
#

like the text

#

Should it be in person

cloud thunder
#

ui would be local so how about just score?

peak plover
#

Should it say 'your score' or 'my score'

#

As an example

#

There would be like

#

More than 1 scores

small iron
#

Or you know

#

Just

#

Score:

#

Current Score:

meager heart
#

maybe better name score

#

not my or your

cloud thunder
#

^

peak plover
#

What if you forget what side you were on

meager heart
#

it's possible, but forget your name is harder

peak plover
#

is there a way to align them easily without creating 3 separate elements?

meager heart
#

structured text ?

peak plover
#

I am using that

#

Space bars are not equal elenght

#

1st / 2nd are not equal length*

#

I guess I gotta make 3 elements

meager heart
next lily
#

I believe structured text can be aligned left or aligned right.

#

But I know that if you don't, it's all centered for each new line.

#

At least, for single line bits.

meager heart
#

ignore background size, that thing is animated and wip...

next lily
#

So centering shouldn't be an issue.

#

(at least, in a hint)

meager heart
#

also just valign maybe, nigel

peak plover
#

I kinda wanted it to start from left

#

and align the : and -

#

I guess

#

I'll just make 2 structured text controls

#

or 3

meager heart
peak plover
#

Hmm

#

I guess that makes sense

#

Just color coding it and dat it

#

Thanks

#

Your hud looks really cool btw

meager heart
#

thanks

peak plover
meager heart
#

underline for "scores" maybe, also side colors ?

#

maybe not... 🤔

peak plover
#

Good point thanks

#

It's a dynamic system where sides are not based on side

#

So there are unlimited sides, but I'll make player side blue and all else red

meager heart
#

"sides are not based on side" ?

peak plover
#

I just call them sides

#

But they are a custom made up construct

meager heart
#

roger

peak plover
#

I wanted to make 1 mission with this, so I am creating a template in case I ever wanna do something round based again

#

I gotta think of a way of keeping kills as score too

#

prob array of friendly units as setVar public

#

And checked on killed 🤔

meager heart
#

y u no monokai 😮

peak plover
#

default poseidon

#

It's nice to press f1 and it opening the wiki 😄

meager heart
#

vscode ^

peak plover
#

Ohh

#

didn't know it had that for sqf

lone glade
#

also for the fucking love of everything that is holy, USE COMMENT BLOCKS

still forum
#

throws a block with a nasty comment at @lone glade

lone glade
#

waaaaaaaaaaah no bulli

austere granite
#

@peak plover just use Atom

#

and dis

lone glade
#

not material? GIT OUT

meager heart
#

discord with monokai will be... nice

austere granite
#

you're nice

meager heart
#

thanks ?

neon snow
#

Is there a way to create custom EventHandler? Becouse now in my script I use while loop with waitUntil

winter rose
#

publicVariableEventHandler?
but hey maybe your script doesn't need that, it sounds like you may be headed towards a wrong direction

neon snow
#

I need to activate script whenever weapon is changed(with F key) in jet

tough abyss
#

UI Eventhandler maybe?

austere granite
#

checking weapon in a PFH would be more reliable

still forum
#

No there is no way to create custom engine eventhandlers

#

But you can just make a PFH that checks periodically and then call your function. Or use the CBA Event framework

#

PVEH as @winter rose said is completly unrelated to this. Atleast I don't see any connection

#

@neon snow There is a weapon changed eventhandler afaik

#

Ah no.. That was CBA ^^

winter rose
#

UI event handler checking the pressed key might do the trick

#

that or currentWeapon

neon snow
#

@winter rose How could you use the currentWeapon for that?

austere granite
#

check it in a loop

#

but intead of waitUntil do a perFrame thing on it

neon snow
#

@austere granite is it more performence friendly?

meager heart
#

currentWeaponTurret 🤔

tough abyss
#

What about inputAction?

still forum
#

@neon snow No it's not more performance friendly

#

It could be a little better if you use it properly. But only if you run 10x or more of these waitUntil loops simultaneously

neon snow
#

@tough abyss could I combine UI eventHandler with inputAction somehow? Or do I have to check it in a loop aswell?

still forum
#

I don't see how inputAction would be in any way related to this....

#

Besides actually changing the weapon yourself. But you said you only want to detect if the weapon changes

austere granite
#

you'd put innputAction "weaponchangethingie" > 0 on keydown probably

still forum
#

Ahhhh

meager heart
#

inputAction switchGunnerWeapon also

austere granite
#

but yeah, i do just suggest checking currentWeapon

#

honestly

still forum
#

Potentially unreliable waitUntil inputAction.
Or known reliable waitUntil currentWeapon

#

Just keep using what you are currently using. If you only run one loop then it's fine.

neon snow
#

Well currenty I use something like this:

while {(alive _FA18)} do
{
    _mag=currentMagazine _FA18;
    ...
    waitUntil {!(currentMagazine _FA18 isEqualTo _mag)};
};```
So I guess it is pretty similiar
#

Thank you all

neon snow
#

Well I got around it, by using actionKeys "nextWeapon"; which will return the code for the key for changing weapon and then use it in displayAddEventHandler

still forum
#

Which might randomly break for joystick/gamepad keys or mouse buttons or keys with modifiers.

neon snow
#

Yeah, and it will not work if the weapon is selected with keys like 1,2,3,4... -selecting particular weapon. So yeah, I will leave it as it is.

meager heart
#

just checked inputActions for switch weapon and there are none reliable/usable,
also some of them works only with default keys lol

#

tried nextWeapon,switchWeapon,switchGunnerWeapon

astral tendon
#
{_x moveInAny Cut_car_1} forEach (allUnits) select {side group _x isEqualTo resistance} select [4,3];
#

the (allUnits) select {side group _x isEqualTo resistance} select [4,3] return the correct aray of units [Un_Soldier_12,Un_Soldier_3,Un_Soldier_1]

#

but for some reason the frist one comes with a generic error and put opfour units inside that vehicle

#

it works if i just paste the aray that it returns, why is that?

little eagle
#

Parenthesis are wrong.

#

forEach is executed before select, which will not make sense.

lusty canyon
#

anyone know how to make those nice BIS addactions where you have to HOLD space for a few secs and you have progress circle UI ?

astral tendon
#

removing the parenthesis makes no diference

still forum
#

You have to add the right parenthesis. Not just remove the wrong ones

little eagle
#

True, but I never said you have to remove them. You have to use them to execute the code on the right side of forEach before the forEach itself.

astral tendon
#

uh, any exemple?

little eagle
#

( )

astral tendon
#

Thanks.

little eagle
#

It's more rewarding this way and it is literally that easy.

astral tendon
#

I dont know, i dont really fell that the reward is that good.

little eagle
#

10 - 5 - 4
This is 1, right?
But you want it to be 9. Now add parenthesis to fix it.

meager heart
#

...loading

astral tendon
#

Nevermind, i will just do it in some other lazy way.

little eagle
#

¯_(ツ)_/¯

lusty canyon
#

will setvehicleammo 1 fully reload a pylonized plane that has custom weap/mags (through addweapturret/addmagturret)

#
  • pylons changed with grumpy loadout pylon script (GOM)
strange urchin
#

The script I believe is not relevant

#

setVehicleAmmo should refill magazines for dynamic loadout vehicles

#

setVehicleAmmoDef would give you problems with jets

little eagle
#

Only one way to find out.

lusty canyon
#

can i do setvehicleammo 0.1 per tick (holdaddaction) to gradually refill the ammo?

little eagle
#

That would probably remove ammo the first time.

lusty canyon
#

right, guess ill just do set 1 on hold completion

meager heart
#

afaik in hold action you will have always 24 steps
so you can try something like _step = 0,042; and _vehicle setVehicleAmmo (_baseValue + _step) < for every progression step... 🤔

lusty canyon
#

how do you get _basevalue?

#

is that current ammo of vehicle?

meager heart
#

if that is for repair/rearm thingy, you can set it to 0...

little eagle
#

Still would be weird. Consider a plane with machine cannon and missiles. Fires all rounds, but no missiles. Then uses setVehicleAmmo 0.5 and half the missiles are gone.

meager heart
#

true

lusty canyon
#

setVehicleAmmo + setFuel + setVehicleArmor enough to return veh to pristine condition?

burnt cobalt
#

hi there, is there a scriptcommand to add/remove the new camo-nets etc to a tank model?

little eagle
#

Is this something from the dev branch?

tough abyss
#

It's all done via the Vehicle customisation system

still forum
#

Yes there is. And yes dev-branch

little eagle
#

The answer is probably animate then. That is at least how my tanks show or hide their camo nettings.

tough abyss
burnt cobalt
#

ahhh awesome!!

little eagle
#

That's for simple objects. Unlikely. Bet it's animate.

burnt cobalt
#

thank you I will dig in

tough abyss
#

Alright, just one way to find out

little eagle
#

The animation names should be in the config viewer.

#

CfgVehicles / <tank_name> / Animations / hide_<something>

still forum
#

I would've guessed animate too

burnt cobalt
#

animate works thanks everybody, the customization page is really helpful too

#
{
    if (typename _x == "STRING") then {
        _tank animate [_x, 1];
    };
} foreach _animList;```
still forum
tough abyss
#

NEVER end a script with a variable assignment. That will trigger the only real SQF language bug in existence.

#

What's that about? Never heard of it

#

That from your link btw

still forum
#

Try yourself.

#

A assignment returns nothing

#

That's the bug.

#

Literally everything in SQF returns something.

#

That's the only thing that doesn't

#

and when you try to assign the functions result to a variable.. You die.

tough abyss
#

Ha, that would explain an issue I had a few weeks ago

still forum
#

Imagine if BI did write the 1 or 2 lines of code to fix that

#

you could then do stuff like _var1 = _var2 = _var3 = 5;

tough abyss
#

Fixing that would be too easy wouldn't it

still forum
#

yup

tough abyss
#

Alright, thanks for the explaination

little eagle
#

Assignment operator is bugged. If you end a function with an assignment, and call that function, and assign the return value of the function to a variable, the game says "generic error" for no reason.

still forum
#

Well.. The reason is there 😄

#

It's just dumb

little eagle
#

Goal of "good practice" is to avoid scenarios of confusion and "unexplainable" weirdness. That's why you should never end a function with a variable assignment.

#

Or not use private...

strange urchin
#

Seems like intended behavior if you ask me. If people want to make a function return something, they’re supposed to end it with the variable.

#

Or the value

little eagle
#

No, it's a bug. The assignment is intended to report GameValueNil.

strange urchin
#

Is it supposed to work?

lone glade
#

at that point it became a feature commy

little eagle
#
[{
    systemChat "boop";
}, [], 1] call CBA_fnc_waitAndExecute;

^ this prints something after one second.

_null = [{
    systemChat "boop";
}, [], 1] call CBA_fnc_waitAndExecute;

^ this does too, but also says "generic error".
Explain to me how that makes sense.

still forum
#

You mean a thing that applies to 99.9% of everything in SQF. But doesn't apply to one thing and that one thing isn't officially documented anywhere... Is intended?

#

And a thing that works in most other programming languages.

#

And then even if it's intended it just prints a useless "generic error" that doesn't tell you at all what's wrong

strange urchin
#

Why would anyone do that, though?

still forum
#

What?

little eagle
#

Why would anyone what?

strange urchin
#

Who in their right mind would have a function return the result of systemChat

still forum
#

What?

#

Dude...

lone glade
#

....

#

wooooosh

little eagle
#

That's not what happens.

strange urchin
#

Or a variable assignment?

still forum
#

What if you want to return nothing in case of an error?

strange urchin
#

Does returning nil work?

still forum
#

yes

#

everything works

#

besides using a assignment

little eagle
#

Also, as I said, a command like systemChat reports GameValueNil and can be assigned without error. The assignment itself reports nothing (not nil or sqf nothing, literal nothing in C++) and therefore breaks.

still forum
#

A empty stack is a SQF engine level error.

#

So don't tell me that is intended

strange urchin
#

I don’t see how someone doing something like getting the result of a variable assignment would be useful.

still forum
#

You just don't get it 😄

#

It's not.

lone glade
#

doesn't stop people from doing it.....

strange urchin
#

At that point, the function is being used in a way that was not intended

still forum
#

And no one would want that.

#

But people do that by accident

#

and fuck up other peoples scripts who use your function

#

which is exactly why you should never end with an assignment

strange urchin
#

Maybe you don’t try to assign a variable to the result of a function that doesn’t return anything?

still forum
#

Dude

#

Let's say you have a function that returns a number in 99.9% of cases. So ofcause everyone stores the return value.

#

Let's say there is a 0,01% chance that something goes wrong. Author displays a error message and ends in an assignment

little eagle
#

: Maybe you don’t try to assign a variable to the result of a function that doesn’t return anything?
But that is legal for 2000 commands, except the assignment operator. Because of a engine level bug...

still forum
#

as he doesn't want to return anything he doesn't care.

#

But that breaks everyones script who calls you function

#

Even if returning nil would be totally fine

#

No one would do that while wanting to do it.

#

It's broken anyway. So why would anyone do it?

little eagle
#
private _broken = {
    private _something = 1;
};

private _working = {
    private _something = 1;
    nil
};

_null = call _broken; // error
_null = call _working; // no error

Makes no sense.

still forum
#

Everything else returns nil in case of error.

#

That thing doesn't return nil on error. And even doesn't return nil when it operates normally

strange urchin
#

Hm. I think I would rather those throw errors instead of returning nil.

still forum
#

You would prefer to show people "generic error"

#

instead of showing an actual error message?

#

How good that I don't use any of your code.

strange urchin
#

Hm,yeah, I guess they would throw an error eventually

still forum
#

It kills the script with a generic error.

#

That's it

#

if you return nil then people know that function failed and can catch the error

#

But you cannot catch this error at all

#

Well besides param I think

little eagle
#

You mean when you want to call functions and don't know what others return?

still forum
#

Like if you have a eventhandler framework. And tell people to either return number or nil.

#

And they return nothing. And your framework crashes. And all other eventhandlers aren't called anymore

#

Yeah. Brilliant. Thanks.
You now have generic error in: {call _x} forEach _funcs

#

Very nice. You immediately know what's wrong and where right?

strange urchin
#

Would that bug caused by an If statement or something?

little eagle
#

Well, I gave you the solution in that one intercept PR. param does not work sadly, because sqf complains about nothing also when trying to create an array, not only when assigning.

still forum
#

if statement?

#

What?

#

In that one intercept PR? 😄 Which?
But I know you have the solution in CBA. And I know where to search for it

little eagle
#

The bug is caused by an assignment.

#

But I know you have the solution in CBA.
Do we?

strange urchin
#

If you’re assigning a variable to the result of a function, That function should be built with that in mind

still forum
#

Exactly.

#

Tell that to noobs like you who say "I would rather return nothing than nil"

#

Chaos. Pure chaos.

strange urchin
#

So basically, the issue here is someone fucked up their function, and the bug is that the game doesn’t say exactly what the problem is?

still forum
#

No

little eagle
#

That function should be built with that in mind
Agreed. No function should end with an assignment.

still forum
#

The issue is that the assignment operator is bugged

strange urchin
#

But who would end their function with it if they’re going to assign a variable to the result?

still forum
#

Causing a completly nonsensical and undocumented and idiotic result.

#

Idiots. Noobs.

strange urchin
#

Hm

little eagle
#

But who would end their function with it if they’re going to assign a variable to the result?
Sometimes you call other peoples functions, sometimes they call yours.

#

Good practice is to avoid the empty stack bug by never ending your function with an assignment.

still forum
#

What? No! I never use CBA or ACE. I wrote my own stuff that does the same just more dumb.

#

Because these are dumb frameworks that are soo overhyped

little eagle
#

Jesus.

#

I don't think the apply workaround I posted on the intercept github is used anywhere in CBA. If you use the keybinding framework or use directCall, and your function ends with an assignment, it errors out.

#

I think the same is true if you use a postInit function in the base game and end it with an assignment.

still forum
#

There are idiots who think you need to end everything in an assignment. Aka put 0 = stuff or _dummy = ... everywhere

lone glade
#

🗞

still forum
#

just because you have to do it in Editor init scripts because that's also bugged and BI is refusing to fix that

little eagle
#

That's what the editor teaches you.

lone glade
little eagle
#

Because reasons.

lone glade
#

; for returns or not hueheuhuehueue

still forum
#

not.

#

So yeah.. Why would you save a return value of a function? Because The Eden editor forces you to do it.

little eagle
#

Leaving out the final ; to indicate a return value.,. Does this have any basis in other languages?

still forum
#

No

#

in other languages you return by... returning

#

#define return 0= huehue

little eagle
#

Does have it's charm the way it is in SQF.

lone glade
#

you get attached to it

#

I WANT GETDAMMAGE IN ENSCRIPT

#

sqf support pls, just to have that command survive

little eagle
#

inb4 they kill sqf, but the eventhandler will still be named Dammaged

lone glade
#

I legit would laugh my ass off

still forum
#

If we'll even have eventhandlers like we have in A3

#

If the damage code is in Enscript and you can hook/edit it. we make our own eventhandlers

lone glade
#

if we don't have another language on top of enscript

#

I know you can't wait to mod in js

little eagle
#

What for? Enscript is supposed to be the scripting language, no? Why build something else on top.

still forum
#

Because enscript is shit. Currently 😄

#

And we need to hide all the crap by building an additional layer on top

lone glade
#

looks at sqf

still forum
#

looks at intercept

#

little eagle
#

🤦🏻

meager heart
#

are you guys watching the stream ? 😀

still forum
#

ye

#

DayZ will be moddable because they release the server files...
We can already mod it and use Enscript. But we don't because they don't provide any documentation on how to do so

#

If they release server files again without documentation that won't help much

little eagle
#

Doc is for wussies.

still forum
#

I wonder how the general public will react when they actually see how enscript works and how crap it is 😄

little eagle
#

Probably disappointed. I never had any expectations. Hope someone remembers that I was right all along. Again.

#

(I haven't looked at it once)

still forum
#

The syntax looks awesome. And if it would actually work how it looks... it would be awesome.

#

But it doesn't.

#

If you know any other OOP programing language. You will keep swearing and throwing things at enfusion

lone glade
#

soooooo

#

ITS SQF 2.0?

still forum
#

If you don't know any other languages and grow up with Enfusions quirks. You'll love it.. I guess.. maybe

lone glade
#

oh gee, I can't wait 😄

still forum
#

If you remove the quirks it's actually the same as SQF with OOP on engine types. Like object.setDamage

little eagle
#

You'll love it.. I guess.. maybe
It looks verbose compared to SQF.

still forum
#

If you remove all the broken stuff. Like.. All of OOP except the engine OOP stuff that you can't remove...

little eagle
#

... then?

still forum
#

It's basically just a file with a bunch of functions in it

little eagle
#

What I hate the most about sqf is probably the scopes. Is that still the same?

still forum
#
S_fnc_setDamage = {
  params ["_object"];
  _object setDamage 1;
};

Enscript:

void S_fnc_setDamage(Object _object) {
    _object.setDamage(1);
};
#

Well.. Scopes.. Variables don't automatically carry over to functions you call

#

and you can't overwrite variables from functions that call you

#

is that what you mean?

little eagle
#

Variables don't automatically carry over to functions you call
Sounds promising.

still forum
#

But in the backend every local variable is global and unique

#

huehue.

lone glade
#

oh boi

#

I can't wait

still forum
#

You probably won't notice that though

little eagle
#

Jesus.

still forum
#

There is a stack. But it is not used for passing or storing variables.

lone glade
#

imagine what "lifers" will be able to shit out

still forum
#

It is used for storing variables in recursive calls.
Because all variables are global and unique you cannot do recursive calls because they would overwrite themselves.

little eagle
#

That sounds like a problem.

still forum
#

And even if that sounds acceptible.. Look at the backend.

func(var1,var2);
func(var1,var2);

turns into

push var1
push var2
call func(var1,var2)
pop var2
pop var1
push var1
push var2
call func(var1,var2)
pop var2
pop var1
#

the pop/push in the middle are total bullshit. But there is no optimizer

#

Also. All functions have to return. So by default every function has a return instruction. If you add your own return at the end. You now have two return instructions and the second one will never be hit.

lone glade
#

....

still forum
#

But as I said.. Most people won't notice these things.
But I know they are there. And it bugs me.

little eagle
#

Well, it IS a scripting language.

still forum
#

Btw this info is from Enscript between 2013-2018(dayz 0.62)
I hope they will fix all this. We'll see

tough abyss
#

Lacking recursion is bad, that hasn't been reasonable for decades.

still forum
#

Well they ducttaped recursion into it

tough abyss
#

Having the compiler be woefully optimised is one of the reasons I think integrating another language would have been beneficial.

still forum
#

But every variable being global completly stops any possibility of even getting some multithreading

tough abyss
#

It takes a lot of time to write a compiler/interpreter that runs genuinely well

#

Sounds like just more broken scope issues like with SQF

#

If it doesn't have OO like scope of variables within a "class" you can hardly even call it OO, then it is just namespaces for functions

still forum
#

It does have them

#

But.. You don't want to do OOP with inheritance. You'll just get frustrated.

tame portal
#

you can cast to any child from a parent without issues, it only errors when you try to call functions that are only defined within the child

#

so if you instantiate a parent and try to cast to any child of it, it works just fine 😄

still forum
#

Inheritance doesn't really make sense if you HAVE TO overwrite every function from the parent

#

Or was that only constructor?

tame portal
#

only the constructor

slate olive
#

.

little eagle
#

🤔

still forum
#

@open vigil ^

#

But even the constructor. You cannot change argument types or number.

#

I guess i can imagine a few things where you are fine with that. But in most cases that makes it kinda useless

tame portal
#

so things like

#
public class Point {
    private int x;
    private int y;
    
    public Point(int p_x, p_y) {
        ...
    }
}

public class Point3D : Point {
    private int z;
    
    public Point(int p_x, p_y, p_z) {
        base(p_x, p_y);
        ...
    }
}
#

arent possible

#

Dont know if theres something like base() or super() in Enscript so dont take that for granted

open vigil
#

@slate olive Either participate as a mature user or leave.

slate olive
#

oh wow my bad

open vigil
#

Delete your previous message as well.

#

@slate olive

wary vine
#

umm

#

gg

open vigil
#

@wary vine 22. do not post URL links w/o short description of what it is , anywhere

wary vine
#

o.O

#

do you not know what Gyazo is ?

#

I thought everyone did.

open vigil
#

Do you not know how to read the rules?

wary vine
#

Yeah, its just a screenshot

open vigil
#

of...

wary vine
#

debug console

#

watch list.

little eagle
#

$ is an illegal char for parseNumber, so it defaults to 0.

still forum
#

Why don't you just post what's on there and say what it does

open vigil
#

Thats what you should have included with the link

wary vine
#

i had to make a minifunction xD

still forum
#

instead of violating a rule. And requiring everyone to click that link to know what you actually mean

little eagle
#

tbh, I post links all the time without explicitly saying what they are.

still forum
#

True. Biki links and links to github 😄

wary vine
#

i think pretty much everyone does.

still forum
#

I think these could be excluded

#

You are wrong @wary vine

open vigil
#

^

wary vine
#

gyazo is what i see most people link screenshots. thats litteraly all it does.

still forum
#

Also commy is theoretically still veteran. So it's fine.

little eagle
#

"theoretically still veteran" What?

open vigil
#

He's on probation

still forum
#

@wary vine You are breaking another rule right now btw.

wary vine
#

?

still forum
#

You are arguing about how the moderation is handled here

#

that's against rules

wary vine
#

o.O

#

Im not really arguing tbh, im just stating a point.

still forum
#

That is what arguing is though

#

maybe you should read them. just to be safe ^^

open vigil
#

The only point here is "read and follow the rules and everything will be fine"

#

¯_(ツ)_/¯

still forum
#

Also posting links without description is fine (IMO) if you already know from the conversations context what that link will contain.

#

Wasn't the case with yours though

little eagle
#

What was $100000 supposed to be? A binary number?

wary vine
#
params [
  ["_numberString","",[""]],
  ["_type","",[""]]
];

if (_numberString isEqualto "") exitWith {
  ["A Number as string must be passed through with this function"] call BIS_fnc_error;
};

private _type = toLower(_type);

private _stringArr = _numberString splitString "";
private _newArr = [];

{
  if (([_x] call Lega_fnc_isNumber)) then {
    _newArr pushBack _x;
  };
}forEach _stringArr;

private _newString = _newArr joinString "";

private _output = switch (_type) do {
  case ("numbertext") : {[(parseNumber _newString)] call bis_fnc_numbertext};
  case ("money") : {(([(parseNumber _newString)] call bis_fnc_numbertext) splitString " ") joinString ","};
  case ("int") : {parseNumber _newString};
  default {_newString};
};

_output;
still forum
#

<random link with random characters at the end>
Uh lol. Look at that.

^ That this is supposed to be prevented with that rule. And you accidentally did exactly that

#

@little eagle $ == money

#

I think that fixes itself if you just put the $ at the end though

little eagle
#

That would be incorrect though.

lone glade
#

wait

still forum
#

Welll.. Murica.. Fahrenheit. ¯_(ツ)_/¯

exotic tinsel
#

how do i use apply the contents of a variable in my addaction?

_AI_unit addaction [_addactiondescription,
{                    
    [_AI_unit, _player, 2, _type, ""] remoteExec ["TLS_fnc_hostage_prisoner", 2];
}];

the _AI_unit isn't being passed to the function or _player.

little eagle
#

Decimal dot or decimal comma?

lone glade
#

decimal coma

little eagle
#

_AI_unit, _player and _type are undefined, Snatcher.

lone glade
#

switched his alignment to chaos neutral

still forum
#

@LifeSnatcher#6222 you make it a global variable

#

local variables don't and can't propagate

little eagle
#

Eh, you pass them as arguments.

lone glade
#

or you pass it as arguments

still forum
#

addAction has parameters?

little eagle
#

Yes.

wary vine
#

One thing, does anyone know anything outside of arma that will let me convert classname - displayname ?

exotic tinsel
#

they are defined in the params of the function that is applying the addaction

little eagle
#

No, they're undefined.

lone glade
#

they're clearly undefined there

still forum
#

As I just said.. local variables don't and can't propagate

#

@wary vine Unpack the configs and stringtables from the pbo's and use notepad++.

little eagle
#
_AI_unit addaction [_addactiondescription, {   
    (_this select 3) params ["_AI_unit", "_player", "_type"];            
    [_AI_unit, _player, 2, _type, ""] remoteExec ["TLS_fnc_hostage_prisoner", 2];
}, [_AI_unit, _player, _type]];
wary vine
#

@still forum its for my discord bot 😛

little eagle
#

There. Now they are defined.

still forum
#

Just export all of them from arma. And let your bot read the text file

lone glade
#

^ what I was about to suggest

#

just redo the export whenever you update a mod / arma and you're good to go.

still forum
#

Till today I didn't know that addAction had arguments...

#

That is also what all external tools would do... Almost all.

lone glade
#

Today I Learned Today?

wary vine