#arma3_scripting

1 messages Β· Page 371 of 1

astral tendon
#

what kinda of script can read that?

little eagle
#

What you posted? Doesn't look like SQF or config, so nothing in Arma.

astral tendon
#

ok, thanks.

rancid ruin
#

surely you could write a reader for pretty much any text file in arma considering we have ways to manipulate strings

#

it would be painful cos it's sqf, but it's possible

rotund cypress
#

you would have to read it with an extension however @rancid ruin

rancid ruin
#

why? i've parsed .txt files myself from mission dir with no addons

#
_names_first_contents = loadFile "\functions\character\names_first.txt" splitString toString [13,10] joinString "";
_names_first = _names_first_contents splitString ",";

for a names_first.txt file like

John,
Bob,
Dave,
Steve,
....
#

i can't remember what the splitstring and tostring is doing exactly but i remember it definitely worked

indigo snow
#

its removing linebreaks

rancid ruin
#

past me, why didn't you just split it by linebreaks instead of by commas?

#

so the first line is creating a string like this then?

John,Bob,Dave,Steve
rotund cypress
#

Ah, loadFile, didn't think of that πŸ˜‰

astral tendon
#

im trying to find a decent reason why AI squads are not holding at theit dan hold way point instead of move around

#

but that seens to be just arma being arma

rotund cypress
#

AI

#

Β―_(ツ)_/Β―

subtle ore
#

@astral tendon did you try dangling steak in front of them?

astral tendon
#

I did with disableAI "MOVE" but afther it got turned on again they said "fuck it" to my way point and start to hang around in the vilage intead off move to the waypoint.

#

seens like unit capture is my only friend.

#

bugy as hell for cars but at least they work to some level.

coarse silo
#

Hello! I was wondering what is probably the best altis life framework that is out currently that supports most scripts and such ?

subtle ore
astral tendon
#

I already tryed as many combinations i could with it, yet they still unrelible.

subtle ore
#

what I am trying to get at here

#

is that you should not be using disableAI

#

nor triggers

astral tendon
#

im not even using triggers in this one.

subtle ore
#

don't use disableAI then

astral tendon
#

just the units init and waypoints

#

so what i am going to do with out it if they cant hold and still on their hold marker?

subtle ore
#

literally just move them to the point

#

they aren't going to move without more intructions

astral tendon
#

and then actually move to their move marker with out going around the map?

subtle ore
#

🀦

#

what the hell are you even using to make them do that?

#

I mean seriously

astral tendon
#

squad hold into a coupound
explosion
trigger activated
hold waypoint skiped
move to the next marker were players destroy their ammo cache and thy to go afther they

subtle ore
#

So you are using triggers

#

caught you red handed

astral tendon
#

what happens:

squad dont hold, walk around the map
explsoion
trigger activated
squad does not give a single dan wabout their waypoint

subtle ore
#

Code please

astral tendon
#

same happens with veicle

subtle ore
#

code

astral tendon
#

there is literay none

subtle ore
#

Why.

astral tendon
#

this is a exemple of a pure starting mission making

subtle ore
#

No, that's learning how to use drag and drop functionalities

astral tendon
#

what i did to try to fix that:

disableAI "MOVE" + the hold maker (they actually hold and still)
explosion
trigger activated
enable AI "move"
they move akwardly to the waypoint or some times it just dont do it at all

#

i dont know how the trigger did broken everyting even the hold mark.

warm gorge
#

Whats a good object I can use for an anchor point for a player that wont interfere with cursorObject/cursorTarget or impact on performance if there was a lot of them?

subtle ore
#

@warm gorge memory point on the player/

#

?

astral tendon
#

and for the vehicle, i just decide to give up and use the unit capture and record my self driving to the goddamn palce

warm gorge
#

@subtle ore Nah just to create temporarily and attach a player to it. Its for a tazer script so they cant move. I know some people use helipads etc for this sorta thing but was wondering if there was some special one like a helper object or something

astral tendon
#

and how about make they actually move to the giving waypoint?

#

just a simple move marker

amber palm
#

I need help setting up ACE mod on a Altis Life 5.0 server

still forum
#

@amber palm You should ask on Altis Life Forum or some ACE specific site. Also I fail to see the link to #arma3_scripting

thick sage
#

Hi everyone. I am strugling to find a webpage that describes the steps to convert assets into a mod. Coul anyone point me to a direction?

rancid ruin
#

what kind of asset?

thick sage
#

sqf scripts.

#

(simplest case I suppose)

rancid ruin
#

it's quite simple

#

config.cpp which looks something like this

class CfgPatches {
    class whatever {
        init = "call compile preprocessFileLineNumbers '\folder\script.sqf'";
    };
};

wrapped up in a folder called "folder" with script.sqf in it

#

then pack that folder in to a .pbo and it'll run your script

thick sage
#

and will that show neatly on the launcher? is it ready for steam workshop, is it signed?

rancid ruin
#

yes, i guess, no

thick sage
#

e.g. where would I write the cfgFunctions?

rancid ruin
#

you can just stick it in the config.cpp, same as anything else i think

thick sage
#

ok. Thanks.

rancid ruin
#

best to rip apart other peoples' mods and see how they managed to do things, i think that's how most people learned

#

that's how i figured out certain things anyway, there's not many good guides for arma modding

fallow radish
#

hey chaps πŸ˜„

#

anyone here can recommend a good weather script?

#

a dark feel with plenty of fog

#

for a WW2 mission I am working on

robust hollow
#
setDate [2035,1,1,0,0];
0 setfog 1;

dark and foggy πŸ‘

fallow radish
#

cheers

flint kraken
#

Anyone know how to create Safe Zones in Exile mod? if so can you pm me how!

simple solstice
#

@flint kraken ask that question in the exile discord

earnest ore
#

Why is:

_fnGetClass = {
    _finalArr = [];
    { _finalArr pushBack (_x select 0) } forEach _this;
    _finalArr;
};

_arr = getArray (missionConfigFile >> "CfgArsenal" >> "Weapons" >> "list");
[missionNamespace, _arr call _fnGetClass, false, false] call BIS_fnc_addVirtualWeaponCargo;

Giving me a generic error expression at (_x #select 0) at briefing, and yet the same code works in the debug console.

still forum
#

@Golias#2739 and will that show neatly on the launcher? is it ready for steam workshop, is it signed?
It's signed if you sign it. It is ready for steam workshop. It will should show neatly on the launcher after you have it in workshop.

#

@earnest ore There is no "generic error in expression" unless one special case

#

Check what the real error is

indigo snow
#

If _this is nil

#

That fnc can just be replaced by an apply, tho

#

_arr apply {_x select 0};

earnest ore
#

/headdesk

#

I didn't save the config with the right structure.

astral tendon
#
    _this spawn { 
        params ["_injured","_healer"]; 
         
        _startDamage = damage _injured; 
        if (_startDamage > 0) then { 
            waitUntil {damage _injured != _startDamage}; 
            if (damage _injured < 0.2) then {_injured enableAI "move" 
            }; 
        }; 
    }; 
}];````
#

in MP this does not work, the AI does not move

#

in SP it works, what is wrong?

little oxide
#

I think, you need to execute enableAI where AI are local in multiplayer

#

if you don't have HC, this will be on the server

#

@astral tendon

#

And saw in the wiki, the eventhandler need to be added where unit is local

#

so same as before

astral tendon
#

how i do that?

little oxide
#

use remoteExec command

#

Don't forget to check, in the wiki, if the command are local or global when using it in multiplayer

subtle ore
#

Don't bother

#

Posted twic

#

Answered twice

astral tendon
#

i will try that.

subtle ore
#

You were already told about this last time πŸ™„

astral tendon
#

Because some event handlers work with out it

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

like this

little oxide
#

You need to add the eventhandler HandleHeal only in the server

#

so don't put anything inside the init, or use a condition with isServer command

#

because if i give you a solution, all player we tell the server, to move the IA

subtle ore
#

Β Triggers only on PC where EH is added and unit isΒ local

little oxide
#

Yeah, and if you don't have HC, the IA are local in the server

subtle ore
#

No they are not local to the server. They would be local to the HC

#

Roque obviously doesn't have an HC running

little oxide
#

Yeah like i said, if you don't have HC, this will be local to the server

#

so use isserver command

#

and add only to the server

subtle ore
#

No

#

Just because you add it to the server

#

Doesn't mean that it'll be executed locally to the AI

little oxide
#

yeah so i used remoteexeccall inside

#

BB

#

already done it

subtle ore
#

jesus christ

#

You're making this way too difficult for yourselt

little oxide
#

yes

subtle ore
#

To be fair Nii. I do read the wiki before talking πŸ’© by the way πŸ˜‰

#

*BIKI

little oxide
#

Yes

subtle ore
#

Yes?

#

Uh huh. Right.

little oxide
#

Idk what are you talking, you said, if he doesn't have HC, so the IA will be local to the server, and two lines after, you said, the unit will not be local to the server Uh

subtle ore
#

No, i said in both conditions

#

That ai will not be local to the server

#

Ubless

#

The creation takes place local to the server machine

little oxide
#

Yes and

subtle ore
#

Which in case. Still wouldn't allow you to be one and done

#

The eh needs to be added locally to each ai unit

#

Because why would you just be one and done if you needed to add functionality to each differently?

#

Mission event handlers can be used to trigger eh through mission namespace

#

Which don't require either a target or local target

little oxide
#

yes, so just use remoteexeccall and it's completed

#

like i send him, in private

subtle ore
#

Wow, you're so cool

#

Do you keep your machine under lock and key at night?

#

Wear a little tinfoil hat?

little oxide
#

m here to help people, if you're the right one to rot the life of this channel, I invite you to leave it, and never come back, I'm not even attacking you, just try to help this someone who asked for help, if you're so strong that you say it, why are you still here?

subtle ore
#

Ouch. That hurt, I think you hurt my tiny little heart.

sand pivot
#

i realize this was discussed briefly several months ago but does anyone know what enableTraffic does?

little oxide
#

i think it's working only in TOH

sand pivot
#

sorry, TOH?

little oxide
#

Take On Helicopters

subtle ore
#

Ported from TKOH, doubt it was ported for full functionality

sand pivot
#

roger

subtle ore
#

Much like the DB functions from TKO&

#

Seems like there are quite a few

#

But all of the wiki commands are exported from the base game

#

So theu may be there, just that they may not work

sand pivot
#

bummer, i was a little excited for a second there that there was work going on for a good patterns of AI life

subtle ore
#

It's very possible to do in arma 3

#

You just may have to muscle it a little more than you would in TKOH

sand pivot
#

you may have misunderstood, what you heard was, "i want a hacky scripted AI paterns of life that kinda works" what i said was "i want a good patterns of life" that being said, my standards are a bit unreasonably high in that i want R* quality. (ref: all your bacon and eggs)

subtle ore
#

iirc hearts and minds did something very similar for handling bridge patrol over tanoa bridges. Traffic as well. Civies would either pass the car in front of them or drive behind them.

#

Well come on nos

#

You could probably script something better than whatever mockup they had in TKOH

#

A hacky ai script is only a hacky ai script if you make it so

sand pivot
#

true

#

again, my standards may be "unreasonably high" in what i expect for AI out of the box.

#

i hope you sensed my joking tone

subtle ore
#

Arma ai are certainly more configurable than any other game ive seen

#

I did sense your joking tone

#

I just chose to reply with something a little more serious, as i think people take arma ai as granted. cough quiksilver cough

sand pivot
#

are there any solid ambient life mods you would recommend?

sour saffron
#

TPW does some ambient modules

cunning nebula
#

spawn a lot of cars with civilians lying under them playing that mechanic animation and pretend all their cars broke down at the same time

#

credible simulation achieved

tame portal
#

pop noice

thick sage
#

guys, on a mod, where do I add the cfgFunctions?

#

on the addon's config.hpp, next to the CfgPatches?

astral tendon
#

do you guys know how to give respawn tickets to units?

fringe gull
#

say I have added a trigger in EDEN editor which is represented in the mission.sqf like so:

class Item1
{
position[]={1100,-30,8060};
interruptable=1;
age="UNKNOWN";
expCond="isServer || !isServer";
expActiv="onMapSingleClick ""(Driver(vehicle Player1)) DoMove _pos; Player2 sideRadio ''"";";
class Effects
{
};
};

Do you guys know if there is a way to create a trigger via script in my init.sqf without having to manually do :

_trg = createTrigger ["EmptyDetector", getPos player];
_trg setTriggerArea [5, 5, 0, false];
_trg setTriggerActivation ["CIV", "PRESENT", true];
_trg setTriggerStatements ["this", "hint 'Civilian near player'", "hint 'no civilian near'"];

#

Something like:

_myTrigger = {
position[]={1100,-30,8060};
interruptable=1;
age="UNKNOWN";
expCond="isServer || !isServer";
expActiv="onMapSingleClick ""(Driver(vehicle Player1)) DoMove _pos; Player2 sideRadio ''"";";
class Effects
{
};
};

_trg = createTrigger ["EmptyDetector", getPos player, true, _myTrigger];

indigo snow
#

no, you need to use the commands

fringe gull
#

Ok, thanks!

earnest ore
#

There is no way to change the side of an object like an ammo crate or empty vehicle from CIV to something else, is there?

thick sage
cunning nebula
#

no

#

fn_ is correct

simple solstice
#

config.cpp

#

@thick sage

#

never seen config.hpp :D

thick sage
#

thanks Tajin. It is unfortunate because ACE does not use those. Katekarin, thanks, it was a typo indeed

#

another question. If I have the class CfgFunctions on the config.cpp for an addon named foo with a script fn_bar.sqf on it, what path should I add to class func {file = "...";}? class func {file = "foo\fn_bar.sqf";}?

obsidian bane
#

Hey guys, I'm looking at this line of code to return all compatible optics getArray(configfile >> "CfgWeapons" >> _x >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems"); but after looping through the array it seems to be empty, not quite sure where to go with it. Also, does getArray return an array of strings or do classes get returned as their own special type?

astral tendon
#

i have this on my mission init

#
  player enableFatigue false; 
  player addEventhandler ["Respawn", {player enableFatigue false}]; 
};```
#

but when a JIP player connects to the server he still got the fatigue

obsidian bane
#

use initPlayerLocal.sqf or onPlayerRespawn.sqf maybe?

tough abyss
#

i wonder when player will ever be nonlocal πŸ€”

obsidian bane
#

dedicated server or headless client

little eagle
#

@obsidian bane Just use BIS_fnc_compatibleItems/CBA_fnc_compatibleItems.

obsidian bane
#

nice, didn't know there was a function for that. Thanks.

little eagle
#

Damn, still getting used to this keyboard.

tough abyss
#

uhm i got mentioned here but i see nothing

jade abyss
#

Commy's fault

little eagle
#

Sorry.

jade abyss
#

=}

tough abyss
#

^^

jade abyss
#

I play that game pretty often with someone special πŸ˜„

little eagle
#

I sometimes get the red 1 and then can find nothing. I'll blame you from now on.

jade abyss
#

Okay.

rancid ruin
#

@little eagle what keyboard did you get?

little eagle
#

lol, just using a different old one.

rancid ruin
#

does it have mx blue switches?

little eagle
#

Idk, probably not. I'm not a geek. I just want to type my rants.

rancid ruin
#

pretty sure you are a geek

#

if you're typing more than a few paragraphs of anything, code or text, you'd do well to get a mechanical keyboard ⌨

little eagle
#

OK

obsidian bane
#

@little eagle works like a charm, thanks man

fringe gull
#

Does anyone know if using this: 'trigger setTriggerStatements [condition, activation, deactivation]' would be the same as using this: 'trigger setTriggerActivation [by, type, repeating]' ??

#

or can this 2 be used together

little eagle
#

Uhm, you can use one after the other?

fringe gull
#

Ok, thanks... sorry Im very new at this arma scripting xD

cedar kindle
#

they're separate things

fringe gull
#

would you say that this:
_trigger setTriggerActivation ["ANYPLAYER", "NOT PRESENT", true];

could be activated by anyplayer, at any place in the map, repeatedly?

#

(if the conditions are true)

cedar kindle
#

no it only applies to the trigger

little eagle
#

Statements are separated by semi colons:

trigger setTriggerStatements [...];
trigger setTriggerActivation [...];
cedar kindle
#

when no player is in the trigger, it activates

#

so it would depend on the size of the trigger / what it covers

fringe gull
#

ok what Im trying to do is: if a player is in a vehicle add X action

#

no matter if that player is inside the trigger or outside the trigger

little eagle
#

Just add the action at mission start and make being inside the vehicle a condition of the action.

fringe gull
#

and it can happen any number of times

little eagle
#

No triggers,

fringe gull
#

and this condition of the action could be dynamic? like is not always going to be the same vehicle

#

vehicles spawn during the mission

cedar kindle
#

yes, you can have a condition of when the addAction is available

fringe gull
#

ok, let me read about that "addAction" function in the docs

little eagle
#

You can specify inside the condition which vehicle.

#

I'd say you add the action to the vehicle and not the player.

#

And then just check if the object the action is attached to is the current vehicle of the player.

#

That way you avoid having to deal with respawn changing your body disarding all old actions.

fringe gull
#

yes but, since the player can buy any number of vehicles during mission I cant attach the action to a vehicle, unless I manage to add it manually

#

like every time the vehicle spawns I add the action

little eagle
#

Is this with mods?

fringe gull
#

nope vanilla

#

(for now)

little eagle
#

Hmm, any way to execute a script every time a vehicle is created? I mean, is there something like an eventhandler in that framework?

fringe gull
#

yes, the spawn has a callback

#

or eventhandler to do things after

#

well not the spawn, I believe is the execVM

little eagle
#

By "spawn" I meant the vehicle creation. Common term in video games unrelated to the spawn command.

fringe gull
#

I was playing a mission downloaded from the workshop where the dev added functions to control de HeliPilot from the Gunner seat by adding functions like "Increase Altitude" "Turn to target" so I opened his mission to learn how he did it (im planning to credit him ofcourse) and my intention is to:

  1. Make it work as a stand alone mod for any attack helicopter
  2. Make it easy to integrate into any mission
#

in the original mission the dev added triggers, which are represented in the mission.sqm like so:
class Item233
{
position[]={1689.3507,5.5,5563.3813};
a=5;
b=5;
repeating=1;
interruptable=1;
age="UNKNOWN";
text="GunnerCMDs";
name="GunnerCMDs";
expCond="!(isnull (driver(vehicle pilot01))) && (Gunner Viper01) == player || !(isnull (driver(vehicle pilot01))) && (Gunner Viper02) == player || !(isnull (driver(vehicle pilot01))) && (Gunner Viper03) == player || !(isnull (driver(vehicle pilot01))) && (Gunner Viper04) == player";
expActiv="nul = execVM ""HGM\HGM.sqf"";";
expDesactiv="removeAllActions Player;";
class Effects
{
};
};

#

since im trying to replicate this behaviour, my intention is to dynamically create a trigger in the init.sqf file

#

thats why im doing that... the problem is that the class stated above does not have anything related to "trigger setTriggerActivation [by, type]"

#

only the repeatin is present in the class

#

since by default a trigger has a repeating set to false... i need to be able to change it, but theres no way to set it without set the "by" and the "type"

little eagle
#
["Helicopter", "init", {
    params ["_heli"];

    _heli addAction ["Test Action", {
        systemChat str _this;
    }, nil, 2, false, true, "", "cameraOn == _this"];
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
#

This is what I'd do, but it requires mods.

fringe gull
#

hmmm ok Imma test what I have so far, if not I will consider your solution

#

thanks for your support

thick sage
#

I have been using it extensively in production, and thought it can be helpful to others.

queen cargo
#

@thick sage how you get access to the file system of Arma without an extension?

thick sage
#

there is no access. Why would you need that?

queen cargo
#

What is the purpose then? Oo

#

Though it was to iterate over files

#

Ohh... I see...

#

Should get some sleep finally... Second time I missread something

thick sage
#

πŸ˜ƒ

queen cargo
#

Tipp for ya Btw. Using locations is more performant (as long as one does not needs garbage collection)
Also you got a perfect example for what one should use try catch throw commands (errors)

little eagle
#

What's wrong with locations and garbage collection?

#

Also you got a perfect example for what one should use try catch throw commands (errors)
lol

queen cargo
#

They do not get auto deleted on scope exit @little eagle
You have to manually delete them

little eagle
#

How is that different from OBJECTs?

queen cargo
#

And yes, APIs are where that set of objects is supposed get useful

#

It is not
It also is just an assumption that the whole dictionary is working with arrays instead of locations

little eagle
#

I saw setVariable in there, so I assume it's pseudo namespaces.

thick sage
#

it uses vehicles as CBA. The main use case is to easily serialize nested dictionaries

austere granite
#

@thick sage lel, i just wrote the same thing basically

#

done with it, check here... hey someone just wrote that

astral tendon
#

is there a way to keep AI doing supresive fire?

#

commandSuppressiveFire and doSuppressiveFire works but they dont keep shooting

subtle ore
icy raft
#

Hello again!

So... I found the neat object "UserTexture1m_F". Is there a way to make the texture at 0 emissive or unshaded? :D
(I mean, when using object setModelTexture [0, "path\to\texture"])

zenith totem
#

Try it using an emmsive material

thick sage
#

@austere granite, what? Either you did not understand what I coded, or I did not understand what you wrote. Because I am pretty sure this does not exist.

thick sage
#

The closer we have would be iniDB, which supports writing to file (which Dictionary does not), but unfortunately

  1. does not support saving natively into Arma (profileNamespace) and

  2. does not support nesting (i.e. not possible to save a OBJECT type with native types).

  3. means that you must use a filesystem, 2. means that you still need to define your own hierarchical "schema" when saving the database in iniDB, e.g. through a custom convention of naming keys that will invariable limit the depth that you can go.

Dictionary completely abstracts you from this problem. You define an object of data (which contain other objects), and it just serializes the object to a string. To give you an idea, in the mission I am working on there a single global variable, AS_persistents (with a maximum depth of 5 or 6 atm), that contain all the data I want to save persistently (with nesting). To save it,

private _data = AS_persistents call DICT_fnc_serialize;
profileNamespace setVariable ["MY_MISSION", _data];

to load it

private _data = profileNamespace getVariable "MY_MISSION";
AS_persistents = _data call DICT_fnc_deserialize;
meager granite
#

Wasn't there a command to shuffle array added some time ago or I am dreaming?

tough abyss
#

thanks πŸ˜›

meager granite
#

I had an impression some command was added, I guess I was dreaming

still forum
#

Also thought we had something like that.. But I guess not...

tough abyss
#

had a dns issue with the wiki for some reason πŸ€”

still forum
#

maybe you're thinking about selectRandom?

meager granite
#

Or I was thinking about sort

little eagle
#

deleteAt made shuffling easier.

peak plover
#

Are bis functions ever updated with new commands?

still forum
#

some of them. yes

#

for example BIS_fnc_selectRandom and params(I think) and fnc_MP

peak plover
#

Hmm, nice

little eagle
#

KK rewrote them all at one point.

peak plover
#

😍

still forum
#

wut?

little eagle
#

Except stuff like the arsenal, where all hope is lost.

still forum
#

Why are so many functions still such a heap of garbage then?

#

πŸ˜„

little eagle
#

Why are so many functions still such a heap of garbage then?
Example?

peak plover
#

New tasks are quite unreadable as well

little eagle
#

Task Framework came with A3, didn't it?

peak plover
#

Yeah, the functions are confusing

little eagle
#

Personally I think the SQF commands are easier to use, but I guess the point is that you don't have to worry about locality when using the functions.

meager granite
#

I need an array of numbers from 0 to X in random order, I wonder if this can be done better:

_to = 10;
_array = [];
_result = [];
for "_i" from 0 to _to do {_array pushBack _i};
for "_i" from 0 to _to do {
    _random = selectRandom _array;
    _result pushBack _random;
    _array deleteAt _random;
};
_result;
#

Not that performance difference would matter, just curious if this can be improved

little eagle
#

The deleteAt already reports the deleted element , so you can put the pushBack, deleteAt and selectRandom all in one line.

meager granite
#

Good call

little eagle
meager granite
#
_to = 10;
_array = [];
_result = [];
for "_i" from 0 to _to do {_array pushBack _i};
for "_i" from _to to 0 step -1 do {
    _result pushBack (_array deleteAt floor random _i);
};
_result;
#

Well I guess it can't get any better than that

little eagle
#

to 1, I think. Both random floor 1 and random floor 0 always report 0, so you do that element twice.

meager granite
#

Hmm

little eagle
#

deleteAt 0 would report nil for the [] empty array.

#

pushBack nil fails silently.

#

So there is no practical difference, but one iteration is useless.

meager granite
#

for "_i" from (_to + 1) to 1 step -1 do {

#

That's how it should be then

#

or ceil random

#

so no additional + is done

little eagle
#

Yes, _to + 1 is the size of your array, since it has 11 elements.

meager granite
#
_to = 10;
_array = [];
_result = [];
for "_i" from 0 to _to do {_array pushBack _i};
for "_i" from _to to 0 step -1 do {
    _result pushBack (_array deleteAt ceil random _i);
};
_result;
little eagle
#

ceil random is bad, because there is a one in ten million chance it reports out of bounds

#

ceil random 5
could be
0
every other full moon

meager granite
#

Something to do with floats?

little eagle
#

random 5 can report 0

#

and ceil 0 is 0

#

random _x is [0, _x)

meager granite
#

Hm, good point

#

Yeah, I figured

#

(I seem to have brain malfunction today as I somehow managed to type "going" instead of "good" and noticed just now πŸ€” πŸ”« )

little eagle
#

Muscle memory.

tough abyss
#

i'm a bit confused right now, a fired EH triggers on all clients or only the one it was assigned to?

#

to extend my confusion, what about cfgWeapon based EHs?

little eagle
#

fired is AG, EL. It will trigger for remote units, but only on the machine that added the eventhandler. It's the same for config fired, but I never used the CfgWeapons version. I assume it's the same, but you never know...

#

Config should be the same everywhere, so the question is if it triggers for machines that not own the object that fired the weapon. For fired it does (AG), but the question remains if the CfgWeapons version is also AG. I assume it is until proven otherwise.

tough abyss
#

my confusion still stands πŸ˜„

#

AG means arguments global i know

#

EL execution local

little eagle
#

Yep, that sums it up.

tough abyss
#

i still can't grasp if its executed on nonlocal units or other clients

#

i'm a bit slow today πŸ˜›

little eagle
#

nonlocal units
Yes, because AG

#

other clients
No, EL

#

Of course EL just means that you have to use the addEventHandler on every machine to have the event code be executed on every machine.

tough abyss
#

ok, so i need to test how the config version actually behaves

#

thanks! rest should be clear by now

little eagle
#

The CfgWeapons one, yes. Because I can guarantee that the CfgVehicles one is AG, EL too.

#

Well, config and EL is hard to tell, but for simplicity it is.

tough abyss
#

but what means EL in that context πŸ˜›

little eagle
#

In context of config?

tough abyss
#

yea

#

only "assigned" where the vehicle or unit is local?

little eagle
#

That you have to own the mod and that config entry for the config entry to be executed.

#

only "assigned" where the vehicle or unit is local?
No, it would be assigned to all objects even remote ones on the machine that has the config entry.

#

You're confusing A and E again.

#

E in this case is on which machines the code will be executed in case the event triggers. That's always the local one for events and always every one for MPEvents (please don't use them)
A is the object the event is attached to. AL means it only fires for local objects (killed), while AG means it fires for remote objects as well (fired).

tough abyss
#

What's so bad about MP Events?

little eagle
#

Nothing really. MPRespawn is good aside from the bugs.

tough abyss
#

🀦 thanks πŸ˜„

little eagle
#

Dunno if they ever fixed them.

tough abyss
#

now i get it πŸ˜›

little eagle
#

A is concerned about the object the event is attached to, while E is concerned about the machine which execute the code block. I guess that is how you can think about it.

tough abyss
#

"...is good aside from the bugs" is a good way to describe Arma in general πŸ˜„

little eagle
#

MPRespawn is/was weird.

#

Rather people would KISS and use respawn eventhandler with remoteExec than MPRespawn. At least with the former you know it works.

#

OR

#

Make Respawn AG in A4.

#

Triggered when a unit, it is assigned to, respawns. This EH does not work as one would expect MP EH should work like. It is only triggered on one machine where the unit it was assigned to is local. The only difference between Respawn and MPRespawn is that MPRespawn can be assigned from anywhere while Respawn requires the unit to be local. This EH must be used in conjunction with the addMPEventHandler command.

#

Yeah, MPRespawn is fucked

little eagle
#

Why not entityKilled though?

little eagle
#

You sure?

cedar kindle
#

what are the effects ?

little eagle
#

See ex3

#

But it's kinda obsolete, since you can now just delete the logic.

#
        class test_EmptyObjectForBubbles: Thing //inherits 36 parameters from bin\config.bin/CfgVehicles/Thing, sources - ["A3_Weapons_F"]
        {
            author = "Bohemia Interactive";
            mapSize = 1;
            _generalMacro = "test_EmptyObjectForBubbles";
            scope = 1;
            animated = 0;
            side = 4;
            faction = "None";
            editorCategory = "EdCat_TEST";
            editorSubcategory = "EdSubcat_TEST";
            vehicleClass = "Emitters";
            simulation = "thing";
            icon = "iconExplosiveAP";
            displayName = "Underwater Bubbles";
            picture = "\A3\weapons_f\ammoBoxes\data\ui\map_AmmoBox_F_CA.paa";
            model = "\A3\Weapons_F\empty.p3d";
            class EventHandlers //sources - ["A3_Weapons_F"]
            {
                init = "(_this select 0) call compile preprocessFile """"\A3\weapons_f\data\scripts\bubbles.sqf"""";";
                deleted = "{deleteVehicle _x} forEach (_this select 0 getVariable [""""effects"""",[]])";
            };
        };
#

See the newish deleted event.

little eagle
#

deleted event is nice.

#

5 more years and we have entityInit.

tough abyss
#

does someone know if its possible to play a guesture only locally but in sync with the animation queue?

#

playAction is global and *Move commands would be local but can only play fullbody animaitons afaik

warm gorge
#

Im having issues using safezones as the coordinate system for menus on my mission. For people with smaller resolutions, text becomes stretched and out of wack and sometimes impossible to read. Is there any way around this? When I used GUI_GRID, I had issues which is why I changed to safe zones but now this is causing issues

lone glade
#

use pixelGrid

warm gorge
#

Does it work well over different resolutions?

lone glade
#

it's intended for that, however there's some weird things going on with UI scaling, I'm using pixelGridNoUIScale for now

warm gorge
#

Looks like a new system, havent seen that used much yet at least. I guess ill give it a go, because safezone is just causing too many issues for me

lone glade
#

you still have to use safezones for anchoring

warm gorge
#

Oh its not in the GUI editor yet

lone glade
#

GUI editor is trash, diag branch + diag_mergeConfigFile is much faster

warm gorge
#

As in using that to do it manually?

#

Would take ages for all the menu files I have

lone glade
#

ofc, if you know what you're doing it's much faster

#

plus it's pixel precise compared to safezones

austere granite
#

[4:25 PM] alganthe: GUI editor is trash, diag branch + diag_mergeConfigFile is much faster

#

that

#

learn to write GUI configs yourself instead of GUI editor

astral tendon
#

do you guys know were i can find radio commands? like the "injued!" command? my medic does not heal injured squad mates

#

i wanna make a script so AI call medic once low on healt

subtle ore
#

commandRadio

#

sideRadio

#

CfgRadio entry in description.ext

astral tendon
#

were i find that CfgRadio?

#

wiki goes in loaps

little eagle
#

Ingame config viewer.

subtle ore
#

Or

#

Use a default one

#

Yep

#

I am going to assume you want the unit to screech something else other than just injured

astral tendon
#

that page have no list of radio commands

little eagle
#

Ingame config viewer. There's your full, complete and always up to date list.

astral tendon
#

thanks

subtle ore
#

🀦

astral tendon
#

i think actions will work better

subtle ore
#

Slowly crawls away with hands over ears

eager prawn
#

Anyone know the basic concept of retrieving a texture in Arma from the web? I assume it's possible, as I've seen servers pull Youtube videos from the web. Basic goal is that I want to assign a billboard a custom texture, but have it re-retrieve the texture every 5 or 10 minutes from a webhost, rather than storing it in the mission file, to allow for easier changes to images, rather than having to modify the actual mission pbo.

lone glade
#

not possible

#

youtube videos are using a specific control / steam interface

eager prawn
#

Really? Would it not even be possible with a mod/hook specifically made for it?

little eagle
#

htmlLoad?

lone glade
#

it's for controls tho, he want a billboard, don't think that's possible

little eagle
#

Definitely not possible with 3d object textures without editing the mission pbo / addon pbo.

#

Exception is Squad.xml, but that logic is only for the squad.xml stuff.

#

Wonder if you can abuse it somehow. Doubt it though.

tough abyss
#

Extension to download the image file onto client machines.
Don't forget about BE Whitelisting, since extension will be on client machine

little eagle
#

But then you still need file patching.

lone glade
#

or live config reloading, good luck with that

little eagle
#

Not config, but inlcuding the texture into a loaded pbo file.

austere granite
#

only possible with filepatching

#

htmlLoad with arguments for the size in pixels i want it, to get a map overlay from an online picture

#

that's about the max you can do, but there's a ton of flaws with it

sour saffron
#

Anyone know the basic concept of retrieving a texture in Arma from the web? try the clan sign application to a model i have seen that

austere granite
#

you mean squad.xml? Those pictures are cached and even then i don't think you have a whole lot of acces to it

sour saffron
#

i think they assigned it squad url to a billboard which was the server / player or a logic

#

it weas a while back and it maybe even the billboard was Man class

#

i think you can even play live video now or HTMl vids cant you to a PIP ? or is it third party dll ?

brazen sparrow
#

it was in editor tho so who knows

subtle ore
#

Applies to controls

#

But still

little eagle
#

That is PIP?

brazen sparrow
#

nope

lone glade
#

no

little eagle
#

How?

brazen sparrow
#

setobjecttexture

#
  • dll to download/resize/convert
little eagle
#

Yeah, that's not going to work outside the editor and without file patching.

austere granite
#

still wouldnt work

#

needs filepatching

subtle ore
#

The extension?

austere granite
#

tried basically all of those solutions

#

actually loading in a picture needs filepatching

subtle ore
#

Why would it need filepatching if say allowed to load by the server?

brazen sparrow
#

textures are local

austere granite
#

are we still talking about him wanting to load in a picture on a billboard?

#

if so, you need a local texture

brazen sparrow
#

u cant like stick a base64 encoded image into the set texture cmd

subtle ore
#

Where is the limitation at then?

#

Arma?

austere granite
#

and without file patching you can't load pictures outside addon/currently loaded mission

astral tendon
#

is there a variation of the setPos that acept a array of objets?

subtle ore
#

No

little eagle
#

foreach loop

astral tendon
#

im trying to use ```thislist setPos [11606.3,8057.68,0];````

subtle ore
#

Yeah but that's not a command variant commy. πŸ’

little eagle
#
{
    _x setPos ...
} forEach thisList;
#

Yeah but that's not a command variant commy. πŸ’
Put it in a macro and it essentially is.

subtle ore
#

True

#

Ewwww

#

F

#

ThisList?

little eagle
#

Trigger.

subtle ore
#

Triggers? AGAIN?

little eagle
#

Still.

#

Idk why. Some people enjoy suffering.

astral tendon
#

that works

subtle ore
#

sits on the floor cries

astral tendon
#

thanks commy2

#

jelous Midnight?

subtle ore
#

No.

#

Not at all

#

Not one bit

#

What the hell is wrong with people and their triggers.

little eagle
#

You get triggered by triggers.

astral tendon
#

what is wrong with triggers anyway?

little eagle
#

Replace trigger with anything you do regularly in SQF and then feel my suffering.

subtle ore
#

Words cannot express the migrane i am getting from this convo

little eagle
#

Aspirin, glass of water, nap.

austere granite
#

triggers make stuff complicated for absolutely no reason and they don't do anything special that you wouldn't be able to do otherwise with more control

subtle ore
#

I thought you have beer there Commy. Wtf. Plus i am on lunch break, no beer here.

little eagle
#

Beer doesn't help with headaches, does it?

austere granite
#

Sure it does

#

Embrace the korsakoff

subtle ore
#

Pretty sure aspirin and beer isn't the best

little eagle
#

In my experience drinking water helps, and beer is dehydrating. If you drink so much that you pass out, then I guess it helped.

subtle ore
#

Hah. Well water it is then, with my luck i will grow a brain tumor over this trigger bullshit

#

If you dont want to die

#

Dont use triggers

#

If you dont want to live in anguish

#

Then dont use triggers

#

Ban them all

#

Unfortunately as a mere mortal to those at BI, i cannot lift the hammer.

#

I really hope that gets fixed

#

I am really tired of manaully placing ubits

#

But. But. But. But.

#

NOTE: Currently in Arma 3 this command does nothing 😒

astral tendon
#

how do i getPosASL in the editor?

indigo snow
#

what do you mean?

astral tendon
#

i need to get the possition of someting in the editor, but needs to be in ASL

#

if i right click and log possition it does not work

indigo snow
#

open up the debug menu and put it in a watch field with the return of "log position"

astral tendon
#

just paste "log position"?

indigo snow
#

why would you think that?

astral tendon
#

nevermind.

rotund cypress
#

Cool stuff

#

Dictionaries in SQF wasn't something I thought I would see πŸ˜‰

tough abyss
#

? Bunch of implementations of it

still forum
#

just use intercept and make a std::map from gameValue to gameValue.. done in <5 minutes πŸ˜„

tough abyss
#

Honestly if you add to intercept by default, you will prob get more people using it on serverside πŸ˜‰

still forum
#

Yeah.. was planning on a plugin with such stuff. hashMaps, some math functions and such

rancid ruin
#

aren't dicts just a normal key/value data structure?

#

in which case i've seen about 6 different sqf solutions for that

tough abyss
#

Yeah there are bunch of different versions, pretty sure CBA has one aswell.
A native version via intercept would be nice.

still forum
#

The important thing with Golias' version is that you can store OBJECT's which can have sub values.
and that it's serializeable

#

Intercept could use Arma's serializer though.. which is known to be able to serialize everything and deserialize it also over network

astral tendon
#

do you guys know a perfect loap for music?

still forum
#

loap?

astral tendon
#

loop*

#

the one i had did some stange "jumping" on the sound to loop

austere granite
#

pfh

still forum
#
_hashMap = createHashMap;
_hashMap set ["stuff", _object];

_found = "stuff" find _hashMap;

These command names are not as nice as I would want them.. But I don't know how else I would call that
Repurposing existing commands instead of adding new ones looks quite good

#

set would accept [ANY, ANY]
you can PVAR hashMaps just like any other type. But controls/displays would create problems as they can't be serialized
Would take me about an 20 minutes to implement into engine if I had access.. But BI doesn't have time for such things

still forum
#

https://image.prntscr.com/image/ZYOu0a2BQzemNB4uhNcxvw.png
https://github.com/dedmen/interceptTest/blob/master/interceptTest/cba.cpp

There we go.. Only took an hour because I was playing around trying to get serialize to work. But i didn't implement the necessary backend for that yet.. So no PVAR yet.
@little eagle Can you post that image here so that people don't need to click shady link? :x

little eagle
#

Would be amazing to have this also:

#

_hashMap select "stuff"

still forum
#

but how would that be different from find? Just as alternate syntax doing the same thing?

little eagle
#

find reports a number/index, not the element.

still forum
#

hashMaps have no index

little eagle
#

True. Then name the command select and not find.

still forum
#

125 find hashMap on hashmap with 10k elements.
0.002ms in diag_codePerformance

tame portal
#

123 find map instead of map find 125?

still forum
#

I wanted to replicate the original find. That takes the array it searches in as right arg

#

No it doesn't

#

derp

little eagle
#

There are 3 things I want from sqf
hashmaps
entityCreated mission eh
addClassEventHandler

tame portal
#

entityCreated?

still forum
#

2 of these Intercept can't... Well... it could do it the CBA way.

little eagle
#

entityInit. Like entityRespawn and entityKilled

tame portal
#

I actually havent looked at entities yet, any short summary of what they are or a link?

little eagle
#

It's just a mission eventhandler version of init/killed/respawn events.

#

If I had these 3, and the ClassEventHandler one would work with dialogs, I could turn the whole of CBA into a mission script.

still forum
#

Okey I added count hashMap and hashMap select ANY the select one is just a copy of the find

little eagle
#

Good.

still forum
#

Throw some Ideas at me for other simple stuff I can implement

tough abyss
#

Is it case senstive or insenitive for the keys?

still forum
#

hashMap. so sensitive

#

It also accepts anything. case-sensitive only applies to strings

tough abyss
#

Important to dcument that. Will catch people out

austere granite
#

Throw some Ideas at me for other simple stuff I can implement'

#

increment

still forum
#

@Adanteh#0761 Not possible

austere granite
#

BUTG YOU TODL ME EEVYERHTING WA SPOSOIBIRURU

#

ree

#

+e10

still forum
#

What else do people need?
I could add createNamespace but.. That's not "simple"

austere granite
#

pseudo-namespace

still forum
#

well yeah.. I could just use the hashMap and accept it as argument to set/getVariable

little eagle
#

No need for createNamespace when you have hashMaps. But maybe with hash do.

still forum
#

That's one of the few things I can't implement

austere granite
#

why isn't increment possible? 😦

#

you were the chosen one

little eagle
#

Only arrays are passed as references. Numbers aren't.

still forum
#

I could do increment "varname"

#

But if you do increment varname
Then the increment function only get's the value inside varname. It can't actually write to varname

#

I do actually get values by reference. But...

_v1 = 5;
_v2 = _v1;

increment _v2;

would also increment _v1. And I guess you wouldn't want that

austere granite
#

maybe a command implementation of usual config return?

#

dunno if that is a thing

#
    private _value = call {
        if (isNumber _cfg) exitWith { getNumber _cfg };
        if (isText _cfg) exitWith { getText _cfg };
        if (isArray _cfg) exitWith { getArray _cfg };
        if (isClass _cfg) exitWith {
            {
                private _subset = _hashCurrent select 1;
                private _return = [_x] call _fnc_recurse;
            } forEach (configProperties [_cfg, "true", true]);
            nil
        };
        nil;
    };
still forum
#

I already have getNumber with default value

#

yeah.. could do that

little eagle
#

getNumber [config, defaultValue, ignoreInheritance]

#

Same for getArray and getText

still forum
#

ignore inheritance.. I can only do what SQF can do. Can SQF ignore Inheritance?

little eagle
#

configProperties can

austere granite
#

yes, but not directly

little eagle
#

I mean, I can turn this into a macro.

austere granite
#

yea i know

#

i like macros too

#

at moments

little eagle
#

All I'm saying is, that dedmen can therefore turn this into a function with the limitations he has.

still forum
#

Intercept would do the same as the macro. But in one command.. and thus alot faster

little eagle
#

Yep.

austere granite
#

ah okay. Anyway @still forum the vanilla config viewer shows is a config value is specified in that scope or if it's inherited by indentation

#

As an example

little eagle
#

The ignoreInheritance parameter would work the same as the ignoreInheritance parameter does in configProperties.

still forum
#

default getNumber config
or getNumber [config,default]

little eagle
#

array version, so you can add more parameters.

#

ignoreInheritance being optional and defaulting to false.

austere granite
#
params ["_input"];
if (!(_input isEqualType true)) then {
    if (_input isEqualType "") then {
        _input = call compile _input;
    } else {
        if (_input isEqualType {}) then {
            _input = call _input;
        } else {
            if (_input isEqualType 0) then {
                _input = (_input >= 1);
            };
        };
    };
};
_input

something likel this?

#

basically any input to bool

little eagle
austere granite
#

yes

little eagle
#

parseBool πŸ˜›

austere granite
#

fn_parseToBool.sqf is my name πŸ˜„

little eagle
#

Top

still forum
#

I'll add getBool just like getNumber n stuff

austere granite
#

the combined config get would be nice though. getConfigValue (aka don't care what it is, just return it)

little eagle
#

2 things. Do away with the "With" and write out "Def" as Default.

#

And getNumber actually works on STRING entires, but isNumber reports false.

#

So you need isText and isNumber.

still forum
#

GG compare_case_sensitive does case insensitive compare... WTF.. I code too much when tired

austere granite
#

dunno if this makes sense, but ```sqf
params [["_code", {}, [{}, ""]]];
if (_code isEqualType {}) exitWith { _code };
if !(_code isEqualType "") exitWith { { false } };

private _function = uiNamespace getVariable _code;
if (!(isNil "_function") && { _function isEqualType {} }) exitWith {
_function
};

_code = compile _code;
_code;

still forum
#

Actually.. it compares case_sensitive on linux and insensitive on windows

austere granite
#

aka give a string, if it's a function get that, otherwise compile it

little eagle
#

Good job.

austere granite
#

that works fine as function though

#

vectorRotate

still forum
#

added getBool which works with number/string from config.
and getAny. Which get's number or string or array depending on what's there

austere granite
#

nice

still forum
#

vectorRotate does what?
rotate by 5 moves first elements five to right. and last element get's pushed to first and so on?

#

ahh.. vector! not array πŸ˜„

#

my vector math is not so good tho :x

austere granite
#

selectLast

little eagle
#

^

austere granite
#

_array select (count _array - 1)

little eagle
#

pop which is deleteAt for the last element.

austere granite
#

insert

little eagle
#

_array deleteAt (count _array - 1)

#

== pop

#

pop _array

still forum
#

getLast? seriously? :D

game_value getLast(game_value right_arg) {
    return right_arg.to_array().back();
}

There ya go.

austere granite
#

πŸ˜„

#

harder to get markdown right

#

πŸ”₯

#

selectLast pls though

#

or

still forum
#

@little eagle popEnd and popFront ?

little eagle
#

Sure.

#

popFront had a different name though, didn't it?

#

popEnd was just pop and popFront was...

austere granite
#

arrayMove

#
params ["_array", "_element", "_targetIndex"];

_array deleteAt (_array find _element);
private _right = _array select [_targetIndex, (count _array)]; // [''hello', 'cya']
_array resize _targetIndex; // ['bye']
_array pushBack _element; // ['bye', 'hi']
_array append _right; // ['bye', 'hi', 'hello', 'cya']
_array;
#

or somethnign like that

#

does that sqf even make sense

still forum
#
game_value popEnd(game_value right_arg) {
    auto elem = right_arg.to_array().back();
    right_arg.to_array().erase(right_arg.to_array().end()-1);
    return elem;
}

game_value popFront(game_value right_arg) {
    auto elem = right_arg.to_array().front();
    right_arg.to_array().erase(right_arg.to_array().begin());
    return elem;
}

It's literally so friggin easy

little eagle
#

Name popEnd, pop and popFront, shift

still forum
#

but :U

#

people would be confused. popEnd/popFront is more readable

little eagle
#

No, they'd get used to it, because the names are actually brilliant.

still forum
#

@Adanteh#0761 I dunno what that thing does

tame portal
#

What about the real question here: peek

austere granite
#
    Example:        [['hi', 'bye', 'hello', 'cya'], 'hi', 1] call MB_fnc_arrayMove;
    Return:         ['bye', 'hi', 'hello', 'cya']
still forum
#

but.. peek is just select isn't it? @tame portal

tame portal
#

Peek is like pop, but it does not remove

little eagle
#

So, select

still forum
#

well... select 0 ?

tame portal
#

Basically

little eagle
#

But selectLast?

austere granite
#

so.. selectLast?

little eagle
#

^

austere granite
#

is that called peek

still forum
#

Adanteh that's swap ?

tame portal
#

Peek is the more appropiate name

austere granite
#

yes

little eagle
#

peek is a better name than selectLast

tame portal
#

Thank you

austere granite
#

well not swap

still forum
#

but if you already have pop for front/end.
people would again be confused if peek means start or end

tough abyss
#

You are all insane

tame portal
#

Peek always means top

austere granite
#

No u

tame portal
#

I havent heard of a peek at the bottom yet πŸ˜„

still forum
#

already have select 0 for start and selectLast for end.

austere granite
#

selectLast is now known as peek

#

apparently

still forum
#

could make a std::queue like datatype

tame portal
#

selectLast was always known as peek

austere granite
#

That's grown up words

still forum
#

well.. for me peek is "look at next value" and on a queue that would be first

#

selectLast.. is not first

little eagle
#
peek _array  // _array param [count _array - 1]
pop _array   // _array deleteAt (count _array - 1)
shift _array // _array deleteAt 0

Everything else is a lie.

tame portal
#

For me peek always means look at the last element and return it, but not remove it

still forum
#

make a PR if you want it πŸ˜„

tame portal
#

^

#

commy is right (for once)

#

hue

tough abyss
#

[1:23 AM] Dedmen: well.. for me peek is "look at next value" and on a queue that would be first(edited)
^^ Yep

austere granite
#

is it still server-only stuff

still forum
#

With battleye yes.

austere granite
#
params ["_control"];
private _controlPos = ctrlPosition _control;
private _controlParent = ctrlParentControlsGroup _control;
while { !isNull _controlParent } do {
    private _parentPos = ctrlPosition _controlParent;
    _controlPos set [0, (_controlPos select 0) + (_parentPos select 0)];
    _controlPos set [1, (_controlPos select 1) + (_parentPos select 1)];
    _controlParent = ctrlParentControlsGroup _controlParent;
};

_controlPos
#

gets actual position of a (sub)control, instead of relative to its parent

tame portal
#

For me a Queue only has Queue and Dequeue, Clear and Peek

little eagle
#

@austere granite Does this work for controls inside controls groups from inside controls groups?

austere granite
#

yes

tame portal
#

Inside a pineapple under the sea?

still forum
#

yep.
push, pop, clear, peek
peek shows value at start of queue. as it is FIFO

little eagle
#

🍍

tame portal
#

Please react with a pineapple to your pineapple

#

Thanks

#

God damn it

#

πŸ†

#

Urgh, you disgust me

#

Cucumbers

still forum
#

Gimme more commands.. stuff that more than one guy finds useful :x

tame portal
#

@still forum For?

austere granite
#
params [["_pos", [0, 0], [[]]], ["_posSecond", [0, 0], [[]]]];

if (count _posSecond < 3) exitWith { false };

if ((_pos select 0) < (_posSecond select 0)) exitWith { false }; // Left of pos
if ((_pos select 1) < (_posSecond select 1)) exitWith { false }; // Above pos

if ((_pos select 0) > ((_posSecond select 0) + (_posSecond select 2))) exitWith { false }; // Right of pos
if ((_pos select 1) > ((_posSecond select 1) + (_posSecond select 3))) exitWith { false }; // Bottom of pos

true;
#

i only find UI things useful

little eagle
#

I disgust you? Have you ever tasted an aubergine?!

austere granite
#

posInPos thingie

rancid ruin
#

give60FPS please

tame portal
#

It tastes and smells like fresh not-cucumber in the morning

little eagle
#

posInPos thingie
inAreaArray?!

#

forceFPS. Just end the frame after a certain amout of time.

#

lol

austere granite
#

commy its for ui things

little eagle
#

Oh, ok.

tame portal
#
public void SetGameFPS(float desiredFps) {
    throw new ArgumentException("Cannot be logical number"); 
}
little eagle
#

logical number

austere granite
#

inArea you could somewhat use, but half the arguments would be pointless

#

and obviously UI positions aren't based of a central point

#

pls

tame portal
little eagle
tame portal
#

🍍

still forum
#

This looks like the veins on my cucumber

tame portal
#

ArmA roads are SO inconsistent

#

Half of the roads aren't properly connected and hence roadsConnectedTo returns bullshit

rancid ruin
#

how did you do that satnav? that's nice

tame portal
#

It's especially bad on Malden..

rancid ruin
#

you draw markers for the route?

tame portal
#

Yes

#

Works 10/10 actually

tough abyss
#

@still forum createVehicle that takes vectors arguments

still forum
#

would then call setPos?

rancid ruin
#

if arma's vehicle controls weren't so fucked you could make a cool euro truck simulator style mission with that

#

but driving in arma always feels bad 😒

tame portal
still forum
#

PURIEEE

tame portal
#

Wait

#

Wot

#

No this

austere granite
#

nice link

tame portal
#

PURiEE

#

The next IEEE standard

little eagle
still forum
#

Good bot

rancid ruin
#

you gonna release that sat nav?

little eagle
#

You got me in this channel to upload pictures.

#

I could just repaste the image path 🀦

tame portal
#

@rancid ruin That's a modified map control

#

I actually don't know where this Navi could be useful lol

little eagle
#

Life

tame portal
#

I wrote it for that specific cough scene cough

#

Jesus commy

#

I'm sure some units want to run into battle with a TomTom in their hands

brazen sparrow
#

life communities would pay good money for it πŸ˜›

little eagle
#

Jesus commy
Is this the nice way to point out that I should shave myself after a week already?

tame portal
#

@brazen sparrow Oh they do, mostly because those people have no idea how to script

#

Their support tickets are always super silly things

#

I mean, have you looked at a instruction file of ours yet?

brazen sparrow
#

if u gave me a free copy i would πŸ˜›

tame portal
#

They are basically bullet proof, if you do mistakes while following them you were either not paying attention or in general have a problem lol

#

"at the very bottom" is the 100% guarantee someone is going to add it at the top of the file

still forum
#

added findCaseInsensitive does what you think it does

little eagle
#

Same for in now.

still forum
#

thought I won't need in.. as find kinda does that

#

.-.

little eagle
#

But god damn that name. Can't you come up with something better?!

tough abyss
#

Its ok you can make up a macro for it πŸ˜›

still forum
#

done.

#

Give me a better name

#

findCI ?

#

inCI

little eagle
#

findMX, because CASELESS, slowclap

still forum
#

...

tough abyss
#

either go ifind or findci.
Or you could do both names etc, short & long version for the command

little eagle
#

iFind and iIn
Would apple sue?

still forum
#

I'll go for findCI

tough abyss
#

Naming convention used for c++ (boost string crap), kinda before apple πŸ˜‰

little eagle
#

Cl (case Less) or CI (case insensitive)

austere granite
#

invalid picture

little eagle
tame portal
#

commy just paste the link again

tame portal
#

Why does it not work now lol

little eagle
#

Dun't no work.

austere granite
#

@still forum

#

startsWith

little eagle
#

Not reposting junk.

austere granite
#

if ("string" startsWith "st")

tame portal
#

What do you mean?!

austere granite
#

dunno what c 'ish people call that, but thats the python name

little eagle
#

arrayUnion

#

_res = _array1 + _array2;
_res arrayIntersect _res

still forum
#

startsWith is implemented. case sensitive tho

#

you need startsWithCI? :/

austere granite
#

... πŸ˜„

#

thanks

#

i dont

still forum
#

nvm.. also implemented

little eagle
#

lol

austere granite
#

formatC

#

good command

#

just name it something like enableCheats

still forum
#
game_value arrayAppendUnique(game_value left_arg, game_value right_arg) {
    auto& leftArr = left_arg.to_array();
    auto& rightArr = right_arg.to_array();
    auto_array<game_value> output(leftArr);
    for (auto& elem : rightArr) {
        if (output.find(elem) != leftArr.end()) leftArr.emplace_back(elem);
    }
    return output;
}
austere granite
#

nice

still forum
#

_array appendUnique _array2

#

That's quite inefficient though. I should first do a isSorted check and if it is sorted do a binary search instead

#

But I only want to do simple stuff now

austere granite
#

would some weird for syntax be possibru

#

for [_i, _j] in _nestedArray {

still forum
#

no

austere granite
#

for targetpath, targetmodefiles in extra_data.items():

still forum
#

That is script instruction stuff.. I'd need to have access to the compiler to do that. And I don't

austere granite
#

okay

still forum
#

Atleast I don't want to because Battleye wouldn't like that

austere granite
#

that's about all i can think off

little eagle
#

appendUnique

#

It's called Union

#

It has been called that for hundreds of years 😦

still forum
#

but.. arrayUnion ?

little eagle
#

Why not? They already fucked up arrayIntersect when it should've been named intersection

still forum
#

IMO it's more readable that way.

little eagle
#

union and intersection as well as subtraction are basic operations in set theory.

still forum
#

You guys gotta have more Ideas.. I'm bored..

little eagle
#

All the vector commands, but with n dimensional vectors, n!=3

still forum
#

:U

#

but... do you REALLY have a use for that?

little eagle
#

Yes.

#

Matrices and quarternions.

#

Or at least complex numbers.

#

nth-root command

still forum
#

vectorAdd should really support that.. and I can't add an existing command with same argument types

little eagle
#

vectorAdd dies if one of them isn't 3 dimensional.

#

Because this game is πŸ’©

still forum
#

Theoretically I can delete Vanilla commands... But that is disabled for good reason..

austere granite
#

can you disable setUnconscious

little eagle
#

nth-root, ln (natural logarithm) and logarithm base n. Implement these.

still forum
#

there is no nth-root func in c++..
I know you can do that with log right?

#

and that is LN right? natural log?

little eagle
#

log is base 10

jade abyss
#

supppp Blue bitcheeessssss

#

.!.. yeah man ..!.

austere granite
#

solveRiemannHypothesis

little eagle
#

there is no nth-root func in c++..
There is cuberoot. But I never understood why there's no nth root.

still forum
#

But you can do nth root with logn right?

little eagle
#

Uhm, I don't know how you'd do that, but that doesn't mean you can't.

#

cbrt x
is just
x^(1/3)
I guess.

#

For SQF at least. Where there's no negative results for either anyway.

still forum
#

I now know why there is no nth root. std::pow(value, 1.0/root)

little eagle
#

Sure.

still forum
#

what should I call it nthRoot funcName number

#

or swap them around?

little eagle
#

exp root x

#

3 root 8

#

= 2

still forum
#

done

#

dunno how to log base n yet

little eagle
#

Do you know how to change base of logarithms?

jade abyss
#

btw: The Topic is booooooooooorrrrrrriiiiiiinnnnnnnggggggg

little eagle
#

Your mother is boring.

jade abyss
#

Probably

still forum
#

We are making new SQF commands here @jade abyss That's not boring

jade abyss
#

It's still booorrrriiiinnnngggg

#

ditch sqf

zenith totem
#

If only it were so easy

still forum
#

It is

jade abyss
#

inb4: Incest

#

No wait, how is it called?

still forum
#

okey.. apparently log(n)/log(15)
would be log of base 15

little eagle
#

But this is the SQF channel. If you don't like it.
<------- there's the door

zenith totem
#

How do I implement my missions without mods with no sqf, huh? lol

jade abyss
#

No, there is your Avater Commy2

still forum
#

you think that's right? @little eagle

little eagle
#

Yes.

zenith totem
#

Technically his avatar is set in the frosty outside world

still forum
#

base logn number ?

little eagle
#

It's not that cold today here.

jade abyss
#

Technically... i don't give a damn

little eagle
#

ln for natural log

jade abyss
#

uh, sounds kinky

still forum
#

yeah. already have that

little eagle
#

base log x

#

Just make it binary.

jade abyss
#

Sounds more kinky

still forum
#

all done

little eagle
#

❀

#

Finally some math in this shit.

#

Hyperbolic sine / consine next lol (jk)

still forum
#

I wonder how many mods I break with that...

little eagle
#

With what?

still forum
#

adding new commands

little eagle
#

People not using OFPEC? Fuck them

#

They deserve the shit they get.

still forum
#

Ah yeah.. didn't even think about that

subtle ore
#

Refresh me, what is OFPEC?

still forum
#

tag_name

little eagle
#

MyTag_varName

still forum
#

tag is called OFPEC tag

austere granite
#

The website you use for tagging

#

Some archaic beast

#

That no one uses

subtle ore
#

Wait wtf? Why wouldn't people do that?

zenith totem
#

Because people are people

#

and do things they shouldn't

jade abyss
#

exactly, Adanteh.

still forum
#

because some people think their scripts are the only scripts that run in the game

little eagle
#

Lazy. The real question is why people bother naming them fn_blah or fnc_blah though.

austere granite
#

Someone should make something for that

#

like something you could use that takes care of prefixing

#

and adds module names too

#

And then does it a lot

little eagle
#

GVAR πŸ˜„

austere granite
#

like..

#

πŸ˜„

#

πŸ˜‰

zenith totem
#

Modules you can keep track of internally

#

Everything after tag_ should be yours anyway

little eagle
#

GVARMAIN then

still forum
#

back to increment... I could add ++number; I think

#

or βž•NUMBER

austere granite
#

increment would a b nice one

jade abyss
#

+=

austere granite
#

LOL

still forum
#

to get some Emoji into it

subtle ore
#

πŸ€”

austere granite
#

+= best

still forum
#

++number would return the number.
+= still not possible

jade abyss
#

Why?

#

Fix it!

#

NAO!

still forum
#

so you do _number = ++_number instead of _number = _number +1;

#

guess that doesn't really make it better

jade abyss
#

bla bla bla excuse bla bla mimimi blablabla
Do it!

austere granite
#

no

still forum
#

missionNamespace setIfNil ["varName", {code}] ?

little eagle
#

++_number
This currently is the same as
_number
You might break something with this.

still forum
#

instead of the endless if isNil _var then _var = x

jade abyss
#

*IfNilSet

zenith totem
#

How are you adding commands anyway

austere granite
#

New DLC

still forum
little eagle
#

Intercept

austere granite
#

.. i wish i could locate my Intercept = Orange DLC picture now 😦

little eagle
#

Do we have pushFront(Unqiue) already?

still forum
#

no

rancid ruin
#

wow you guys are still at it

little eagle
#

Do it. I wonder if it should report the size of the array afterwards or just 0.

rancid ruin
#

carry on at this rate and you'll have fixed arma 3 by morning

little eagle
#

Not unless addClassEventHandler is implemented.

jade abyss
#

still boring

still forum
#
game_value pushFront(game_value left_arg, game_value right_arg) {
    auto& arr = left_arg.to_array();
    arr.emplace(arr.begin(), right_arg);
    return {};
}

game_value pushFrontUnique(game_value left_arg, game_value right_arg) {
    auto& arr = left_arg.to_array();
    if (arr.find(right_arg) == arr.end()) arr.emplace(arr.begin(), right_arg);
    return {};
}
#

Just return nil now.

#

I guess pushFrontUnique could return bool

#

added something or didn't

#

does that now.

jade abyss
#

... compiling since 30min, bluescreen... Okay guys, you got me for ~45min again \o/

still forum
#

what u compiling?

jade abyss
#

A specific Engine

still forum
#

#Unreal

jade abyss
#

#BetterThanSQF

still forum
#

#Intercept

austere granite
#

--- Break

jade abyss
#

#StillArmaBugs

austere granite
#

Can you use the Eden boundingboxes and resize them through scripting?

jade abyss
#

No

still forum
#

no

austere granite
#

reee

rancid ruin
#

yes