#arma3_scripting

1 messages ยท Page 336 of 1

little eagle
#

All local variables carry over to the child scopes.

#

Doesn't matter if magical or not.

lusty canyon
#

ok thanks was just wondering if exitwith had any special kinks

peak plover
#

kinky

little eagle
#

Oh, it has. But has nothing to do with magic variables.

lusty canyon
#

is there a script way of giving me debug console on my dedicated? ive already #login but still nothing.

little eagle
#

Eden -> Attributes -> General -> States -> Debug Console -> Enable for host and logged in admin

peak plover
#
findDisplay 46 createDisplay "RscDisplayDebugPublic";```
#

Don't know if it really works

little eagle
#

No.

subtle ore
#

Description ext has a nifty entry as well enableDebugConsole = 2; //dangerous in MP

lusty canyon
#

does that mean its on a per mission basis? its there a global cfg thingy in a folder somewhere so it works on any mission file?

little eagle
#

Yes and I don't think so.

lusty canyon
#

or something liek if UID = jayTAC then SuperPowersEnabled = true ๐Ÿ˜‰

subtle ore
#

2 = everyone 1 = logged admin 0 = nobody

indigo snow
#

You can also enable specific UIDs iirc now

subtle ore
#

Indeed nick

little eagle
#

Oh, yeah. You can make it a mod now.

lusty canyon
#

thing is i dont touch mission editing, even the dedicated stuff i just let TADST handle it. a pbo cfg i can work with?

peak plover
#

I had a mod with keydown eventhandelere and ```sqf
findDisplay 46 createDisplay "RscDisplayDebugPublic";

little eagle
#
class CfgPatches {
    class My_DebugConsolePls {
        requiredVersion = 0.1;
        requiredAddons[] = {"A3_Ui_F"};
        units[] = {};
    };
};

enableDebugConsole = 2;
#

Something like this.

subtle ore
#

Holy fuck, that is dangerous for those without filepatching

little eagle
#

They thought it was a good idea. Made things easier for me, so : P

subtle ore
#

๐Ÿ˜ฑ

little eagle
#

You can still explicitly disable it for the mission though.

#

But it no longer is by default.

#

:>

#

With that addon at least.

lusty canyon
#

why do mission makers even get to decide admin level stuff???

#

priority should be dedicated setting > modcfg > mission

little eagle
#

No, mod should always be lower than mission.

#

The more local it is, the higher the precedence.

peak plover
#

mission is more specific that makes sense

lusty canyon
#

but debug is the domain of the admin, how dare a lowly mission maker defy that?

subtle ore
#

Lowly mission maker

little eagle
#

And the addon makers are the pinnacle of this community, so why don't they get to decide everything?

subtle ore
#

Commy, youre like a monopoly after all. A ton of mods use CBA.

little eagle
#

Eh, I had nothing to do with that.

#

I just made it suck a bit less (hopefully).

peak plover
#

top 5 servers have no mods and ~1500 unique players per day

subtle ore
#

I wonder what they host for gamemodes. Cough altis life king of the hill

little eagle
#

Yet they all have missions.

lusty canyon
#

blasphemy

peak plover
#

How dare they have missions. I bet they use scripts as well!

#

๐Ÿ˜ก

subtle ore
#

๐Ÿ˜ฑ

peak plover
#

Is there an eventhandelere for "j" or tasks dialog?

little eagle
#

Is that a display?

peak plover
#

No clue, don't know what to look for or what to call it

little eagle
#

I don't think there is.

peak plover
#

It's diary

#

Damn I need a convinient way for a display that can be used similar to the briefing tab, but elements can be removed and added

little eagle
#

You can hide parts of the briefing, no?

peak plover
#

I think briefing entries can be added, but not edited removed

mortal halo
#

does inidbi only support x32

little eagle
#

You mean x86 ?

peak plover
#

I need a dialog similar to briefing but editable elements to for ORBAT, Commander Options (reinforcements, forefit, etc.).
Where do I impliment this? openMap eventhandeler is my first guess

#

Alternatives?

little eagle
#

openMap sounds good. Heads up though, the display will not be available via findDisplay in the frame the eventhandler fires.

subtle ore
#

Is there any way to add units to an orbat group dynamically?

mortal halo
#
removeAllAssignedItems _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;```
#

that's gonna work in multiplayer if the server executes those on a player right

#

or there're locality problems

subtle ore
#

I think there would be locality problems. As i think the commands have a local effect

mortal halo
#

but the server has the biggest cock of them all

peak plover
#

@subtle ore Don't think so, but maybe

mortal halo
#

oh my god

#

@little eagle

#

getUnitLoadout / setUnitLoadout handles weapon attachments in backpacks

#

๐Ÿ˜ฑ

little eagle
#

Yeah, but only if they belong to a soldier.

mortal halo
#

yeah

#

still something

#

i have put that inventory system aside

#

but i didnt know that

little eagle
#

It's maddening that they can do backpacks, but not cargo boxes.

mortal halo
#

it is

#

and it's not like they cant

#

they can

peak plover
#

we cant

mortal halo
#

it's not a priority as kk told me

#

exactly

#

it's good because set and get loadout are global

#

meaning I can reset inventory by setting an empty loadout to a unit

#

from the server on a player

#

with no locality problems I think

sharp fable
#

How can i spawn a hemmt full of first aid kits on my mil server?

#

I wanna put for example 256 med kits inside it

little eagle
#

"FirstAidKit"

peak plover
#

Do you want to spawn a hemmt which is already full of med kits or do you want to spawn medkits to fill a hemmt

#

Or spawn a hemmt and then spawn medkits in there

sharp fable
#

A hemmt full of medkits OR a hemmt and then spawn them inside. Doesnt matter both sounds good

#

@little eagle @peak plover Thats why i love this community

little eagle
#

I hope this wasn't sarcastic.

sharp fable
#

No lol didnt found the additemcargo

#

I am thankful

little eagle
#

Sometimes people get angry when you don't give them something to copy paste immediately. :S

sharp fable
#

Well i am not stupid. And theres a syntax so wheres the problem?

little eagle
#

Lol, you tell me.

peak plover
#

jQuery just joined and asked a question, to which he did not recieve an answer,but the tools to craft the answer himself.

#

He was grateful for the tools, which is unexpected

sharp fable
#

Is that rare? Xd

cedar kindle
#

you'd be surprised

tame portal
#

The moment someone asks for help and you hint him into the right direction and he says "Thanks!", you feel that slight hope in humanity.

lusty canyon
#

how do you check if player is in FFV seat? ive tried is not driver/gunr/cmdr but its returning also for vanilla cargo seat.

lusty canyon
#

or is there a script way to convert all cargo seats into FFV? even better can you make a driver seat FFV?

cedar kindle
#

fullCrew

warm gorge
#

How could I use the splendid camera copied params and use them with cameras with scripting? Having trouble using camSetPos/camSetTarget with positions

#

Nevermind got it working, bit confusing

tough abyss
#

hey, is there a way to call BIS_fnc_guiMessage oly on the player who executes the script?
Right now when the BIS_fnc_guiMessage is called, all the players are getting the message, and I don't want that.
I want only the player who creates the message to get it.

warm gorge
#

How are you executing the function?

#

Sounds like your globally executing it

tough abyss
#

oh wait

#

can it be because of BIS_fnc_MP ?

#

I'm using BIS_fnc_MP because the rest of the code should be globally executed

warm gorge
#

By the sounds of it yes. Youll need to show us some code to help you easier.

tough abyss
#

Thank you, I figured it out ๐Ÿ˜„

tough abyss
#

any clever cookies know how to make a custom rangefinder script, i guess it would be some combination of "distance" and perhaps "modelToWorld" ???

digital pulsar
#

hint str ((getPos player) distance screenToWorld [0.5,0.5]);

#

will work locally

#

if u wanna be precise and measure from eyepos, u gonna have to convert from ASL

tough abyss
#

0.5,0.5 is fine

#

that works, just doesnt intersect with trees and buildings obviously. cheers!

digital pulsar
#

thats coordinates of the middle point of your screen

tough abyss
#

i dont know if a3 has this function but i can use lineIntersects [start, end, objIgnore1, objIgnore2, considerSnow] apaprently

digital pulsar
#

distance will be measured from unit's feet

#

oh, they added plenty intersect functions

tough abyss
#

nice. i'll make the end be the screenToWorld 0.5 0.5 thing

#

thanks mang

digital pulsar
#

unless its in mp and for some reason you want server make the measurement, not the player

tough abyss
#

yeah just the player, always the player

lusty canyon
#
                _startPoint = eyePos player;
                _end = (_startPoint vectorAdd (player weaponDirection currentWeapon player vectorMultiply 4999));
                _array = lineIntersectsSurfaces [_startPoint , _end, player, _cam, true, 1, "GEOM","NONE"];
                
                _targetPointInASL = (_array select 0);
                _targetObject = (array select 2);

this one hits trees and other bobs

daring pawn
#
if (side _x inAreaArray _gMkr == INDEPENDENT) exitWith {};

So every x seconds, a function runs to check if a grid is clear, each grid has a marker in it. The above way doesn't work (obviously) I'm wondering, instead of creating a foreach for the InAreaArray and seeing if any of those are of a side, if theres a more compact method?

peak plover
#

What exactly gets moved to newunit on respawn?

#

I assume all variables

little eagle
#
private _westGroups = allGroups select {side _x == west};
private _westUnits = [];
{
    _westUnits append units _x;
} forEach _westGroups;
count (_westUnits inAreaArray _position) > 0
#
{side group _x == west} count (allUnits inAreaArray _poisition) > 0
#

Not sure which is better.

peak plover
#

wait

daring pawn
#

1 was what I was trying to avoid, I'd imagine in a scenario where say you had 10 players in 10 different markers running that, it could become pretty intensive @little eagle - The second one, i'd assume, would be less of a strain assuming it works in my scenario how I need it to

little eagle
#

But 1 should be faster than 2.

#

If I am not mistaken:
1 faster than 2
2 easier to maintain than 1

#

The reason why 1 could be faster is, because there are way less groups than units on a map, so filtering the side for groups is more effective.

#

It also depends on the mission.

peak plover
#
count ((allUnits select{side _x isEqualTo west}) inAreaArray _position) > 0
daring pawn
#

Only up to a certain point I assume, as i'm checking for all enemies (in my case the INDIE side) and the situation is, the grid areas spawn the enemy units based of proximity to player.

peak plover
#

Does that work

little eagle
#

If all you have is single group units on west, then 2 is better.

daring pawn
#

the {select} would need to be on other side of InAreaArray as far as I know. The syntax on the wiki says such

#

thats why I didn't just go with that

little eagle
#

@peak plover Why would you check the units before filtering out the ones outside the area? You have way more iterations this way. Clearly worse than my 1.

daring pawn
#
gridClear = {
    private ["_gMkr"];

    if (vehicle player != player) exitWith {};
    _gMkr  = str(player call getGridPos);
    if isNil "_gMkr" exitWith {};
    if (markerColor _gMkr == "ColorBLUFOR") exitWith {};
    //WORK
    if {side group _x == INDEPENDENT} count (allUnits inAreaArray _poisition) > 0 exitWith {systemChat "HostileinZone"};
    _gMkr setMarkerColor "ColorBLUFOR";
    //_gMkr setMarkerTypeLocal "B_unknown";
    missionNamespace setVariable [format["%1cleared", _gMkr], true];
    publicVariable format["%1cleared", _gMkr];
};

Is what I have at current, its partly Pogoman's grid checker from the old ArmA 2 Insurgency mission

#

I'm using it for a persistent system to save data in all grids

peak plover
#

Qustion

little eagle
#

I gave you 2 good answers which both have merits and flaws.

#

Pick one.

daring pawn
#

Oh yes indeed, not questioning that

#

Sorry if it came across as that, I do appreciate the response

peak plover
#

Why do you not generate new grids every time based on units stationed there? Just make units persistant instead

little eagle
#

Do you have lots of groups or lots of units in few groups?

#

That could make a difference, but generally 1 should be quicker if that's a concern.

peak plover
#

Also have grid checker check cached units positions (save cached units positions to array)

daring pawn
#

In most cases, its lots of units, because if a grid has lots of houses, the unit spawner prioritises spawning CQB dudes.

#

Yea i got 90% of the saving stuff sorted

little eagle
#

Are they in each their own group or all in one group?

daring pawn
#

Right now their own, but they will be in one when its all sorted

#

one per grid for CQB units

#

So yea I guess 1 would be faster

little eagle
#

Then I'd go with 1. But if speed doesn't matter, then 2 is worth considering.

daring pawn
#

Yea 100%, cheers again mate

peak plover
#

Do eventhandelers and/or variables move from _oldUnit to _newUnit automatically?

#

onRespawn

little eagle
#

All eventhandlers carry over.

#

All variables carry over, but only for soldiers

#

The name and vehicleVarName carry over

#

Although idk if the global variable now points to the new vehicle instead of to the wreck / corpse

peak plover
#

ohh boy

little eagle
#

I hate the vehicle var names / editor names and I rarely do missions so no idea :S

warm gorge
#

Does anyone know if render to surface / screen feeds with cameras are limited to a certain amount? Im trying to spawn around 10 screens with feeds on them, but no matter what, it gets limited to around 7 or 8, and the other ones are just blank.

little eagle
#

I would conclude: Yes.

warm gorge
#

Hmm okay. They also dont seem compatible with setObjectTextureGlobal, doesnt work for JIPs

little eagle
#

Yeah, PIP stuff is weird.

warm gorge
#

Is it possible to allow UAV controls of like stompers, etc without being a UAV Controller unit?

digital pulsar
#

yes

#

you just need the terminal

warm gorge
#

That seems to work fine for darters, but for larger drones like the stomper or sentinel, it wont let me take controls, only connect to it

lusty canyon
#

how to concat variables to display in a hint without using format[]? _var1.toString() + " " + _var2.toString();?

warm gorge
#

Providing the variable is a string, just _var + " " + _var

little eagle
#

I think you also need to be on the same side as the stomper class is

#

Or be a "UAV hacker"

warm gorge
#

Uav hacker?

lusty canyon
#

unit trait

warm gorge
#

ah

little eagle
#
this setUnitTrait ["UAVHacker", true];
warm gorge
#

Cheers

lusty canyon
#

so vars dont get automagically turned into strings when you try to concat with " " ?

warm gorge
#

no

lusty canyon
#

mkay

little eagle
#
_str = str _var;
lusty canyon
#

can i do hint str(_varIsArrayOfObjects) + "suck it sqf" + str(_var2); ?

warm gorge
#

yes

little eagle
lusty canyon
#

thats the thing tho i feel so lame using format

warm gorge
#

You're better off using it, can be faster

little eagle
#

"lame"?

lusty canyon
#

wizardry > code performance. its true!

little eagle
#

What you posted needs parenthesis btw. It wouldn't work like you wrote it,

lusty canyon
#
 hint ( str(_varIsArrayOfObjects) + "suck it sqf" + str(_var2) ) ;
#

like that?

little eagle
#

Yeah.

#
str( )

What's up with that?

warm gorge
#

I guess some people just do it like that, though its not neccesary

lusty canyon
#

you mean i just need one str compass them all?

little eagle
#

It's confusing to me that it is used where it's superfluous and then not when it's needed. str and hint are the same in their usage, but somehow get treated as if they worked differently syntax wise.

#
hint _variable
str _variable
#

you mean i just need one str compass them all?
No, that would be if you used format.

lusty canyon
#

my next problem fullcrew isnt being nice, my player getcargoindex never lines up with the resulting array so i cant use it in a select


                        _vehCargoArr = (fullcrew [vehicle _this,""cargo"",true]);
                        _returnBoolOfIsSeatFFV = 
                        (_vehCargoArr select ((vehicle _this) getCargoIndex _this)) select 4;
#

how do i get the seat the player is in from the fullcrew array?

#

i can do a foreach and get the index that way but it will have to check every single seat right? i need this in an addaction condition

little eagle
#

Yeah, careful.

#

The cargo index reported by fullCrew is shifted by the amounts of FFV slots compared to getCargoIndex.

#

They are different "cargo indices" essentially.

lusty canyon
#

my first mistake FFV seats arent "cargo" but "turret" so i guess i can then just get all the FFV seats that have units in them then foreach cmpare with my getcargoindex?

little eagle
#

What are you trying to do.

lusty canyon
#

uav is slaved to player weaponVector intersectsurfaces (this part works on foot)
but now player is in vehicle uav must ignore lockcam unless player is in FFV

#

hope that was clear as mud

#

plus i have other actions that rely on player being in ffv like launching grappling hooks at aimpos

little eagle
#

I think it would be better if you split up your "project" into simple tasks. What is the task here?

lusty canyon
#
if (player isInFFVseat) then { hint "simple task?"};
little eagle
#

So you want a way to know if a unit is sitting in a FFV slot?

lusty canyon
#

yes please

little eagle
#

Give me a minute to start up the game...

lusty canyon
#

my fullcrew result:

"[[MCSS_C2_MEMBER_5,""driver"",-1,[],false],[MCSS_C2_MEMBER_4,""Turret"",2,[0],true],[MCSS_C2_MEMBER_8,""Turret"",3,[1],true],[MCSS_C2_MEMBER_0,""Turret"",4,[3],true],[MCSS_C2_MEMBER_3,""Turret"",0,[5],true]]"
#

i can get the seatIndex with getcargoindex, so now i just foreach if (_x select 3 == _mySeatIndex )?

little eagle
#
private _unit = player;
fullCrew vehicle _unit select {_x select 0 == _unit} param [0, [nil, nil, nil, nil, false]] select 4
#

That should report true if _unit is in a person turret and false otherwise.

lusty canyon
#

wow i dont even recognize that

little eagle
#

SQF is madness nowadays and I love it.

lusty canyon
#

im like a caveman and your da vinci

#

what is _x inside the select code block?

little eagle
#
// init
PZG_fnc_isPersonTurret = {
    params ["_unit"];
    fullCrew vehicle _unit select {_x select 0 == _unit} param [0, [nil, nil, nil, nil, false]] select 4
};

// mission
hint str (player call PZG_fnc_isPersonTurret);
#

This is what functions are for.

lusty canyon
#

you can use _x outside for loops?

little eagle
#

wait

#

what is _x inside the select code block?
ARRAY select CODE is a loop that creates a new array. The new array elements only include those elements which the code block reported true for. _x is the current array element.

#

So...

#
[
[MCSS_C2_MEMBER_5,""driver"",-1,[],false],
[MCSS_C2_MEMBER_4,""Turret"",2,[0],true],
[MCSS_C2_MEMBER_8,""Turret"",3,[1],true],
[MCSS_C2_MEMBER_0,""Turret"",4,[3],true],
[MCSS_C2_MEMBER_3,""Turret"",0,[5],true]
]
#

Lets assume we do this test for MCSS_C2_MEMBER_3.

#
MCSS_C2_MEMBER_3 call PZG_fnc_isPersonTurret;
#

Then this part:

fullCrew vehicle _unit select {_x select 0 == _unit} ...
lusty canyon
#

oh right i see it now

little eagle
#

Filters out all other arrays with not the desired unit.

lusty canyon
#

damn thats smooth like bourbon

little eagle
#

It is!

lusty canyon
#

im gonna steal that, i think ive been relying on foreach too much

#

i do something like

_myBool = ( fullCrew vehicle _unit select {_x select 0 == _unit} ) select 4;

because im a caveman and didnt understand param ๐Ÿ˜‰

little eagle
#

I don't think that works.

#

After the parenthesis, you have:

[
[MCSS_C2_MEMBER_3,""Turret"",0,[5],true]
]
#

For our previous example.

#

So an array inside an array.

#

Can't use select 4 if the array has only one element.

lusty canyon
#

oh right the object gets sent to the select 4 ?

little eagle
#

No, the inbetween result is what I posted.

#

Array with one element that is an array.

#

You first have to pick the array.

#

That is what param [0, ... does.

lusty canyon
#

ah ok man my head is starting to spin

little eagle
#

The only reason I don't use select 0` is, that there could be no result!

#
[
]
#

For a unit that is not inside a vehicle.

#

So param is just a fancy way of writing select and have a fallback default value in case the element doesn't exist.

lusty canyon
#

oh default value that i understood

little eagle
#

If you strategically pick [nil, nil, nil, nil, false] as default value, then you can sefely use select 4 one step later.

#

And get the desired return value: false (because the unit was not inside a vehicle).

#
fullCrew vehicle _unit select {_x select 0 == _unit} param [0, [nil, nil, nil, nil, false]] select 4

So in the end it's the same as writing:

fullCrew vehicle _unit select {_x select 0 == _unit} select 0 select 4
#

Except that the later one will report nothing instead of false when you are on foot. Which is not as slick imo.

lusty canyon
#

ah ic now, genius dont even have to use (vehicle _this != _this)

little eagle
#

Yeah, not needed as it is implicit when using this "function".

#

"implicated"?

#

second language is English ยฏ_(ใƒ„)_/ยฏ

lusty canyon
#

first is sqf

little eagle
#

I'm sure you could write all of this with forEach loops and stuff too and it would maybe be easier to read, idk.

lusty canyon
#

[] select {} is more performant than foreach?

little eagle
#

Don't think it's much different, but you have to use more steps along the way.

#
private _isFFV = false;

{
    if (_x select 0 == _unit) exitWith {
        _isFFV = _x select 4;
    };
} forEach fullCrew vehicle _unit;

_isFFV

Something like this maybe?

lusty canyon
#

my addaction condition string now looks like this:


    "(alive _this) and (_this getVariable [""DW_UTIL_RDF_MENU"", 1] == 1) and 
        {
            _return = false;
            if (vehicle _this != _this) then {
                if ( !((driver (vehicle _this)) == _this) ) then {
                if ( !((gunner (vehicle _this)) == _this) ) then {
                if ( !((commander (vehicle _this)) == _this) ) then {
                    if ({
                        ( fullCrew vehicle _this select {_x select 0 == _this} select 0 select 4 )
                        }) then {
                        _return = true;
                    };
                };
                };
                };        
            } else {_return = true; };
            _return    
        }
    ",
#

addaction conditions are checked all the time in unscheduled env right? is this too much ?

little eagle
#

Every frame, yeah.

lusty canyon
#

this should only do the intensive array stuff if player is in cargo seat

little eagle
#
driver (vehicle _this)
#

think you can just use

driver _this
gunner _this
commander _this

and get the same result.

lusty canyon
#

i want the condition to be true if player is NOT in driver gunner cmdr

#

like this?

if ( !(driver (vehicle _this)) )
little eagle
#
private _unit = player;
private _vehicle = vehicle _unit;
_unit in _vehicle && {!(_unit in [commander _vehicle, gunner _vehicle, driver _vehicle])}
lusty canyon
#

in keyword checks if object is in array?

little eagle
#
1 in [0,1] // true
2 in [0,1] // false
lusty canyon
#

in automatically turns vehicle object into fullcrew array???

little eagle
#

Also works for vehicles instead of arrays when used with soldier on the left side. Rarely used for some reason, I like it.

#

in automatically turns vehicle object into fullcrew array???
No

lusty canyon
#

wow thats really good

little eagle
#

There is two syntaxes of the in command.

#

OBJECT in OBJECT <--- checks crew in vehicle
ANY in ARRAY <--- checks if element in array

lusty canyon
#

ah ic, im learning alot, my condition looks like this now:


    "(alive _this) and (_this getVariable [""DW_UTIL_RDF_MENU"", 1] == 1) and 
        {
            _return = false;
            if (vehicle _this != _this) then {
                if (
                    (_this in (vehicle _this) && 
                    {!(_this in [commander (vehicle _this), 
                    gunner (vehicle _this), 
                    driver (vehicle _this)])}) 
                    ) then {
                    if ({
                        ( fullCrew vehicle _this select 
                        {_x select 0 == _this} 
                        select 0 select 4 )
                        }) then {
                        _return = true;
                    };
                };
                };
                };        
            } else {_return = true; };
            _return    
        }
    ",
little eagle
#

I thinkvehicle _this != _this is superfluous after _this in (vehicle _this)

tough abyss
#

Why isn't there ever a semi-colon after _return?

lusty canyon
#

right redundant


    "(alive _this) and (_this getVariable [""DW_UTIL_RDF_MENU"", 1] == 1) and 
        {
            _return = false;
            if (
                (_this in (vehicle _this) && {
                !(_this in [commander (vehicle _this), 
                gunner (vehicle _this), 
                driver (vehicle _this)])
                })) then {
                if ({
                    ( fullCrew vehicle _this select 
                    {_x select 0 == _this} 
                    select 0 select 4 )
                    }) then {
                    _return = true;
                };
            } 
            else {_return = true; };
            _return    
        }
    ",
#

as for why no terminating semi that because im "monkey see monkey do" all code returning bools do it i dont know why

tough abyss
#

Another question: is there a CBA macro for double quotes (""var"")? Something like QQUOTE()?

little eagle
#

In ACE there is.

#

Nah, can't find it there either.

#

Just do:

#define QQUOTE(var1) 'QUOTE(var1)'

I guess.

tough abyss
#

~~What about ```CPP
#define DOUBLES(var1,var2) ##var1####var2
#define TRIPLES(var1,var2,var3) ##var1##
##var2##_##var3
#define QUOTE(var1) #var1

#

Wait no that's for more than 1 var.

#

Nvm.

little eagle
#

DOUBLES is
var1_var2

#

TRIPPLES
var1_var2_var3

tough abyss
#

Would #define QQUOTE(var) ##var work?

little eagle
#

No

#

I posted what would work already.

tough abyss
#

๐Ÿ‘Œ

peak plover
#

killed EH means that inventory of vehicle is gone?

little eagle
#

I don't think so, but not sure.

hollow mauve
#

Hey there, I was wondering if someone could help me with this.

#

this addAction ["Take Intel", this hideObject true]

#

I'm trying to make it so when a user interacts with the object, It will disappear, Can anyone help me as I have no idea why it isn't working

warm gorge
#

@hollow mauve What sort of objects? Like vehicles and units/AI orr ?

#
this addAction ["Take Intel", {deleteVehicle cursorObject}]
hollow mauve
#

file2_f.p3d

#

A file

warm gorge
#
this addAction ["Take Intel", {deleteVehicle cursorObject}]
#

Try that

hollow mauve
#

That worked, Thank you so much

warm gorge
#

np

lusty canyon
still forum
#

Probably material.. I guess

lusty canyon
#

thanks, turns out you can only get/set uniform stuff helms and facemask no joy. ill just have to go cfg way.
touching cfgs yuck!

tough abyss
#

if i wan't to access the objects which are on any seat and like to have some information bout it then I prefer the fullCrew command. but maybe it is a bit overpowered in this case.
https://community.bistudio.com/wiki/fullCrew

icy raft
#

Hi there!

Is there any advantage on declaring functions inside the CfgFuntions class besides having them set as "TAG_fnc_sumFuktion"?

still forum
#

Besides pre/postInit

#

Or having pre/postinit available in general.. Not just for a compiler

#

It also adds the script header

icy raft
#

Okay thanks!

#

Yeah, I have my very own function compiler

#

With some custom EH built in

#

with a dev mode that updates functionality in runtime

little eagle
#

This bracket placement tho ๐Ÿคข

tough abyss
#

Hold it... ๐Ÿ™Š

vague hull
#

clean and consistent, all it needs to have

tough abyss
#

Readable as well.

still forum
#

Readable?

#

I can only read the first few lines till my eyes go dark

little eagle
#

Should put a empty line between every line to make it even more readable.

tough abyss
#

Non-spaghettially formatted.

still forum
#

Honestly using else in the if would be more readable

little eagle
#

The only problem I can see with this, is that it has no function caching. And if your stuff ever gets to ACE size, you have to wait like 30 seconds longer every mission restart.

tough abyss
#

I don't think there are mods as anal (in a good way) as ACE and CBA when it comes to performance.

little eagle
#

It's not really performance. It's saving your sanity when debugging and having to restart.

rancid ruin
#

that's the whole point of CBA though isn't it, a load of useful functions written well by some anal guys

#

if it wasn't written well it wouldn't be used so much

little eagle
#

Nothing worse than loading screens. No one uses the ingame config viewer because of them.

tough abyss
#

I mean... Look at the life mods...

little eagle
#

What about them?

rancid ruin
#

nothing, just look at them

tough abyss
#

Aren't they written super shittally?

#

And used a lot?

rancid ruin
#

I think most people's problems with life mods are ethical tbh

#

I'm sure there's some which are well written but they're still probably scumbags

tough abyss
#

Ethical?

rancid ruin
#

stealing models, code, etc. anything they can

#

begging for donations. anything

little eagle
#

And the playerbase is annoying.

rancid ruin
#

my favourite bit about anything Life is how the server always has a 500 different roles in TS and a website telling you about Project Leader (CTO) John Smith, who you know is 13 years old

tough abyss
#

I know at least one decent guy who plays Altis life.

still forum
#

Well.. There are decent guys who sometimes play life. And there are lifer's that sometimes play the good stuff.

rancid ruin
tough abyss
#

Haha.

rancid ruin
#

it's rare in #arma3_scripting that people ignore questions in order to talk about something else

little eagle
#

Project Leader (CTO) John Smith, who you know is 13 years old
Better let them larp as successful people before reality hits them.

rancid ruin
#

offtopic isn't much of a problem in here, everyone is OK

little eagle
#

There was no question atm though.

tough abyss
#

Fucking LARPers ๐Ÿคฃ

rancid ruin
#

I look at lifers posts on /r/armadev sometimes when I want a laugh. they have a list of 50 different requirements. and a vague promise of maybe getting paid from donations or something maybe possibly.

#

yeah basically, we need you to understand everything about the engine, and scripting. then build us a really complicated mission. thanks.

dusk sage
#

It usually goes looking for a dev, join ts to talk thanks

#

And naturally, you wont get paid

rancid ruin
#

speak to Chief Commander Johnny Smith (not 12 years old honestly) in the Commander Loungeโ„ข on teamspeak for more info

tough abyss
#

Ironic how open source mods get the best devs by simply existing.

dusk sage
#

yes hello sir i am very good developer, where would you prefer me CTRL+C CTRL+V from? thanks

tough abyss
#

No advertisements needed.

rancid ruin
#

everything is always a framework with Life guys too

#

it's not a mission, it's a framework

indigo snow
#

its never a mission, they call it a map

dusk sage
#

Well people use a framework to build their own shit

tough abyss
#

You use the framework to create a mission ๐Ÿคฆ

#

I've tried various mission frameworks, and TBH they're kinda overrated.

peak plover
#

You are supposed to get a base/framework that you use so you don't have to spend hours setting up every time

little eagle
tulip cloud
#

I have performance/optimization question. In an environment of 140 players online I'd like to capture whenever someone is killed the location of the killer and the person killed. The information should contain [UID,LocationXYZ,Weapon,UnitRole,Squad,Side] if destroying a vehicle it should be [VehicleName,LocationXYZ,Squad,Side]. Beyond this I'd like to capture every units [UID,LocationXYZ] every second. When a player revives another player, repairs a vehicle or completes an objective I'd also like to capture that information. All this information would then be stored in a database for review in a chronological geographic timeline.

It seems like this could potentially be a lot of stress on a server capturing this information and sending it to a database. So would it be possible/worth having a dedicated client bot that would be in a spectator slot and would have a script that would capture this information and send it to the database?

peak plover
#

headless client

little eagle
#

Yes it would be possible.

#

Probably not worth it though.

tulip cloud
#

@peak plover Can you explain? I've never touched headless. I thought headless benefits mostly for having massive hordes of AI. I guess I would need to do a lot of research into the headless client because I have no idea how coding for one works vs the standalone dedicated server works.

little eagle
#

You can also use a headless client to run scripts instead of AI. It's the same idea.

peak plover
#

It's like a second server, can be used to run anything, ai, scripts anything

little eagle
#

I don't think anyone does it though, since it doesn't help.

#

In practice.

mortal halo
#

is there a way to delete grass under a ground holder?

#

invisible helipad is way too big

tulip cloud
#

Wait @little eagle you are saying headless clients don't actually help?

little eagle
#

No.

peak plover
#

You can use headless clients to run unscheduled loops, etc. It's a great resource

runic surge
#

anyone know if it's possible to make the wheels of a vehicle turn with scripting?

little eagle
#

Yes. It's not.

mortal halo
#

anyone knows a good smoke effect? the test for empty smoke object is too high for me

#

nvm

#

universal it is

obsidian chasm
#

I hope somebody can help :\

rancid ruin
#

share your initServer.sqf on pastebin or something if you want help bruh @obsidian chasm

obsidian chasm
#

ok

rancid ruin
#

just for future reference in debugging, it tells you the error there: undefined variable in expression bis_grp_main

#

meaning that variable is the problem

obsidian chasm
#

I'm still new so im in full panic mode right now

#

been working on this for like 11 hours straight for 3 days and when i finish this happens

rancid ruin
#

that's quite a lot of code

obsidian chasm
#

that doesnt sound good lol

rancid ruin
#

it's fixable, anything is

#

but editing an existing mission is never a good thing to start out with when you're learning

obsidian chasm
#

Yeah now I can see that

rancid ruin
#

BIS_grpMain isn't defined in initserver.sqf so it must be somewhere else

obsidian chasm
#

honestly... everything has been fine

#

Yeah I'm looking for it now

rancid ruin
#

you didn't actually share your RPT either

#

i'm probably not the guy to fix this, but share what you've got and someone might be kind enough

obsidian chasm
#

Was that not the RPT I sent?

rancid ruin
#

you shared screenshots then your initserver.sqf

obsidian chasm
#

ye my bad

rancid ruin
#

clear your RPT by deleting the contents, run mission once, then upload to pastebin

obsidian chasm
#

i cant believe ive done this

#

i'm actually devastated

rancid ruin
#

where's the original BIS mission from?

#

nvm, found it

#

each of your player characters should have this in their init

BIS_grpMain = group this;
#

maybe you changed characters by just deleting the old ones?

#

also, make sure all your player/playable characters are actually grouped together. in 3den editor, they should have a blue line going to their group leader

#

looking at your RPT, all the errors seem to be related to bis_grpmain so once you sort that out, it should be fine probably

obsidian chasm
#

Yeah theyre all connected and have that tag

rancid ruin
#

well that shouldn't be happening

#

are you 100% sure you've spelled it correctly?

obsidian chasm
#

Yeah..

#

100%

rancid ruin
#

case correct? no bis_grpmain

obsidian chasm
#

I copy pasted your one

#

I also have never touched this part

#

i wouldnt mess around with stuff like that

rancid ruin
#

that's weird, i have no idea why BIS_grpMain would be undefined in that case

obsidian chasm
#

while {true} do
{
{if ((side _x in [east,resistance]) and {((count units _x) == 0)}) then {deleteGroup _x}} forEach (allGroups - [BIS_grpMain]);
sleep 30;
};

#

is that worth anything?

#

in DeleteEmptyGroups.sqf

rancid ruin
#

mmm shouldn't be a problem but i'm not sure and i haven't written sqf in a while so i don't want to tell you to do X and fuck things up further

obsidian chasm
#

@tough abyss I take it you just formatted it for me?..

#

I wish I knew where to find it mate

#

Yeah It still says mission failed

#

when it fails I get this

#

There are vehicles on the map that can be used for escape though

lusty canyon
#

anyone know of an updated external config browser site? the last one i have only goes up to 1.62

icy raft
#

Joining the Life conversation from earlier, I did develop for free for a good community (no economic goals) and my code wasn't shitty, all well documented and formated for the future script kiddies that would joing the community. I did even manage to make my own framework over time. Not all are shit, not all steal, but it sucks trying to be the good guy and getting stolen from tbh. It's hard to compete when whatever you have worked hard on, someone comes and steals it. Had to wire a few core functions in RPC calls so the couldn't steal my shit without risking an BattleEye ban, with the consquenting overhead that comes with it.

tl;tr:
Life mods community has lots of intruders that just rip-off others content. no one is denying that, but they disapear when they realize it's more difficult than that. But not all Life communities sucks nor they are full of screamming ratkids, and you can find quality code written by serious organized people with amazing results.

lusty canyon
#

@daring pawn thanks for the links, the dropbox link has the jets dlc stuff right like new component classes? gonna see if its possible to turn a human being into a walking radar installation ๐Ÿ˜‰

sharp fable
#

@icy raft Whats your community?

icy raft
#

Can't tell becouse of spam rules, dear enemy of IE11

little eagle
#

I suggest taking this to a different channel.

icy raft
#

Roger, dear omnipresent @little eagle

daring pawn
#

@lusty canyon the latest one posted on the forum thread should do yes. Otherwise, there is references on the BIS Wiki for that specific thing AFAIK

thick sage
#

I remember that BIS_fnc_suffleArray was broken. Is it still broken?

vale halo
#

Hey Guys, I am making a rifle range and i'm trying to have a Control laptop where you can scroll on and use an action to upper and lower targets. The problem is, it works on singleplayer but not on multi, and its killing me. I've tried calling this trough the script that got called by the action: [targetsr1,0] remoteExec ["Rsp_fnc_animateTargets"]; aswell as [[targetsr1,0],"Rsp_fnc_animateTargets",true,true] spawn BIS_fnc_MP; where targetsr1 is an array of targets.

the function is as follows:
`private["_targets","_state"];
_targets = _this select 0;
_state = _this select 1;

{_x animate["terc",_state];} ForEach _targets;`

I've been trying a couple hours to get this working on multiplayer now with no result. The problem is is that the script seems to be executed locally only. Can someone help me fix it? I'm confused now and drowned in frustration about the locallity ๐Ÿ˜›

obsidian chasm
#

Damn...was hoping to wake up to a solution to my problem ๐Ÿ˜„

#

I'm going to have to start again arent I

still forum
#

@vale halo params and remoteExec. My first thoughts. Probably unrelated to your issue.

vale halo
#

Yeah i tried remoteExec

still forum
#

you could put a hint or systemChat into your function to see if it get's executed on the clients

#

so far it looks correct to me.

vale halo
#

And it only doesn't seem to work on dedicated servers ๐Ÿ˜’

still forum
#

your remoteExec exec's on everyone. Headless clients, Clients and Server.

vale halo
#

this addAction ["<t color='#FF0000'>150m up</t>",{[targetsr1,0] remoteExec ["Rsp_fnc_animateTargets"];},"",1,false,true,"","_this distance _target < 3"];

#

Thats my action

#

It works on singeplayer, local hosted multiplayer, but not on dedicated servers ๐Ÿ˜’

#

According to the remoteExec it should be running on multiplayer too right

#

like dedi servers

#

When i type the command ( {_x animate["terc",1];} ForEach targetsr1;) in the debug window and exec global or server it works tho

#

its just the way the script gets called atm it doesn't work on the dedi server

little eagle
#

Maybe Rsp_fnc_animateTargets is undefined on the server.

lusty canyon
#

code executed inside the addaction is always local unless specified? is it scheduled or unscheduled? if i uisleep do you have to spawn = {sleep}; first?
can you sleep inside the condition string to make it not evaluate on every frame?

little eagle
#

Always local, the statement is always scheduled. No, you don't need spawn. No, because the condition is unscheduled.

obsidian chasm
#

@rancid ruin I fixed it man. It seemed to be an issue with 'Empty Vehicles'

vale halo
#

wow im stupid

#

๐Ÿ˜’

#

my fault

#

the actual array with targets

#

wasn't public

#

GG

#

Thx for the help tho

lusty canyon
#

my client stutters horribly when populating a box with the first command:

_myBox spawn {_this addItemCargoGlobal ["TicTac", 300];};

with this second one it doesnt stutter so much:

_myBox spawn {_this addItemCargoGlobal ["TicTac", 100];};
_myBox spawn {_this addItemCargoGlobal ["TicTac", 100];};
_myBox spawn {_this addItemCargoGlobal ["TicTac", 100];};

they should be the same right? how do you make it add items slower? sleep on every 10 items?

still forum
#
_myBox spawn {
_this addItemCargoGlobal ["TicTac", 100];
sleep 0.1;
_this addItemCargoGlobal ["TicTac", 100];
sleep 0.1;
_this addItemCargoGlobal ["TicTac", 100];
};
tough abyss
#

@lusty canyon your question bout addAction:
youu ll find that information on the wiki page for addAction.
the code is executed scheduled but the condition is unscheduled.
the condition will be checked only if player is within 15 m of the object where the action is added to...

still forum
#

the sleep 0.1 forces the game to wait for one frame. Essentially the same what your multiple spawns are doing

tough abyss
#

... and no, u can't sleep inside of the condition because it's unscheduled.

split coral
#

wouldn't sleep 0.1 be one frame only when your fps is around 10? 0.001 would be better.

little eagle
#

sleep 0.001 is pointless, because that would mean it's executed in the same frame.

split coral
#

I thought sleep was always at least a frame. Might remember wrong though

little eagle
#

It's not. Try it.

split coral
#

Nah. Not that important to me

#

I believe you

little eagle
#

Then you shouldn't make statements like this : )

peak plover
#

Lower fps means that every frame takes longer to process and scheduled scripts still only get 3ms per frame. On low fps the time between frames would be bigger than your sleep. With 45FPS sleep 0.1 would be 5 frames. With 30 fps it would be close to 4. and with 10 FPS it would be 1 frame

split coral
#

Next time I'll check before stating

little eagle
#

That's a good estimate, but I'm not sure it's working out that smoothly in practice.

peak plover
#

Use waitUntil if you must ensure that it's running on a seperate frame, because waitUntil is checked only once a frame

little eagle
#

True.

still forum
#

@split coral Sleep always sleeps at least a frame.

split coral
#

I can't get this to fit the same frame:
[] spawn {sleep 2;_frame1 = diag_frameno;sleep 0.001; hint format ["1: %1 2: %2",_frame1,diag_frameno]}

#

fps 20

still forum
#

Yeah. Commy is wrong

peak plover
#

or diag_frameNo

still forum
#

Sleep puts the script to sleep till the next frame

split coral
#

AHA!

still forum
#

or waitUntil or uiSleep or anything else that pauses a script

peak plover
#

sleep checks if the sleep is over yet, if it's not it's not going to continue on this frame

split coral
#

sleep 0.0001 does fit the same frame though. ๐Ÿ˜„ or it equals zero sleep. dunno

peak plover
#

yes, but it only gets one chance per frame

#

If it fails it tries again next frame

#

Is it 0.1 ms in the future yet? No? Better try next frame

still forum
#

I never tried what sleep 0 would do tho

#

Don't know if the engine checks first before suspending

peak plover
#

just do this:

_spawnedTics = 0;
waitUntil{
    //_myBox spawn {_this addItemCargoGlobal ["TicTac", 300];};
    _myBox addItemCargoGlobal ["TicTac",1];
    _spawnedTics = _spawnedTics + 1;
    _spawnedTics isEqualTo 300
};
#

adds a tic tac every frame until it's added 300

#

takes 300 frames

little eagle
#
[] spawn {
    sleep 1;
    diag_log diag_frameno;
    sleep 0.0001;
    diag_log diag_frameno;
};

Same frame, 0.001, different frame. What does make the difference here?

tough abyss
#

@still forum if the engine doesn't check before suspending you could just do sleep.

little eagle
#

How would it turn out with >100 FPS?

peak plover
#

<trying>

split coral
#

240fps, same frame

rancid ruin
#

commy is wrong
explain this commy

peak plover
#

Does that mean it gets more than 1 checks per frame?

little eagle
#

I'm not.

#

Dedmen said sleep always skips a frame.

#

Yet 0.0001 doesn't.

#

0.001 does

#

But I haven't checked with >100 FPS yet

split coral
#

sleep 0.00001 > same frame when fps was 280

#

that's a very small nap

peak plover
#

0.001 skips frame

split coral
#

let's just assume no one plays with 300fps and 0.001 is probable way to skip a frame.

peak plover
#

more realistic to do 30-40

little eagle
#

let's just assume no one plays with 300fps and 0.001 is probable way to skip a frame.
Seems right.

tough abyss
#

How many 0s are we going to add after the decimal?

little eagle
#

Not too many.

tough abyss
#

sleep 0.pi1

#

Doesn't make any sense does it ๐Ÿคฆ

little eagle
#

I got one frame diff at ~150 FPS

#

14:26:45 [9135,148]
14:26:45 [9136,149]

#

Best I can do with this machine.

#

0.001 sleep

split coral
#

isn't diag_log slow for this?

little eagle
#

It also means that:

Lower fps means that every frame takes longer to process and scheduled scripts still only get 3ms per frame. On low fps the time between frames would be bigger than your sleep. With 45FPS sleep 0.1 would be 5 frames. With 30 fps it would be close to 4. and with 10 FPS it would be 1 frame

Is not really what happens, but at least a trend.

#

isn't diag_log slow for this?
Maybe that's why, idk.

peak plover
#

๐Ÿคฆ

little eagle
#

Could replace
diag_log diag_frameNo
with
diag_frameNo spawn {diag_log _this};
I guess.

still forum
#

@tough abyss No you couldn't. Because the command is not a nular.

tough abyss
#

Yes.

still forum
#

I know that sleep internally doesn't check what the current average frametime is. Probably sleep has a check like if time < 0.001 then don't sleep cuz too low value

little eagle
#

Seriously?

#

@tough abyss
You could write:

sleep (pi/10);

which would be the same.

obsidian chasm
#

So excited that the ww2 planes strafe run you and bomb you on my mission

#

its so cool ๐Ÿ˜„

peak plover
#

setVectorUp influences object's bank

#

What is bank

tough abyss
#

X and Y rotations

peak plover
#

bank is the total of x and y rotations?

tough abyss
#

i think pitch and bank are the same as X and Y rotation

#

not familiar with these namings tho

peak plover
#

pitch == x rotation. bank === y rotation?

tough abyss
#

yaw is Z iirc

#

not sure which one is which

peak plover
#

okay, how do I use setVectorDirAndUp to set an completly random vector

tough abyss
#

Up and Dir vectors need to be in a 90 degree angle to eachother or it will do weird stuff

peak plover
#

Ok so i need random dir and then calculate an up that's in correlation to that

peak plover
#

When we were learning that in school, I said "I'll never need this". And here I am now, requiring something I forgot because I thought it was irrelevent

indigo snow
#

Make two random vectors, get the cross product, and you have orthogonal vectors

#
_dir = randomVector;
_ab = randomVector;
// make sure that _ab is not a multiple of _dir, eg _dir vectorDot _ab isnt 1
_up = _dir vectorCrossProduct _abc;

Would be quick semi-SQF

peak plover
#

irl north pole is vector up?

little eagle
#

I think yes, but there are unlimited perpendicular lines on a sphere that all point in a different direction.

#

In Arma, the world is flat, so there is no north pole.

peak plover
#

up is always up

little eagle
#

In Arma, yes.

#

On a sphere, there would be different "ups" depending on where you are.

#

E.g. the south pole also points up.

peak plover
#

from center to me is my vector up, because the vector keeps going infinitely

indigo snow
#

[0,0,1]

little eagle
#

From earths core to any point on the surface is up, yes.

peak plover
#

Why is there cos and sin etc. but no degreeToVectorNumber?

indigo snow
#

uh

#

what is vectorNumber?

little eagle
#

You mean a function that converts polar to vector coordinates?

peak plover
#

Yea?

indigo snow
#

you can't really do that automatically

tough abyss
indigo snow
#

you need quaternions and shit

#

or manually check things

little eagle
peak plover
#

Why is there a default command for cos on my calc, but no degToVec

little eagle
#

One angle does not make a vector.

#

You need two.

#

In 3D at least

indigo snow
#

degToVec is nonsensical, they have no units

little eagle
#

In 2D it would make sense I think.

indigo snow
#

vec = [cos(angle),sin(angle)] then

#

but in even then you have some issues

#

because sin and cos are on a unit circle

#

e.g. 45 and -45 are the same for cos

little eagle
#
params ["_mag","_dir","_elev"];

private _magCosElev = _mag * cos(_elev);
[_magCosElev * sin(_dir), _magCosElev * cos(_dir), _mag * sin(_elev)];
#

_mag can be 1 for unit vectors.

#

I posted this already. CBA_fnc_polar2vect

peak plover
#

[random 360,random 360,random 360] call cba_fnc_polar2vect;

little eagle
#

_mag is not an angle. It would have to be 1

indigo snow
#

polar coordinates have 1 length and 2 angles

little eagle
#

Yes, but if we're talking about direction vectors, then the length doesn't matter and the setVectorBlah commands need unit vectors.

#

So 1

indigo snow
#

yea, it was mostly adding to your reply

little eagle
#

I see.

#

Should be all clear now.

lusty canyon
#

thanks nigel commy ded green and others for that insightful back and forth, i understand the relationships between frames sleep sched/unsched much better now.
here is my box of TicTacs based on nigels code:

[_myBox] spawn {
_myBox = (_this select 0);
_spawnedTics = 0;
    waitUntil    
    {
        _myBox addItemCargoGlobal ["TicTac",1];
        _spawnedTics = _spawnedTics + 1;
        if (_spawnedTics == 300) exitWith {hint "im done";};
        false;
    };
};

using the above i dont get any stuttering anymore (loss of only 2fps while populating compared to 12fps before)

im i right to assume you dont need to use any sleeps inside a waituntil considering it will automatically limit itself to one loop per frame?

while in a WHILE DO loop you need sleep since it will burn itself out trying to constantly loop multiple times per frame right?

little eagle
#

True, but keep also in mind that, only for waitUntil loops, you cannot leave the scope simply by using exitWith. The exitWith code block should always return true if you want that.

#

Your loops in endless and prints "im done" every frame after a while, while still adding items.

lusty canyon
#

so i should change it to

 if (_spawnedTics == 300) exitWith {true};
little eagle
#

I guess it wouldn't print the hint, but still add items, since you use ==

#

Yeah. The hint can stay for debugging.

peak plover
#
waitUntil {
    code; // should not return anything
    (condition)// should return true or false, when this is true, the loop will quit and continue at code2
};
code2;// script continues
little eagle
#
waitUntil {
    if (condition) exitWith {true};
    false
};

Also works, but raises the question: way use it this way?

lusty canyon
#

readability?

little eagle
#
    waitUntil    
    {
        _myBox addItemCargoGlobal ["TicTac",1];
        _spawnedTics = _spawnedTics + 1;
        _spawnedTics == 300
    };
#

Why not this? Seems more readable to me.

lusty canyon
#

i tried that one, it only ever makes just 1 tictac

little eagle
#

I don't think that can be. Must be a mistake.

lusty canyon
#

i checked the rpt, nothing. only when i added false and exitwith only then did it loop properly

little eagle
#

You made a mistake. This works.

lusty canyon
#

this is strange before it would stop at making just 1 item, now using your code the box is there but no tictacs at all

#

wait ur right, my bad i had an extra bracket it works

sharp fable
little eagle
#

You can not.

sharp fable
#

Is there an alternative?

lusty canyon
#

{ _myContainer addItem _x} foreach ["itemClassname1","item2name"];

little eagle
#

or

for "_i" from 1 to 20 do {
    _unit addItem "blah";
};
#

for 20

sharp fable
#

That looks nice

#

thank you man

peak plover
#

How come setVectorDir only change the vector around the x axis

lusty canyon
#

you need setvectordirandUP

peak plover
#

setVectorDir only changes where X vector is pointin?

indigo snow
#

no, likely your UP vector is along the X axis

#

Dir rotates around Up

peak plover
#

z axis?

indigo snow
#

no or it would rotate around that wouldnt it

#

check your vectorUp

peak plover
#

It modifies the rotation around the Z axis, in doing so it modifies where X axis and Y axis points at?

indigo snow
#

it doesnt rotate around the Z axis, it rotates around the Up axis

peak plover
#

z != up?

indigo snow
#

not if youve changed it

#

check the notes on the wiki for the command

#

im not too good at explaining this

peak plover
#

๐Ÿ˜• ๐Ÿ”ซ

indigo snow
#

just check the image here

lusty canyon
peak plover
#

vector dir and up have to be 90 degrees

#

ok, i've grasped the concept slightly, however some aspects remain questionable

#
_target setVectorDirAndUp [[random 2 - 1, random 2 - 1, random 2 - 1], [0, 0, 1]];
#

This is what I use and it seems to provide a fully randomized rotation on all 3 axis

tough abyss
#

up and dir vector need to be fixed into a 90 degree angle

#

hmm doesn't look right to me at all

peak plover
#
[] spawn {_target = cursorObject;
_pos = getPosASL _target;
while {isNil "rotate_cancel"} do {
_target enableSimulation true;
_target setPosASL [_pos select 0,_pos select 1,2];
_target setVectorDirAndUp [[random 2 - 1, random 2 - 1, random 2 - 1], [0, 0, 1]];
_target enableSimulation false;
sleep 0.1}}

sometimes points up sometimes points down, sometimes points right, sometimes points left, sometimes points forward, sometimes points backwards. and all combinations inbetween

lusty canyon
#

i had the same issure with that command when i was trying to align a camera on an attached vehicle, gave up on it and used fnc_setpitchbankyaw instead (degrees as args not silly 0 - 1)

indigo snow
#

[random 2 - 1, random 2 - 1, random 2 - 1], [0, 0, 1] these two vectors will typically not be orthogonal

#

and with the Up vector remaining [0,0,1] might behave more like a simple setDir

peak plover
#

it's like setDir but rotates on all axis

indigo snow
#

no because you keep your vectorUp to [0,0,1]

#

imagine your body, your head has to stay pointing straight up from your feet, youd only be able to rotate 360 degrees around the compass, right?

peak plover
#

vector up is [0,0,1]. vector dir is the direction of the vector in correlation to the vector up

indigo snow
#

vectorUp is the vector from your feet to the top of your head

#

if you keep that [0,0,1]. your direction can only be rotating around the compass

still forum
#

Too that waitUntil... count frames stuff. There is no guarantee that a waituntil condition is evaluated every frame

peak plover
#

@still forum waitUntil guarantees that it's checked only once per frame

still forum
#

at max yes

#

It is checked between 0 and 1 times per frame

peak plover
#

Depends on how full your scheduler is.

indigo snow
#

yes

peak plover
#

vector up is the direction that your vector (z) is pointing

still forum
#

If you really want to count frames.. Just use diag_frameNo.

_start = diag_frameNo;
waitUntil {diag_frameNo > _start+300};

peak plover
#

He needed 300 ticktacs not frames

still forum
#

Ouhhh

#

That's what it was about lul

indigo snow
#

@peak plover i feel youre really not fully understanding this vector business

still forum
#

I thought that was part of the sleep discussion we had a few hours ago

indigo snow
#

vectorUp is not always the world Z vector

still forum
#

@peak plover the Z axis is always pointing upwards

#

By definition

indigo snow
#

e.g. the vectorUp of a plane taking off is not [0,0,1], itll point up and a bit to the rear

#

and the vectorUp of something upside down is [0,0,-1]

still forum
#

vector up is the Normal of your forward vector that points upwards

indigo snow
#

(upwards relatively to the model)

little eagle
#

It is checked between 0 and 1 times per frame
Either 1 or 0 times, not "between"

#

:^)

still forum
#

Well if you take the average of several frames

icy raft
#

Let's add this to all our code and ask for payment for "optimizing" the code.

for "_i" from 0 to 10000 do {
    diag_log "WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE WASTE IO TIME PLEASE "
}
#

(Joke, please do not kick/kill me)

peak plover
#

-nologs

icy raft
#

@peak plover I hate you.

#

๐Ÿ˜‚

peak plover
#

๐Ÿ‘

icy raft
#
[] spawn {
    while {true} do {
        for "_i" from 0 to 10000 do {
            variableLove = str _i;
            publicVariable "variableLove";
        };
        sleep 0.1;
    };
};

@peak plover Fix this.

#

#iwon

still forum
#

why 10k tho.. Why not just a endless while loop

icy raft
#

A while loop breaks at 10k anyway

still forum
#

no

#

you are in scheduled here

icy raft
#

Well yeah, just... Why not?

#

lol

#

It will break network in 5 secs anyway

still forum
#

no reason. Just use a while loop

peak plover
#

"variableLove" addPublicVariableEventHandler {call compile (_this select 0) = nil;};

#

but i feel like it will still cause network traffic

#

no clue, never used that command

icy raft
#

I was just kidding

peak plover
#

There's a limit on the servers that limits the packet size etc.

#

and amount of packets

#

So that would be impossible

icy raft
#

But I did it once becouse an admin was ignoring me on a UI textbox flaw

peak plover
#

Does it work?

icy raft
#

It does, any call to publicVariable syncs its value to every client anytime it's called

#

With the consequent traffic

#

An effectis way to DOS a A3 server

#

Serious question: Can you use a unsigned .dll addon in serverside with BE enabled?

still forum
#

yes

#

"variableLove" addPublicVariableEventHandler {call compile (_this select 0) = nil;};
That's not how SQF works

peak plover
#

I think it adds to the packet and if your client has to send too much, some of it will get cut out, causing it to be added to the next packet, and so on. This means the client will get desyncronized and should eventually catch on unless the loop is infinite

#

publicvariable should not force a new packet to be sent. It will only deny the client

tardy wagon
#

MOTHER OF GOD

#

WHAT AM I

sharp fable
#

what does all these "global" commands mean?

#

there are non global and there are global ones

#

Multiplayer:
Command is executed on all connected clients in multiplayer.

#

Is that the correct explanation?

little eagle
#

addMagazineCargo is pretty unusable in Arma 3, because it can only add the item locally when executed on the machine where the box is local.

#

Is that the correct explanation?
No.

local arguments: command needs to be execute on the machine that owns the object
global arguments: command can be executed on any machine
local effects: command has to be executed on every machine to have effect everywhere
global effects: command should/must be only executed on one machine (e.g. server)

#

It's all on the wiki somewhere

tame portal
#

@still forum

#

This (was atleast) is a sufficient ArmA killer

#
while (true) do {
    screenshot "";
};
still forum
#

๐Ÿ˜„

#

Yeah. Can imagine

#

But you could just crash the game if you want a Arma killer ^^

tame portal
#

preprocess a file that has a faulty include?

still forum
#

Didn't even think of that ๐Ÿ˜„

#

Yeah

#

I thought about using the eventhandler crash that I reported over a year ago

little eagle
#

while {true}
not
while (true)

digital pulsar
#

is player removed from his group when he dies in MP? respawn on custom position

tame portal
#

@little eagle #normallanguageshabbit

peak plover
#

Btw, was "definecommongrids.inc" from ui_f not included in the server version of ui_f?

#

It seems to be included now

little eagle
#

Did your server crash when picking a mission?

lusty canyon
#

how do you get the ATL altitude of a chopper? _myHeli distance getPos (something?)??

peak plover
#

previously, when #include "A3\ui_f\hpp\defineCommonGrids.inc" in mission, yes

indigo snow
#

_alt = (getPosATL _heli) select 2

lusty canyon
#

ty cpt

peak plover
#
_alt = (_heli getPosVisual) select 2
#

also good

indigo snow
#

actually better in most cases since it gives height above water when the heli is above water

#

except you have the command and the argument reversed ๐Ÿ˜‰

peak plover
#

ohh shit, I do

#

It also shows 0 if you land on a rooftop

#

or carrier

indigo snow
#

mhm thats a shame

lusty canyon
#

can you get the altitude above water and terrain? or check for if heli is flying over land or sea?

indigo snow
#

AGL should be what you want

lusty canyon
#

wiki says:

Returns an object's rendered 3D position (z value above sea when over sea, or above ground when over land) in render time scope

what does render time scope mean?

peak plover
#

PositionAGL and compare to ASLW and ATL to find out if you are above water?

little eagle
#

@peak plover When you include addon space files in a description.ext, a PBO packed (binarized?) mission will crash on a dedicated server.

peak plover
little eagle
#

The solution is to copy paste the file you want to include into the mission folder and include that.

peak plover
#

why only on dedicated?

little eagle
#

Dedi only

peak plover
#

Addon locations are saved to memory. To include a file from one of them write:

little eagle
#

@lusty canyon There is a simulation scope and a render scope. Simulation scope is where the object is. Render scope is where the object is drawn. The render scope is updated more frequently to make fast moving objects look smooth. Visual reads from the render scope, other commands from the simulation scope.

#

You want to use the render scope when drawing nametags, because otherwise they would be choppy.

peak plover
#

for description.ext, addon configs โ€“ game root folder (where exe file is)

little eagle
#

Also getPos and getPosVisual don't report PosAGL. They report PosAGLS. z=0 is the first "walkable" surfice below the model, not necessarily the terrain. This is important when flying over houses. There can be multiple z=0 in one X,Y position for every floor in buildings plus one for the terrain.

#

@peak plover

why?
It's a bug.

#

The real question is why it's not fixed yet.

lusty canyon
#

wow now its getting real, where is my panadol

#

so i need to make multiple checks first on the object then decide which getposType to use?

little eagle
#

If you want to retrieve the PosAGL format, the best thing you can do is:

ASLToAGL getPosASL _blah
#

Or getPosASLVisual of course.

#

In simple terms, getPos sucks and player setPos getPos player will always move you under a building or walkable rock, because one command uses AGL and the other AGLS as format.

lusty canyon
#

what i want to do with the altitude is create a fast rope with length just slightly above the ground, player attaches to the end of it (feet not touching the ground)

little eagle
#

Yeah, first you have to define what you mean by "ground".

#

The terrain?

lusty canyon
#

yea terrain

little eagle
#

Or the up most walkable surfaces?

#

E.g. the roof of a building

lusty canyon
#

ah walkable like carrier deck too

little eagle
#

Then PosAGLS is what you want most likely.

#

Sorry for talking you out of it first lol. But maybe you know a bit more now :/

lusty canyon
#

so if i run posAGLS ( _heli ) select 2 i will get an array of walkable surfaces?

little eagle
#

No, the first one below the _heli

#

getPos, not "PosAGLS". That's just the name of the format, not the command.

#

The upmost one.

#

Will be z=0.

#

So the z will essentially be the height above the walkable surface below.

lusty canyon
#

so i can make my rope like this

_myRope = ropeCreate [ _heli, [0,0,0], _player, "pelvis", (((getPos _heli) select 2) -1)];

and hopefully the player is hanging off the ground / or sea level just by a tiny bit

little eagle
#

I never used ropes myself.

lusty canyon
#

just tested it, works great, doesnt even need the -1. player gets pulled up into the chopper. now i just have to test it on nimitz

#

what happens when the heli is directly under a vehicle? you cant walk on top of most vehicles, so getpos select 2 will be terrain?

little eagle
#

getPos takes z=0 from the first walkable surface below the vehicle.

#

Vehicles don't have a walkable surface. You fall through them (exceptions maybe in mods)

#

But if there was a carrier floating above the heli, then it would take the roof of the building below or the terrain if there is no building. z can never be negative in AGLS unless you are below the terrain or the waves.

peak plover
#

When do displayeventhandelers get deleted?

#

and can they be added to main game menus etc?

#

How do I run code as soon as game starts?

vapid frigate
#

i think you'd have to edit the RscMainMenu or whatever it's called (probably not that)

still forum
#

@peak plover
When you delete them or the display get's deleted
yes
preStart

tough abyss
#

Any suggestions on how to slow down a vehicle as if it would be more heavy?

digital pulsar
#

increase mass

indigo snow
#

Does setMass not do that?

tough abyss
#

fantastic, I ll try that. thank u @indigo snow

lusty canyon
#

does the mass of items inside infantry inventory affect rope physics? because even if my rope wind up speed is 9999m/s those fat bastards stay firmly planted on the ground

#

i have to give them a setvelocity nudge only then will the ropes carry them up

#

if a building lifting skycrane cant even lift you up, then how did you get past the recruitment office soldier?

obsidian chasm
#

Notepad++ is the hardest thing about scripting things I think

#

constantly jumping to a new line is going to kill me today

jade abyss
#

No clue what you mean oO

peak plover
#

Using notepad++ to write scripts
Notepad++ is the hardest thing writing scripts
constantly jumping to a new line writing many many lines

#

I guess

jade abyss
#

Still don't get his Problem ยฏ_(ใƒ„)_/ยฏ

peak plover
#

Writing scripts is hard

#

Because it takes many new lines?

jade abyss
#

Yeah, but what has it to do with n++? oO

#

It does?!

peak plover
#

It's what he uses. If he would use notepad.exe he would blame that.

jade abyss
#

never noticed (or you have that shitty autoLinebreak stuff enabled^^)

#

Not rly sure about that ๐Ÿ˜„

peak plover
#

Wait, are you saying that you don't write everything in one line?

jade abyss
#

Of course

#

No spaces

peak plover
#

Saves processor time

jade abyss
#

always using comment "blatext"

#

๐Ÿ˜‚

peak plover
#

exactly ๐Ÿ˜„

obsidian chasm
#

No

jade abyss
#

"No" to what?

#

lol

obsidian chasm
#

The issue is when you're using Notepad++ and click anywhere above or below your current line it takes you to a new line

jade abyss
#

uhm, no?

#

Check your settings

obsidian chasm
#

pls tell me if i can change this lol

#

its driving me crazy

jade abyss
#

Check the preferences, can't recall what the exact name was

obsidian chasm
#

lol..

#

guess ill just have to be driven crazy by this

indigo snow
#

How do people manage to find these hilariously hidden settings?

obsidian chasm
#

trial and error I guess..

indigo snow
#

So you click on any line in N++ and it immediately makes a newline below that and places your cursor there?

obsidian chasm
#

Um pretty much

#

If I click and move sideways to select all of a certain weapon or vehicle code

#

if I move anywhere above or below it it takes me right back to the beginning of the line, no matter how far along I am

#

and right now when im changing loadouts of 10 different soldiers to be all individual it's trying my patience...to put it lightly ๐Ÿ˜„

warm gorge
#

Is there a way to prevent the console from being opened ingame? Such as to prevent commands such as endmission from being executed

indigo snow
#

The cheat console? Not that I know

warm gorge
#

Yeah the cheat console. People using it to get around things on my server

indigo snow
#

The debug menu you can easily disable

peak plover
#

cheat console?

warm gorge
#

yeah

peak plover
#

This works online?

warm gorge
#

Yes

digital pulsar
#

so anyone can type in endmission?

peak plover
#

How to prevent strecthing?

lusty canyon
#

how do you bypass the 15 radius limit on addaction?

warm gorge
#

It wont end the whole mission but it will put them only to the lobby

indigo snow
#

You want something against combat logging?

digital pulsar
#

attach it to player, jaytac

#

and in condition check cursorObject

peak plover
#

Is there a way to check size/dimensions of an image or how do I force images to not stretch

indigo snow
#

Please now theres three questions at the same time going

digital pulsar
#

well u contributed to that ๐Ÿ˜„

warm gorge
#

@indigo snow The reason im looking into this is because I have an auto data-save which can be avoided to like exploit it with this

lusty canyon
#

@digital pulsar was trying to avoid adding to player again cuz of the constant condition checks + would then have to do removeActions while deleteVehicle cleans up nicely

digital pulsar
#

well there you go, 15m or slight performance drop

#

every action on a vehicle executes different script?

#

if it's the same u can just have 1 action

#

and put cursorobject into parameters

indigo snow
#

I remember people looking into this like a year ago but I cant for the life of me remember what came from it, @warm gorge . You might try looking into if it creates a dialog or something.

peak plover
#

Add your save to this

indigo snow
#

Does that fire when the cheat is used?

peak plover
#

I assume all cheat does is run endMission

warm gorge
#

Yeah it does Triggered when mission ends, either using trigger of type "End", endMission command, BIS_fnc_endMission function or ENDMISSION cheat.

#

that might actually work

peak plover
#

So the dimensions to my image are 1024 x 512. I want to either detect other images as well and check the dimension somehow, or how do I stop the image from stretching ( i want fullscreen ) using RscPictureKeepAspect

peak plover
#

it works

vague hull
#

is there a way to fetch the attachment positions for a weapon?
Been a while since I did stuff like that

tough abyss
#

afaik the weapon is not part of the "world"

#

you can only access the weapon bone i think

#

kinda shitty explenation ๐Ÿ˜„

sand pivot
#

i'm writing a incoming fire detector for rpgs since addEventHandler ["IncomingMissle"] doesn't work for player fired rpgs. Anyone have an idea for a good way of doing this?

#

my current thought was using fired event handler on everyone but exitWith if they fired something other than a rocket or missile but that seems messy

heavy plover
#

Is there a way to publicVariable an Array of UIDs? I keep getting Error publicvariable: Type Array, expected String ๐Ÿค”

#

I get you can't because the syntax needs to be a string but is there an alternative

sand pivot
#

the string is the variable you are trying to make public i thought. have you tried using putting your variable name in "quotes"?

heavy plover
#

Nah. I'm not that smart, thinking of it now though. That sounds like a good idea. Thanks ๐Ÿ˜„

peak plover
heavy plover
#

What res are you using? @peak plover

peak plover
#

1920x1080

heavy plover
#

Perhaps it is an issue with your description.ext?

peak plover
#

Don't think so. It's in good proportions now, but

heavy plover
#

๐Ÿค”

peak plover
#

The small box on right is clipping

heavy plover
#

Does it happen for all of the players?

peak plover
#

1 out of 1. 100% all players currently

heavy plover
#

Could you get someone else to try joining and see if they have the issue too?

distant egret
heavy plover
#

@distant egret Thanks. idk how but I didn't see that. ๐Ÿค” โค

peak plover
#

finally. ONe of the controls had a - in it so i didn't think it's the highest point

#

It's almostl ike the good old arma 2. Now mission makers can include fullscreen images to set the tone

distant egret
#

@peak plover That's pretty cool, how did you achieve that?

peak plover
#

config + onload

#

it's a mod

distant egret
#

I personally liked the arma 2 loading screen a lot more as you can show a lot more information.

peak plover
#

Exactly

distant egret
#

You change the loading screen dialog?

#

So does it use the loading screen picture or is there a different file path needed?

peak plover
#

It uses the same images as normally in the tiny window
loadScreen and if it does not exist then it uses overviewPicture

#

both from missionconfigfile

distant egret
#

cool, and on the bottom right can that be removed?

#

Or does that mean changing the whole dialog?

peak plover
#

Yeah, but I thought I'd leave for map info...

distant egret
#

You could just leave the text yea

peak plover
#

I could try removing that, I guess...

distant egret
#

but the pixture

#

picture*

obsidian chasm
#

It amazes me that missing just one " out of a small script collapses the whole thing

distant egret
#

because everything becomes a string ๐Ÿ˜›

obsidian chasm
#

I don't even think what I'm doing in scripting ๐Ÿ˜„

#

it's probably not lol

tender fossil
#

Do you guys happen to know any possible places where scripters might be lurking? My team is working on an open source Arma project but we'd like to have more scripters working on it to speed things up

#

I've promoted the development on Discord channel and on forums, but they don't seem very effective, while contacting developers directly seems to work

spark cobalt
#

which I now see you've already tried

icy raft
#

@tender fossil we don't lurk, we just hide below rocks and only come out when summoned with worthy food offerings

tender fossil
#

@obsidian chasm So I need to add pizza and good beer as benefits? ๐Ÿ˜„

obsidian chasm
#

oh god dont ask me ๐Ÿ˜„

#

I'll burn your server down by accident hahaha

icy raft
#

Ususally it's a good combination

still forum
#

@tender fossil Make something great that People will want to put time into

tender fossil
#

@still forum I believe we do ๐Ÿ˜› I think a lot more people would be interested in the project if I got the chance to explain the details

still forum
#

Github link?

tough abyss
#

If its opensource i would just link the repo. But i assuming its some sort of life mod, so prob have less people interested in working on it imo

icy raft
#

Making a project moving is painful

tender fossil
#

It will become open source after v1.0 release @still forum , though we can change it to open source earlier too if people think it's good option

still forum
#

So it's actually not open-source and you have nothing to show to attract people

icy raft
#

I remember when I tried to make Project Arkana or Purelife, no one joined

tender fossil
#

And technically it's neither a Life gamemode or mod, it's multiplayer mission (framework) that's quite different from Life as gamemode

little eagle
#

Oh boy.

tender fossil
#

Well, if someone is interested, I can grant access to our repo if you want to take a look ๐Ÿ˜ƒ

icy raft
#

And Arkana was really something else ๐Ÿ˜„ Magic in Arma 3 ๐Ÿ˜„ ๐Ÿ˜„

tender fossil
#

But if you guys really think it would be better to go open source also during the development of first full version, we'll take it into consideration

peak plover
#

If you already have more than 1 people working on it and use gitlab or similar, you might as well have it public, as it does not make it harder for you. But if you work on something on your own and can't be arsed to upload to a cloud every change you do, you should keep it closed until you are ready