#arma3_scripting

1 messages Β· Page 369 of 1

grave torrent
#

@barren magnet - Clouds solution

meager granite
#

I had an evil plan of inducing epilepsy to cheaters by skipping time by infinite value, it used to make screeching noice and screen flashing black and white

tough abyss
#

Key down*

barren magnet
#

ok just for the records, i do have one and that triggers when i spress shift + -, and it does what it does and returns true.

peak plover
#

Jesus, what if someone with mild epilepsy cheats, you 'gon kill some dude

barren magnet
#

BUT still arma does not care and executes the cheat

meager granite
#

no longer possible though as infinites are no longer considered numbers

still forum
#

I think shift+- might be grabbed by engine before it reaches key handlers

#

but you can just kick the player when he presses that

peak plover
#

But flush

#

People still use flush

tough abyss
#

Really?

peak plover
#

I atleast do

still forum
#

People will stop using flush if they get kicked everytime

barren magnet
#

flush should be obsoltete since x64

tough abyss
#

Lol

peak plover
#

It's placebo, it makes me feel like it's smoother

#

I need it πŸ˜„

barren magnet
#

ok sry

tough abyss
#

Lol

grave torrent
#

My server freezes me, I cannot use any shift numpad minus. Ive yet to bypass it

tough abyss
#

Gl

#

Well

#

@still forum a simple jmp can do it 🀣

#

Or nop

still forum
#

yes.

#

Whatever you are talking about.. yes.

tough abyss
#

Anything with bypass

#

Well not anything

#

But for most simple things

still forum
#

@tough abyss Actually as you are serverside. You can theoretically get nanosecond precision by using Intercept

tough abyss
#

Oh hell I would so much prefer c++ thanks for remind me of it existing

#

Or that lua interpretation

#

Maybe expand it to c# with ref classes and a wrapper hmm

meager granite
#

We need to go deeper, write custom extension

barren magnet
#

nanosecond precision and arma sound like, nitro injection for my turtle ....

still forum
#

That's what I just said.. somewhat @meager granite πŸ˜„

tough abyss
#

Lol

barren magnet
#

its a good thing, but arma is just not able to handle it

still forum
#

Someone already tried a C# wrapper and failed so.. probably not gonna happen.. I guess.
I don't know C# myself

tough abyss
#

What did they try?

barren magnet
#

Because C# suckzzzz

tough abyss
#

I would personally try ipc or com or hosting clr

still forum
#

I dunno

meager granite
#

inb4 Cloud needs to just send a public variable each 5 minutes

#

Better use Intercept then

tough abyss
#

Lol

#

No need for public vars

still forum
#

#Intercept-Network

barren magnet
#

Public vars .... buhhhhh

tough abyss
#

Agreed

barren magnet
#

Use remotexec with jip m8

meager granite
#

You're all so 2007, custom-written arma engine ftw

still forum
#

sqf-vm πŸ˜„

astral tendon
#
_unit = this select 0;
if ({!alive _x} count crew _unit == 0) then {_unit setDamage 1}  
}];````
#

still did not managed to make it work

still forum
#

any script errors @astral tendon?

barren magnet
#

@still forum i like how you try to sneak that one in all the time >.> Why don't you just rewrite arma

astral tendon
#

literary nothing

barren magnet
#

Or join them for arma 4 and make it better

still forum
#

What am I trying to sneak in? ^^
That's the first time I sneak in sqf-vm

#

@astral tendon put some diag_log's into it to test what's wrong

barren magnet
#

Nah nah nah, there was no way around in since you had it released the first time XD

#

But I thinks its a good util so its fine

still forum
#

sqf-vm is from X39

#

^^

barren magnet
#

yeah ok i kinda put you two together sry

still forum
#

πŸ˜„

astral tendon
#

how?

barren magnet
#

Arma studio thingy and stuff ... you are married in my mind

still forum
#

@astral tendon like I said..

this addEventHandler ["hit", {
    _unit = this select 0;
    diag_log ["hit", _unit, crew _unit, {!alive _x} count crew _unit];
    if (({!alive _x} count (crew _unit)) == 0) then {_unit setDamage 1;};
}];
simple solstice
#

I wish he just implemented the debugger into visual studio code or atom

still forum
#

Actually the only thing I ever made myself from scratch is my SQF debugger. That people only know through Arma studio..
Intercept, TFAR, whatever else I just joined in at some time and made it better

simple solstice
#

instead of making a whole new ide

still forum
#

Β―_(ツ)_/Β―

astral tendon
#

15:36:07 ["hit",any,array,scalar]

still forum
#

uh

#

πŸ˜„

#

_this. not this

#

or just use params and stop making these mistakes

simple solstice
#

@still forum new tfar compatible with battleye?

still forum
#

yes

astral tendon
#

nope, still noting

simple solstice
#

is there some kind of list what's new, changed etc

still forum
#

still nothing makes no sense

#

the diag_log should spit out something

astral tendon
#
_unit = _this select 0; 
if ({!alive _x} count crew _unit == 0) then {_unit setDamage 1}   
}];```
#

or

still forum
#

Join TFAR Discord and read the changelog in #announcements

simple solstice
#

okay thanks

astral tendon
#
_unit = this select 0; 
if ({!alive _x} count crew _unit == 0) then {_unit setDamage 1}   
}];```
still forum
#

@astral tendon Leave the diag_log in and send me what it tells you

#

only change the second this

astral tendon
#

15:41:25 No speaker given for
15:41:27 ["hit",any,array,scalar]
15:41:27 ["hit",any,array,scalar]
15:41:27 ["hit",any,array,scalar]
15:41:27 ["hit",any,array,scalar]

#

in the init

    _unit = _unitthis select 0; 
    diag_log ["hit", _unit, crew _unit, {!alive _x} count crew _unit]; 
    if (({!alive _x} count (crew _unit)) == 0) then {_unit setDamage 1;}; 
}];````
#

derp

simple solstice
#

not intended for production use ;(

still forum
#

@astral tendon Or.. As I told you.. just use params

simple solstice
#

holy shirt why is there unitthis

still forum
#

@simple solstice Just a disclaimer. in case something breaks and people think they can yell at me

simple solstice
#

so it's stable?

still forum
#

yeah

simple solstice
#

kk

still forum
#

5600 users in the last 24hours

#

So I'd say it's stable enough

simple solstice
#

yeah I guess

tame portal
#

@little eagle Regarding my original question, why does it crash though?

#

It can find the files most of the time, but on some machines it just straight up kills the server the moment the mission is being loaded, so I guess it's not able to find the files that are meant to be included

little eagle
#

Sorry I forgot what your question was.

still forum
#

I also fail to find it

#

"What's the deal again with including game files from the missionfile? I must have forgotten what the issue is with it again..."
"Randomly results in crashes while on other machines it works fine, strange to me"

little eagle
#

Including an addon scope file in the description.ext ?

still forum
#

If the file is not there. Then crash.
Also you cannot #include from addons in missions that are loaded from folder instead of from pbo.. I think.. right?

little eagle
#

Yes, has been broken since 3den exists.

#

Only applies to the dedicated server though when you log in as admin and pick it on the mission select screen or something like that.

astral tendon
#
_this select 0 params ["_unit"];
if ({!alive _x} count crew _unit == 0) then {_unit setDamage 1}    
}];```
#

i still failed at this

still forum
#

DUDE

#
this addEventHandler ["hit", {  
    params ["_unit"];
    if ({!alive _x} count (crew _unit) == 0) then {_unit setDamage 1;};
}];

And put the diag_log back in to find out if it's working

tough abyss
#

Hi, is there a way of detecting who the player is and make an AI unit join his group while activating an addAction?

still forum
#

the player is player

astral tendon
#
    params ["_unit"]; 
    if ({!alive _x} count (crew _unit) == 0) then {_unit setDamage 1;}; 
}]
16:28:55 [1.25919e+006,29732,0,"XEH: PostInit started. MISSIONINIT: missionName=dfbhd_bandit_cross, missionVersion=53, worldName=pja310, isMultiplayer=false, isServer=true, isDedicated=false, CBA_isHeadlessClient=false, hasInterface=true, didJIP=false"]
16:28:55 [1.25919e+006,29732,0,"CBA_VERSIONING: cba=3.4.1.170912, "]
16:28:55 [1.25919e+006,29732,0,"XEH: PostInit finished."]````
still forum
#

are you serious?

#

I don't have time for such learn-resistant idiots.

#

[yourAI] join (group player)
Will put that AI into the players group

tough abyss
#

Will it work in multiplayer if I do

[prisoner] join player;

?

still forum
#

I'm not sure

#

you might need (group player) instead

tough abyss
#

oh group player

still forum
#

But yes. That #should work

astral tendon
#

Nerver mind, triggers are the way to go.

still forum
tough abyss
#

Alright, I will try. Thanks

#

I've been told that we shouldn't script with 'player' in dedicated servers

still forum
#

it won't work if you script runs serverside.
And if Zeus is controlling a unit then player will point to the Zeus unit. Not the unit the Zeus is remote controlling

tough abyss
#

because everyone is a player in a dedicated server, but I guess that because I use an addAction it's making it dedicated to the specific player

still forum
#

yes.. everyone is a player. But on clientside there is only ever one player

#

player always points to yourself

tough abyss
#

right, I will try it. Thanks!

#

it says in the wiki that if I want the unit to leave the group I should use grpNull instead of player group
like [guy1] join grpNull

astral tendon
#

done it

#
_car = _this select 0;
if ({alive _x} count (crew _car) == 0) then {_car setDamage 1}}];```
#

now the car explodes when hit wile having no crew

#

Thanks @still forum

tough abyss
#

Random Q: is there a way to enable chat in SP?

little eagle
#

No.

tough abyss
#

Ok, thanks πŸ‘

peak plover
#

I think I left /* open somewhere

#

But I don't know where

#

How do I find out where

astral tendon
#

never noticed the chat was disabled in SP

little eagle
#

ctrl+F and F3, nigel

#

Chat is disabled in SP and so is respawning. And there is no way to get them to work. Well I guess you can try to recreate both features with a lot of scripting.

astral tendon
#

or triggers

#

πŸ˜„

little eagle
#

Good luck making a chat with triggers.

#

πŸ˜›

peak plover
#

There's a RPG chat frameowrk

#

Google might find it

little eagle
#

I get why you'd want respawning in SP. And I can see how you could emulate it. But why would you need a chat?!

cunning nebula
#

if you want units to communicate via text, you could use drawIcon3D for it

#

atleast for regular communication, it may not be suitable for radio comms ^^

little eagle
#

Oh, systemChat works fine in SP. And so do the other commands I think. But you can't type anything yourself.

timber ridge
#

@peak plover There's a RPG chat frameowrk Google might find it
didn't get any luck on this - maybe you remember where did you locate it? bif scripting subforums? the best bet i found is this one: https://github.com/AsYetUntitled/Framework
but i guess you were talking about a SP and MP compatible rpg-like conversation/chat framework?

#

with conversation tree support, right?

peak plover
#

It was years ago on armaholic, someone made it for RPGs

#

not sure if it was mp compatable

cunning nebula
peak plover
#

it had selectable answers and text

#

Bad memory not sure 😦

#

But I know somewhere something exists

cunning nebula
#

in fact there are several

peak plover
#

πŸ™ƒ

cunning nebula
#

plenty to choose from really xD

haughty scarab
#

Hey, does anyone know why this script i made doesnt work? it just doesnt spawn the helicopter or anything nor does it give any errors what so ever

https://hastebin.com/goqamefawu.cs

rancid ruin
#

not sure, but it sometimes looks cooler to just setFuel 0 a helicopter and lock the doors if you want it to crash

#

first ensuring it's at a good altitude of course

haughty scarab
#

nah its not susposed to crash

#

its susposed to fly around until a player shoots it down and spawn a crate

zinc fossil
#

Is there any way to make an animal, lets say a goat, move faster then it does with playMove "Goat_Run"; It's "running" is more like slightly faster walking?

haughty scarab
#

not that i know of lol (personally)

rancid ruin
#

@zinc fossil setAnimCoef

#

not sure if it works on animals but give it a go

#

or setAnimSpeedCoef, can't remember

#

you can make players run at like 500mph though, smoke a joint and play around with it, it's fun

zinc fossil
#

Will test it out. Thanks

rancid ruin
#

does it work?

tough abyss
#

yes it works

#

ive messed with it before

rancid ruin
#

on animals? noice

tough abyss
#

Oh I thought you meant on players my bad

zinc fossil
#

I can't get it to work on a goat

icy raft
#

So still didn't find a good way to detect weapon change without writting a scheduled loop, as I will have to depend on a few of them later down the line, so the less I put the better. Anyone has any clues how to do that? In the video you can see that when you change weapon it still thinks you are out of ammo and there's no EH for that.

https://www.youtube.com/watch?v=TzZ2_NSmaXI

["lowAmmoBadge", "onEachFrame", {
    playerEyePos = ((ASLToAGL eyePos player));
    _weaponDir = (player weaponDirection currentWeapon player);
    _vectorSide = (vectorDir player) vectorCrossProduct (vectorUp player);
    avaHUDBaseVector = (_weaponDir vectorAdd (_vectorSide vectorMultiply (-0.12))) vectorAdd ((_weaponDir) vectorMultiply -0.6);

    if(inAvaRange) then {
        if(hasLowAmmo) then {
            _lowAmmoVector = (playerEyePos vectorAdd (avaHUDBaseVector));
            drawIcon3D [MISSION_ROOT + "resources\hud\low_ammo_hud.paa", 
            if(parseNumber(((currentMagazineDetail player) splitString "(/)") select 1) == 0) then [
                {[1,0,0,1]},
                {[1,0.8,0,1]}
            ], _lowAmmoVector, 10, 10, 0, "", 0, 0.025, "TahomaB"];
        };
    }
}] call BIS_fnc_addStackedEventHandler;

inAVArange = true and hasLowAmmo defined reliabiliy outside

meager granite
#

Comparing two strings each frame is not that bad

#

There is no event handler so you have to produce the event yourself

tough moth
#

Trying to execute simple script from addAction on an object. Works in editor, won't work on dedicated server. Here's what I have:

box1 addAction ["Action Text Here", "somescript.sqf"]

What am I doing wrong?

rancid ruin
#

what do you mean by "won't work"?

tough moth
#

option shows up, but when clicked does not execute

rancid ruin
#

probably a problem in somescript.sqf then

tough moth
#

works perfectly fine in editor preview, which is the strange thing

#

but that call function is still correct? nothing has changed in recent updates right?

#

i can also do execVM "somescript.sqf"; through debug console on dedicated server, and it works verifying that it not an issue with the sqf

#

seems to be something im missing in the call

daring pawn
#

does box1 addAction ["Action Text Here", {ExecVM "someScript.sqf"}]; work @tough moth ?

subtle ore
#

Ewwww

#

wtf

#

why execVM

daring pawn
#

If the other situation isn't working where its just a normal addAction

#

Β―_(ツ)_/Β―

#

If it works it works

subtle ore
#

ewwwwwwww

still forum
#

Some people just never get out of the beginner level

tough abyss
#

2real @still forum.

waxen tide
#

hides

nocturne bluff
#

i am the realest scripter i only use SQS

cunning nebula
#

😱

tame portal
#

@tough abyss loops Screenshot command endlessly

simple solstice
#

@tame portal the folder is limited to 50MB

#

or something like that

cunning nebula
#
player addEventHandler ["Fired", {(_this select 6) spawn {sleep 0.1; _this setVelocity ((velocity _this) vectorMultiply -1);};}];

😡

still forum
#

yes.. no... won't work

cunning nebula
#

no ?

#

you telling me im too stupid to commit scripted suicide ? 😒

still forum
#

on trivial error..

#

probably

cunning nebula
#

oh no

still forum
#

setVelocity takes object.. You give array πŸ˜„

cunning nebula
#

oh... woops

#

thats what happens when you try to avoid a bad habbit at the wrong time

meager granite
#

But if you shoot yourself indoors you still can't kill yourself πŸ€”

cunning nebula
#

fear not, the ways of the fired-eventhandler are plentiful

#
player addEventHandler ["Fired", { (_this select 0) attachTo [_this select 6]; }];
meager granite
#

Won't that be under your feet?

cunning nebula
#

its the mΓΌnchhausen script

meager granite
#

I'd suggest to attach yourself to the bullet but you probably can't

cunning nebula
#

thats what it does

#

im pretty sure you can ^^

meager granite
#

Oh, I thought you attached bullet to yourself

#

Anyway attachTo doesn't work with projectiles iirc

cunning nebula
#

hmmm

meager granite
#

Better set velocity then

#

Why do we do this again? πŸ€”

cunning nebula
#

no idea

#

i can write nonsense like that all day

#

replaced bullets with camping lanters once, at night

#

that was rather spectacular

#

felt a bit like shooting the plasma gun from doom

indigo snow
#

You can attach players to bullets

#

Empirically proven

cunning nebula
#

the fun really starts when you use ropes for that

#

especially when the other end attaches to static objects

#

or rpg-rockets that stop after beeing fired and then slowly follow you around...

#

I know it's sad but I never get tired of messing with "fired" πŸ™ƒ

#

that agents cost more resources than regular AI ? I kinda doubt it.

still forum
#

AI also see walls.. Otherwise they would just shoot through them.. Waffle's comment seems to say that AI completly ignores obstacles

#

Animal AI is also FSM. And Animals are Agents

#

But a Agent without FSM will just stand around and do nothing.
Wth a compilcated FSM attached they are ofcause worse on Performance than normal AI's

cunning nebula
#

the animal behaviour can be disabled via variable though

#

im not sure if I should use agents as civilians or just civilians with most their AI routines turned off (including FSM)

#

yeh, also saves me the trouble of having to manage groups

#

then again, maybe agents are too limited

#

that is, if I ever need a civ to reach for his gun

little eagle
#

Make it a 3den setting.

peak plover
#

trigger_1 isEqualType objNull
true/false?

nocturne bluff
#

is triggers objects?

#

yes

peak plover
#

thanks

deft owl
#
  while {not isnull _caller} do { "mkr_unit1" setmarkerpos getpos _caller; sleep 0.5; };
}; ```

why is this not working?
robust hollow
#

caller is not defined?

deft owl
#

yes :/

#

dont know i thought when _caller = player it shoud be clear

astral tendon
#

do you guys know any easy script to revive a unit in SP? i just wanna trow that in the unit init and not be able to revive other AIs, only the squad mates

still forum
#

@deft owl local variables don't carry over into spawned scripts..
local varaibles (start with _) only exist in the current script. And get deleted when the script ends.
Spawn spawns a new script that might run when the current script has already ended.

deft owl
#

so i need a loop?

still forum
#

...

#

you already have a loop

deft owl
#

i mean i am a noob πŸ˜‰

still forum
#

yep. Read wiki thingies I posted and my message a couple times.

deft owl
#

but thank you anyway

#

will do thank you for the fast help

warm gorge
#

Is there a way to disable Regroup messages from player group leaders?

little eagle
#

ACE

warm gorge
#

Is the way that ACE does it achievable through vanilla arma? I dont have much experience with ACE so unsure about it

#

I expected enableRadio to work for this but it doesnt

still forum
#

Well.. ACE is a Mod that runs on vanilla Arma

little eagle
#

I think he means without mods. No in that case.

warm gorge
#

Yeah thats what I meant. Oh well thats a shame, thanks anyways thou

astral tendon
#

you want to disable the message it self or the order?

warm gorge
#

Just from coming up in general

astral tendon
#

then, you will have to be the leader or not be in a group

little eagle
#

That'd work too.

warm gorge
#

Ah okay I guess its just another one of those things that are annoying but we cant do much about without mods lol

little eagle
#

At least we can do something about them with mods. Could be much worse πŸ˜›

cunning nebula
#

you can at least make em silent: _unit setSpeaker "NoVoice"

#

but the message itself...

#

maybe by disabling the group channel ? not sure if the AI cares about that

indigo snow
#

cant disable the group channel

cunning nebula
#

doh

inner swallow
#

MRB Voice Stop

#

although that'll disable enemy AI voices too, iirc

cunning nebula
#

is there any list of all the special BIS_ variables like "BIS_enableRandomization" ?

#

or "effects"

flint kraken
#

Anyone know an addon for exile that allows the to get groups so they can get kit

#

Like donator 1 kit and donator 2 kit

cunning nebula
#

you mean like a list of UIDs that automatically adds certain loadouts to people in that list, on spawn ?

flint kraken
#

yeah

cunning nebula
#

well

indigo snow
#

you call them donator kits, youre aware of the monetization rules?

cunning nebula
#

you can do it but basically only if those kits are purely cosmetic and have no gameplay advantages

austere granite
#

i can make one for you for 90% of the income

inner swallow
indigo snow
#

thats a different thing tho

cunning nebula
#

wasn't talking about functions

#

special object Variables

indigo snow
#

i dont think theres a list somewhere

cunning nebula
#

:/ a shame

indigo snow
#

i know theres the special variable to lock doors, too

inner swallow
#

ah, variables.

cunning nebula
#

yeh those

#

bis_disabled_Door_#

#
effects
number # (for karts)
color # (for randomized vehicles)
BIS_SUPP_useDefaultBurst # (for artillery vehicles)
BIS_enableRandomization bool
BIS_fnc_animalBehaviour_disable bool
BIS_noCoreConversations bool
bis_disabled_Door_# 0/1

missionNamespace setVariable ["BIS_dynamicGroups_allowInterface", false]
<curatorModule> setVariable ["showNotification", false]

found some more by searching the sitreps πŸ˜ƒ

hidden field
#

okay either i found a bug or i miss something, if im correct a rearm of a vehicle should take 'ammo cost' x 'count of that projectile' (like rockets) ammount of ammoCargo out of an ammo carrier (like vehicle ammo box)??

#

but if i use an vehicle ammo box (transportammo = 30k) the ammount removed is higher and if i use something with much more ammo cargo (huron ammo box) no ammo cargo gehts removed (it carries 1*10^12)

#

did i miss something for the cost or is this a bug because of some calculation error or something???

subtle ore
#

Why don't you do this. Post your code.

hidden field
#
    while {true} do { 
        sleep 1; 
        systemChat ((getnumber (configFile >> "CfgVehicles" >> typeOf _this >> "transportAmmo") * (1 - getAmmoCargo _this)) tofixed 6);
    }
};``` thats the code i use to get the ammo amount used
#
1002,818970
1502,137207
2005,537720
2504,961426
3008,630371```
and these are the values of removed ammo cargo if i have an orca with a skyfire launcher and removing 1 rocket at a time and let it refill ( cost of sykfire rocket ammo is 500)
#

(the code to get the ammount used is put into the init of object)

stable quest
#

The old way of making cinematic cutscens and camera movements is not working.

#

How do I do this in the new ARMA update?

#

Is it a zeus function now?

hidden field
#

okay same with an wipeout were i remove the ammo of the minigun via cameraon setMagazineTurretAmmo ["1000Rnd_Gatling_30mm_Plane_CAS_01_F", 0 ,[-1]] cost is now 20013.925781 with an box_east_ammoVeh_f as ammo source O.o?

#

should only be 20000 <.<

stable quest
#

There is bi useable guides for making mission into and outro cinematics and cutscenes because "camera.sqs" dont work anymore.

grizzled spindle
#

Does anyone know what could be causing a setVariable to be very slow like 5 second delays sometimes

still forum
#

on profileNamespace?

#

Even there.. no..

grizzled spindle
#

just on a item

still forum
#

not really

grizzled spindle
#

its so weird

still forum
#

how do you measure?

grizzled spindle
#

its so slow i can count it

still forum
#

how do you measure.

#

If setVariable is slow.. you drop to 0fps for 5 seconds and your game freezes

#

if that doesn't happen then it's not setVariable that's slow.

grizzled spindle
#

I was using the watch on the debug console

still forum
#

What exactly did it tell you?
And so your game really froze for 5 seconds?

still forum
#

everything is by reference unless it specifically isn't

#

Same

stable quest
#

Whya re you guys ignoring me?

tribal crane
#

You can't tell if strings and integers are by reference or value, because they themselves are immutable.

still forum
#

My guess is just error reading the debug console output or missinterpreting "measurements"

stable quest
#

I got my cutscene camera to work, now how do I make it switch back to playable units?

still forum
#

@tribal crane everything is by reference and copyOnWrite

#

same here Β―_(ツ)_/Β―

tribal crane
#

What makes you say that, Dedmen?

still forum
#

I know it. That's why I say it.

#
_str1 = "test";
_str2 = _str1;
_str3 = _str1;

All 3 variables point to the same string

#

and _str1 = "test" doesn't allocate a new string in memory

tribal crane
#

When does the copy on write happen?

cloud thunder
still forum
#

"copy on write" By definition creates a copy on write.

#

so.. on write/modification

tribal crane
#

How do you modify a string?

still forum
#

"test" + "test2"
creates a copy of the first test and then appends "test2"

stable quest
#

Shit, nobody told me there is a terminate camera function. Shame is. The camera position is even wrong.

#

Lol

#

ARMA....

#

Nobody in the tutotials that is

still forum
#

everything that does some modification on a string.
select returns a substring if the parameters tell it to return a substring.
but "string" select [0] returns a reference of the original.

tribal crane
#

That's not copy on write though.

#

Copy on write is used to emulate value semantics with references.

still forum
#

Strings are copy on write in the engine.
That there isn't really a method to write into a string doesn't change that

stable quest
#

Well it works.

#

Just 60 seconds it not 60 seconds to ARMA apparently.

cloud thunder
#

@stable quest you can start and stop it with effectName

stable quest
#

It is 60 frames per second, seconds lol

#

I got it figured out, and there are no errors.

#

Time to make more camera cutscenes and stuff.

#

This will be a long day. Need redbull.

#

If anyone wants to join the project and help me get my civil crisis simulator to a realistic level, I would greatly appreciate it.

#

Now to pack a .pbo lol

young current
#

just so you know @stable quest that link looks fishy as hell

stable quest
#

Why?

#

Its a dev site, and its mine. Self hosted.

#

Scan it, tehre is nothing harmful on it

tribal crane
#

If you can't mutate a string then it isn't possible to use copy on write. Any operation on a string, including operations on two strings, simply produce a new string.

young current
#

just how its written and ends with biz

stable quest
#

Move Swiftly Shoot Straight OPS

#

I doubt you even opened the link...

young current
#

no i did not

#

because of the fishyness

stable quest
#

Thanks for being a paranoid critic πŸ˜‰

#

I am a legit business man. I do not appreciate that.

young current
#

wait

still forum
#

@tribal crane just passing a string somewhere passes it by reference though.
Calling a function that takes string. Or assigning a string to a variable

young current
#

youre not using arma as business platform

stable quest
#

Im using it to story board, then I am developing in UnrealEngine

#

Am in Full Sail UNI for Game Design and Dev

young current
#

there may be clauses in Arma eula about business use

stable quest
#

The name HorribleGoat stands true

#

There is and I talked to them about it.

still forum
#

his is actual game footage from the project. Enjoy! Coming soon, more missions. More videos. More Tactical Military Simulation.
In this day and age, we have to consider the posibility that it may be time for an urban warfare trigger discipline tactical simulator.
Along with military mission and state of the art x64 Linux Cloud Systems. We plan to bring out the best from Unreal Engine.

@stable quest You are showing Arma footage and claim it's your Unreal engine game?

tribal crane
#

Dedmen: You can't know that without having the source code of the engine. Immutable strings can either be passed by value or by reference and unless your scripting language lets you introspect the storage details of the string you have no idea which is actually happening.

stable quest
#

They said as long as I dont make money from it it is fine.

#

"Actual footage from the project"

still forum
#

@tribal crane Oh.. I remember you.. You are that Idiot from BIF right? From the Server fps unlock thread

stable quest
#

Why are you wasting my time??!?! Lol

#

BIF?

#

One thing I will say to the person with function string issues is this. EVERYTHING CHANGED IN THE LAST 3 MONTHS, DOUBLE CHECK THE WIKI

still forum
#

@tribal crane If you want to test it yourself. Get Intercept. And find out that everything I'm saying is true

stable quest
#

^^

#

No debug console or stdout is gonna save you...

#

is ded

#

One thing I love about ARMA is this, the developer community is hardcore and pushes me to my limits.

#

@still forum thanks for telling me to edit the text on my website, indirectly so, but you helped. Thanks.

tough abyss
#

🎡 push it to the limit 🎡

stable quest
#

IS there a way to make a BIS_fnc_endMission call wait?

#

So I can do a cut scene?

indigo snow
#

Wait with calling it or modify the function

stable quest
#

Cause it is instantly ending the mission without any sort of debrief

tough abyss
#

Call it after the cutscene.

stable quest
#

Thankx

#

Trigger to trigger?

#

Hmm. This will be tricky. I; need to learn timer functions

#

Who made the song "Push it to the limit"

#

Is that rick ross?

#

Yep

#

There is also one in the scarface soundtrack

indigo snow
#

You can just use sleep or whatever

stable quest
#

Damnit, Rick Ross ripped off scarface hardcore.

#

I hope he payed to have that sample cleared.

tough abyss
#

I don't think Rick Ross was the one to create the Scarface OST...

flint kraken
#

Anyone know of any free alteratives to InfiSTAR which does the same things?

stable quest
#

BTW, Dev's before a bad ATV accident I was a Audio Engineer, if you need custom audio let me know. I still have all my gear.

indigo snow
#

Many servers are fine without infistar though

#

Actually scratch that idk that much about public servers

stable quest
#

I host everything on linux so we dont need that.

#

Debian ❀

#

One bit of advice, dont try to load multip[le mods in the same -mod=@modname

tribal crane
#

Dedmen: Wasn't me in that thread, I guess the corollary of what I said is that you can know if you do have the source. πŸ˜‰

stable quest
#

you have to do each one individually

indigo snow
#

I fail to see what infistar has to do with server os

#

Unless it now offers more than it used to

stable quest
#

Im just saying, use debian php7 and mariadb instead of windows

indigo snow
#

But what does that have to do with infistar

stable quest
#

Altis life, asylum is F***** because of that reason, they use windows SQL db's

#

Not much, ill shut up

astral tendon
#

just a little check

#
  _unit = _this select 0; 
  _selection = _this select 1; 
  _damage = _this select 2; 
 
  if (_selection == "?") exitWith {}; 
 
  _curDamage = damage _unit; 
  if (_selection != "") then {_curDamage = _unit getHit _selection}; 
  _newDamage = _damage - _curDamage; 
 
  _damage - _newDamage * 0.89;
}];
this addEventHandler ["HandleDamage", { 
  _unit = _this select 0;
  if ((damage _unit)> 0.50) then { [[_unit,"PRONE_INJURED", ASIS],BIS_fnc_ambientAnim ] remoteExec ["call"]};
  if ((damage _unit)> 0.50) then {_unit setCaptive true}; 
}];
0 = this addEventHandler ["HandleHeal", { 
    _this spawn { 
        params ["_injured","_healer"]; 
         
        _startDamage = damage _injured; 
        if (_startDamage > 0) then { 
            waitUntil {damage _injured != _startDamage}; 
            if (damage _injured < 0.2) then { 
                _injured call BIS_fnc_ambientAnim__terminate remoteExec ["call"] AND _injured setCaptive false; 
            }; 
        }; 
    }; 
}];````
#

this script i made will work in MP?

#

test in SP seens to do just fine

indigo snow
#

_damage - _newDamage * 0.89; this line is useless

astral tendon
#

this is the amout of damage to reduce

indigo snow
#

you dont assign it to anything

astral tendon
#

the higher value = less damage

indigo snow
#

its just a value

#

it gets lost in the void

#

many electrons waste their lives

cloud thunder
#

so why don't you set up an mp test eviroment @astral tendon

astral tendon
#

because i suck at set up a server

stable quest
#

"PLAY IN MP" in the editor

indigo snow
#

other than that i see many remoteExecs which seems fine, but then you shouldnt add it on all clients either

astral tendon
#

that does not really work right

indigo snow
#

currently they get added at every client

#

but the AI will only ever be local to the server

cloud thunder
#

even after the tut i gave you?

stable quest
#

pack it as a pbo so you dont have to worry about it all

indigo snow
#

thats the least useful advice

astral tendon
#

yes and i still sucked

stable quest
#

I gotta step off to code now

astral tendon
#

especially when is moded

cloud thunder
#

well theres channels to get help with that too.

stable quest
#

What is the new replacement for this exec "camera.sqs";

cloud thunder
#

just code in sqf

tribal crane
stable quest
#

I am but the game logic wont export the camera positions unless I use that .sqs

astral tendon
#

also if you guys are interested, that is a verry simple revive system to the AI inits

#

just trow that on the init

stable quest
#

What revove suste,?

#

Wait what?

#

Share!

#

What INIT do I put that code in

still forum
#

It's like saying you don't know how to walk because you didn't read the source code of your brain and legs

tribal crane
#

My point was that with immutable values you can't tell if the VM implementation is using values or references.

#

You might happen to know, because you wrote the VM or have the source, but you can't write a script that would detect one or the other.

#

And since the person originally asking the question presumably doesn't care about hidden implementation details I mentioned the above.

still forum
#

you can't via script. correct.
But with Intercept you can read the memory adress of the values

#

So if you pass a string and the passed value has the same adress as the original.. and the refcount was incremented by 1. Then you know it was now copied

#

He asked "by reference or by copy" I answered the truth. And then you told me "No! You can't know that!"

#

Also Whale specifically asked about the hidden implementation detail. He asked what the engine does.

tribal crane
#

Ah, yeah, he asked about arrays. Those you can definitely tell.

astral tendon
#
  _unit = _this select 0; 
  _selection = _this select 1; 
  _damage = _this select 2; 
 
  if (_selection == "?") exitWith {}; 
 
  _curDamage = damage _unit; 
  if (_selection != "") then {_curDamage = _unit getHit _selection}; 
  _newDamage = _damage - _curDamage; 
 
  _damage - _newDamage * 0.89;
}];
this addEventHandler ["HandleDamage", { 
  _unit = _this select 0;
  if ((damage _unit)> 0.50) then { [[_unit,"PRONE_INJURED", ASIS],BIS_fnc_ambientAnim ] remoteExec ["call"]};
  if ((damage _unit)> 0.50) then {_unit setCaptive true}; 
}];
0 = this addEventHandler ["HandleHeal", { 
    _this spawn { 
        params ["_injured","_healer"]; 
         
        _startDamage = damage _injured; 
        if (_startDamage > 0) then { 
            waitUntil {damage _injured != _startDamage}; 
            if (damage _injured < 0.2) then { 
                _injured call BIS_fnc_ambientAnim__terminate remoteExec ["call"] AND _injured setCaptive false; 
            }; 
        }; 
    }; 
}];```
#

one small problem i am having, the cachater still lost hes helmet

#

even though i put it ASIS

still forum
#

What is ASIS?

astral tendon
still forum
#

Could it be that you wanted to "ASIS" ?

#

As the wiki tells you. And the examples show you twice. That argument is a string

astral tendon
#

fak

#

you right

astral tendon
#

i need to set up a trigger to start only if there is about 4 units in it

#

what is the code for the condition?

little eagle
#

count thisList >= 4

astral tendon
#

thanks

distant egret
#

anyone knows what this error message is about?

21:44:49   Error position: <latSlipDrive 0.8[-0.1, -0.4])*(Speed 0.8>
21:44:49   Error Generic error in expression
21:44:49 Error: Sound volume expression: engineOn*(1-asphalt)*(1-camPos)*(latSlipDrive 0.8[-0.1, -0.4])*(Speed 0.8[2, 15])```
never seen it before and appeared at 3 different times now about 10 times each time.
zinc fossil
#

Anyone knows how to get a custom texture to display on Land_Laptop_unfolded_F? I tried using the texture field in the editor, tried setObjectTextureGlobal, setObjectTexture, setObjectMaterial and setObjectMaterialGlobal.

astral tendon
#

i use this one for the board [board2,[0,"images\medic.jpg"]] remoteExec ["setObjectTexture", 0, true];

zinc fossil
#

worked with remoteExec, thanks

halcyon crypt
#

@distant egret is this your work or someone else's?

#

in any case latSlipDrive 0.8[-0.1, -0.4] and Speed 0.8[2, 15] seem wrong

distant egret
#

@halcyon crypt not mine

#

Never wrote something like that

halcyon crypt
#

it's probably supposed to be latSlipDrive [0.8, -0.1, -0.4] and Speed [0.8, 2, 15]

distant egret
#

I don't even know what's it from. A vehicle?

halcyon crypt
#

it's RHS

distant egret
#

Ah

#

Yea that's it than

halcyon crypt
#

no clue if there's a fix though

distant egret
#

there is a fix file

#

but means I need to redo the pbo

halcyon crypt
#

you could probably maybe make a patch PBO

distant egret
#

Yea

#

bit easier

#

wait the file is a patch I think as it inherits all that's needed.

#

just need to add CfgPatches

frank ruin
#

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

#

Does Items still work as it didn't do what It was supposed to do. πŸ˜„

halcyon crypt
thick sage
#

I have a question: when closeDialog 0 is used, does it removes all displayEventHandlers of the opened display? or do I need to remove them myself?

still forum
#

When the dialog is closed then it is deleted.

#

You can't remove something from something that doesn't exist

#

so yes. They are removed

thick sage
#

great; thanks.

still forum
#

But

#

closeDisplay != closeDialog

tough abyss
#

I need some assistance on how to traverse config files correctly.

simple solstice
#

be more specific

tough abyss
#

Traverse the configfile for all weapons, backpacks, items attachments etc.

#

It's being fed to the virtual cargo box

still forum
#

configClasses Or I think even forEach might work

tough abyss
#
{
_configName = configName _x;
diag_log format ["_configName: %1",_configName];
            } forEach [
                (configFile >> "CfgWeapons"),
                (configFile >> "CfgMagazines")
                // ( configFile >> "CfgVehicles" ),
                // ( configFile >> "CfgGlasses" )];
jovial nebula
#

Does anyone know if it is currently possible to write extensions using .Net Core platform?

tough abyss
#

Doesn't work due to configFile not returning the right data.

still forum
#

@jovial nebula yes. See Arma Extensions wiki page.

#

@tough abyss You should forEach through the config.. Not through the array containing configs

tough abyss
#

This was someone elses original code

#

it's apart of liberation and is pretty broken

#

the guy who wrote it

#

used dense expressions for "" configClasses

#

It wasn't a simple expression as explicitly recommended on the wiki

#

It uses one big ass string to determine the "expression"

#

@still forum

#

Borderline scrapping this script

#

Another one that had to be canned

#

facepalm

#

That function looks like a programmer trying to be clever.

#

And failed terribly with readability.

still forum
#

I don't see a problem in that configClasses string

tough abyss
#

** The condition code passed to configClasses should only be used for simple filter expressions and nothing more**

still forum
#

yeah.. and?

#

I actually don't see why..

#

It works.. And I don't see any problem with that. No Idea why KK added that warning.

tough abyss
#

Doesn't work

#
_fnc_linkedItems = {
    "
        if ( isText( _x >> 'Item' ) ) then {
            _virtualItems pushback _configName;
        };
    "configClasses _this; // (_x >> linkedItems) resolves to: bin\config.bin/CfgWeapons/srifle_DMR_01_ACO_F >> "linkedItems"; to nothing... 
};
#

Bool bad conversion

indigo snow
#

You dont filter in your filter, youre executing code

#

Dont do that

tough abyss
#

if ( isText( _x >> 'Item' ) ) then { _virtualItems pushback _configName; }; doesn't return a true, does it?

indigo snow
#

Select the array with the command and then pushback from that srray

still forum
#

Original code was

        "
            if ( isText( _x >> 'Item' ) ) then {
                [ _box, getText( _x >> 'Item' ), false ] call BIS_fnc_addVirtualItemCargo;
            };
        "configClasses _this;

Which is different from what you are doing

indigo snow
#

Doesnt it want a boolean return anyway?

tough abyss
#

yeap

still forum
#

just use

    " isText( _x >> 'Item' )" configClasses _this;
tough abyss
#

example on the wiki _configs = "true" configClasses (configFile >> "CfgVehicles");

#

Thats not a boolean comparison though?

indigo snow
#

_virtualItems append ^^

#

IsText returns a bool

tough abyss
#
_fnc_linkedItems = {
    "
        _bool = if ( isText( _x >> 'Item' ) ) then {
            _virtualItems pushback _configName;
        };
    "configClasses _this;
still forum
#

what is not a boolean comparison?

indigo snow
#

What

still forum
#

your code? right.

tough abyss
#

Does it?

#

Oh der...

#

Still would need to be assigned right?

#

yes it returns a bool

#

or just add as the return type at the bottom _bool

indigo snow
#
_fnc_linkedItems = {
     _virtualItems append "isText( _x >> 'Item' )" configClasses _this;
};```
#

Also virtualItem is might be nil

tough abyss
#

Original code is doing this

#

Bad conversion: bool

#

Bad conversion: bool

#

Bad conversion: bool

#

Over and over.

#

yea because your code in " " doesn't return a bool, does it?

#
{
   "
       if ( getNumber( _x >> 'scope' ) isEqualTo 2 ) then {
           _configName = configName _x;
           _itemType = _configName call BIS_fnc_itemType;
           if !( ( _itemType select 0 ) isEqualTo '' ) then {
               switch ( _itemType select 0 ) do {
                   case 'Item' : {
                       _virtualItems pushback _configName;
                   };
                   case 'Weapon' : {
                       if !( ( _itemType select 1 ) isEqualTo 'VehicleWeapon' ) then {
                           if ( ( _configName call BIS_fnc_baseWeapon ) isEqualTo _configName ) then {
                               _virtualWeapons pushback _configName;
                           }else{
                               ( _x >> 'LinkedItems' ) call _fnc_linkedItems;
                           };
                       };
                   };
                   case 'Magazine' : {
                       _virtualMagazines pushback _configName;
                   };
                   case 'Mine' : {
                       _virtualMagazines pushback _configName;
                   };
                   case 'Equipment' : {
                       if ( ( _itemType select 1 ) isEqualTo 'Backpack' ) then {
                           _virtualBackpacks pushback _configName;
                       }else{
                           _virtualItems pushback _configName;
                       };
                   };
               };
           };
       };
   "configClasses _x;
#

Thats what runs all the comparisons

#

This is basically a piece of code to initialize a ammobox

#

the code isn't mine it's owned by someone else.

#

yes but nothing of that returns a bool

#

which it needs to function

indigo snow
#

Oh man thats a wonderful abuse there

tough abyss
#

So what just stick a "true" at the bottom?

indigo snow
#

Is that BIS?

tough abyss
#

No.

#
// LARs_fnc_addAllVirtualCargo.sqf
// Original code by Larrow - https://forums.bistudio.com/profile/770615-larrow/
#

and can you confirm his code is even working?

#

Sort of.

#

But the dump to the log isn't pretty.

indigo snow
#

Man there isnt supposed to be much code in those strings

tough abyss
#

It does work

#

no, because it doesn't work

#

I just dumps Bool bad conversion

#

But it does work...

#

if it goes bad bool conversion I doubt the rest of the code works

#

hence the abuse.

indigo snow
#

The switch might return something

tough abyss
#

I am thinking this is a can and rebuild job.

indigo snow
#

Id rather nuke it yea

#

Bucket full of spiders right there

tough abyss
#

I'm not seeing any returns in the switch :/

#

I know.

#

This is in Liberation

#

by the way KillahPotatos liberation

indigo snow
#

The switch itself might return the value of the matching case or something, refer to wiki

tough abyss
#

I am just going to bin this and re-write it.

#

isn't it way easier to just use the virtual arsenal?

#

This is apart of the code for that...

#

Want to see worse?

#

no

#

I've got a Liberation running, edited from where KP left off, and I haven't seen that bad bool conversion anywhere

still forum
#

The worst code is the Virtual Arsenal itself πŸ˜„

tough abyss
#

0 = ["AmmoboxInit",[this,true]] spawn BIS_fnc_arsenal; seems a lot easier than that waterfall of code

simple solstice
#

make a CBA Arsenal @still forum

still forum
#

No.. Someone is already working on ACE Arsenal

simple solstice
#

πŸ˜†

still forum
#

It's awesome so far. Filters so you can search for items. Buttons to clear your vest/backpack with a single click... and moar

simple solstice
#

but it's on ACE.. wish it was donated to CBA

tough abyss
#

@tough abyss This is for a realism group

#

So the ammoboxes MUST be filtered

#

I run it for a realism group too, and we just have people capable of not using overpowered weapons

#

and I have yet to find a weapon considered overpowered in the addons

#

so if that is your concern, just talk to your gents πŸ˜‰

nocturne bluff
#

Real men uses loadouts

tough abyss
#

saves on the 30 minute dress up on the start of every play xD

tough abyss
#

Something someone posted on the BI forums

#

_pistolConfigs = "((configName (_x)) isKindof ['Pistol', configFile >> 'cfgWeapons']) && (getText (_x >> 'displayName') != '')" configClasses (configFile >> "cfgWeapons"); 

@indigo snow

#

Actually thats not too bad.

jovial nebula
#

@still forum I've just discovered that .net core does not support Unmanaged exports, how can I deal with this?

little eagle
#

@tough abyss That first configName is superfluous, as isKindOf accepts CONFIG and STRING type.

still forum
#

@jovial nebula Have a intermediary .net library that has unmanaged exports. and then calls into your .net core thingy

tough abyss
#

@little eagle

_pistolConfigs = "_x isKindof ['Pistol', configFile >> 'cfgWeapons'])
 && (getText (_x >> 'displayName') != '')" configClasses (configFile >> "cfgWeapons");
#

?

jovial nebula
#

Oh understood, then no cross-platform at all

little eagle
#

Missing space.

#

I really miss the syntax highlighting here, which is why I'd just go wit "true" configClasses ... select {...} πŸ˜›

tough abyss
#

Now to search an array without iteratively looping through them... too much

little eagle
#

Uhm, rephrase that?

tough abyss
#

Avoid doing this

#
{
    { }forEach 
} forEach
little eagle
#

Is this related to this problem?

#

The config one I mean.

tough abyss
#

This config I need to build a full list of items

#

_virtualCargo = [_virtualWeapons, _virtualMagazines, _virtualItems, _virtualBackpacks];

#

An abuse of the condition checking I'm told

#

So that entire script needs re-writing

#

@little eagle

little eagle
#

This page has been removed!

still forum
tough abyss
#

fixed

#

Extreme abuse of the configClasses

little eagle
#

That big string would annoy me so much.

#

Extreme abuse of the configClasses
Ye, pointless too.

tough abyss
#

Why do you think I am re-writing it.

#

Just not sure how to approach it.

little eagle
#

private keyword is a place to start^^

still forum
#

PrivatizeAllTheThings

tough abyss
#
_fnc_getConfigs = {
    
format ["getnumber (_%1 >> 'Rifle') isEqualTo 2 AND getnumber (_x >> 'scope') 
    isEqualTo 2",_x] configClasses(configFile >>"cfgWeapons");
    forEach ["Pistol","Rifle"];
    
};
#

Bad?

#

Would that even work?

still forum
#

No...

#

Don't think so...

little eagle
#

Just use
"true" configClasses _config select {...}

#

Like normal people would.

still forum
#

The syntax is completly incorrect and the format will also not work

tough abyss
#

not familiar with using select

still forum
#

Wiki

little eagle
#

You look up select CODE right now.

#

Best thing that happened to A3

tough abyss
#

Oh right.

#

I see use an oh thats neat.

still forum
little eagle
#

I guess you can use something simple as filter for configClasses:

'getNumber (_x >> "scope") == 2' configClasses _config select {...}

and it stays readable while making the select code block a bit smaller.

#

Most common convention to interpret a float as boolean is > 0, right?!

still forum
#

kinda

little eagle
#

= 1 ?

still forum
#

no

#

0.5 would round to 1

#

should*

little eagle
#

People bother with

= 0.5 ??

#

I like > 0 because of how symmetric it is. It's like you slice the number line in two exact halves, while keeping 0 = false.

tough abyss
#
{
    _configName = configName _x;
    _getClasses = 'getNumber (_x >> "scope") == 2' configClasses _x;
    _getWeapons = _getClasses select {_x == 'displayName'}
    diag_log format ["_getClasses: %1",_getClasses select {_x == 'displayName'}];
} forEach [
    (configFile >> "CfgWeapons"),
    (configFile >> "CfgMagazines")];

?

still forum
#

a config class will never equal a string

little eagle
#

Would error.

#

Also missing ;

#

Also you wrote two times the same thing.

tough abyss
#

Oh right

#

and I need to convert the config entry to a value

flint kraken
#

Anyone know what script i can use to teleport someone to me?

peak plover
#

yes

#
player_2 setposASL getposASL player;```
little eagle
#

ASL

#

^^

tough abyss
#

@still forum

#

Thats one of the init files for KillahPotatos liberation

still forum
#

And?

#

What's wrong with that? besides that load of crap(spawn compileFinal preprocessFileLineNumbers) instead of execVM

tough abyss
#

Thats spawn compileFinal I was referring to

#

Does it make any difference?

#

vs execVM?

still forum
#

okey yeah.. That's quite dumb

#

yes

#

it's 3 commands instead of one

tough abyss
#

How do you learn how the traverse config files?

still forum
#

Read wiki + logical thinking

tough abyss
#

Your script code is throwing type number expected bool

still forum
#

the pastebin one?

#

yeah.. Forgot a false at the end

tough abyss
#

It's back

#

Bad conversion: bool

little eagle
#

those are choices for scripter to waste time fretting about
True. Fortunately this channel is named #arma3_scripting.

tribal crane
#

@tough abyss If you're doing a virtual ammo box type thing you might want to time your configClasses calls to make sure they aren't locking up the game for too long. If they are you can walk through configs the old fashioned (CONFIG select ...) way.

tough abyss
#

Still wonder whats the source of this Bad conversion: bool

little eagle
#

Just do

#
"1" configClasses configFile
#

"Code block" (string) reports something that is not a boolean.

still forum
#

Bad conversion happens when engine get's a value of different type and calls the getType method.
If it is not convertible a default value will be returned and Bad conversion will be logged.
So if you call getBool on a Number... ERROR.

#

Although they could've just builtin that numbers automatically convert but... Β―_(ツ)_/Β―

tough abyss
#

Bingo found whats causing it

still forum
#

As in this case.. We don't actually care about what value configClasses is using.. One can just ignore that error

tough abyss
#
if ( ( _configName call BIS_fnc_baseWeapon ) isEqualTo _configName ) then {
still forum
#

I don't see it

tough abyss
#

"_itemType = [""Weapon"",""MissileLauncher""]"
"BIS_fnc_baseWeapon result: true"
"_itemType = [""Weapon"",""SniperRifle""]"
"BIS_fnc_baseWeapon result: true"
"_itemType = [""Weapon"",""SniperRifle""]"

#

then

#

"_itemType = [""Weapon"",""SniperRifle""]"
Bad conversion: bool

still forum
#

Why .. I don't see how that is connected to the code you posted

tough abyss
#
"BIS_fnc_baseWeapon result: true"
"_itemType = [""Weapon"",""SniperRifle""]"
"BIS_fnc_baseWeapon value: srifle_DMR_01_F"
"BIS_fnc_baseWeapon result: true"
"_itemType = [""Weapon"",""SniperRifle""]"
"_itemType = [""Weapon"",""SniperRifle""]"
Bad conversion: bool
"_itemType = [""Weapon"",""SniperRifle""]"
Bad conversion: bool
#

It is

#

this section

#
case "Weapon" : {
                            if !( ( _itemType select 1 ) isEqualTo "VehicleWeapon" ) then {
                                if ( ( _configName call BIS_fnc_baseWeapon ) isEqualTo _configName ) then {
                                    diag_log format ["BIS_fnc_baseWeapon value: %1", _configName call BIS_fnc_baseWeapon];
                                    diag_log format ["BIS_fnc_baseWeapon result: %1",(_configName call BIS_fnc_baseWeapon) isEqualTo _configName];
                                    _virtualWeapons pushback _configName;
                                } else {
                                       ( _x >> "LinkedItems" ) call _fnc_linkedItems;
                                };
                            };
                        };
#

Is causing it

#

somehow BIS_fnc_baseWeapon fails

#

after a specific rifle

#

every time.

still forum
#

Is that code inside configClasses or in select? Did you add a false to the end?

tough abyss
#

Yeah there is a false at the end

little eagle
#

Come back when you have a simple repro.

dusk sage
#

in dentation?

still forum
#

Why did the other _itemType -> Weapon's
not log the BIS_fnc_baseWeapon diag_log?

#

I guess because baseWeapon?

#

what is inside _fnc_linkedItems

tough abyss
#
_fnc_linkedItems = {
    "
       if ( isText( _x >> 'Item' ) ) then {
           _virtualItems pushback _configName;
       };
   " configClasses _this; // (_x >> linkedItems) resolves to: bin\config.bin/CfgWeapons/srifle_DMR_01_ACO_F >> "linkedItems"; to nothing...
};

still forum
#

DUDE

tough abyss
#

It's not that causing it

still forum
#

RLY?`

#

Why?

#

What if it is?

#

You just learned that the configClasses code needs to return a bool

#

you don't return a bool. But you are still ABSOLUTLY sure that it's not the issue.

#

You know you are doing something wrong.. But doing something wrong can't be what causes the errors right?

#

sure not

tough abyss
#

Runs.

still forum
#

DUDE

tough abyss
#

I can give it a bool and see what happens.

still forum
#

Are you stupid?!

little eagle
#

This is a mess. Sometimes it's best to just start over.

tough abyss
#

@still forum fix not mine

#

the big select { }

still forum
#

You have an error. You know what's wrong.. But you ignore it and search the problem elsewhere? wtf?

halcyon crypt
#

"isText (_x >> 'Item')" configClasses _this

tough abyss
#

isText returns a bool?

halcyon crypt
#

I guess

still forum
#

@halcyon crypt I told him that about 2 hours ago already

little eagle
halcyon crypt
#

well that's the entire point of the is in the command ^^

#

isX always returns a bool unless someone was being a major idiot

still forum
#

@tough abyss "is this a cookie?" "15!"
?
Just imagine if it would not be a bool. You'd just be like "wtf? that's dumb"

#

If you ask if something IS something.. You get a yes/no back

tough abyss
#

The documentation about anything on the wiki is vague.

#

Someone said isText returns a bool.

halcyon crypt
#

what?! Return Value: Boolean

tough abyss
#

So I thought that wasn't a problem.

still forum
halcyon crypt
#

lol

still forum
#

And I already told you 2 hours ago that that part of code is wrong and how it would be correct

little eagle
#

isText BOOLEAN
getText STRING

#

btw, this command should've been named getString

#

TEXT != STRING

dusk sage
#

isText MAYBE

still forum
#

true. But non-programmers would be confused what a string is ^^ I guess. Text is clearly text though

tough abyss
#

I am aware of what a string is...

#

I am aware of what a boolean is.

little eagle
#

getText [config, default, ignoreInheritance]
^ When do we get this?

tough abyss
#

There is 0 documentation on how to traverse the configFile structure.

still forum
#

@little eagle #Intercept?

tough abyss
#

ffs stop self-prompting.

halcyon crypt
#

just iterate over the configs

#

or whatever

little eagle
#

What doc do you need? configClasses reports an array of all non-inherited config classes of a main config class.

tough abyss
#

configClasses doesn't return a list in the sense it comes in

#

it's delimited by /

still forum
#

/ and >> are the same thing

tough abyss
#

[config / config ] or whatever.

still forum
#

and that's incorrect.

little eagle
#

config/config is just how a CONFIG is visually represented.

tough abyss
#

Normal SQF list -->

array = [item1,item2];
#

configList = [config / \ config /\ etc

#

];

still forum
#

configClasses returns an array of CONFIG.
CONFIG's are no string.

dusk sage
#

lol

little eagle
#

configClasses // [config1, config2]

#

It's exactly how every other array works.

still forum
#

So if you convert them into strings you ofcause get a string representation of that. Which is not the same

tough abyss
#

Heh.

#

Need my glasses.

still forum
#

It's the same as when you stringify objects

tough abyss
#

Yeah yeah I know.

#

Probably tired to go with it.

#

isText I can see your point now.

#

Codes still a mess.

#

I don't like it.

little eagle
#

Start over.

still forum
#

But still you insist on editing it instead of starting over like you were told to over 2 hours ago

little eagle
#

Ctrl + A, backspace

tough abyss
#

How can I tell if a config is of a specific weapon type

#

without feeding it to BIS_fnc_itemType ?

still forum
#

manually doing what BIS_fnc_itemType does

little eagle
#

BIS_fnc_itemType is good though.

tough abyss
#

Okay thats part of the new specification.

little eagle
#

That's what the editor uses, so it's official and covers all the edge cases.

tough abyss
#
private _virtualCargo = [];
private _virtualWeapons = [];
private _virtualMagazines = [];
private _virtualItems = [];
private _virtualBackpacks = [];
#

or ```SQF
private [array];

still forum
#

first one

tough abyss
#

Reason?

#

Is it faster now?

still forum
#

compiletime vs runtime

little eagle
#

It's prettier and it's easier to handle. the keyword that is.

still forum
#

so yeah.. performance difference at runtime is infinite%

#

using private keyword is infinite% faster than private ARRAY

#

Is that even correct?

#

Isn't that just 100% ?

dusk sage
#

No, you're saying it's not possible to measure

still forum
#

so 100% faster would be the right thing to say then?

little eagle
#

If A takes 1 and B takes 0, then B is infinitely times faster than A and you save 100% of A's time.

still forum
#

okey.. "infinite times faster" sounds better. That was what I wanted to go for

#

That sounds like "WOAH! I will use that everywhere then!"
Need to find something like that for params

little eagle
#

I guess the only negative about the keyword has having to write it down more than once. But it makes the code easier to read, because you immediately see where the variables are first declared, especially with a proper syntax highlighting tool.

dusk sage
#

Hi there sir, my code is infinitely faster than yours, goodday

little eagle
#

And scopes are the biggest headache of SQF imo. This helps a lot.

timber ridge
#

guys, are there any good practices articles on SQF? a friend asked, wanted to get into A3 scripting a bit. been working with langs like Ruby (RoR and shit) and Erlang. thx, fellas.

icy raft
#

There are a few of them

timber ridge
#

i got him prepared for the clusterfuck of SQF already, no worries.

icy raft
#

But not an official coding standard

#

You could try going with the ACE coding standard

tough abyss
#

What is the difference between select and forEach ?

#

If there is one?

icy raft
#

@tough abyss Very different

timber ridge
#

@icy raft you mean by just skimming through their code and noticing the patterns??

#

do they have any articles published on their code structure and the reasons behind it for a large project?

icy raft
#

But it's relative, I myself have a few issues with some details of it, so it's more of personal preference

timber ridge
#

whoa, that's a nice one, thx. it'd be great if this channel supported attachments for stuff like that...

still forum
#

@tough abyss read wiki. Two different functions doing two different things. In your case you really only need forEach.. Or count (For that one see code performance guide on wiki)

little eagle
#

What is the difference between select and forEach ?

  • one is CODE command ARRAY, the other is ARRAY command CODE
  • one expects a boolean return value, the other doesn't
  • one reports an array, the other the last return value of the code block
  • one has _forEachIndex, the other doesn't

That's all I can think of.

tough abyss
#

so select is hacky version of forEach really?

dusk sage
#

No

slender halo
#

count is hacky version of foreach

dusk sage
#

They serve different purposes

little eagle
#

They're not really that different. They're pretty similar and related in my opinion. Their usage is different though.

cedar kindle
#

select is a way to filter an array and return a new array with the results that passed

dusk sage
#

Or to select an element

timber ridge
#

@tough abyss if you ever touched Javascript, imagine select being like Array.proto.filter or Array.proto.find in JS.

dusk sage
#

πŸ‘Ί

timber ridge
#

that's the way I understand it.

cedar kindle
#

select an element > filter out the rest when we’re talking about the CODE variant

dusk sage
#

Or, its original usage, array[x]

little eagle
#

Well, select NUMBER/BOOL is a totally different command from select CODE

cedar kindle
#

that’s array select number not code

dusk sage
#

He asked What is the difference between select and forEach ?

little eagle
#

They just share a name.

#

True, select CODE assumed. The others are really different.

tough abyss
#
    ( "getNumber( _x >> 'scope' ) isEqualTo 2" configClasses _x) select {
    false;
};

} forEach [
    ( configFile >> "CfgWeapons" ),
    ( configFile >> "CfgMagazines" ),
    ( configFile >> "CfgVehicles" ),
    ( configFile >> "CfgGlasses" )
];
little eagle
#

That's pointless.

still forum
#

That code is useless

cedar kindle
#

πŸ€”

tough abyss
#

Thats your code @still forum

#

....

still forum
#

no it's not

dusk sage
#

select false πŸ™ƒ

tough abyss
#

facepalm

#

It is..

still forum
#

Where did I post that?

cedar kindle
#

select {false} will always return an empty array

tough abyss
#

Yours

#

"Fixed"

still forum
#

wtf?

#

That's completly different code

little eagle
#

Have you started over already?

still forum
#

no he hasn't

tough abyss
still forum
#

I just... wtf?

tough abyss
#
 ( "getNumber( _x >> 'scope' ) isEqualTo 2" configClasses _x) select {
#

Thats a piece of your code.

#

"fixed"

still forum
#

yes

tough abyss
#

Thats what I said..

dusk sage
#

He said config classes needs to return a bool, not the select

timber ridge
#

guys, can you take this to a more personal level than here?? maybe PMs?

dusk sage
#

Which you seem to have added

tough abyss
#

no select with an expression has to return a bool.

little eagle
#

I don't even know what this code is trying to do anymore.

tough abyss
#

or nil

still forum
#

You put one line of my code into your otherwise completly different code.. And said it was my code?

timber ridge
#

this entire chat is now flooded over some stupid discussions about 50 lines of code....

dusk sage
#

no select with an expression has to return a bool.
Naturally, but that was not what he said

little eagle
#

No, keep it here

still forum
#

Look at my code again @tough abyss

dusk sage
#

You just learned that the configClasses code needs to return a bool

still forum
#

I literally just moved the code from the string on configClasses into the CODE of select

timber ridge
queen cargo
#

Popcorn time and I cannot sit straight for an hour

little eagle
#

This IS the debates channel.

timber ridge
#

lol ^^

queen cargo
#

@timber ridge #PopcornTime would be the name

tough abyss
#

Why can't I just get a straight answer.

still forum
#

And fixed the other error that you didn't want to fix although being told to several times

cedar kindle
#

there’s really no better way to explain ARRAY select CODE. the code part has to return true or false. the elements where it returns true will be in the result, the rest will not

cunning nebula
#

ego select {false};
this makes communication much easier πŸ˜ƒ

still forum
#

You have to ask a question to get a answer

little eagle
#

Why can't I just get a straight answer.
What question?!

dusk sage
#

@timber ridge Read the channel description, it says, 'don't chat about script'

little eagle
#

The description of this channel uses == true. It can be discarded.

queen cargo
#

πŸ˜‚ πŸ˜‚ πŸ˜‚

dusk sage
#

Exactly 'don't chat about script' πŸ™ƒ

tough abyss
#

I post his code back to him, ugh... all I said was how select behaved in comparison to forEach thats it. Then @still forum just has to argue about whats true or false. ffs.

timber ridge
#

what @tough abyss is trying to say, is, in short, "fuk ur code, i'm doing it my way"

queen cargo
#

Actually it would be a script error so this channel is error by default

still forum
#

@tough abyss You posted a pointless piece of code that contained one line of my code.
That's not the same as posting my code

little eagle
#

Only macros can save us
#define true 1

queen cargo
#

#define true 0

#

Where is your God now

little eagle
#

#define true (random 2 > 1)

cunning nebula
#

😰 you killed true !

still forum
#

#define 0 1

dusk sage
#

#include <stdbool.h>

tough abyss
#

@still forum I get the feeling you don't work in Software Development. No offense.

still forum
#

ok

cunning nebula
#

ew

little eagle
#

That's a compliment?!

cunning nebula
#

how is taht even related ?

queen cargo
#

@cunning nebula it is called popcorn timr

dusk sage
#

He can't work in software development obviously, he's ded, dead people can't work

tough abyss
#

SDLC. Thats all I have to say.

still forum
#

@tough abyss Now.. If you have a question. Ask it.
Stop ignoring answers.
If you want help with your code. Stop ignoring advice and instructions on how to fix it

queen cargo
#

Accept the rules and wait for auto-summoning

timber ridge
#

#admin kick @tough abyss

#

oops, did not work

cunning nebula
#

#vote admin Inlesco

dusk sage
#

Careful, we'll start talking about how everyone who smokes weed is a degenerate

still forum
#

I heard weed is healthy

timber ridge
#

Donald would not agree

little eagle
#

Duck?

cunning nebula
#

^this

timber ridge
#

Duck aka US pres