#arma3_scripting

1 messages ยท Page 314 of 1

rotund cypress
#

It's the same thing

#

Just that it automtically look up onPLayerRespawn if that file is in the directory

little eagle
#

It's not the same thing.

copper raven
#

commy2, explain more if you can.

little eagle
#

You can have infinite respawn eventhandlers and even remove them mid mission, while the file is either there or not.

#

Also I think the file runs in scheduled environment so you might have to take care of race conditions.

#

And the file is not possible to use when you're making an addon.

rotund cypress
#

No reason to have the file though

#

Essentially the same thing though

#

The handler is exactly the same

#

Runs on when you respawn

#

Conclusion from me: setup the eventhandler with addEventHandler

#

and don't use the file

copper raven
#
             params ["_unit"];
            
            _jetType = selectRandom ["I_Plane_Fighter_03_AA_F","I_Plane_Fighter_03_CAS_F"];
            private _SPAWNPOS = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");
            private _jet = createVehicle [_jetType, _SPAWNPOS, [], 3500, "FLY"];
            _unit moveInDriver _jet;
             _SPAWNPOS = getPosASL _jet;
            private _jetvelocity = velocity _jet;
            _SPAWNPOS set [2, 1000];
            _unit moveInDriver _jet;
            (vehicle _unit) setPosASL _SPAWNPOS;
            (vehicle _unit) setVelocity _jetvelocity;

this is what iam using

#

so your recommendation is using eventhandler for it?

rotund cypress
#

onPlayerRespawn is an eventhandler

#

It's just two different ways of using it

#

But yes, use addEventHandler command to add eventhandler to mission

copper raven
#

kk,will see what i can do

little eagle
#

What is the point of setVelocity here?

copper raven
#

have a setDir in otherfile

#

not finished yet

rotund cypress
#

But it will just set the same velocity as it already has?

copper raven
#

no, as i asid not finished

little eagle
#

The vector would be rotated, Sim

copper raven
#

yea

rotund cypress
#

Ah ye ok, didnt think of that

little eagle
#

I'd keep using _jet instead of (vehicle _unit)

copper raven
#

see,sometimes it bugs out with a player, and setVelocity would fail

#

so for that , iam using (vehicle _unit)

#

happens for clients tho

#

not host

little eagle
#

Don't see how that would fix anything.

rotund cypress
#

Just do a check to see if player is in vehicle

#

a waitUntil or something

copper raven
#

idk, seems like it doesnt fail anymore after i started using

(vehicle _unit)
little eagle
#

Hope scripting

rotund cypress
#

It wouldnt change anything

#

Your player is always a vehicle

#

It would give same result

little eagle
#

It's as effective as sugar pills are.

rotund cypress
#

Hahah

#

@copper raven Essentially what the vehicle addition to player does is that if you are in a vehicle, it returns that vehicle

#

If you are not in a vehicle, it just returns the player

#

So at the end of the day, it's the same thing

#

If you just wait until your player is in the vehicle, it will be fine

#

Also, use the vehicle as Commy said

#

Then your problems should be solved

copper raven
#

also one more question,

_allWeapons = "true" configClasses (configFile >> "cfgWeapons");
_weaponArr= [];
{
    _weaponString = configName (_x);
    _parents = [_x,true] call BIS_fnc_returnParents;
    
    if ("Rifle" in _parents) then {
        _weaponArr append [_weaponString];
    };
}forEach _allWeapons;

some weapons are bugged/broken
using this to get a randomweapon, to add to groundweaponholder, and some weapons either dont have sound, or dont have animation, etc, is there any way to exclude them?

little eagle
#

Well in CfgWeapons there are also base classes and pre equipped weapons.

copper raven
#

i hinted the array, and it has some base classes

#

yea

little eagle
#

Of course some of those cannot be used or shouldn't be used.

copper raven
#

so is there a possible way of exluding them?

#

maybe using isKindOf condition, but dont think it would work

little eagle
#

The whole BIS_fnc_returnParents thing is a bit messy.

copper raven
#

would still use "Rifle" so doesnt matter

little eagle
#

wait

#
private _allWeapons = "getNumber (_x >> 'scope') == 2" configClasses (configFile >> "CfgWeapons") apply {configName _x};
    
_allWeapons = _allWeapons select {
    _x isKindOf ["Rifle", configFile >> "CfgWeapons"];
};
#

I guess

copper raven
#

sec,gonna test it

#

checked alot of buildings, seems like thats it, didnt find any broken weapon

#

thanks

#

or maybe thats just luck ๐Ÿ˜„

little eagle
#

apply and select is nice

#

Idk what you mean by "bugged weapons".

jade abyss
#

there is also pushback

little eagle
#

It will not work with base classes, that's for sure.

#

Yeah, append [element] is weird.

copper raven
#

they spawn as invisible, without icon in inventory, when equipped , there is no sound when shooting/no animations etc, and weapons are invisible while holding

jade abyss
#

(tbh. i never used append)

little eagle
#

Rare compared to pushBack, but sometimes you need it.

jade abyss
#

Can you give me a case, where append should be used?

#

Ah, okay.

little eagle
jade abyss
#

ewwwwww

#

Macromaniac

#

๐Ÿ˜›

#

and oneliner

#

eeeeewwwwwwwwww

#

*giggle*

little eagle
#

Where do you see a bad one liner?

vapid frigate
#

the _allWeapons code above probly should be a 1 liner for performance.. don't need the select, just the 2 conditions for configClasses

#
private _allWeapons = "getNumber (_x >> 'scope') == 2 && (configName _x) isKindOf ['Rifle', configFile >> 'cfgweapons']" configClasses (configFile >> "CfgWeapons") apply {configName _x};
jade abyss
#
    if (_x select 0 == "") then {
        if (_x select 1 == "preInit") then {```
#

2 of them @little eagle

#

๐Ÿ˜„

thick oar
#

ha... i found something most retarded today.

Inside a config MACRO was something like this

parameter = __EXEC(_dam = 0; while {_dam < __VAL__} do {_dam = _dam+1}; _dam)

No idea what they were smoking. ..

little eagle
#

@jade abyss
Nothing woring with this control structure:

if () then {
    if () then {
    } else {
    };
};
#

@thick oar looks strange

jade abyss
#

@little eagle
Thats... no. Just no. Thats torturing.

little eagle
#

Actually it's

#
    if (cond1) then {
        if (cond2) then {
            ...
        };
    } else {
        ...
    };
#

What else do you suggest?!

tough abyss
#

sometimes its even necessary cause u can't evaluate 2 conds in 1 if clause if they are dependent from each other

jade abyss
#
if()then
{
    if()then
    {
        //code
    }
    else
    {
        //code
    };
};

OR

if()then
{
    if()then    {//ShortCode};
    else        {//ShortCode};
};
tough abyss
#

other question; is there a big performance difference between missionConfig crawling to get values out of a custom config or is it faster to select from an array out of a sqf-function?

still forum
#

((cond1) && {then;true}) || {else}

jade abyss
#

โ˜ proof, that dedmen loves to walk barefoot on Lego. Damn masochists.

little eagle
#

How is that any different aside from different formatting style?

#

And the last one is pure cancer

#

Googol, define "missionConfig crawling"

#

Dedmen has a point. if-then-else is so 2016

(cond) && {then; true} || {else}

is the way to go

#

/s

tough abyss
#

@little eagle

well for example using:

getText(missionConfigFile >> "licenseConfig" >> str(playerside) >> _x >> "icon"); //defined in the licenseConfig.h

to get the iconpath or

_x call bla_fnc_iconpaths; //defined in a switch-case structure

both variants return the string to the icon path

little eagle
#

probably the mission config one, but depends on how many of them exists and I can also think of a faster method than both.

tough abyss
#

@little eagle oh, could you tell us? ๐Ÿ˜„

#

if its anything besides of callextension

little eagle
#

inb4 I get screamed at again

#

Do you have CBA available, Googol?

tough abyss
#

unfortunately, no

little eagle
#

How often do you use bla_fnc_iconpaths per client per mission?

jade abyss
#

*fortunately
fixed

tough abyss
#

xD its just an example we had this once in a mission

#

do you think of saving into ram and selecting with indexes?

little eagle
#

Well if you only need one icon per mission per client, then it doesn't matter

#

Then you can use whatever you want and it wouldn't make any difference worth worrying about.

tough abyss
#

well the icons are added to a listbox, there are 150 entries of licenses

little eagle
#
// init
My_Icons = createLocation ["Name", [0,0], 0, 0];
My_Icons setVariable ["icon_name_1", "icon\path\1.paa"];
My_Icons setVariable ["icon_name_2", "icon\path\2.paa"];
My_Icons setVariable ["icon_name_3", "icon\path\3.paa"];

// mid mission
My_Icons getVariable "icon_name_1"
#

You cannot get faster than this, but it's obviously not worth to create the namespace and set all the variables if you only use it once.

#

This uses C++ hash stuff.

tough abyss
#

so do you think its more efficient to just create a variable and safe every entry into this variable as array, just with pushbacking?

and afterwards selecting with find?

#

*save

little eagle
#

No, that would be slower than what I wrote.

#

But again. If it only chooses one or like ten icons per mission, who cares. Choose what you're most comfortable with. This one is the fastest you can get.

tough abyss
#

thanks for your advice commy

copper raven
#

is there a way of rotating a moving jet mid air?, tried this:

    _velJet = velocity _jet;
    _jet setDir 180;
    _jet setVelocity _velJet;

but jet doesnt stay on its velocity, it uses the velocity on previous dir, i would need to rotate vector or something?

#

using createVehicle , jet spawns with dir==0(north), but i need it to face 180 (south)

tough abyss
#

Because velocity is in 3 parts, designated towards a direction.

#

This is for adding speed on the current direction. So do some math on reversing it. I can't think math right now haha

_vel = velocity _vehicle;
_dir = direction _vehicle;
_speed = 10; comment "Added speed";
_vehicle setVelocity [
    (_vel select 0) + (sin _dir * _speed), 
    (_vel select 1) + (cos _dir * _speed), 
    (_vel select 2)
];
#

Couldn't you just multiply the current velocity in the [x, y, z] directions and do [-x, -y, -z].

#

From the original velocity (speed in direction)

#

Like this:

_vel = velocity _vehicle;
_vehicle setDir 180;
_vehicle setVelocity [
    -(_vel select 0),
    -(_vel select 1),
    -(_vel select 2)
];
#

@copper raven

copper raven
#

will try

little eagle
#

180 is trivial, but for rotating the velocity vector around an arbitrary angle I'd convert the vector to polar coordinates first.

#
private _velocity = velocity _vehicle call CBA_fnc_vect2Polar;
_velocity set [1, (_velocity select 1) + 180];
_velocity = _velocity call CBA_fnc_polar2Vect;

there. rotated arbitrarily.
Still no idea if this exists as BIS function.

copper raven
#

its CBA fnc

vapid frigate
#

you can do it with getpos

#

origin getPos [distance, heading] (Since Arma 3 v1.55.133361)

#

actually thats the overall position.. would need to subtract the origin pos then

little eagle
#

I think you can hack that together, wait

#

obviously won't work with the inclination angle

#

But the plane shouldn't dip anyway, so...

vapid frigate
#

[0,0,0] getPos [speed, 180];

little eagle
#

Yeah, but also convert kmps to mps when using the speed command

vapid frigate
#

not sure what that will do with height actually

little eagle
#

z is 0 as the plane flies straight.

vapid frigate
#

yeh i mean that getpos will be agls

#

i guess it should stay 0?

little eagle
#

This syntax uses AGL I think, not AGLS

#

z will always be 0

vapid frigate
#

might need to set it to 0 or it's previous z velocity anyway

#

depending on the effect you want

copper raven
#

alright gonna hop on arma, will let you know if i get it to work

vapid frigate
#
_speed = vectorMagnitude velocity _vehicle;
_vehicle setDir 180;
_vehicle setVelocity ((vectorDir _vehicle) vectorMultiply _speed);
#

i guess that should work too

copper raven
#

@vapid frigate works like a charm, thanks guys

little eagle
#

yeah, lol. Sometimes it's simple.

hasty pond
#

Y'all got any ideas on why this just shows the rsc but doesn't set the structured text but when I wait a bit and then run the script again, it adds the text to the existing rsc? I'm completely lost

disableSerialization;

params["_structuredText"];

_lc = uiNamespace getVariable ["Alert", displayNull];

if(isNull _lc) then {
    3 cutRsc ["Alert", "PLAIN"];
};

(_lc displayCtrl 1100) ctrlSetStructuredText parseText _structuredText;

jade abyss
#

try

...
_lc = uiNamespace getVariable ["Alert", displayNull];
waitUntil{!isNull _lc};

3 cutRsc ["Alert", "PLAIN"];
...
little eagle
#

The layer maybe conflicts with something used by the base game.

vapid frigate
#

that's an infinite loop?

#

the waitUntil

#

Alert probably won't exist until after cutRsc

jade abyss
#

Okay, then:

_MaxTime = diag_tickTime + 5;
waitUntil{ (!isNull _lc || _MaxTime < diag_TickTime) };
vapid frigate
#

_lc will never change..

little eagle
#

Does uiNamespace getVariable even work like this?

#

Doubt it somehow

vapid frigate
#

only if you setVariable

jade abyss
#

If the Dialog sets the Var, then yes.

little eagle
#

Maybe there is an onLoad eh in the cutRsc config thing

vapid frigate
#

but i think the onload doesn't run immediately

little eagle
#

It does, Lecks

vapid frigate
#

oh ok

little eagle
#

: D

vapid frigate
#

i've always just done the setStructuredText in onload

#

to be safe

jade abyss
#
onLoad = "uiNamespace setVariable ['Display_HUD', _this select 0]; ";

onUnload = "uiNamespace setVariable ['Display_HUD', displayNull]";```
#

Example is from an RscTitles dialog config

little eagle
#

That onUnload is super pointless

vapid frigate
#

either way,waitUntil{ (!isNull _lc || _MaxTime < diag_TickTime) }; isn't useful :). it's like doing waitUntil {false}; or waitUntil {true}

jade abyss
#

dafuq?

vapid frigate
#

waitUntil{ (!isNull (uiNamespace getVariable ["Alert", displayNull]) || _MaxTime < diag_TickTime) }; would wait until it exists

hasty pond
#

_lc is defined onLoad in my case.

little eagle
#

You don't even need all of this

#
params["_structuredText"];

private _lc = uiNamespace getVariable ["Alert", displayNull];

if(isNull _lc) then {
    3 cutRsc ["Alert", "PLAIN"];
    _lc = uiNamespace getVariable ["Alert", displayNull];
};

(_lc displayCtrl 1100) ctrlSetStructuredText parseText _structuredText;
#

There, fixed

hasty pond
#

I'll try that ๐Ÿ˜ƒ

vapid frigate
#

thats assuming you're doing onLoad = "uiNamespace setVariable ['Alert', _this select 0]; ";

little eagle
#

Yes.

jade abyss
#

Thats what he wrote

hasty pond
#

Yup

little eagle
#

Also using plain numbers like 3 will probably conflict with some layers used by the game or mods.

hasty pond
#

So I should probably change that to like "alertLayer"?

little eagle
#

Yeah.

hasty pond
#

Aaalright

little eagle
#

Something unique.

#

BI uses BIS_fnc_rscLayer to generate a new layer and that starts at 0 and increments.

#

And there are like 10 of these for PP effects, so 3 is definitely already taken by something else.

hasty pond
#

Ah okay

#

My experience with displays, rscTitles and all that is pretty minimal...

hasty pond
#

Thanks for the help, works like a dream โค

little eagle
#

yw

vivid quartz
#

Hello, i would like to get a random position in marker or trigger, i tried using BIS_fnc_randompostrigger,but its not accurate enough is there an alternative?

#

also trigger or marker is rectangle, not ellipse

still forum
#

How is a random position not accurate enough?

vivid quartz
#

selects one outside marker etc

#

read bis forums, also found ppl with problems on bis_fnc_randompostrigger

little eagle
#
_position = _origin getPos [_radius * sqrt random 1, random 360];
#

Random position around "origin" in "radius"

#

z will be always 0, perfect for PosATL

vivid quartz
#

i was trying something like that, but it becomes ellipse if you use radius,i want rectangle

little eagle
#

Well it's a square, not ellipse

#

Is the rectangle rotated?

vivid quartz
#

yes.

little eagle
#

This is a math question then essentially^^

#

oh boy

vivid quartz
#

ah i didnt see sqrt in your code,my bad on ellipse

#

but yeah, i need it rotated

little eagle
#

The sqrt is just so the points aren't more likely to be at the center of the circle.

#

rotated rectangle...

#

So you have the w and h of the rectangle, right?

vivid quartz
#

yea

little eagle
#

And the X and Y represents the center of the rectangle? Or an edge?

vivid quartz
#

center, the position of it

spice arch
#

hey guys, is there a way to get the type of road or the width of the road?

#

been looking around on the forums and documentation but couldnt find anything

little eagle
#

I will think about something, eXel. Maybe someone else is faster...

vivid quartz
#

kk, please ping/pm me then.

little eagle
#

This is the format we are working with, right?

vivid quartz
#

markerSize works aswell doesnt it?

little eagle
#

Idk, we talking about a trigger or a marker?

#

They're different

vivid quartz
#

well bis_fnc_randompostrigger accepted both, marker and trigger,atm in my sqfs i have markers, but if trigger is easier we can do trigger

little eagle
#

marker it is

vivid quartz
#

i only need to return a and b from random position, iam using createvehicle with "fly" dir doesnt matter either

little eagle
#
commy_randPosRectangleMarker = { 
    params ["_marker"]; 
 
    private _position = markerPos _marker; 
    private _direction = markerDir _marker; 
 
    markerSize _marker params ["_width", "_height"]; 
 
    _position = _position getPos [2 * random _width - _width, _direction + 90]; 
    _position = _position getPos [2 * random _height - _height, _direction]; 
    _position 
};
#

I love this new getPos syntax, lol

#

Tested with:

("marker_1" call commy_randPosRectangleMarker) inArea "marker_1"

and it always reports "true"

#

damn

jade abyss
#

y not Trigger?

little eagle
#

wrong code, but still always "true"

jade abyss
#

๐Ÿ˜‚

little eagle
#

Well it's easily rewritten for a trigger, but it would look different ofc.

jade abyss
#

๐Ÿคฆ

little eagle
#

ยฏ_(ใƒ„)_/ยฏ

jade abyss
#

We all need a button for you.

little eagle
#

O.K. whatever

jade abyss
#

Everytime we make a joke, we press that button. For you, just for you, will popup a big fat sign with "WARNING: JOKE INCOMING" ๐Ÿ˜„

little eagle
#

Beautiful code. The best. Tremendous success.

vivid quartz
#

_marker="mymarker";
_position=[_marker] call commy_randPosRectangleMarker;

can i call it this way?

little eagle
#

Yeah.

#

Well, missing ;

#

^^

vivid quartz
#

yea stupid me ๐Ÿ˜‚

#

thanks for code tho

little eagle
#

Now let's look at the inevitable abomination that bis_fnc_randompostrigger is...

vivid quartz
#

dunno,wouldnt have used it, since it was only option i found on forums ,so gave it a try, and it didnt work out

little eagle
#
([markerPos _marker] + markerSize _marker + [markerDir _marker, true]) call BIS_fnc_randomPosTrigger
vivid quartz
#

meh

little eagle
#

I think that is how it would be used, but the result is wrong

#
_marker = "marker_1"; (([markerPos _marker] + markerSize _marker + [markerDir _marker, true]) call BIS_fnc_randomPosTrigger) inArea "marker_1"

reports "false" 80% of the time : (

vivid quartz
#

yea, see what i mean

#

inaccurate

little eagle
#

Yeah, very inaccurate when a >> b

vivid quartz
#

running b >> a on mine same thing tho

little eagle
#

I placed a red transparent marker on the map and did:

0 spawn {while {true} do {sleep 2; 

player setPos ("marker_1" call commy_randPosRectangleMarker);

}};
#

Fun to watch where it teleports me on the map.

#

Seems to work. At least for me

vivid quartz
#

Kappa

#

using
_marker = (_this select 0) so i dont need to rename mkr over and over again, passing with ["mkrname"] call commy_randPosRectangleMarker;

tough abyss
#

is there any way to move the GPS or any Arma-Overlay to another position through commands in a mission?

vivid quartz
#

probably not,only by hud LO

tough abyss
#

i might be wrong but i guess i have seen this before on another server, but i can't remember the name ๐Ÿ˜ญ

little eagle
#

lol

#
private _display = uiNamespace getVariable "RscMiniMap"; 
 
{ 
    (_display displayCtrl _x) ctrlSetAngle [random 360, 0.5, 0.5]; 
} forEach [13301, 13302];
#

This is the ultimate troll move.

plucky beacon
#

wait what

#

so it just does one 360 loop?

little eagle
#
private _display = uiNamespace getVariable "RscMiniMap"; 
 
{ 
    private _control = _display displayCtrl _x; 
 
    ctrlPosition _control params ["_posX", "_posY"]; 
 
    _control ctrlSetPosition [- _posX, - _posY]; 
    _control ctrlCommit 10; 
} forEach [13301, 13302];

I can move parts of the GPS with this ^ code, but the map control doesn't move.

#

I think this was some kind of limitation for map controls.

#

If they use BIS_fnc_displayLoad, yes

#

BIS_fnc_initDisplay* I mean

tough abyss
#

so this would work? i don't understand, is this a solution or a joke xD

little eagle
#

Well it moves part of the thing, but the map is still locked in place.

#
private _display = uiNamespace getVariable "RscMiniMap"; 
 
{ 
    private _control = _x; 
 
    ctrlPosition _control params ["_posX", "_posY"]; 
 
    _control ctrlSetPosition [- _posX, - _posY]; 
    _control ctrlCommit 10; 
} forEach allControls _display;
#

This code moves it completely

#

I just forgot one...

abstract shuttle
#

Seems logic...

little eagle
#

Good

tough abyss
#

lol

little eagle
#

It's a compliment, no?

abstract shuttle
#

It is! Thanks for your help tho. We will try this out and give response here...

little eagle
#

The challenge now is to figure out WHERE to move it. I just inverted X and Y

#

Ah, seems like map controls don't move when you move their controls group.

#

Entry #127 on today's glitch list.

rotund cypress
#

If I have a dialog in a GUI editor format, how would one import that again to gui editor?

#

Never did that

#

Like in the array type

#

Would it be Ctrl + O maybe? But then what would I name that file?

rotund cypress
#

never mind

jovial ivy
#

lol

rotund cypress
#

Clipboard ๐Ÿคฃ

abstract shuttle
#

You need to copy the the code of your GUI dialog in to your clipboard, then open the GUI editor again and it woll be appear

rotund cypress
#

Yep as I wrote above, but thanks anyways ๐Ÿ˜‰

abstract shuttle
#

Same second ๐Ÿ˜„

rotund cypress
#

๐Ÿ˜‰

warped fractal
#

Anyone know how to get this count playableunits trigger to work correctly?
Currently have this -
https://puu.sh/vzCU9/79fbbf9ff4.png
This has worked in the past for previous missions but now I can't seem to get it to activate, changing the percentage doesn't do anything either
Trying to get it so the mission ends once a certain percentage of players have entered the area

vapid frigate
#

are switchableunits also playable units?

#

nvm i guess it should count them twice both times anyway

#

if you want to use actual players, allPlayers might work better than (switchableunits + playableunits)

tough abyss
#

fast question, so im going to use _handle = [] spawn life_fnc_copLoadout; to spawn civ in police gear but i want to save the civ gear they have on, do i use [] call SOCK_fnc_updateRequest;?

rancid ruin
#

nobody knows what those functions contain so it's not really possible to answer that question @tough abyss

dusk sage
#

That's one way yes @tough abyss

#

Although if you're spawning something to add gear, make sure that runs before you try update them (i.e use call if you can)

tough abyss
#

wait so what script is used to load your gear from the database?

dusk sage
#

Wrong Discord for this stuff mate

copper raven
#

executing a code for everyone in the server, but not guy who called it, how to do it?

#

tried something like this:

_timer= [200,150,100];
_type= selectRandom _timer;
_pname= name player;
[[[_type, _timer,_pname],"timer30.sqf"],"BIS_fnc_execVM",true,true] call BIS_fnc_MP;

i tested this with my friend, when he calls script, on my screen and on his screen his name appears, but i dont want him to get the exec, even doe he calls it.

#

the ```sqf
[[[_type, _timer,_pname],"timer30.sqf"],"BIS_fnc_execVM",((((true)))),true] call BIS_fnc_MP;

dont think that true should be there, the one i highlighted
#

from wiki

Boolean - true to execute on each machine (including the one where the function was called from), false to execute it on server only
#
(including the one where the function was called from)

i dont want this ^

dusk sage
#

BIS_fnc_MP is deprecated, you should look to use remoteExec instead

copper raven
#

thought so

vapid frigate
#

anyone know how to get synchronizedObjects of an object (not unit)?

dusk sage
#

When number is negative, the effect is inverted. -2 means execute on every client but not the server. -12, for example, means execute on the server and every client, but not on the client where clientOwner ID is equal to 12.

copper raven
#

so i have to return the id of each player then? so i could restrict one?

vapid frigate
#

yeh problem is clients don't know IDs

#

in that specific case @copper raven , it might be easier to just check the player name in timer30.sqf (if (_name == name player) exitWith {};)

#

don't think there's an easy way to do it from clients

dusk sage
#

remoteExec ["...", -clientOwner]

#

etc.

vapid frigate
#

oh nice.. didn't know about that command

dusk sage
#

1.56, too new for me

#

๐Ÿ˜„

#

Also, make sure you don't execute it on the server if it isn't needed. Further, create a function, don't use execVM! Especially if you wish to whitelist in the future, oh the possibilities..

copper raven
#
_caller= clientOwner;
[_type, _timer,_pname] remoteExec ["fn_execTimer", -_caller, ""];

?

#

have todo some tests

#

or as you said, shouldnt use _caller, just -clientOwner instead

dusk sage
#

Doesn't matter, but there is no need to make another variable

copper raven
#

yeah.

dusk sage
#

Also your last argument (the "") is wrong

#

In RE it is a boolean, for JIP

#

Or object

copper raven
#

ok made a test, i dont get the message anymore on my screen, but gotta wait for friend to come up so we can test, if he gets the noti

little eagle
#

On hosted server there could be some inconsistency between clientOwner, owner and object creator id, especially in missions started from save.

#

"could" lol

#

never fixed -.-

proven crystal
#

i start this script from the initplayerocal.sqf. _unit is a player. it works fine first, but it doesnt run anymore after respawn.


_unit = _this select 0;

while {true} do
{
    if ((cameraview == "External") && (isNull objectParent _unit)) then {
        _unit switchCamera "Internal";sleep 0.5;
    };
    sleep 0.5;
}; 
#

its just kicking people out of 3rd person, when they are on foot. (i allow 3rd person in vehicles)

#

i thought the while loop would be running on the player regardless of their death, until they leave the server

#

could the script throw an error if the player is waiting for respawn?

warm gorge
#

Try changing _unit to just player. That object reference might be lost when the player dies for some reason

#

@proven crystal I assume you understand what I mean?

proven crystal
#

yep, will gie that a try. thanks

copper raven
#

@little eagle the getpos script you posted yesterday, is there a way to select random position in the marker, but also make sure that the distance is atleast 5km away from players, so if i was in marker, and there is a player1 let say, i would you like to spawn a player2 atleast 5km away from player1

#
commy_randPosRectangleMarker = { 
    params ["_marker"]; 
 
    private _position = markerPos _marker; 
    private _direction = markerDir _marker; 
 
    markerSize _marker params ["_width", "_height"]; 
 
    _position = _position getPos [2 * random _width - _width, _direction + 90]; 
    _position = _position getPos [2 * random _height - _height, _direction]; 
    _position 
};

this one

#

sorry for ping, just wanted to ask

little eagle
#

Sure, but that would be more math. You trying to kill me?

copper raven
#

no ๐Ÿ˜›

thin pine
#

Math is life

copper raven
#

thinking about adding some sort of radius of 5000 around selected pos, and checking if there are any other players in the radius of him

little eagle
#

roll a position, check if the result is near any of the players, if it is, roll again

#

just make sure the marker is larger so you don't roll forever

copper raven
#

ye with like while loop maybe

#

gonna try something

copper raven
#
_list =  nearestObjects [(position player),["Plane"], 5000];
hint str(_list);
_pos= [_border] call commy_randPosRectangleMarker;
_checklist= (_list select 0);
while {!isNil "_checklist"} do
{
    _list =  nearestObjects [(position player),["Plane"], 5000];
    _checklist= (_list select 0);
    _pos= [_border] call commy_randPosRectangleMarker;
};

cant get this working

#

_list does return a plane in range of player, which is a10, but then i get undefined var _checklist,even doe first object in _list arr is a10 id
EDIT: got it working, thanks

proven crystal
#

@warm gorge now it sort of works, but it always brings me back into the first person view of the dead body of my first death.

#

maybe i gotta update the applied unit inside the loop instead...

warm gorge
#

@proven crystal Sounds like you havent updated all instances of _unit to player.

while {true} do
{
    if ((cameraview == "External") && (isNull objectParent player)) then {
        player switchCamera "Internal";sleep 0.5;
    };
    sleep 0.5;
};
#

Is that what it looks like now?

proven crystal
#

yep, works now

warm gorge
#

sweet

barren spire
#

does nearObjects return hidden Objects? because either it doesn't or I'm doing something wrong
on a trigger: { _x hideObjectGlobal false; } foreach (this nearObjects 20);but when activated nothing happens

austere granite
#

what's the main way to hide range on personal and squad waypoint, but still show the arrow?

#

only seem to be coming across things to hide it entirely

little eagle
#

Probably because there is no main way.

austere granite
#

So i'm guessing ill have to go with custom drawing while hiding the engine waypoint?

little eagle
#

I guess that would work. drawIcon3D

austere granite
#

Okay thanks, i'll go that route then. Just wondering if i was overlooking something and seemed like a familiar problem

little eagle
#

I've never heard of a way to remove just the numbers. But that doesn't mean it's not possible.

warm gorge
#

Is there any way to convert a number to a string while avoiding scientific notation

#

Nevermind, found BIS_fnc_numberSafe, however doesnt seem 100% accurate

little eagle
#

toFixed

#

Can get additional accuracy compared to str or format

#

HOWEVER

#

all SQF numbers are still single floating point thingies, so there will always be inaccuracy with large numbers

warm gorge
#

Oh nice, didnt know of that. Fairly new ccommand. Yeah I read something about that, sucks it has to be like that. Cheers tho

barren fable
#

Present for you guys from CaptnCaps

queen briar
#

Does anyone know how I would go about getting a picture like this added to my addon. Like a picture that can be seen when launching the game and being on the main menu. http://i.imgur.com/c2Lvuu4.jpg

boreal edge
#

Take a look at Exile. They defined the mission that is run in background while beeing in main menu and this mission just plays a background video (but a picture would be possible too). I currently cant tell you how to exactly do that.

high vigil
#

need debug scrit to tell all ai to setCombatMode "red"

tough abyss
#

๐Ÿ˜‰

#

haha

indigo snow
#

in sqf this gets really easy to do with positions, too.

_centroid = (_pos1 vectorAdd _pos2 vectorAdd _pos3) vectorMultiply (1/3);```
leaden plover
#

hey guys!, just a question, where do i find the cfgvehicle classnames of the different parts of the USS Freedom?

still forum
#

typeOf cursorObject

leaden plover
#

aight, umm where do i input it? eheh, do i input it on the init field of the carrier or on the debug console?

#

thanks man! ๐Ÿ˜„

still forum
#

cursorObject doesn't make much sense outside of debug console (mostly)

leaden plover
#

one more question, where do i unput the NearestObjects command?

dusk plume
#

hey all, trying to make a system to allow a more structured and GUI-based mission voting system to pick the next mission. Does anyone have any insight into this? I'm doubting this can be done in SQF, and I'll likely have to make a DLL and try to get documentation or something from BI

still forum
dusk plume
#

@still forum Thanks, I've looked at that before. Is there something specific in there you're refering me to? I know how to write DLLs, but no for specifically managing a server

still forum
#

You can manage the Server over RCON if you have Battleye enabled

vapid frigate
#

anyone know if it's possible to make a generic scenery object work with 'synchronizedObjects' ?

#

like what it is specifically that allows it to work with units/modules

vapid frigate
#

or any other way to get synchronizedObjects of non-units? (they seem to link in 3den)

manic sigil
#

When I create a Taru via createVehicle with "FLY" selected, it spawns in the air - but then immediately nosedives as the engine hasn't turned to full speed yet. Even giving it a setVelocity of +50 upwards, it'll just nose down and eat pavement :/

small mantle
#

@manic sigil does it have crew when it spawns?

#

Actually, I've done this before using:

[([getPos player select 0, getpos player select 1, 500]), (random 360), "O_Heli_Attack_02_F", EAST] call BIS_fnc_spawnVehicle;

This article is where I read about this before:
http://www.armaholic.com/forums.php?m=posts&q=24018

#

But I believe it needs to have an enemy somewhere on the map first before running that command or it spawns without crew.

#

and then crashes.

manic sigil
#

I'm reasonably sure it has crew... but I'mma add some code to throw a pilot in, just to check.

#

I'll be dipped. Apparently createVehicleCrew solved it - though it was turning and acting like it had crew trying to save it from becoming a lawn ornament before.

small mantle
#

Anyone able to help with Lecks' question above around synchronizedObjects?
This is something that we are both working on and we are stumped.

Issue is that using synchronizedObjects doesn't work on objects, but if an object is syncd to a person or module, that code will show that the object is synchronized, but not the other way round, and not between two objects.

#

If someone also has a workaround it would be appreciated as well.
The use-case is to link a non-unique object to another non-unique object, where the former is used as a visual reference for players to know where a vehicle is about to spawn, and the latter object is used with ace_interact to initiate the spawning of a vehicle to the former-objects location.

rancid ruin
#

can you use locations? they are pretty diverse

vapid frigate
#

don't think they're visible in 3den, so you couldn't sync to them?

rancid ruin
#

oh well it's not really a scripting question then

small mantle
#

care to elaborate?

vapid frigate
#

and if another non-unit/module object is used instead of player, can't seem to get the synced objects at all

rancid ruin
#

that screenshot doesn't work for me, but i just tested synchronizedObjects with locations and it works

vapid frigate
#

that doesn't really solve the issue though.. need something with a model

#

screenshot is synchronizedObjects player = [pad1], synchronizedObjects pad1 = []

rancid ruin
#

you could just use setVariable on locations to refer to the other objects/players you're actually interested in

#

locations are under the systems section in eden if you wanna test

vapid frigate
#

hmm not sure what you mean. simplest example is we want to link a helipad > a sign

#

im not sure how you could do that with a location (unless you scripted it individually for each one)

rancid ruin
#

what's the end goal? do you really need to sync?

vapid frigate
#

for our mission makers to be able to set up whatever combination of vehicle 'pads' with signs that open an arsenal type thing to spawn stuff on those pads

#

via an ace action on the sign(s)

#

if it was just a one off could easily 'hard-code' it with script, but trying to make it more intuitive

rancid ruin
#

does ace or the arsenal rely on the syncing system?

vapid frigate
#

no

rancid ruin
#

like i'm just thinking you might be better to use locations, then create the pads on the locations via script

#

logic things like locations are pretty powerful

small mantle
#

Are you suggesting that we could use a location, then as part of the locations init it places a visual reference?

rancid ruin
#

yeah exactly

#

run a script on init which goes over your custom locations and does what you need doing

vapid frigate
#

yeh ok, could do the same with a module

#

only issue is there's no visual representation in 3den

#

well maybe an icon or something

rancid ruin
#

but you place locations in eden just like any object though?

vapid frigate
#

yeh, they'd just be an icon though?

#

you wouldn't be able to show the sign/helipad?

rancid ruin
#

yeah i guess, is that a big deal?

#

i'm still so used to doing everything in 2D view ๐Ÿ˜„

vapid frigate
#

would be much better if it was showing the 3d object

#

but starting to think it's not possible

#

basically need a module/vehicle combined

#

just because syncedObjects doesn't work on vehicles

#

(or location/vehicle combined)

rancid ruin
#

it doesn't seem like it'd be that hard to solve via scripting

#

i would just compromise and go without seeing the objects in 3D view in eden personally

vapid frigate
#

yeah.. wonder what it is that makes it work with modules but not vehicles

#

must be the 'simulation' i guess

small mantle
#

I suppose we should whack in a feature request then

rancid ruin
#

i would wait and see if anyone more knowledgeable comes up with a better solution first

small mantle
#

Cheers for the help in the meantime oneoh.

vapid frigate
#

can see in the mission.sqm that it is syncing them properly

#

just no way to read it ๐Ÿ˜ฆ

small mantle
#

can we read values direct from mission.sqm like you do with vehicle configs?

rancid ruin
#

you can read classes from description.ext for sure, i don't know about the sqm though

little eagle
#

You can not (without unreasonable effort) unless they are 3den attributes in which case you use getMissionConfigFile.

small mantle
#

That may help as well. We were looking at using 3den attributes to create a unique ID for each of these visual representations. That way, we could use something like nearestObjects to find the objects in the area, then read the unique value from 3den attributes to uniquely identify them.

little eagle
#

what

small mantle
#

there is a whole lot of back-story here

#

Or did I just say something that is not possible... I do that at times.

little eagle
#

"the unique value from 3den" threw me off

small mantle
#

So we were planning on using an object like Sr_border to show people where a vehicle will spawn, then somehow linking multiple of these boxes to a sign (Land_InfoStand_V2_F) with a bunch of ace_interact options on it.

#

We were trying to use synchronize to link the pads to a sign, but that doesn't work between two objects.

little eagle
#

For a mission?

small mantle
#

Well, you can synchronize, but synchronizedObjects doesn't work

vapid frigate
#

was just having a play with it, it looks like if you add simulation = "invisible"; then synchronizedObjects works

#

so just need to find a simulation type with a model that it works on

small mantle
#

For mission makers, but using scripts to simplify it, so they don't need to cut and paste init scripts

#

or fill in unique names for everything

#

Ok, that sounds good Lecks. Might solve the issue

little eagle
#

hmm, what I would do is to modify the eden editor scripting to support this. has a lot of nifty eventhandlers including synchonising objects. But I probably have a bit more experience than...

small mantle
#

These ace_interact options would be filled in dynamically, so that we can link different versions of Sr_border, some for land vehicles, some in the water for boats, etc.

#

anyway, all that aside. That is something that I have no experience in... ๐Ÿ˜ƒ

vapid frigate
#

that might be a good approach commy2 (assuming i can't find a suitable simulation that just does it)

#

setting 3den attributes in syncing event handlers

little eagle
#

It's a hell of a task that ends up in like 300 lines, but getting there is a bitch

vapid frigate
#

yeh was just looking at that, think it might be the way to go

little eagle
#

And the meta data could be stored in an dummy 3den attribute with invisible unselectable control in a random category xD

vapid frigate
#

will make it look like normal objects/syncing to mission makers

little eagle
#

Eden is nice, but it's scripting is something for... creative minds

vapid frigate
#

yeh we have some 3den modules/custom attributes already

#

i know what you mean

little eagle
#

I have no idea what

class: Config - connection config class
is

#

but if this all works like advertised, then it should be possible.

vapid frigate
#

maybe it's whether it's a group or synchronization

#

i assume the EH would work for both

little eagle
#

Yeah, but didn't know these have classes

vapid frigate
#

yeah me either.. probably a new one just for 3den

#

cfg3den > connections > group/randomstart/sync/triggerowner/waypointactivation

vapid frigate
#

@little eagle regarding your suggestion of using event handlers, how would you serialize the objects in a manner that can be read ingame? would have to give all the relevent objects a unique ID or something?

#

or can you use get3denEntity during init or something?

queen briar
#

I'm sorry to be asking again, but does anyone know how I would go about getting a picture like this added to my addon. Like a picture that can be seen when launching the game and being on the main menu. http://i.imgur.com/c2Lvuu4.jpg

peak plover
#

You mena like alive?

warm gorge
#

Is dead bodies not coming out of vehicle wrecks a known arma bug? I dont have remains cleanup enabled, so it wouldnt be that.

vapid frigate
#

@queen briar i think you would modify the config for the main menu (not sure what it's called.. RscSoemthing)

jade abyss
#

@warm gorge Yes. You must place a unit in the Seat (and delete it afterwards again), to kickout the dead unit.

warm gorge
#

So in my case, in my vehicle wreck cleanup script, just loop through it's crew and put in a dummy AI for each dead unit before deleting it?

jade abyss
#

For example, yes.

warm gorge
#

Alright ill give that a go. Always been a pain cause youd have a crashed vehicle and only the pilot would come out in most cases, or sometimes the missing bodies would only show for the pilot that gets revived, very weird. Cheers anyways, hopefully it works ๐Ÿ˜ƒ

little eagle
#

@vapid frigate Did you get my part about using a dummy 3den attribute?

warm gorge
#
{
    if(!alive (_x select 0))then {
        _tempUnit = DS_civGroup createUnit ["C_man_polo_1_F",[0,0,0],[],0,"NONE"];

        switch(_x select 1)do {
            case "driver": {_tempUnit moveInDriver _vehicle;};
            case "commander": {_tempUnit moveInCommander _vehicle;};
            case "gunner": {_tempUnit moveInGunner _vehicle;};
            case "turret": {_tempUnit moveInTurret [_vehicle,(_x select 3)];};
            case "cargo": {_tempUnit moveInCargo [_vehicle,(_x select 2)];};
        };

        deleteVehicle _tempUnit;
    };
} forEach (fullCrew _vehicle);
#

You reckon that will work @jade abyss

jade abyss
#

erm

#

can't you just select the "turret" or CargoPos he is in?

#

iirc there was a way

little eagle
#

Be aware that the returned role may or may not be in lowercase. E.g. it's "driver" for the driver, but "Turret" for turret units.

#

switch is case sensitive

warm gorge
#

Didnt know there was an easier way to do it, is there?

jade abyss
#

When deleting a car -> Check all Turrets (and also Cargo!)

#

OR:

#

crew

little eagle
#

Careful.

jade abyss
#
{if(!alive _x)then{deleteVehicle _x}}forEach (crew _Veh)```

Something like that.
#

careful?

little eagle
#

The cargo index reported by getCargoIndex is different from the one used by moveInCargo

#

The one of moveInCargo is shifted by the number of FFV slots

jade abyss
#

meh

little eagle
#

fullCrew handles this, yeah, but then why use allTurrets for the turrets?

jade abyss
#

That should do it

#

Not needed anymore, haven't thought about fullCrew ๐Ÿ˜‰

#

btw

#

can you assign an Action to a dead person? @little eagle

#

like _DeadUnit action ["moveOut",Vehicle];

warm gorge
#

Yeah I chose to use fullCrew cause it has all the features to decide on where to place the temp unit, as in each role, cargo position, turret position etc

little eagle
#

Probably, but it would not be accessable when the dead one is inside a vehicle.

vapid frigate
#

@little eagle yeah, by that you mean for a unique ID? (+ another variable for linked IDs) ?

jade abyss
#

If course Commy

#

Doesn't matter where that Person is in.

little eagle
#

Yeah, Lecks. Something like that.

vapid frigate
#

rgr, thanks

#

was hoping there was an easier way with 3den ids or something

little eagle
#

I'll take a look. Maybe you don't need to keep track of the given ids.

#

Otherwise this might also need a mission attribute taking care of these.

jade abyss
#

(HL if something needed, back in OB)

vapid frigate
#

might be a good time to try out the CBA hashtable

little eagle
#

There is something in the mission.sqm already

#

    class Connections
    {
        class LinkIDProvider
        {
            nextID=1;
        };
        class Links
        {
            items=1;
            class Item0
            {
                linkID=0;
                item0=2;
                item1=1;
                class CustomData
                {
                    type="Sync";
                };
            };
        };
    };
#

But no idea how to access that later in the mission.

vapid frigate
#

yeah, but you can't really read it from in a mission ๐Ÿ˜ฆ

little eagle
#

Yeah, I don't think you can.

vapid frigate
#

yeh i can't test right now, but i think that only works in 3den

little eagle
#

Only inside 3den

#

Goto methods when wanting to serialize an object is BIS_fnc_objectVar and BIS_fnc_netId

vapid frigate
#

planning to use that + ConnectionChanged3DEN

little eagle
#

But none of them survive 3den

#

might really be the best to have your own custom ids and keep track of the last one given via a mission attribute.

#

then iterate through allMissionObjects at the start once.

#

OH

#

I found it

#

get3DENEntityID

#

Returns unique index of an Eden Entity. This number remains the same even after saving and loading the scenario.

#

Now how to use this inside the mission / preview ...

#

One Eden attribute that stores the 3DEN Entity ID on the object

#

One Eden attribute that stores all 3DEN Entity IDs of the connected objects

vapid frigate
#

yeh i think i'm going to have to do that (or some other hash/unique id)

little eagle
#

Then iterate through that once at mission start

vapid frigate
#

in this case could make a hash from the position pretty safely

little eagle
#

Sounds doable.

#

gl

vapid frigate
#

np, thanks for advice

warm gorge
#

Can 'isTouchingGround player' sometimes return inaccurate results? Im trying to use it in a parachute script, but sometimes, only sometimes, it seems to be returning true as soon as the player ejects out of the vehicle even know they are in the sky

little eagle
#

Did you answer your own question?

warm gorge
#

Yeah I was more asking if anyone else has experience similar issues before

#

Or would know a workaround

little eagle
#

You have provided no repro.

vapid frigate
#

could probly just use (getPosATL _unit) select 2 < 1

rancid ruin
#

what i did was to check the unit's animation

little eagle
#

But what if you land on the roof?

vapid frigate
#

hmm yeh true

little eagle
#

Apparently isTouchingGround player should always report true for units inside vehicles

#

And units inside a parachute are inside a vehicle

#

because parachutes are vehicles

rancid ruin
#

lol what

#

so a unit in a helicopter is touching the ground in arma logic?

vapid frigate
#

sort of makes sense.. they're 'not falling'

little eagle
#

It's even worse

#

If you are using this command as a validation method, it should not be the sole thing you are checking for, as the result is often inaccurate. For example, it returns false for some helicopters when landed on the roof of certain buildings, and it always returns false for boats, even if they are beached.

#

In addition to previous statement: That behaviour is true, simply because isTouchingGround applied to a player unit (or any unit) is frozen to a last state when unit enters vehicle. To get proper return from this command you should go for units vehicle:

#

This command returns always true if the falling object is attached to some other object with the command attachTo, like for vehicle air drop with parachute.

rancid ruin
#

seems like a pretty broken command

#

but also seems like you can achieve something less broken with some pretty simple scripting

little eagle
#

I guess. As long as the z in PosAGLS is greater than like 0.1, the unit should be falling

warm gorge
#

I can show you the code I have now. Basically it gives the player a parachute, then ejected them out of the vehicle and has a waitUntil {isTouchingGround player} before giving them back their original backpack. But the issue is it seems to skip this check and remove their parachute and give back their backpack before they even touch the ground

rancid ruin
#

i checked that the unit isn't in that HALO animation last time i needed to do something similar

jade abyss
#

โ˜

#

I was about to write the same ๐Ÿ˜„

little eagle
#

You should probably check if the parachute touches ground and not the player

rancid ruin
#

aren't parachutes automatically deleted when you land?

warm gorge
#

Yeah

rancid ruin
#

maybe check and wait until the parachute dies

little eagle
#

check until the backpack becomes ""

jade abyss
#

isNull ObjectParent <- ?

#

Doesn't that work, in that case?

warm gorge
little eagle
#

Should work too

jade abyss
#

player action ["Eject",vehicle player]; <- moveOut maybe better

#

iirc "eject" had an issue, but i can't remember what it was

rancid ruin
#

hint "You're not high enough to use this" ๐Ÿ‘๐Ÿฟ

warm gorge
#

lol

jade abyss
#

if(((getPos player) select 2) < 100)exitWith{hint "You're not high enough to use this";};
->
if(((getPosATL player) select 2) < 100)exitWith{hint "You're not high enough to use this";};

rancid ruin
#

you know, i wish BI had just done javascript style === instead of isEqualTo command

jade abyss
#

mimimi

#

=}

little eagle
#

There is no getPosAGL command

#

The whole check for deleting the parachute is unnecessary.

warm gorge
#

It sometimes takes a while to delete tho

#

But yeah, I guess its not really that neccesary

rancid ruin
#

waitUntil {!(typeOf vehicle player) isEqualTo "Steerable_Parachute_F"}
wouldn't that do it?

jade abyss
#

@little eagle *atl

little eagle
#

Or just wait until the backpack is "" ...

#

Dscha, ATL runs into problems with landing on buildings

warm gorge
#

And water

jade abyss
#

First line, Commy

little eagle
#

Yes

jade abyss
#

He is checking if he is high enough

#

with getPos (as you just sayd) its possible that he can't jump, beacuse a high building is below him.

#

Can happen.

little eagle
#

Depends on what you want I guess, but ATL sucks for jumping over sea

jade abyss
#

Who cares? ยฏ_(ใƒ„)_/ยฏ

#

๐Ÿ˜„

#

Not our Problem ๐Ÿ˜„

little eagle
#

ASLToAGL getPosASL
; )

jade abyss
#

now add some getPosWorld to it also XD

#

OR:

#

intersect!

little eagle
#

Not needed

jade abyss
#

๐Ÿ‘‡
(Commy, i am kidding, just4info) ๐Ÿ‘ˆ

#

โ˜

little eagle
#

@warm gorge Hope you remember to remove all the preeqipped backpack items in your function.

warm gorge
#

Ah true ill add that in

#

Alright I updated the script. Had to add 2 waitUntils tho, the first one waiting until the parachute is actually open

#
waitUntil {(typeOf (vehicle player)) isEqualTo "Steerable_Parachute_F"};
waitUntil {!((typeOf (vehicle player)) isEqualTo "Steerable_Parachute_F")};
manic sigil
#

A trigger with condition 'heli in thislist' and onAct 'deleteVehicle heli' should remove a helicopter that flies through it, right?

vapid frigate
#

don't forget about those ppl that forget to push the button too shadowranger

#

that would keep running forever for them

delicate lotus
#

When creating a briefing you have the option to use various tags like br or marker and such.
But how does one use the gear tag? The wiki says it requires a unit id. But what is that so called unit id?

#

Also what does the gear tag do?

#

Is it showing the inventory of that unit?

warm gorge
#

@vapid frigate So I should just add a !alive player check into the waitUntil?

vapid frigate
#

that should work i guess

manic sigil
#

Okay, partially working... does deleteVehicle not work on script-spawned vehicles?

vapid frigate
#

it does work on them

manic sigil
#

I can't seem to get it to, though :/ I have a helicopter spawn in, create a pilot for it, move a crew into cargo (specific units, cant spawn), where it unloads them, then moves to a bugout position... all that works, but the delete script just doesn't go off, unless there's a dead body in the back that one time.

#

The trigger has been various things, currently it's Opfor Present / this and (helit in ThisList) / helit deleteVehicleCrew pilot; deleteVehicle helit;

manic sigil
#

Got it - bloody thing was stopping well outside the 100m trigger zone.

#

Stupid self-preserving AI :/

copper raven
#
//position
_pos= [_border] call commy_getRandomPosMarker;
_list=[];
_checklist= "notnil"; 
//checks in radius of 5000 for jets
while {!isNil "_checklist"} do
{
    _pos= [_border] call commy_getRandomPosMarker;
    _list= [];
    _list =  nearestObjects [_pos,["Plane"], 5000];
    _checklist= (_list select 0);

};
if (isNil "_checklist") then
{code}

so i have a=10 b=6000 marker setup, so script works good, if there arent any jets in radius of 5000 of _pos, then do code, but then , sometimes a position is like 10km away from AO, because marker is big, and selected position meets condition of 5km nojets, so what i want is like "spawn jet 5km away from any other jets(if there are any at all) to closest position, meaning that it would select position atleast 5km from other jets, and not more than 5.1km from other jets lets say. Maybe its complicated, but thats probably the best i can explain. Better example would be like, lets say there are no jets in air, only me, so i would get spawned in front of marker, closest position to AO, and not at the back of marker. Like i dont want it to spawn it at the back of the marker if there is no reason to, i just want to restrict like

if (_posDist >= _closestJet && _posDist <= 5100 && isNil "_checklist")
#

^ that obviously wont work, but just an example what i want, the reason i want this, is because i tried this with a friend, so even doe iam like 20km away from his spawn, he gets spawned far away like 10km away, in the back of the marker, so its kinda boring to fly those 5 kilometers, where you could be spawned in

quartz coyote
#

Hello, Does someone have a link to some Multiplayer Timer countdown ? (my problem is with syncing every player to the time so it ends at same time for everyone)

still forum
#

If you are using CBA then CBA has a time synchronized between everyone

quartz coyote
#

No mods

copper raven
#

@quartz coyote you mean like, with sleep command or something?

quartz coyote
#

Yeah

#

I have one working but it is based on "time" var so if the script isn't stated for all at same time... then is dosn't end at same time for everyone

copper raven
#

so you change your time var into some random time?

#

so you want something like this?

sleep _someRandomTime

and you want random time to be same for everyone but random?

quartz coyote
#

No, start time is defined by param1 and end is 0

copper raven
quartz coyote
#

the problem is that it's in a MP environnement, so I can't flood the game with publicVariables

still forum
#

run the timer serverside. make the clients send a request of the current time to the server. then the server remoteExec's back with the current time

quartz coyote
#

@tough abyss Could you have a few minuts to jump in my Teamspeak to Explain ?

frank ruin
#
{
    _displayName1 = getText(_x >> "variable");
        _control1 lbAdd format["%1",(localize _displayName1)];
        _control1 lbSetData [(lbSize _control1)-1,_x];
} forEach _licenses;

diag_log format["licenses config: %1",_licenses];
diag_log format["Displayname config: %1",_displayName1];```
#

Output of diags

#
21:19:35 "Displayname config: any"```
#

For some reason I can't get the displayname to be retrieved from my missionconfig licenses.

#

As it comes back as any.

#

People here that have experience with this ?

indigo snow
#

Well did you define it?

native hemlock
frank ruin
#

Oh yeh sorry

#

The displayname

#

didn't work neither

#

I tried variable later on but same any

#

Expecting it to maybe work then you know ;D

#

The listbox has been defined yes

#

So that should work fine.

#

For some reason the displayname don't come up with the real name.

#

Yet I get the array of all the license names

#

getText(_x >> "variable");

#

And then I try to get that text

#

It being displayname then

#

But it doesn't matter either they are both text values

#

Just weird it can't get the text displayname variable for all the licenses categories. ๐Ÿ˜

native hemlock
#

@frank ruin I'm a little confused by what you mean. This should work though

_licenses = "true" configClasses (missionConfigFile >> "Licenses");
_displayName1 = ""; //this would need to be defined here for it not to print "any"
{
    _displayName1 = getText(_x >> "displayName");
    _control1 lbAdd format["%1",(localize _displayName1)];
    _control1 lbSetData [(lbSize _control1)-1,_x];
} forEach _licenses;

diag_log format["licenses config: %1",_licenses];
diag_log format["Displayname config: %1",_displayName1]; //only prints the last thing in the forEach
frank ruin
#

I define displayname1

#

_displayName1 = getText(_x >> "displayName");

#

As such

#

For each license >> get me displaynam

native hemlock
#

Yes but it prints any for the diag_log because it's defined inside the forEach loop.

indigo snow
#

As an example:

call {_a = 2};
diag_log str _a; // "ANY"
_a = 0;
call {_a = 2};
diag_log str _a; // "2"
frank ruin
#

That doesn't matter

#

I did it with another same kinda of setup

#

And that worked fine

indigo snow
#

it does

#

believe us

jade abyss
#

๐Ÿคฆ

indigo snow
#

or rather, even if it still doesnt, there is more wrong than that

frank ruin
#
    _displayName = M_CONFIG(getText,"VirtualItems",_x,"displayName");
        _control lbAdd format["%1",(localize _displayName)];
        _control lbSetData [(lbSize _control)-1,_x];
        _icon = M_CONFIG(getText,"VirtualItems",_x,"icon");
        if (!(_icon isEqualTo "")) then {
            _control lbSetPicture [(lbSize _control)-1,_icon];
        };
} forEach _shopItems;
#

Worked fine ๐Ÿ˜‰

#

Same concept.

indigo snow
#

oh yes everything inside that block works

frank ruin
#

But then for items insteado of licenses

indigo snow
#

but the forEach throws up a new scope

#

and all variables defined only inside that scope will not exist once you exit that scope

#

anytime you change a variable inside {} and wanna use it afterwards, you have to make sure its defined outside of that {}-scope too

frank ruin
#

But I only push it into the list

#

Does it need afterwards ?

indigo snow
#

well you diag_loged it afterwards

#

so i guess so, yes

frank ruin
#

mm

#

How would I get it then so it defines and runs all the license names in the listbox

indigo snow
#

you tried to log a variable that only existed inside of the foreach scope

#

everything inside it works (probably). Look at penny's code snippet to see how you could still log the last iterated displayName

frank ruin
#

But I would still need the foreach to run

#

to cycle through the license list

#

How can I store it then.

indigo snow
#

if you want to use a variable outside of the forEach scope, you have to define it once before you open that scope.

#

see the past examples we gave you

frank ruin
#

So

#

_displayName1 = "";

#

Simply defining it as that

#

will fix that?

dusk sage
#

Or even make it private before the scope

#

No need to even define it

indigo snow
#

@frank ruin for diag_logging it, yes.

#

or yea doing private "_displayName";

frank ruin
#

Now I get

#

22:55:51 "Displayname config: STR_License_Pilot"

#

As response

#

But it's not filling the list

#

It's getting the correct variable though now

indigo snow
#

I'm not that well versed to tell you if your listbox stuff is set up correctly, but i doesn't look immediately wrong to me.

#

try reading up on the wiki for that and filling up some dummy listboxes, e.g. starting out simple.

frank ruin
#

Well I did controls are also correct

#

Input is correct though now

#
23:01:10 "Displayname config: STR_License_Boat"
23:01:10 "Displayname config: STR_License_Pilot"
23:01:10 "Displayname config: STR_License_Truck"
23:01:10 "Displayname config: STR_License_Firearm"
23:01:10 "Displayname config: STR_License_Diving"
23:01:10 "Displayname config: STR_License_Home"
23:01:10 "Displayname config: STR_License_Oil"
23:01:10 "Displayname config: STR_License_Diamond"
23:01:10 "Displayname config: STR_License_crate"
23:01:10 "Displayname config: STR_License_Copper"
23:01:10 "Displayname config: STR_License_Cocaine"
23:01:10 "Displayname config: STR_License_Heroin"
23:01:10 "Displayname config: STR_License_Marijuana"
23:01:10 "Displayname config: STR_License_Rebel"
23:01:10 "Displayname config: STR_License_Assassin"
23:01:10 "Displayname config: STR_License_meth"
23:01:10 "Displayname config: STR_License_explosive"
23:01:10 "Displayname config: STR_License_blackm"
23:01:10 "Displayname config: STR_License_Pilot"
23:01:10 "Displayname config: STR_License_CG"
23:01:10 "Displayname config: STR_License_Pilot"
23:01:10 "licenses config: [C:\Users\Gebruiker\Documents\Arma 3 - Other Profiles\RPGforYOU\missions\outlawedvet1234.Altis\description.ext/Licenses/driver,C:\Users\Gebruiker\Documents\Arma 3 ```
#

_control1 = CONTROL(3300,3304);
lbClear _control1; //Flush the list.

#

class LicenseInfomationList : Life_RscStructuredText {
idc = 3304;

split coral
#

(tab separated)

frank ruin
#

Cheers for the people spending time to explain me.

#

I got it working now suprised it was such a stupid thing. ๐Ÿ˜ƒ

frank ruin
#

How does one make of a string

#

a config type agaiN?

indigo snow
#

Whats your string look like?

#

str(someConfigPath)?

frank ruin
#

I solved it otherwise

#

I just passed the classname

#

Instead of the entire CFG path

#

Works now

#

All the hassle resulted in it working at least.

tough abyss
#

is there a maxlength value for the RscEdit?

tough abyss
#

whats the diff with [_this select 0,1] and [_this select 0,0]

dusk sage
#

One has a 1 and the other has a 0

rancid ruin
#

good detective work

tough abyss
#

lol what does that mean tho?

subtle ore
#

I believe this is what we'd call a multi dimensional array correct?

little eagle
#

It's a one dimensional array, but I guess those are multidimensional arrays too in a way.

#
_this = ["banana"];

[_this select 0,1] // ["banana",1]
[_this select 0,0] // ["banana",0]

nothing more. Should be easy to understand if you know how arrays work.

subtle ore
#

๐Ÿคท

dusk sage
#

I mean re his actual question ๐Ÿ˜„

#

There is only one answer

little eagle
#

Yeah, the difference is 1 and 0, no matter how you look at it

vapid frigate
#

@subtle ore multidimensional would be [[1,2], [1,2]] (2 dimensions)

#

which this could be.. can't tell without know what's in _this select 0

subtle ore
#

@ Lecks#0253 correct, my bad. Looking at it on mobile is hard to do lol, especially with no code fornatting

hollow lantern
#

Is there a command for printing out the current version of arma I'm on?

split coral
#

productVersion

quartz coyote
#

Anyone knows how to make a MP Countdown Timer synced to all players (no mods) ?

warm gorge
#

So I had a similar sort of question a few days ago, but it was the other way around. Is there any way to avoid scientific notation with parseNumber?

warm gorge
#

Nvm sorted my issue out

tough abyss
#

@quartz coyote A couple people mentioned how you can do it yesterday

#

@quartz coyote Run this on the server only:

server_fnc_runCountdown = {
    _countdownTimer = 90;
    GAME_START = false;
    publicVariable "GAME_START";
    while {_countdownTimer >= 0} do {
        format ["ROUND STARTS IN: %1", _countdownTimer] remoteExec ["hintsilent", -2];
        _countdownTimer = _countdownTimer - 1;
        sleep 1.2;
    };
    GAME_START = true;
    publicVariable "GAME_START";
};

[] spawn server_fnc_runCountdown;
quartz coyote
#

Thanks @tough abyss I'll look into this

tough abyss
#

Questions: Why would one ever need to use publicVariable? What's the differance between a public var, and a global var?

still forum
#

public var is the same on every client

#

global var is the same on your client

tough abyss
#

Oh, that explains it. Thanks.

queen cargo
#

Check the wiki @tough abyss
PublicVariable just broadcasts the variable to all clients

tough abyss
#

I did, @queen cargo. But @still forum explained it much better.

jade abyss
#

Yeah, its a bit confusing sometimes ๐Ÿ˜„

queen cargo
#

But it is not correct @tough abyss
The variable Is only synchronized between clients when you invoke PublicVariable
If you change the value again, you have to PublicVariable it again

tough abyss
#

I understood that part.

#

Hard not too, really: ```
Posted on 3 Aug, 2006 23:03 -
Hoz -
This command broadcasts a variable to all clients, but as soon as you change the variable again, you have to use publicVariable again, as it does not automatically synchronise it.

#

Does "valign" work in ctrlSetStructuredText?

jade abyss
#
_ctrl ctrlSetStructuredText parseText format["<t align='center'>%1</t>,"Text];
tough abyss
#

yeah i know, but this does only center the text x-axis but not in the y-axis

jade abyss
#

Config:

class MyTag_RscStructuredText
{
    class Attributes
    {
        font = "RobotoCondensed";
        color = "#ffffff";
        colorLink = "#D09B43";
        align = "left";
        valign = "middle";
        shadow = 1;
    };
};```
#

afaik nothing more.

#

uh wait

#

*updated config-example โ˜

tough abyss
#

Okay, so i gotta use the Config instead of sqf ๐Ÿ˜„ - it was worth a try

jade abyss
#

Why don't you just try <t valign='middle'>"TEST</t> ???

tough abyss
#

didn't work

jade abyss
#

You used "ctrlSetStructuredText parseText " ?

tough abyss
#
_inlineText ctrlSetStructuredText parseText "<t align='center' valign='middle' size='0.9' font='PuristaLight' shadow='0'>Inhalt</t>";

didn't work

jade abyss
#

Then, you got your answer =}

little eagle
#

valign does not work with ctrlSetStructuredText

#

I tried it over and over again and it didn't work for me.

jade abyss
#

That doesn't mean it doesn't work

#

๐Ÿ˜›

#

So again -> It's arma'd.

#

(btw. Commy: That was a joke)

little eagle
#

I ended up moving the whole control down.

jade abyss
#

Make your own control ยฏ_(ใƒ„)_/ยฏ

little eagle
#

It is my own control. But I had to move it

jade abyss
#

class MyTag_RscStructuredText_centered
class MyTag_RscStructuredText_Top
class MyTag_RscStructuredText_Bottom

little eagle
#

Dscha, I had to use ctrlSetStructuredText, because it's dynamic (and colored), but as soon as I used the command, the valign broke

tough abyss
#

Probably should create a ticket.

native hemlock
#

Or change the wiki

pliant stream
#

why is copyFromClipboard disabled in MP?

jade abyss
#

ยฏ_(ใƒ„)_/ยฏ

#

prolly accessing Memory, BE triggers, opening holes etc (just guesses)

dusk sage
#

Think it was for 'security'

pliant stream
#

yes the wiki says as much, but what exactly would the attack vector be then

round scroll
#

just been discussing the rug dsai system in the arsenals on the forums and wonder if anyone knows of a way to run a script when a player enters the arsenal, via learn-arsenal?

little eagle
#

Main menu arsenal.

#

And I don't think there is a way. I mean, you could alter what the script of the button, but it wouldn't survive the mission start.

#

Maybe check the mission name in a CfgFunctions preInit function.

#

If the mission name is the one of the arsenal, then do stuff.

rancid pecan
#

hello

#

I want to add real time to the game

#

How do I add?

#

dd-mm-yy | hours-min

turbid thunder
#

Does anyone know how to spawn blood? (Like the one you can see being "dropped" by wounded soldiers ect)

rancid pecan
#

@turbid thunder Do you have any information?

#

I want to add real time to the game

turbid thunder
#

@rancid pecan Real time in what regard? Do you just want a clock in that format or actually have a mission running at your PC time?

rancid pecan
#

yes add the pc time

#

to game

#

script

turbid thunder
rancid pecan
#

thank you ๐Ÿ˜ƒ but you private message

turbid thunder
#

Back to my problem: Spawning blood

rancid pecan
rotund cypress
#

lol

#

First off, this can be done with extDB

#

Second: you get whats returned, add it to status bar

thick sage
hallow spear
#

does magazineCargo not work on GroundWeaponHolders? any alternatives?

subtle ore
#

@hallow spear Of course they do, are you in MP or SP?

hallow spear
#

singleplayer

subtle ore
#

Oh, and make sure it's local

hallow spear
#

i messed up.. thanks for confirming its function

subtle ore
#

Yep.

worthy spade
#

I have this while loop going. How do I break it from an addAction?

_cond = true;
_this addAction ["Break loop", {_cond = false}];
while {_cond} do {stuff};
#

Can it even be broken from outside the loop?

native hemlock
#

The addAction's code is probably be executed in a different scope so _cond isn't defined.

cond = true;
_this addAction ["Break loop", {cond = false}];
while {cond} do {stuff};

That should work, but if you're going to do it like that you should at least tag the variables

worthy spade
#

That's exactly my problem. I need this snippet to be able to run on several objects.

#

The condition must be _local, or else all the loops will break.

dusk sage
#

setVariable on the objects?

worthy spade
#

Hmm... Yes, that's probably a good idea.

turbid thunder
#

@jovial ivy Thank you

rancid ruin
#

you want mine?

#

save that as something.xml then you can import it

thick sage
#

if you are still using notepad++, I recommend trying out Atom + ACE plugin (colors) + linter-SQF (show errors)

rancid ruin
#

if you are using atom i recommend trying notepad++

#

i use that with the style configurator preset "Deep Black" @tough abyss

#

yeah i updated notepad++ to the latest version cos of someone in here

#

nearly lost all my preferences and shit

#

my sqf definition xml doesn't have all the latest commands but you can add them pretty easily

#

no problem

#

yeah go on then

#

have you split them all in to the different groups nicely?

warm gorge
#

security reasons

rancid ruin
#

not sure i bothered when i added the last ones

warm gorge
#

oops wrong chat

thick sage
rancid ruin
#

i dunno @thick sage, but a linter for a scripting language useful for only one purpose isn't enough to make me switch to atom ๐Ÿ˜ƒ

thick sage
#

ah, sure! If you use texpad++ for other things too, then of course you should keep using one and just one.

rancid ruin
#

mine is missing a load of them @tough abyss but the ones i do have are split in to different groups which are styled differently e.g http://i.imgur.com/Fo7MXep.png

#

i normally just add them one by one as i use the new command and notice it's not styled properly

#

i just followed on from the original grouping scheme, can't remember where i got it from

#

BIS and CBA functions in 3rd group, normal functions in 2nd group, sides in 5th, etc

warm gorge
#

When remoteExec is executed globally, does the server handle running it on everyone? Or the client executing it? Because with a high traffic server, I want to know if its worth confining remoteExec calls to as little amount of players as possible, if it is handled by the server, to help with performance

thick sage
#

"premature optimization is the root of all evil" - Donald Knuth.

#

but remoteExec should be used in limited circunstances, typically when you want machine X to tell server to tell machine Y to run Z

warm gorge
#

Well on a server that has struggled with script lag, I dont know if it makes much of a difference to change for example global death messages, to for example only players within a certain distance

#

Yeah that too

#
{
    if(player distance _x < 150)then {
        [player,'AovrPercMrunSrasWrflDf'] remoteExec ['switchMove',_x,FALSE];
    };
} forEach allPlayers;
#

Not sure if it makes much of a difference, but I do it like that now

#

Compared to your method ^

rancid ruin
#

select is much faster than foreach i thinks

warm gorge
#

Ill give it a benchmark later

still forum
#

@pliant stream copyFromClipboard is disabled in MP because a hacker could steal anyones clipboard content. Did you ever have anything sensitive in your clipboard by playing Arma? If yes then you know why it's disabled

#

@warm gorge Your version will be performing much worse. For one an if in a loop is slower than using the select method. Second you are sending a remoteExec message for every player to the server. Quiksilvers variant sends one remoteExec command with a playerlist

pliant stream
#

i don't see it... you'd have to be able to execute arbitrary scripts on the target client

still forum
#

Yes... And that's kinda easy..

#

And if you are the server owner... Thats even easier

pliant stream
#

alright i can see how the server owner could abuse it

#

i don't know about how the a3 remotexec thing might have screwed things up, but at least in a2 far as i can see, in order to execute arbitrary scripts on a peer client, the target would have to have some code in place to do that

rancid ruin
#

access to clipboard data isn't allowed in web browsers either, unless there is user interaction

tough abyss
#

hello, is there a way of playing animation in a row? Like a playlist.. One animation after another.

#

I tried writing the animation commands in the order I want but it will just play the first one and not continue.

rancid ruin
#

you could maybe use waitUntil

#

like, make unit do animation x, waitUntil unit animation is not x, change animation to y...

pliant stream
#

first you want to wait, with timeout, for the action to start

tough abyss
#

@rancid ruin How can I tell when the animation is not playing?

#

oh with booleans?

rancid ruin
#

playMove / switchMove then waitUntil animationState is not the animation you're playing

#

i'm not sure that's the best way to do it, maybe someone else has a better way, but that's what came to my mind first

tough abyss
#

ok I got it, thanks

#

the animations are kinda sucks though, he's doing a moonwalk lol

rancid ruin
#

if the animations weren't wonky it wouldn't be arma

turbid thunder
#

@tough abyss use playMove. You can stack animations with that IIRC

rancid ruin
#

how are people doing respawn in single player these days? what's the best solution?

warm gorge
#

Is there a certain animation config value that determines whether it is compatible with playMove or needs switchMove?

queen cargo
jade abyss
#

Anybody in DevBranch, who can check/confirm that diag_toggle "hitpoints"; doesn't works?

short sleet
#

Does anyone know how to make a variable from a script be used in a config?

if (!local _this) exitWith {};
   
_vests = 
[ 
    "V_Chestrig_rgr", 
    "V_Chestrig_khk", 
    "V_Chestrig_oli", 
    "V_PlateCarrierIA1_dgtl", 
    "V_HarnessOGL_brn", 
    "V_HarnessOGL_gry", 
    "V_BandollierB_cbr", 
    "V_BandollierB_rgr", 
    "V_BandollierB_khk", 
    "V_BandollierB_oli", 
    "V_TacChestrig_cbr_F", 
    "V_TacChestrig_grn_F", 
    "V_TacChestrig_oli_F", 
    "V_TacVest_blk", 
    "V_TacVest_brn", 
    "V_TacVest_camo", 
    "V_TacVest_khk", 
    "V_TacVest_oli" 
];

_vest = selectRandom _vests;
_this addvest _vest;

I want _vest to be used in a config to give a unit a vest, instead of adding it like it does in the code above ^^

little eagle
#

That doesn't work.

short sleet
#

Welp, okay. ๐Ÿ˜› Thanks

hollow lantern
#
_pilot disableAI "PATH";``` I tried to stop AI from moving its plane. It does not work. Even when ``disableAI "move"`` it still moves the plane...  Any ideas?
peak plover
#

@queen cargo Congrats on release and thank you. Great tool!

#

@hollow lantern You could try removing fuel

hollow lantern
#

@peak plover na, plane will be catapulted from the carrier it needs fuel! but... AI is to dumb to stay on the catapult line ๐Ÿ˜„

unreal siren
#

Hey, anybody know the changes from extdb2 to extdb3 off the top of their head?

#

It's been a nightmare updating.

hollow lantern
#
/*
    author: @Aebian
    description: Launch script for AI catapult start from USS Freedom
    returns: nothing
    created: 2017-05-02
    // _null = [KI_plane02P,ki_plane02,Catapult3] execVM "scripts\ki_launch.sqf"
*/

params["_pilot", "_plane", "_catapult"];

_pilot disableAI "PATH";

_carrierObjects = Freedom nearObjects ["Land_Carrier_01_hull_07_F", 100];
CarrierPart = _carrierObjects param [0, objNull];
_carrierPartCfgCatapult = configfile >> "CfgVehicles" >> "Land_Carrier_01_hull_07_F" >> "Catapults" >> _catapult;
CarrierPartanimations = getArray (_carrierPartCfgCatapult >> "animations");
[CarrierPart, CarrierPartanimations, 10] spawn BIS_fnc_Carrier01AnimateDeflectors;
sleep 14;
[_plane] call BIS_fnc_AircraftCatapultLaunch;
sleep 2;
_pilot enableAI "PATH";
sleep 8;
[CarrierPart, CarrierPartanimations, 0] spawn BIS_fnc_Carrier01AnimateDeflectors;
``` Do I need to do something special with _catapult in order to use it in the ``configfile`` part? I always get a undefinied variable error
little eagle
#

No, the error is most likely something else.

#

_catapult is indeed undefined though.

#

How do you call the script? The example looks wrong

#

Catapult3 most likely has to be a string. With quote marks. "Catapult3"

hollow lantern
#

thats how I called it

#

without the quotes

little eagle
#

A string has to have quote marks.

#

Otherwise it's a variable.

hollow lantern
#

hmm yeah true

#

hmm yeah works

little eagle
#

Any reason why CarrierPart and CarrierPartanimations are global variables?

jade abyss
#

Reasons.

#

Problem solved, next one.

little eagle
#

burp

jade abyss
#

๐Ÿ‘

unreal siren
#
Attempting to connect to database"
Error in expression <ult == "") exitWith {

};
if ((_result) < 60) exitWith {
Error position: << 60) exitWith {
2017/05/02, 13:39:13   Error <: Type String, expected Number,Not a Number```
#

    if(_result == "") exitWith {

    };
    if (_result < 60) exitWith {
        ["The extDB version is outdated"] spawn server_fnc_log;
        [Format["The extDB version was %1", _result]] spawn server_fnc_log;
    };``` What... Is it looking for _result == nil?
dusk sage
#

You check whether result is an empty string, and then if it's less than 60..?

little eagle
#

Yeah, that makes no sense. The return value of callExtension is always a string.

#

"50" < 60
doesn't work

#

parseNumber ?

unreal siren
#

Well

tough abyss
#

@unreal siren look at the example files on extDB3's bitbucket.

unreal siren
#

I'm trying to update from extDB2 to extDB3, one of the changes on an altis life github for said progress was to remove parseNumber

little eagle
#

callExtension always reports strings, but you cannot use > etc. on strings obviously.

unreal siren
#

They also ```
//Replaced
"9:ADD_DATABASE_PROTOCOL:%1:SQL_RAW_v2:%2:ADD_QUOTES",
//with
"9:ADD_DATABASE_PROTOCOL:%1:SQL:%2:TEXT2",

little eagle
#

Don't know anything about that, but your script error is pretty obvious.

unreal siren
#

Alright, gotcha. I'll revert that change.

tough abyss
#

The example files tells you what to write to make it work.

#

So look between the altis life github, the extDB3 example files/documentation and your current version and figure it out.

#

There is also an altis life discord I believe, so feel free to ask them pros

dusk sage
#

The way quotation wrapping happens changed for certain data types. Take a look at the extDB3 wiki to see what is wrapped exactly (things like enums for parseNumber) @unreal siren

unreal siren
#

Awesome, will do.

tulip cloud
#

How would I create a script that on AI death that another unit is created standing in his place? I believe I need to use addEventHandler or something so that it isn't constantly running on all AI.

plucky beacon
dusk sage
#

I'm not aware of one, but you could easily produce those results with keyDown

plucky beacon
#

I mean, do a keydown handler for every control?

dusk sage
#

Main display?

plucky beacon
#

you mean display 46 or something?

little eagle
#

Do you want to disable the mouse too or only keys?

plucky beacon
#

only keys

#

and preferably not escape

little eagle
#

firing weapon still allowed?

plucky beacon
#

ohs hit you're right

#

no weapons either

dusk sage
#

You can combo keyDown with something to stop shooting

plucky beacon
#

well the mouse event handlers can do that

little eagle
#

Yeah. Keydown that reports true, unless the keycode was 0x01