#arma3_scripting

1 messages · Page 447 of 1

little eagle
radiant needle
#

Yeah but I'm thinking of it like you're creating a line extending from 0 to 1500 in a random 360 direction

#

and on that line you have 0-1500 enumerated

#

and it's just picking a random number on that imaginary line

#

although I guess if you look at it from a density point of view

#

and not imaginary dots with no dimensions

little eagle
#

Just imagine 360 lines each pointing one degree apart from the center.

#

They get thinner the further away from the center you are.

#

So all possible spots at the edge become less likely.

#

because there're more of them.

radiant needle
#

Okay so I was looking at it like PoV of single instance. If you just randomed it, your chance of having the point be 1m is no different than it being 1500m away

little eagle
#

Yeah, but that is bad.

radiant needle
#

but if you plotted multiple instances you'd have higher density towards middle

little eagle
#

Correct.

radiant needle
#

Which actually would be a desired behavior if you were doing something like randomized artillery strike

#

or artificial artillery barrage I should say

little eagle
#

Well, you may want a more controlled way of getting the distribution. Not just sqrt.

radiant needle
#

Well no like if you wanted a random artillery barrage you'd just do like random 600

little eagle
#

Like gausian.

radiant needle
#

because ideally an artillery barrage would not be random but rather weighted towards the center

little eagle
#

True, but real distributions are Gaussian, and not sqrt.

#

Which can be done in Arma too with not much effort.

radiant needle
#

yeah random alt syntax

little eagle
#
private _randomPos = _CIWS getPos [random [-1500, 0, 1500], random 180];

I think.

radiant needle
#

Wouldnt you need sin cos to get gausian?

little eagle
#

I assume that is what random ARRAY does in C++ land.

radiant needle
little eagle
#

sqrt gauss normal

radiant needle
#

yeah

#

sqrt, random [-4500, 0, 4500], random 4500

little eagle
#

This is cool stuff : D

radiant needle
#

wonder if I can invert it

little eagle
#

1 - random

radiant needle
#

No like make it so that the edges are denser than middle

little eagle
#

That's what I said, though you need to do something else for Gaussian.

#
private _randomPos = _CIWS getPos [1500 * (1 - random [0, 0, 1]), random 360];
radiant needle
#

I was just about to ask how to make an inverted uniform distribution

#

then I realized

little eagle
#

1 - random, though it would the exactly the same 😛

#

Well, would it? I'm not sure 🤔

#

Dang, it would. I was thinking of sqrt.

radiant needle
#

thats the one you posted

#

weird how dense the edge is

little eagle
#

Yeah, I probably misunderstand what it means for the random function if min and mid are the same.

#
private _randomPos = _CIWS getPos [1500 * (1 - abs random [-1, 0, 1]), random 360];
#

Try this one.

radiant needle
#

yeah that looks better

little eagle
#

looks good.

#

Seems like it takes the max absolute value if min != -max and just clamps the result.

#

So min should always be - max basically.

#

That's fine.

#

Or reroll 50% if you hit the edge. Shit I like this stuff too much.

radiant needle
#

The regular gaussian one looks like a radiograph

#

Like if your film had really giant grain

little eagle
#
private _randomPos = _CIWS getPos [1500 * sqrt (1 - abs random [-1, 0, 1]), random 360];
#

What about this?

#

Combines sqrt with inverted Gaussian.

#

So the density of the points at the edge should be the same as it used to be in center of the vanilla Gaussian.

radiant needle
#

seems like it distributes too far away from center

#

actually

little eagle
#

A few weeks ago someone asked for this stuff with a safe area in the center.

radiant needle
#

When you consider the gaussian visible range is like 4000 when the actual set range is 4500 it makes sense

little eagle
#

For arty that only's supposed to scare you and always misses.

#

Ambient arty.

radiant needle
#

I mean there is a chance this would kill you

little eagle
#

This one, yes.

radiant needle
#

you could always do a simple check though

little eagle
#
private _randomPos = _center getPos [sqrt (random (_radiusOuter^2 - _radiusInner^2) + _radiusInner^2), random 360];
quaint turtle
#

Hey, so i was browsing the BI Wiki, and i found this: lnbAddRow but a friend of mine told me it's depreciated, and was only used in ArmA 2. Is there another function that does a similar thing, but in ArmA 3?

little eagle
#

Why would that be deprecated?

quaint turtle
#

idk. he just told me it is. He attempted to use it before and said it didn't work

little eagle
#

Well, they may've just made a mistake.

radiant needle
#

I dont think arma 3 uses lnb does it?

quaint turtle
#

I was looking through the forums, and i found some people who were using it in ArmA 3 (not the function, but lnb)

little eagle
#

I never used ListNBox myself.

radiant needle
#

I dont even know what a listnbox is

#

Because it's not a 2D list box

#

It's not a 3D list box

little eagle
radiant needle
#

Is it just a list box that is handled differently by the engine or something?

little eagle
#

lnbAddRow definitely works.

quaint turtle
#

Ok, thank you for clearing it up - turns out he was using standard lb, rather than lnb haha

radiant needle
#

Yeah if you have a listbox just use lbAdd and forEach

#

if you have an lnb use lnbAddRow

quaint turtle
#

Ok, ty

little eagle
#

Pretty sure some ListBox commands do work on ListNBox though.

radiant needle
#

Im still really curious what a ListNBox is lol

little eagle
#

Instead of a list, it's more like a table. With multiple rows and collums.

#

The items don't have an index, they have two.

radiant needle
#

Oh is it, I thought a 2d list box was under a different command

little eagle
#

Well they are. They are lnbX, not lbX.

#

The names are just really close, because bad conventions.

radiant needle
#

Where I'm from we call 2d list boxes tables

#

Let's just be glad though BI at least uses english words for commands

little eagle
#

doplonvani

#

usti hlavne

radiant needle
#
effectiveCommander toto setName "Phalanx Defender";
null = [to] spawn {
_CIWS = _ zvolí 0;
_GoodPos = 0;
_Pos = [0,0];
Spánek (Náhodný 10);
pro "_i" od 0 do 1 krok 0 do {
Pokud ((! Živý _CIWS) NEBO (isNull _CIWS)) exitWith {};
_CIWS setVehicleAmmo 1;
pro "_i" od 0 do 1 krok 0 do {
_Pos = [[[(getPos _CIWS), 1500], []], []] volání BIS_fnc_randomPos;
Pokud (_Pos vyberte 0! = 0) exitWith {_GoodPos = 1};
Sleep 0,1;
};
waitUntil {_GoodPos == 1};
_PosHeight = [Vyberte políčko 0, _Pos vyberte 1, ((_ Posuďte 2) + ((Náhodné 300) + 550));
_DistanceDelay = (_CIWS vzdálenost _PosHeight) / 980;
_ChargeType = selectRandom ["DemoCharge_Remote_Ammo_Scripted", "DemoCharge_Remote_Ammo_Scripted"];
_Charge = _ChargeType createVehicle [0,0,0];
_Charge hideObjectGlobal true;
_Charge setPosASL _PosHeight;
_CIWS doSuppressiveFire (getPosASL _Charge);
waitUntil {((_CIWS munice "Weapon_cannon_phalanx") <1450)};
Sleep _DistanceDelay;
_Charge setDamage 1;
_CIWS setVehicleAmmo 0;
Spánek ((náhodný 10) + 10);
};
};
little eagle
#

That should just error out, because variables can only use a-z, 0-9 and _

radiant needle
#

Imagine half english half czech coding lol

tribal stump
#

I'm creating a mission. Using Optre.. I would like for the troops to spawn in a drop pod room, gear up and drop. And when they hit the ground. They would recieve a new spawn position. And the drop pod room wouldn't be accessible. Any ideas on how I could get this to work?

little eagle
#

The most difficult thing would be the drop room model (?).

radiant needle
#

Im sure on the taru pods would work well enough

little eagle
#

Oh, right. You could access gear while sittting inside a vehicle.

radiant needle
#

I think you can even use arsenal

little eagle
#

Yeah, I see no problem with this idea. Should all be straight forward.

radiant needle
#

Omg my Iron Dome type CIWS defense looks so cool at night

#

too bad it cant actually intercept missiles or mortars though

little eagle
#

You could delete the projectiles.

radiant needle
#

yeah, just add an eventhandler onto any mortars or artillery

tribal stump
#

Optre comes with ship modules and a drop pod room.

little eagle
#

What is that drop pod room? A building?

quasi rover
#

Is there some script command for "Edit Vehicle Appearance" menu in Eden editor? I just want to change the camo and skin texture of New Tank.
https://imgur.com/IGwD1uU

little eagle
#

Click Export

quasi rover
#

I know, but I want that the "edit vehicle appearace" window is displayed when I run some scripts , just like the url https://imgur.com/IGwD1uU

little eagle
#

What?

#
["Open",true] spawn BIS_fnc_garage;
quasi rover
#

only Camo & Paint job, not spawn all vehicles.😅

little eagle
#

Well this menu does all of that. If you don't want it to do all of that, you'll have to create your own menu.

quasi rover
#

The script, I just want, is the same as the "edit vehicle appearance..." menu in Eden editor, only Camo & Painting job.

little eagle
#

hmm 🤔

#

['garage'] call bis_fnc_3DENEntityMenu;

#

Dunno if that works, back in 10 minutes, then I'll look closer into this.

little eagle
#

@quasi rover

["Open", [true, _entity]] call bis_fnc_garage3DEN;

Try this. _entity being the vehicle.

quasi rover
#

@little eagle thanks, I'll give it a try. 😀

molten folio
#

can someone help me? i made this Combo List and added a script to give the licnese that is choosen from the combo, and i have another combo for the player name but i cant get it working for the player like when i press on the player name and the license i wanna give him instead it gives me the licnese

#

Main SQF (Excuted by Hotkey)

_k = createDialog "panel";


buttonSetAction [9903, "[] spawn life_fnc_givingWl"];
buttonSetAction [9904, "[] spawn life_fnc_removeWL"];

TW_panel = playableUnits;
{
    if (isPlayer _x and (_x != player)) then
    {
        _uid = getPlayerUID _x;
        _index = lbAdd [9901, (name _x)];
        lbSetData [9901, _index, _uid];
    };
} forEach TW_panel;

lbSetCurSel [9901, 0];

[] call life_fnc_whitelists; ```

Whitelists.sqf (Shows Licenses in the combo)
```sqf
private _test = ["license_civ_pilot","license_civ_rebel","license_civ_trucking"];

{
    private _index = lbAdd [9902, _x];
    lbSetData [9902, _index, _x];
} forEach _test;

GiveWL.sqf (Gives the selected license)

_index = lbCurSel 9902;
_unit = lbData [9902, _index];


if (_unit == "") then {
    hint "Please Select a whitelist!!";
};

if (_unit == "license_civ_pilot") then {
    license_civ_pilot = true;
    hint "You're Whitelisted!!";
};

if (_unit == "license_civ_rebel") then {
    license_civ_rebel = true;
    hint "You're Whitelisted!!";
};

if (_unit == "license_civ_dive") then {
    license_civ_dive = true;
    hint "You're Whitelisted!!";
};

if (_unit == "license_civ_gun") then {
    license_civ_gun = true;
    hint "You're Whitelisted!!";  
};

if (_unit == "license_civ_trucking") then {
    license_civ_trucking = true;
    hint "You're Whitelisted!!"; 
};

#

IDC: 9901 is player Combo Box
IDC:9902 is Licenses Combo BOx

peak plover
#

@still forum how does the profiler get data? Using prof executable? Or ur own dll?

still forum
#

Intercept plugin

#

It only needs prof build for the ingame profiling UI to display it

#

because it's not possible to open it on non-prof

#

But the brofiler version has it's own UI so it doesn't need that

peak plover
#

Okay

#

Gr8 stuff

nocturne basalt
#

Hi guys. Is there a function for raising/lowering landing gear on aircraft? Can't seem to find any with the "land" or "gear" in it. I need to force turn on landing gears on spawning aircraft

little eagle
#

Yes.

nocturne basalt
#

🤔 could you tell me its name?

verbal knoll
#

hey.
i've wanted to ask how do i change the place the menu starts to scale in? im using this fnc - ctrlSetScale
atm the menu starts to scale from the left.
ty.

nocturne basalt
#

I need to do this from an external script which detects nearby aircraft

nocturne basalt
#

ohh thanks ^^ I was looking here

verbal knoll
#

someone?

little eagle
#

ctrlSetScale is for 3d model controls iirc.

unborn ether
#

@verbal knoll You cant change the left upper corner by using ctrlSetScale, if you willing to achieve that, better create your own function which will shift the control position with ctrlSetPosition and some ctrlCommit with delay.

molten folio
#

can anyone tell me how can i set this script to a selected player ? License_civ_tf141 = true;

unborn ether
#

@molten folio Remote exec that to a person.

#

since I don't get where it is selected exactly.

molten folio
#

Can i screen share with you?

little eagle
#
private _scale = 0.5;

ctrlPosition _control params ["_left", "_top", "_width", "_height"];

private _widthNew = _scale * _width;
private _heightNew = _scale * _height;

private _leftNew = _left + (_width - _widthNew) / 2;
private _topNew = _height + (_height - _heightNew) / 2;

_control ctrlSetPosition [_leftNew, _topNew, _widthNew, _heightNew];
_control ctrlCommit 0;

@twitch.tv/im_beast#8058 It's either this or something close. I'm very tired. -__-

#

@verbal knoll

molten folio
#

@little eagle can u help me?

#

plz

little eagle
#

I didn't understand your last question.

still forum
#

he is asking how to

#

to set a variable

little eagle
#

Well, like on the wiki.

#
[_value, {My_variable = _this}] remoteExec ["call", _target];

this?

unborn ether
#

^ but for security reasons its better to create a specific client function, since call|spawn can execute anything.

molten folio
#

my brain is locked

#
[_value, {license_civ_rebel = true}] remoteExec ["call", _target];
#

like this?

#

xd

little eagle
#
{license_civ_rebel = true} remoteExec ["call", _target];
unborn ether
#
["license_civ_rebel",_value] remoteExec ["myClientFunctionToGiveLicense", _target];

where your value is your true or false and _target is your selected player.

little eagle
#

???

#

Why would myClientFunctionToGiveLicense accept some CODE block as argument?

molten folio
#

@little eagle are u free?

unborn ether
#

oh sorry, corrected

molten folio
#

fml im confused

unborn ether
#

You need to read how the remote execution works before.

molten folio
#
if (_unit == "license_civ_trucking") then {
    {license_civ_rebel = true} remoteExec ["call", _target];
    hint "You're Whitelisted!!";
};
#

like that?

still forum
#

yes

little eagle
#

:thonk:

molten folio
#

not working

still forum
#

well that code is correct.

#

So if it doesn't work your error is elsewhere

molten folio
#

how is _target defined?

still forum
#

Also... how about remoteExec setVariable @commy?

#

Yeah.. That is what I would want to ask you

#

apparently it isn't

#

You have to define it.

molten folio
#

aigh

little eagle
#

if (_unit == "license_civ_trucking") then {
Why would _unit be a string? This makes no sense to me.

#

_unit is an object.

still forum
#

It's just horrendous naming. if you had seen his earlier code you'd know it's a string

molten folio
#
private _index = lbCurSel 9902;
_unit = lbData [9902, _index];
_target = lbCurSel 9901;

if (_unit == "") then {
    hint "Please Select a whitelist!!";
};

if (_unit == "license_civ_pilot") then {
    license_civ_pilot = true;
    hint "You're Whitelisted!!";
};

if (_unit == "license_civ_rebel") then {
    license_civ_rebel = true;
    hint "You're Whitelisted!!";
};

if (_unit == "license_civ_dive") then {
    license_civ_dive = true;
    hint "You're Whitelisted!!";
};

if (_unit == "license_civ_gun") then {
    license_civ_gun = true;
    hint "You're Whitelisted!!";
};

if (_unit == "license_civ_trucking") then {
    {license_civ_rebel = true} remoteExec ["call", _target];
    hint "You're Whitelisted!!";
};
#

9902 is the License Combo List
9901 is the player Combo List

still forum
#

read the remoteExec wiki page.

#

Target is not some index in your combobox

little eagle
#

lbCurSel reports the index, right?

still forum
#

yes

little eagle
#

Yeah, that is not how this works.

molten folio
#

how do i define the _target

#

my player list is a combo

still forum
#

It has to be your target

#

aka the object

little eagle
#

9901 is a ListBox will all connected players?

molten folio
#

yes

#

its a ComboBox

#
TW_panel = playableUnits;
{
    if (isPlayer _x) then
    {
        _uid = getPlayerUID _x;
        _index = lbAdd [9901, (name _x)];
        lbSetData [9901, _index, _uid];
    };
} forEach TW_panel;```
little eagle
#

jesus

still forum
#

TW_panel is a list of playable units?

molten folio
#

ye

still forum
#

That's.. totally not confusing variable naming right there

#

and why do you use playableUnits and then isPlayer

#

instead of using allPlayers directly?

molten folio
#

idk my friend told me

little eagle
#

name errors for dead units too.

still forum
#

you have the players UID. I think there is a bis function to get object from player UID

little eagle
#

But what if there's no player.

molten folio
#

it wil be empty

little eagle
#

This is something for BIS_fnc_netId / BIS_fnc_objectFromNetId

#

UID doesn't help here.

molten folio
#

so i need to change the player list?

little eagle
#

Is TW_panel used anywhere else?

molten folio
#

no

#

commy can i show u on Screen share please?

little eagle
#
{
    private _netId = _x call BIS_fnc_netId;
    private _index = lbAdd [9901, name _x];
    lbSetData [9901, _index, _netId];
} forEach allPlayers;
#

and then...

#
private _unit = lbData [9902, lbCurSel 9902];
private _target = lbData [9901, lbCurSel 9901] call BIS_fnc_objectFromNetId;
#

I would also rename _unit to _type, because _unit implies OBJECT type, not STRING type.

#

fixed a typo

#

And then...

if (_unit == "license_civ_trucking") then {
    {
        license_civ_rebel = true;
        hint "You're Whitelisted!!";
    } remoteExec ["call", _target];
};

So, the hint is shown on the machine that got white listed, not on the admins (?) machine.

molten folio
#

the hint was just there to test

#

if the function worked

#

but thhanks ill try this

#

now

#

@little eagle not working

little eagle
#

Checked the rpt?

molten folio
#

alot of warning

#

cant i show u on discord screen share?

#

would be easier

#

xd

little eagle
#

I'm doing stuff on the side you know, just post it here if there's an error,

molten folio
#

k

#

i mean the function u gave me

#

not working

#
if (_unit == "license_civ_trucking") then {
    {
        license_civ_rebel = true;
        hint "You're Whitelisted!!";
    } remoteExec ["call", _target];
};```
little eagle
#

Add some debug, print _target to rpt and look if it's the right one. Make sure call is white listed if you use CfgRemoteExec.

molten folio
#

still confused

#

fml

astral tendon
#

Is there a way to change the vehicle turret sights?

spring dune
#

@astral tendon Sight modes or what exactly?

astral tendon
#

The reticle

spring dune
#

They're integrated in model (if i'm right)

#

Change the configs then

astral tendon
#

how?

spring dune
#

You can change texture of reticle to custom & then calibrate the ballistics

#

Which turret?

#

Here is a lot of nuances so, provide pls more info about what u're trying to do.
@astral tendon

Also, is that scope? Is that 3D scope & etc. etc.

astral tendon
#

Is the scope of the .50 UAV turret "B_HMG_01_A_F"

spring dune
#

Not a scope, but uavCam HUD

#

Watch it

astral tendon
#

So, how to change it?

spring dune
#

IDK, if u don't understood yet.
But that's would be useful for me.

#

So, gimme some time, i will try to investigate
And... What u want to change exactly?
Or you have new texture etc. etc.

#

I meant, if you trying to change sight's texture, it won't be hard but you would change ballistics too.
If anything else, say it.

astral tendon
#

I want to use a scope textere that is already in the game, like the LRPS

spring dune
#

How you can see, it's UI
And only square mask there is texture...
Guess it's inside of HMG_01_F.p3d & HMG_01_high_F.p3d

#

Try to extract it & watch

astral tendon
#

So no way to do that by script?

unborn ether
#

You cant change scope textures, as scopes are actually objects which is created and held by engine internally.

spring dune
#

I don't sure what it's possible yeah

#

@unborn ether But you can create your own

unborn ether
#

Not sure how you are willing to attach that to yourself.

#

And also how to remove existing "texture"

little eagle
#

Wow, this has been going on for hours now.

#

This is painful to watch.

#

Is there a way to change the vehicle turret sights?

#

No.

#

Done.

spring dune
#

Is there a way to create your own turret based on vanilla with custom reticle?

little eagle
#

No.

spring dune
#

Seriously?

little eagle
#

Always*

spring dune
#

Uh, commy... 🙁

little eagle
#

Yee?

spring dune
#

U made me sad

real tartan
#

is there command to get current fire "mode" of weapon ? _modes = getArray (configFile >> "CfgWeapons" >> _weapon >> "modes");

glad venture
#

does anyone know if there is a way to export all available items in a virtual ammobox as an array?

blissful phoenix
real tartan
#

@blissful phoenix thank you 😃

molten folio
#

anyone knows the transparent Color Code?

little eagle
#

1,1,1,0

#

????

molten folio
#

ty

lethal ingot
#

If I run through a playableUnits loop on server side, how do I send a systemChat message to specific unit, if he mets conditions?

little eagle
tough abyss
#

hey

#

are you able to format live like this?

#

<t align=right>

little eagle
#

depends

unborn ether
#

So arma loosing precision on natural Number since how much, 9, 12 digits?

ruby breach
little eagle
#

1E7

lethal ingot
#

@little eagle Yeah, it's remoteExec, but ID is needed. Is it

_clientID = owner _unit;
"I am a message" remoteExec ["systemChat", _clientID]; 

?

lone glade
#

"I am a message" remoteExec ["systemChat", _unit];
no need to ask the server who's the owner of that unit because the request has to go through it anyways

lethal ingot
#

So it's just _unit as ID?

lone glade
#

just pass the unit

#

the server knows who owns what, the remoteExec goes through the server, thus you don't need to pass the netID of the owner.

#

plus you'd need to use clientOwner, owner is server only

lethal ingot
#

And my loop is on server side

lone glade
#

again, you don't need to get the ID of whoever owns what to use remoteExec

lethal ingot
#

Yeah, I've got that, just trying to understand further 😃

little eagle
#

clientOwner reports something different than the id used by RE anyway :^)

velvet merlin
#
[_plane,[_unitTurretPlane,false]] remoteExec ["lockTurret",_plane];```
anything wrong with this from the looks of it?
and would this behave differently on an empty plane vs AI as pilot (SP/plane is local)?
little eagle
#

anything wrong with this from the looks of it?
No, lgtm.
and would this behave differently on an empty plane vs AI as pilot (SP/plane is local)?
No, though I assume if the plane is empty, _unitTurretPlane would be [] or something.

velvet merlin
#

_unitTurretPlane is the turret index

#

seems actually this is the problem somehow

_unit action ["moveToTurret",_plane,_unitTurretPlane];```
#

for some reason moveToTurret doesnt work when the plane is not empty/the plane has an AI pilot

little eagle
#

?

#

Are you executing these one after the other?

velvet merlin
#

test case:

  1. plane with AI pilot
  2. start outside
  3. get in as cargo (manually or via player moveInTurret [cursorTarget,[6]]; or player action ["GetInTurret",cursorTarget,[4]]; )
  4. run player action ["moveToTurret",vehicle player,[5]] to swap to turret
    => doesnt work
  5. driver vehicle player setDammage 1
  6. retry 4
    => works
#

ive got an idea now. i think its due to commanding parameter in config

#

we adjusted these

#

now the pilot is effectiveCommander over cargoTurrets and thus he disallows you to change positions (even when using scripting)

little eagle
#

Yeah, the AI will not let you leave a vehicle if they're the group leader. Maybe the same is true for switching slots.

velvet merlin
#

yeah it was commanding=-1; in cargoTurret 😬

fringe yoke
#

Does anyone know why the showGPS might not be working for me?

#

showGPS true and showGPS false both do nothing

#

whoops nevermind, that is for the map screen

#

Does anyone know how to show / hide the minimap then?

little eagle
#

The minimap?

fringe yoke
#

The GPS minimap, Right Control + M

little eagle
#

Drop the GPS item.

fringe yoke
#

I want to give players a GPS, so they can see their grid on the map view (using ACE), but I don't want them to have a minimap

#

Attributes -> General -> States -> Show GPS in the editor claims to do this, but has no effect

little eagle
#

Well, that is what should control the gps. The showGPS attribute.

fringe yoke
#

It hides the GPS object in the map view, but not the minimap

little eagle
#

Do you have showGPS = 1; in description.ext? That's the mission config, and the mission config overwrites the attributes.

fringe yoke
#

I don't have a description.ext for this mission

#

and ideally I'm trying to find a solution via scripting, it'd be nice to add it to a mod

little eagle
#

Make one, put showGPS = 0; in.

fringe yoke
#

No effect

little eagle
#

Remember to load the mission after adding a file.

fringe yoke
#

Yes

little eagle
#

Make sure you load the correct mission. showGPS is definitely what toggles the gps.

fringe yoke
#

I have other scripts in the mission and it is a very unique mission name, so I know I have the right folder open in my editor. I added description.ext with the contents showGPS = 0; and exited and reopened the editor just to be sure, then playing the mission. Both the minimap and ACE GPS on the map view are available.

little eagle
#

Put this into the init.sqf file:

0 spawn {
    waitUntil {!isNil "ace_common_AssignedItemsShownItems"};
    ace_common_AssignedItemsShownItems set [4, false];
};
fringe yoke
#

No changes

#

running ace_common_AssignedItemsShownItems set [4, false]; in the debug console also does nothing

little eagle
#

Drop an item after executing this code.

fringe yoke
#

alright, nothing happens

little eagle
#

getMissionConfigValue ["showGPS", 1]

#

What does that report?

fringe yoke
#

0 last I checked

#

one sec

#

yeah, still 0

little eagle
#

Can you screenshot that gps of yours?

fringe yoke
#

I guess so?

little eagle
#

do it

fringe yoke
#

working on it

#

can't upload here

#

Minimap and base game GPS

little eagle
#

Are you inside a vehicle?

fringe yoke
#

No

little eagle
#

🤔

fringe yoke
#

Got me stumped too

little eagle
#

Let me start the game. Maybe it's fucked in 1.82.

fringe yoke
#

Alright, thanks for the help

little eagle
#

Yeah, seems like the mini map is shown regardless of the attribute.

little eagle
#

@fringe yoke Put this into the description.ext:

class Extended_DisplayLoad_EventHandlers {
    class RscCustomInfoMiniMap {
        commy_hideMinimap = "\
            params ['_display'];\
            {\
                _x ctrlShow false;\
            } forEach allControls _display;\
        ";
    };
};
#

It also works inside a config.cpp for an addon.

loud python
#

I have a performance question

fringe yoke
#

I've already got that work around running 😛

loud python
#

if I have lots of items, and for each of them I spawn a script that basically just sleeps for 5 minutes and then deletes them

#

how much does that impact performance?

little eagle
#

You do? I just made that up.

fringe yoke
#

Well it ain't named commy_hideMinimap but yes. One interesting thing I found though, is that even unassignItem "ItemGPS" doesn't do anything. So it definitely looks like an Arma bug

little eagle
#

I don't think this MiniMap has anything to do with the GPS.

#

They scrapped the GPS and replaced it with this thing some versions ago. I'm curius how you found this work around though.

still forum
#

@loud python spawn? Basically not at all.

loud python
#

so I can just spawn a new function fevery time a player drops an item and it won't do much bad, right?

#

that's nice 😃

fringe yoke
#

I'm pretty sure the GPS is linked to the minimap, if I edit the loadout in the editor to remove the GPS and nothing else, when you start the mission you can't open the minimap

little eagle
#

Seems broken.

fringe yoke
#

Adding a GPS and then removing it does not remove the ability to toggle the minimap, and it stays open. So definitely broken.

inner swallow
#

GPS = minimap yes

#

although afaik vehicles will always let you see the minimap

#

(if you're a passenger for example)

#

could be a config thing though

fringe yoke
#

Yes, it is a config option, most vehicles have it enabled

little eagle
#

My script kills it for good.

fringe yoke
#

Mine wasn't as nicely formatted, but it preserves it in vehicles that have a built in GPS

class Extended_DisplayLoad_EventHandlers {
    class RscCustomInfoMiniMap {
        synixe_nogps = "params ['_display']; { if (isNull objectParent player) then { _x ctrlShow false; }; } forEach allControls _display;";
    };
};
#

well, actually I guess you could use it if you had a GPS in a vehicle that wasn't supposed to have a GPS. But I don't feel like going through configs

unborn ether
#

It would also nice to kill the annoying actions on the actions panel.

inner swallow
#

bind them to something

#

they should disappear

formal vigil
#

I had the same with Right Panel mode and Right Panel next

#

It disappeared after I bind hotkeys for them

dim terrace
#

what happened to event handlers wiki page? I'm the only one who is not convinced to new layout?

lone glade
#

it got updated

#

it still needs some work tho

errant jasper
#

Nah, you are not the only one, reyhard. Previously, the ToC (Table of Contents) was on the left, and each listing was horizontal, meaning even if you skipped the ToC, you could still quickly find the entry you were looking for just by scanning the titles on the left.

Now the ToC is on the right, not the natural first place to look, in fact I almost forget about it everytime. And now everything about an entry is laid out vertically, so takes longer to find. Before anyone says I could just search - well yeah, I could that before - and then what is the point of a given layout.

fringe yoke
#

I know this might not be the best place to ask but does ACE have any event handlers? It doesn't look like there is to me but I'm just wondering.

errant jasper
#

They have plenty

fringe yoke
#

I can't find any :/

errant jasper
#

Most of ACE is works by using event handlers

fringe yoke
#

I mean do they fire event handlers

fringe yoke
#

Is what I am looking for

errant jasper
#

Just posted lots of it.

fringe yoke
#

Yeah, I had already type and hit enter before they popped up, thank you.

#

I was looking in the arsenal module, looks like they don't have any EH in there 😦

errant jasper
fringe yoke
#

I just want to know when the ACE Arsenal is closed, an EH would be the most elegant solution. but there are other ways, thank you for the help.

#

I've used that page before :/ I think I am tired, I was searching in only arsenal and then was confused and thought all of ACE had no EH for a second.

errant jasper
#

There is one running locally: [QGVAR(displayClosed), []] call CBA_fnc_localEvent;

#

So the event is called "ace_arsenal_displayClosed"

#

So run something like

["ace_arsenal_displayClosed", {
  // Your code here
}] call CBA_fnc_addEventHandler;```
fringe yoke
errant jasper
#

For reference, when using Github search, it is: path:addons/arsenal event

lone glade
#

gimme 5s

still forum
#

@dim terrace for feedback on the page #community_wiki @winter rose made it. The layout is not perfect yet but It's better than before

fringe yoke
#

Huh, this is the first time I tried to use it for searching for code. Didn't realize it didn't search through code...

#

Thanks

lone glade
#

that list is going to be added to the framework doc soon ™

dim terrace
#

I have same feelings as Muzzleflash about layout - imo TOC was faster to browse through

fringe yoke
#

Does ace_arsenal_cargoChanged fire for weapons or other categories on the left hand side? Or just for uniform/vest/backpack items?

lone glade
#

only when you click + or - in the right tab, so containers only

fringe yoke
#

cool thanks

austere hawk
#

@dim terrace agreed

orchid saffron
#

I´m looking for creating my own macros for saving time when programming.
But I don´t know if they´re expensive in optimization terms, what you guys think?

glad venture
#

if I did player addAction[...]; would that give the action to everone looking at the player or just the player?

errant jasper
#

Having macros by themselves cost nothing.

#

However if the definition is more complex than necessary where you are using it, then it may worsen. But defining macros is essentially free.

orchid saffron
#

@errant jasper Could you do an example?

fringe yoke
#

@glad venture just the player who's PC it ran on

[[player, ["My Action Title","myAction.sqf", ...]],"addAction",true,true] call BIS_fnc_MP;

that is for an action for everyone, including people that join after the mission has started
you can read more at https://community.bistudio.com/wiki/BIS_fnc_MP

mossy raptor
#

Someone knows or has developed a script listen to an audio in streaming in-game,it´s possible?

orchid saffron
#

For example if i do #define GVAR(unit,var,default) (#unit getvariable [#var,#default])

little eagle
#

That's just a waste.

orchid saffron
#

Only for things like getText & missionconfigfile...

#

right?

little eagle
#

If you replace a getVariable with a GVAR, there's absolutely no point, since what you got afterwards is just as long as what you had before. You have all the drawbacks for no benefit.

orchid saffron
#

I understand

#

Thank you

glad venture
#

anyone know the best way to convert mp4 to ogg

little eagle
#

Thats...

still forum
#

I use VLC

glad venture
#

ok

#

ill try that

errant jasper
#

I use ffmpeg for my audio and video conversion needs

lusty canyon
#

how do you check if an obj typeof is in an attachedobjects array? do i have to foreach _x == typeof? or is there a faster way?

little eagle
#

findIf urg

lusty canyon
#

cant find the biki for that, undocumented?

little eagle
#
attachedObjects _thing findIf {typeOf _x == "blah"} != -1
lusty canyon
#

oh ok great thanks

little eagle
#

It should be >= 0 ofc

lusty canyon
#

ic since its index of found element, and -1 if nothing, very nice i can replace alot of my foreach stuff

little eagle
#

This is something that could get a macro, because that would give you more descriptive code than the mess above:

#define HAS_ATTACHED(obj,item) (attachedObjects (obj) findIf {typeOf _x == (item)} != -1)
lethal ingot
#

There's scriptDone for execVM. What's the equivalent for call?

errant jasper
#

I don't believe there is one. Why would you even want one? But you can set a variable after the call is done I guess.

glad venture
#

does anyone know how to get rid of saves for an mp map? i am testing all the slots out and I keep spawing with gear from one specific slot.

glad venture
#

do i have to specify to use files like functions.hpp, defines.hpp, and dialogs.hpp or are they used by default?

austere granite
#

you need to do #include functions.hpp in your configfile (config.cpp / description.ext)

still forum
#

@lethal ingot scriptDone for call doesn't make sense. Because after your call your call will be done

glad venture
#

is there a way to pass variables to a dialog?

austere granite
#

As in

torn juniper
#

is there a way to read side chat via script, to output it for logging or otherwise

#

kindof like how a rcon service works but ingame

little eagle
#

No, and I tried.

torn juniper
#

I figured as much

#

thats dumb

little eagle
#

The problem seems to be that the chat log is using structured text and not strings, and there actually is no command to read structured text.

torn juniper
#

ah

little eagle
#

Only Set, no getter.

torn juniper
#

makes sense

#

sucks but

#

I get it

little eagle
#

Yeah, same reason you can display stuff from html, htmlLoad, but you can't use it in SQF. No way to read it.

torn juniper
#

gotcha

little eagle
#

@glad venture _display setVariable ["key", value];

glad venture
#

@little eagle and so from the display would I just use this getVariable?

little eagle
#

Yes.

#

Doesn't even have to be the display. You can also set the variables on all of the controls.

glad venture
#

ok

#

I was making a vehicle spawner and just wanted to pass the location of the marker

little oxide
#

Wich is better optimized for a loop to update an hud

#

FSM or for loop ?

errant jasper
#

CBA per frameHandler?

#

That's how I do it at least

#

Although I guess if HUD is mostly static that might be overkill - in which case I just modify the HUD elements whenever they have to.

little eagle
#

You could add a MouseMoving and a MouseHolding eventhandler with the same code to the display.

little oxide
#

Because, i using fsm, and thinking if cba or any other loop, maybe more optimized

little eagle
#

That way it deletes itself once this display is killed.

#

Together they fire every frame.

still forum
#

"FSM or for loop" is a invalid comparison.
a for loop can be SQS or SQF or FSM and scheduled or unscheduled.

#

"cookie or cupboard"?

little eagle
#

for loop inside a fsm. Imagine

#

fsm is always a waste

errant jasper
#

Nice @little eagle , I like it.

little eagle
#

What do you like?

errant jasper
#

The idea of using mousemoving/mouseholding instead.

little eagle
#

Yeah, it's nice.

errant jasper
#

Wait a minute. Does it also work fine with cutRsc?

#

What is the display then?

little eagle
#

Not sure.

#

Well, the display is... Do you want to retrieve it? Then you need onLoad event in the class.

#
class My_Display {
    onLoad = "uiNamespace setVariable ['My_Display', _this select 0]";
};
cutRsc "My_Display";
private _display = uiNamespace getVariable "My_Display";
errant jasper
#

Yeah, I guess that ought to do it.

#

And then I also move the perFrame args to uinamespace instead and that should be all the changes.

little eagle
#

?

errant jasper
#

Currently I have args to my perFrameHandler. Since I no longer have those args passed from the mouse events I should store them somewhere to access them. Is there a better place to put them?

little eagle
#

On the display as well I guess.

#
_display setVariable ["my_args", [_arg1, _arg2, _arg3]];
_display getVariable "my_args" params ["_arg1", "_arg2", "_arg3"];
errant jasper
#

Yeah. Side question, wasn't there something about the "code" passed to addEventHandlers was actually recompiled all the time, or do I misremember?

little eagle
#

Yeah, that's true.

#
_display setVariable ["my_draw", {
    ...
};

private _fnc_update = {call (_this select 0) getVariable "my_draw"};
_display displayAddEventHandler ["MouseMoving, _fnc_update];
_display displayAddEventHandler ["MouseHolding, _fnc_update];
#

That way only:
call (_this select 0) getVariable "my_draw"
has to be recompiled, which is pretty short.

glad venture
#

does nearestVehicle "vehicle" include people?

little eagle
#

There is no command named nearestVehicle afaik.

glad venture
#

@little eagle i ment nearestObject

little eagle
#

nearestObject [position, "vehicle"]
would always report [], because there is no class named "vehicle" in CfgVehicles afaik.

glad venture
#

how would select the nearest vehicle then

little eagle
#

Define "vehicle".

glad venture
#

anything you can enter and drive, including planes boats helicopter

little eagle
#

Radius?

glad venture
#

15

lone glade
#

worldsize huehuehuehue

little eagle
#

15 meters should be doable.

glad venture
#

im trying to makesure that there aren't any cars near where I am about to spawn a vehicle

errant jasper
#

Alright, I got it changed. Thx @little eagle .

little eagle
#
private _near = _position nearObjects ["All", 15];

// remove non-vehicles
_near = _near arrayIntersect vehicles;

// sort by distance
_near = _near apply {[_position distance _x, _x]};
_near sort true;

private _nearest = _near param [0, [nil, objNull]] select 1;
#

This is my attempt.

#

fixed something

winter rose
little eagle
#
private _near = vehicles inAreaArray [_position, 15, 15];

// sort by distance
_near = _near apply {[_position distance _x, _x]};
_near sort true;

private _nearest = _near param [0, [nil, objNull]] select 1;

Maybe faster, would need some testing, but I assume so.

errant jasper
#

For a CBA setting overridden by mission or server, can it happen that the handling code is run multiple times with different initial values? E.g. the client has false, but server/mission overrides with true, might it run with false?

little eagle
#

I guess.

errant jasper
#

I have a setting that I would prefer not handling changes to during a run. Imagine ace medical being changed from advanced to basic during gameplay. Can I somehow detect when the "correct initial value" has been determined?

#

I see ACE and TFAR use CBA_settingsInitialized - can that be used ?

still forum
#

after CBA_settingsInitialized all settings were propagated from server and everything is set

#

I think

errant jasper
kindred lichen
#

Hey, has anyone ever heard of a script that lets you kill people with thrown IR grenades?

Like, I'm trying to build something like dodge ball, where you can throw things at each other.

#

So I'm thinking there's a way to check if a thrown projectile has collided with a player?

#

I'd just use 40mm smoke grenades, but they don't do impact damage.

winter rose
#

maybe attach a bullet to the grenade?

kindred lichen
#

is that a thing?

#

replace grenade with a bullet?

winter rose
#

no, attach a bullet to it and check Hit Event Handler maybe

kindred lichen
#

like attachto? doesn't that remove collision for the attached object?

#

I'm just trying to build a mini game for people who are in the dead box.

radiant needle
#

Did you already try a hit event handler to the IR strobe to see if it triggers ?

kindred lichen
#

negative, I was about to start poking around with that.

#

just wondering if someone remember seeing something that existed like an Arma Snowball fight or something I could just copy.

#

MPHit usually only fires when someone is damaged by something, no necessarily when a projectile hits something.

radiant needle
#

If hit only triggers when damage is dealt (Which I believe it does) you can always try adding a fired eventHandler and then do a distance check

#

Basically just checking the strobes distance to different body parts, and if it still has velocity

#

Is IR strobe PhysX enabled? If it is you can try EpeContact eventhandler

#

Anybody know how to allow a scripted in map marker be editable by Zeus interface?

kindred lichen
#

map markers are local.

#

You want do have a marker be draggable?

#

You can write something that has the marker follow a draggable object around, like and invisible helipad or something.

#

Or Make it a task that's synch'd to the object.

radiant needle
#

No I would need full Curator control of the object

kindred lichen
#

You can add objects to curator, then it'll be like a little object symbol that they can drag around.

knotty mantle
#

Where can i find the info about how the eden modules are done in script? Basically i want to know how to create the particle effect "smoke" via script.

radiant needle
#

addCuratorEditableObjects does not work on markers

kindred lichen
#

Use it on an invisible helipad, then write a script that moves the marker to the helipad consistently.

radiant needle
#

I need the marker itself to be editable by curator

frozen knoll
#

@knotty mantle in eden click tools > functions > moduleEffectsSmoke

knotty mantle
#

noice. Thanks

radiant needle
#

Dear BI please add addCuratorEditableMarkers command

limber tangle
#

Anybody used the COS (Civilian Occupation System), if so having issues with the AI Civs moving off the road and follow their scripts, using the Tanoa map, if anyone wants the script let me know 😃

glad venture
#

do sound files have to be put in description ext, or can i just do say3D "/sounds/sound.ogg"

meager heart
native siren
#

Helo can someone clarify something for me. My problem is that when player join "_group" and then leave it this group becomes "NULL-group" Is there a way to keep it up? From what I've seen in wiki default attribute should be keeping this group alive even if all units leave but it seems that it's not exacly working as I think.

_group = (createGroup west);
missionNamespace setVariable["test",_group,true];
this addAction["Join",{[player] join (missionNamespace getVariable "test");},"",0,false,false,"",'side player == civilian'];
this addAction["Leave",{[player] join (createGroup civilian);},"",0,false,false,"",'side player == west'];
meager heart
#

🙄

#

group with 0 units will returns as <NULL-group>, but it will be not destroyed and it can be used... createGroup [side, deleteWhenEmpty] (since Arma 3 v1.67)

#

also we have isGroupDeletedWhenEmpty

#

message was removed 🤔

subtle ore
#

So I guess it's useful for things like:

{
  systemChat format["TESTING GROUP: %1",_x];
  if(!isGroupDeletedWhenEmpty _x) then
    {
      systemChat format["GROUP: %1 NOT DELETE WHEN EMPTY",_x];
      private _newGroup = createGroup[side _x,true];
      systemChat format["CREATED NEW GROUP: %1",_newGroup];
      deleteGroup _x;
      systemChat format["DELETED OLD GROUP: %1",_x];
      {
        [_x] join _newGroup;
        systemChat format["UNIT: %1 JOINED: %2",_x,_newGroup];
      } forEach (units _x);
    };
} forEach allGroups;
meager heart
#

yep

warm gorge
#

How could I go about checking if a cutText layer is currently on the screen? I thought I could check if a layer name was in allCutLayers, but it stays there regardless of whether the actual text is on the screen or not.

native siren
#

Thank you for your help @meager heart @subtle ore . Just one follow-up questions so I will make sure that I understand. Once the group becomes NULL-group it's not deleted but players cannot join it any more so I need to check them and recreate if needed?

still forum
#

a group cannot become NULL-group

#

a variable can become that. Which indicates that the group doesn't exist anymore aka was deleted.

#

@subtle ore all your code
->
{[_x, true] remoteExec ["deleteGroupWhenEmpty", groupOwner _x];} forEach allGroups;

#

Ah you mean "<NULL-group>" and not NULL group. aka grpNull which are completly different things.

native siren
#

Yes

still forum
#

What a dumb Idea to call a empty group "<NULL-group>" instead of "<empty-group>"

#

"<NULL-group>" can be two things then. Empty group (in which case it's still valid and you can join units into it) or grpNull in which case it doesn't exist. It's just a pointer as "this variable would hold a group if it wasn't deleted"

native siren
#

I was trying to use my addAction mentioned above but when I joined, left and tried to join again it didn't work. I've also printed the "test" var and I've noticed that in the beginning it has a proper name but after leaving it becomes "<NULL-group>" and then I cannot join it any more. Is there some special way of joining into "<NULL-group>"?

#

The only thing that comes to my mind is that this var I created to get into group is no longer valid for use after group becomes "<NULL-group>".

meager heart
#
player spawn {
    private _group = createGroup playerSide;
    hint format ["Test group: %1\nPlayer group: %2", _group, group _this];
    sleep 5;
    [_this] join _group;
    hint format ["Test group: %1\nPlayer group: %2", _group, group _this];
    sleep 5;
    [_this] join grpNull;
    hint format ["Test group: %1\nPlayer group: %2", _group, group _this];
    sleep 5;
    [_this] join _group;
    hint format ["Test group: %1\nPlayer group: %2", _group, group _this];
};
```try it in the console ^
#

@native siren

#

Dedmen told you already... but
<NULL-group> empty group
grpNull not existing group

native siren
#

Yeah will do that @meager heart as soon as I will get home. I'm probably a little bit thick and the answer is in from of my eyes. Thanks guys 😃

still forum
#

Yeah as I said. Null-group can be two things apparently. In your case it apparently is the second case. Which means the group doesn't exist at all so you also cannot join it.

#

You should be able to check that using _group isEqualTo grpNull

errant jasper
#

In a HitPart handler how to detect if player was _shooter if in a vehicle with multiple weapons?

lone glade
#

batman's favorite command

errant jasper
#

Thanks that did.

#

Hmm. How to get HitPart to fire for all kinds of objects? It works for vehicle and personel, but not a target object

grand sleet
#

Is it possible to prevent postprocessing effects being wiped by pressing Esc

warm gorge
#
private _item = "";
private _configName = switch true do {
    case (isClass (configFile >> "CfgWeapons" >> _item)): {systemChat "1"; "CfgWeapons"};
    case (isClass (configFile >> "CfgMagazines" >> _item)): {systemChat "2"; "CfgMagazines"};
    case (isClass (configFile >> "CfgGlasses" >> _item)): {systemChat "3"; "CfgGlasses"};
    case (isClass (configFile >> "CfgVehicles" >> _item)): {systemChat "4"; "CfgVehicles"};
};

Anyone know why _configName here is returning true here but nothing is being printed to systemChat?

still forum
#

because none of them are true

#

and there is no default case so I guess it just returns true?

warm gorge
#

Ah really? I thought it would return nil as it couldnt find anything true

austere granite
#

it should

still forum
#

would think too

warm gorge
#
private _test = switch true do {
    case false: {"test"};
};
systemChat str _test;

Apparantly not. The above returns true as well.

blissful phoenix
tame portal
#

getShotParents always makes me giggle

glad venture
#

is there a way to add a handle damage event for the source of the damage, like an event handler that triggers when the player damages something else

still forum
#

no

winter rose
#

@tame portal Batman is coming for you

unborn ether
#

@glad venture What are you trying to achieve exactly, didn't get you.

glad venture
#

@unborn ether i am trying to make it so that when a player shoots ai with certain ammo, it triggers a tazer script

#

I could try adding the event handler to every ai that is spawned

unborn ether
#

@glad venture Well yes, thats what you need to do. Kinda might spam, but yes.

#

Dont forget to follow the locality of argument btw.

glad venture
#

How would I do that would I just do _man = spawncmd; _man addEvent handler. For every AI I ever spawn?

unborn ether
#

@glad venture Yes, you should have a head function which does spawn every AI and simply apply it there, if its MP, server sided ofc.

knotty mantle
#

Is there a command to check if there is a line of sight between two objects?

lone glade
#

yes, can't remember what it is tho^

gleaming oyster
#

👏

knotty mantle
#

yeah i tested that. @lone glade and either i am too stupid or it is pretty broken.

#

I did never get over 0.6 even if i went up REALLY close. And from a certain distance it was just 0.

#

And as i want to use it to make AI see us faster on higher distances that is not working so well.

#

Fiddling around currently with lineIntersectsSurfaces

gleaming oyster
#

Why surfaces?

native siren
#

@meager heart I've tested the code those are results:

Test group: B Alpha 1-1 Player group: B Alpha 1-2
Test group: B Alpha 1-1 Player group: B Alpha 1-1
Test group: <NULL-group> Player group: B Alpha 1-1
Test group: <NULL-group> Player group: B Alpha 1-2

If I add deleteGroup _group; after create I get.

Test group: <NULL-group> Player group: B Alpha 1-2
Test group: <NULL-group> Player group: B Alpha 1-1
Test group: <NULL-group> Player group: B Alpha 1-1
Test group: <NULL-group> Player group: B Alpha 1-2

Tbh I don't see any difference between deleted group and empty one. It seems like doesn't matter what attributes i use createGroup [side, deleteWhenEmpty] it always deletes it when it becomes empty and I cannot get this specific group to stay.

winter rose
#

does anyone know of a way to hide/destroy a helicopter blades like it touched a tree or walls?
hideSelection only works on simpleObject, and setHitPointDamage doesn't break them

digital hollow
#

You could do it the really dumb way and just spawn a pole, engineOn, then delete the pole =D

viral mirage
#

hey @digital hollow would you by any chance know if im allowed to advertise my new wasteland server on #creators_recruiting

digital hollow
#

I think that's for content creators looking for contributors.

molten folio
#

How does the RscHTML Work???

unborn ether
#

@molten folio It goes with htmlLoad

unborn ether
#

@native siren Something is cleaning up your groups then.

glad venture
#

anyone here know a lot about ACE 3?

lone glade
#

why ^ ?

drowsy axle
#

Does arma's default SP save function save variables?

#

variable values*

native siren
#

@unborn ether That's what I thought but I tried it in new mission where I just run this and got the same results.

unborn ether
#

@native siren In Arma 3 when last unit leaves its group, the group usually gets immediately auto deleted, regardless of whether or not if it was set for auto deletion manually well, I personally don't understand the reason of that parameter.

native siren
#

Thank you at least I know I'm not going crazy. 😃 I don't get the point of this parameter as well but oh well. I will just create something to check if group is null and then recreate it.

glad venture
#

im trying to figure out how to make ai unconscious or at least give medics the option to carry them when they are conscious in ace

native siren
#

but I hope there would be more elegant solution

unborn ether
#

@native siren Well you can create some dummie npc elsewhere to keep it up

native siren
#

Yeah that could work as well.

lone glade
#

there's a module in zeus for that

glad venture
#

@native siren im already doing that but it still doesn't give me the option to move the person, i am trying to find the script name for carrying a person so i can add it to the interaction menu

native siren
#

@glad venture I don't think there is convenient way to achieve this. You need to use attachTo and some animations to make it work. I've seen some scripts on Armaholic that do that.

glad venture
#

@native siren its already there, i have ACE , im trying to figure out how to add the option to carry them even if the person is awake

glad venture
#

If i were to make a script that cycled over all the ai on a sever ever 10 seconds or so, would that cause a lot of lag?

tough abyss
#

Anything causes lag. What are you doing within the script

warm bronze
#

Ooh good question. I’ve got a while loop that checks the ai distance from the way point and changes the ai behaviour accordingly within 75m. That loop cycles every 15 seconds. If I have 5 or so groups running with that on the server, could that cause server lag etc?

subtle ore
#

depends on how many units you have in the 5 groups, if each group is 100 then sure. If you're worried with a reasonably high ai count then transfer them to an hc

#

if you're talking like 50 or something like that, probably not.

peak plover
#

@glad venture Why do you wanna cycle all the ai?

warm bronze
#

Yeah they are on headless already. Sahweet

lethal ingot
#

Help, please, broke my head already with this.

How do I do stuff in a loop with sleep, while dialog is opened, and then terminate it after it closes? [] spawn doesn't know about variables outside, and I can't make them global because this is per player.

#
_dialog = createDialog "MJ_TabletDialog";
    while {_dialog} do {
        systemChat format["Tablet opened %1", time];
        //sleep 5; // This sleep breaks everything
    };
#

Also time isn't refreshed, it just spams first value

#

If I make

systemChat format["Tablet opened %1", floor random 100];

Then it just gives several random numbres and then just stops. 😖

grand sleet
#

I don't know if I misunderstood you but global variables are not public variables and therefore still remain per player if you make them global

meager heart
#

In Arma 3 when last unit leaves its group, the group usually gets immediately auto deleted, regardless of whether or not if it was set for auto deletion manually well, I personally don't understand the reason of that parameter.

0 spawn { 
    private _group = createGroup playerSide; //--- Default deleteWhenEmpty is false
    hint str [_group, group player, count allGroups];  
    sleep 5; 
    [player] join grpNull;  
    hint str [_group, group player, count allGroups]; //--- _group is empty   
    sleep 5; 
    [player] join _group; 
    hint str [_group, group player, count allGroups];
    private _unit = _group createUnit ["B_pilot_F", getPos player, [], 10, "NONE"]; //--- works
};

0 spawn { 
    private _group = group player; 
    hint str [_group, group player, count allGroups];  
    sleep 5; 
    [player] join grpNull;  
    hint str [_group, group player, count allGroups]; //--- _group is empty and will be auto removed   
    sleep 5; 
    [player] join _group; 
    hint str [_group, group player, count allGroups];
    private _unit = _group createUnit ["B_pilot_F", getPos player, [], 10, "NONE"]; //--- fail here
};
#

@unborn ether

lethal ingot
#

@grand sleet
Oh, my bad, yes. Private, public, global.

Anyway, got away with per player variables.

    onLoad = "player setVariable [""tablet_on"", true]; systemChat ""Dialog opened"";";
    onUnload = "player setVariable [""tablet_on"", false]; systemChat ""Dialog closed"";";
[] spawn {
    while {true} do {
        while {player getVariable "tablet_on"} do {
            systemChat format["Tablet opened %1", time];
            sleep 3;
        };
    };
};
unborn ether
#

@meager heart I got it, but still no idea why would I join unit to a deleted group, and also if it fails it gives more consequences)

meager heart
#

idk 😀 ¯_(ツ)_/¯

lethal ingot
#

BTW, doesn't

0 spawn { 

have to be

0 = spawn { 

or these are the same?

#

In case if you don't bother about returned values, of course

meager heart
#

btw returned values with spawn is <spawn> 😀

#

aka there are none

lethal ingot
#

Also, I don't understand difference between displayAddEventHandler and displaySetEventHandler

Read the wiki, but looks like I lack some knowledge. Can someone explain in simple language?

meager heart
#

afaik all display/control set EH are just leftovers from the older games 🤷

unborn ether
#

wrong

#

Add - stacks. Set - overrides.

#

so

(findDisplay 46) displaySetEventHandler ['KeyDown',''];

will override any keyhandler set before.

meager heart
#

yes... but why you need override them ? 🤔

#

also

#

Game: Armed Assault displaySetEventHandler
Game: Arma 2 displayAddEventHandler

#

also x2

#

do they stacks ? 🤔 🤔

meager heart
#

saw question about F1 try this, MJRamon 😀

(findDisplay 46) displayAddEventHandler ["KeyDown", {
    _this select 1 == 0x3B
}];
#

btw that ^ is not 100% reliable

tame portal
#

@meager heart you could use it to remove all eventhandlers

meager heart
#

yes... but we have displayRemoveAllEventHandlers and ctrlRemoveAllEventHandlers

#

imo set UI EH that how you break some other addons/scripts 🤷

still forum
#

@drowsy axle Does arma's default SP save function save variables? yes.

#

@lethal ingot displayAddEventHandler as the name says. Add's a eventhandler.
displaySetEventHandler sets it.
There can be a "unlimited" number of displayAddEventHandler. but only a single displaySetEventHandler

#

no 0 spawn { and 0 = spawn { aren't the same. The second one actually doesn't make any sense. The 0 = something is just to get around a stupid bug in all the Editor script boxes

drifting copper
#

Hey guys, anyone here with some free time to explain a thing or two to me please? Trying to get commands going but I am a complete and utter noob to it.

still forum
#

don't ask to ask just ask

drifting copper
#

Well,

  1. I want a AI to open a boom gate when a friendly vehicle approaches, just vehicles, no infantry.
  2. Want to connect live feed to screens, want to connect laptop to screens
still forum
#

Oh man. I thought you're gonna ask easy stuff 😄

#

I know how to open a gate. Or atleast I know where to find that. But I don't know if you can make a AI go and open it.
live feed. Basically create a camera and then setObjectTexture on a laptop. I'm sure someone made that already gimme a sec

drifting copper
#

Otherwise I will just place a AI gaurd next to the gate and then we pretend he opens it XD

drifting copper
#

I saw that video but for some reason I do not have the init file that he mentions

still forum
#

init.sqf? you create that file yourself

#

next to your mission.sqm

drifting copper
#

Ah I see! Will go google into that quick. Told you I am noob

glad venture
#

is init.sqf used by default?

still forum
#

if the file exists then it will get called.

glad venture
#

ok, and it's only on the servers start, right?

still forum
#

no

#

on mission start

#

mission also starts for you when you join in 20 minutes after everyone else started

glad venture
#

so is it for every person that joins?

#

i was trying to apply a damage handler to all ai that spawns and someone told me that when they spawn, they call init.sqf

still forum
#

Everyone that joins executes that script yeah.

#

no. no one told you that. And it's not correct

#

someone told you they execute their init script.
You then guessed they mean init.sqf. And that same someone corrected you saying that it's not init.sqf

#

I was there when that conversation happened

glad venture
#

is there a way to specify their init then?

still forum
#

yeah. There is the init script box in Eden.
There is also a init eventhandler which is kinda tedious to use except if you have CBA

glad venture
#

so you mean like in attributes? I was planning on spawning them through scripts so I guess I'll just have to add the event handlers to every spawn script then

still forum
#

if you spawn them through script. Then you can just add the eventhandler in that script.

#

That's easier. Unless you have CBA. then the init eventhandler is probably still easier

glad venture
#

I do have CBA, but is it like a global thing or do I still have to add it to each ai, I also might use the civilian presence module

still forum
#

you add a single global thing that will execute a script on any unit that ever spawns

#

Turn that into every soldier so you don't have vehicles. And you have all AI's and player units

glad venture
#

and to get AI's would I just check if getPlayerUID == ""

still forum
#

or just use isPlayer 😄

glad venture
#

oh

#

I was trying to find out what the command for that was

#

and the event handler goes into cfgVehicles.hpp or desc.ext?

still forum
#

cfgVehicles.hpp goes into description.ext.

#

So... either of them?

glad venture
#

ok

warm gorge
#

How could I go about checking if a cutText layer is currently on the screen? I thought I could check if a layer name was in allCutLayers, but it stays there regardless of whether the actual text is on the screen or not.

unborn ether
#

@warm gorge The thing is that any layer created stays there, until removed.

warm gorge
#

Ah damn makes it a bit difficult then

lethal ingot
#

Is there a way to get all assigned variables for an object?

still forum
#

Yes.

#

allVariables...

lethal ingot
#

Well, call me dumb :0

#

Thank you

still forum
#

I would. But people tell me I shouldn't do that anymore ._.

warm gorge
#

People have feelings @still forum

gleaming oyster
#

@warm gorge Dedmen does not you see.

warm gorge
#

I'm sure we can fix that

steady terrace
#

is it possible to make addaction do multiple things?

warm gorge
#

Example?

still forum
#

You can put multiple things into it's script

warm gorge
#

You can execute whatever you want

still forum
#

it could literally do everything

#

😄

gleaming oyster
#

You can set the world on fire.

still forum
tough abyss
#

Yes

steady terrace
#

this addAction["Take", {this attachTo [player,[0.5,0,1], "zada"], player setVariable["iscarrying", "true"]};

I'd expect that comma after zada"] to be a limiter, but it's not

still forum
#

semicolon

#

not comma

steady terrace
#

I'm probably missing something super easy

gleaming oyster
#

semicolon <
not comma <

still forum
#

why is it called semicolon even? a colon is also a semi colon isn't it? It's one colon.

#

And if you mean semicolon as in only one dot of the colon.
Then it would be dot.

gleaming oyster
#

Asking the important questions here.

steady terrace
#

oehh thanks!

gleaming oyster
#

So, i am making a function that decays a number for a certain number of seconds, on a certain scale. If i were to make the return the variable that is being decayed. Will the return value change during decay or will it only change on exit?

still forum
#

you cannot return a number by reference

#

after return it get's copied

#

you can create an array with the number inside it and return that. That'll get returned by reference

#

and you can then use set to change the value in the array and it will change everywhere

gleaming oyster
#

Alright, cool.

steady terrace
#

now I'm getting error reserved variable in expression, I'm assuming that's something reserved by the game.. what am I misusing?

_thing addAction["Take", {_thing attachTo [player,[0.5,0,1], "zada"]; player setVariable["playeriscarrying", "true"];}, playeriscarrying != true];

winter dune
#

setting a vehicle velocity inside a loop to maintain a certain speed, can this setVelocity cause some performance issue to the server?

winter rose
#

it shouldn't change the rate of velocity updates I think

still forum
#

@steady terrace

#

_thing is undefined inside your script

#

it doesn't carry over.

#

and playeriscarrying != true will never work

#

you are comparing the global playeriscarrying variable. But you only set the variable on the player object

#

also "true" can never be true.

#

also you cannot compare booleans

#

you are like... doing everything wrong that you could do wrong 😄

#
_thing addAction ["Take", {
    params ["_thing"];
    _thing attachTo [player, [0.5,0,1], "zada"];
    player setVariable ["iscarrying", true];
}, !(player getVariable ["iscarrying", false])];
#

Even more incorrect. The third argument are the arguments. But it looks like you think that's the condition

#
_thing addAction ["Take", {
    params ["_thing"];
    _thing attachTo [player, [0.5,0,1], "zada"];
    player setVariable ["iscarrying", true];
}, [], 1.5, true, true, "", "!(player getVariable ['iscarrying', false])"];
quaint turtle
#

Hey guys, how would i terminate a drawIcon3D that's encased in onEachFrame?

still forum
#

remove your eachFrame handler

#

or do you literally mean onEachFrame {code...}

quaint turtle
#
    drawIcon3D ["targetIcon.paa", [1,1,1,1], _randPos, 1, 1, 45, "Drug Cache", 1, 0.05, "PuristaMedium"];
  };```
#

Literally like that

still forum
#

There can only be one onEachFrame

#

so if you create a new one it deletes the old

#

so just onEachFrame {}

quaint turtle
#

Ok, thank you

steady terrace
#

whoa thank you @still forum ! sadly i'm still getting the same error

still forum
#

I'm guessing your error is somewhere else then

#

not in there.

steady terrace
#

hmm.. that's weird.. cause it does say line1. oh well

glad venture
#

anyone know how to tell if an npc is handcuffed in ACE 3?

still forum
#

_target getVariable "ace_captives_isHandcuffed"

glad venture
#

ok, is there a place where I can see all the ACE functions or should I just try to unpack the pbo's and look through them to find the function names and params? I tried the function viewer on configFile and couldn't find anything for ACE functions

gleaming oyster
#

Have you tried using the addon filter? You can select functions that have their own category and tag

glad venture
#

is that the second select box? i tried looking through it but could only see stuff for default arma and CBA

still forum
#

@gleaming oyster ACE functions aren't shown in function viewer

glad venture
#

So do I have to just unpack the pbo's and look through them?

still forum
#

Dude

#

I sent a link.

glad venture
#

I looked at it but theres nothing about the any of the functions or anything

still forum
#

what?

#

look closer

#

all the ACE code is inside there

lone glade
#

squints wut

still forum
#

If it's not in there it doesn't exist

glad venture
#

So I would have to keep doing what I was doing, unpacking the addon files and looking through them?

still forum
#

What?

#

Dude

#

can you read?

gleaming oyster
#

How are functions registered then? I took a look at say the advanced ballistics folder and i don't see how they connect, it's with the Extended event handlers that they are registered? Thus, they don't show in the functions viewer?

still forum
#

yes

#

only CfgFunctions show up in functions viewer

#

ACE has their own system

gleaming oyster
#

I see. Interesting

lone glade
#

CBA*

still forum
#

generally everything in the functions folder is a function

#

CBA doesn't use that system itself though

lone glade
#

O.O? wait what?

#

I thought someone fixed that a while ago

still forum
#

CBA still uses CfgFunctions

lone glade
#

all modules?

still forum
#

not sure

#

most of them

#

I guess the newer stuff like statemachine might not

glad venture
#

and where in the editor are all the modules for ACE, are they under system>modules?

gleaming oyster
#

That's where all of them are.

glad venture
#

ok, I couldn't find some of them, ill try again later. also, are the variable applied to any unit name ace-moduleName-whaterver is called in qgvar (I replace underscore with dash)?

still forum
#

There are no ACE modules anymore

#

And I don't understand your question. which is also missing a question maro

glad venture
#

how exactly am I supposed to enable things like FRIES on a helicopter?

still forum
glad venture
#

it says this, "synchronized with the “Equip FRIES” module in the editor." Is there a fries module then?

still forum
#

yes

#

if it says that then it probably is that way

#

but there are no ACE modules to configure settings anymore. That's what I meant

#

and that's what 99% of the people mean that say "where are the ace modules"

glad venture
#

so if the function sets variable using QGVAR(isState) then to get the variable it would be ace_addonName_isState?

still forum
#

componentName

#

yes

brave jungle
#

is cbChecked still working? It seems to just completely ignore my control and state one isn't present

chrome mason
#

Anyone know how to disable the re-arming using ammo trucks? I wanna stop it in certain areas 😛

winter rose
#

@chrome mason : setRepairCargo to 0

chrome mason
#

On what? The truck?

winter rose
#

yup

#

this will empty its "magic repair" tank

#

setREPAIRCargo btw, I edited

chrome mason
#

and that does ammo vehicles?

still forum
#

Lou needing sleep again 😄

#

It won't

winter rose
#

typed way too fast yeah :p

setAmmoCargo
setRepairCargo
setFuelCargo

molten folio
#
Clonenfuhdbfdsnf = {
    _index = lbCurSel 9110;
    _unit = lbData [9110, _index];
    player setUnitLoadout (getUnitLoadout _unit );;hint "Copied Player Loadout";
};```
#

does it working like that?

still forum
#

uh

#

yes..

#

That code does what it does

#

Ah

#

you edited it. No it doesn't

#

lbData is a string.

#

getUnitLoadout only takes object or classname

#

unless _unit is actually a classname...

molten folio
#

how do i make it from a player list?

still forum
#

In which case you finally gotta work on your variable naming to stop being confusing

#

I don't know what your player list contains

#

if you have netID's then you can just turn the netID into an object

molten folio
#
PlayerList = {
    TW_panel = playableUnits;
    {
        if (isPlayer _x and (_x != player)) then
        {
            _uid = getPlayerUID _x;
            _index = lbAdd [9110, (name _x)];
            lbSetData [9110, _index, _uid];
        };
    } forEach TW_panel;

    lbSetCurSel [9110, 0];
};```
still forum
#

if it is playerUID's then I think BI also has a function for that

#

so uid

#

_playerObject = allPlayers param [allPlayers findIf {getPlayerUID _x == _unit}, objNull]

plucky willow
#

will spectators mess with nearEntities if i search for "Man"?

still forum
#

Depends on the spectator script

chrome mason
#

ty guys

brave jungle
#

Don't suppose you lot know if cbChecked or ctrlChecked are working? Can't seem to get it to return anything >.<

still forum
#

good spectator scripts won't mess with that

molten folio
#

which one is easier ? netID or getplayerUID

still forum
#

but there are many crappy spectator scripts in existance

#

I just gave you the solution for getPlayerUID...

molten folio
#

?!!??!

still forum
#

netID is easier. But I'd have to also write that down

#

and writing is hard

#

And you would also need to change the rest of your code for that

#

so why not just take what you already have?

#

@brave jungle never heard of them not working.

molten folio
#

where do i put this ```_playerObject = allPlayers param [allPlayers findIf {getPlayerUID _x == _unit}, objNull]````

brave jungle
#

hmm strange

still forum
#

where do i put this
Your original question was how do i make it from a player list?

molten folio
#

yea

#

im confused af

still forum
#

it being the object you need for getUnitLoadout

#

There is the code to get the object

#

and you want it for getUnitLoadout

molten folio
#

whats that code?

still forum
#

so I would put it just before getUnitLoadout so that you have the object that you need.

#

It's SQF code.

#

It finds the player with that playerUID

molten folio
#
Clonenfuhdbfdsnf = {
    _index = lbCurSel 9110;
    _unit = lbData [9110, _index];
    player setUnitLoadout (_unit  getUnitLoadout);;hint "Copied Player Loadout";
};```
#

like that?

still forum
#

what the hell dude.

molten folio
#

xDD

still forum
#

I'll go to bed. You'll figure it out.

molten folio
#

noo

#

plz

#

im suffering from this shitty player list for a solid 5 days

plucky willow
#

what are you trying to do with loadouts exactly?

still forum
#

Just read what I wrote. And think about it

#

instead of begging me to solve the problem for you although I already did

molten folio
#

can u rewrite it in a better form?

still forum
#

no

molten folio
#

xd

still forum
#

You'll never learn how to script if you don't try to figure things out by yourself

brave jungle
#

lol

still forum
#

And I just don't have time to babysit you for the rest of your life.

ruby breach
#

Your function returns a string (PlayerID), and then uses that string in a command that requires an Object (the player). Dedmen gave you a script that converts a PlayerID into a player Object.

brave jungle
#

Before I confuse myself again on something simple, the control is the class "name" right? i.e

        class RscCheckbox_2804: RscCheckbox
        {
            idc = 2804;
            x = 0.402031 * safezoneW + safezoneX;
            y = 0.533 * safezoneH + safezoneY;
            w = 0.0154688 * safezoneW;
            h = 0.022 * safezoneH;
        };

Where RscCheckbox_2804 is the control.

molten folio
#

i read the wiki for the GetPlayerloadout and lbdata and from my understanding _unit is a class

still forum
#

you mean the control aka the argument to ctrlChecked?

brave jungle
#

Yea

still forum
#

nope

brave jungle
#

ugh >.<

#

what would it be then?

still forum
#

wait a sec. Am searching

brave jungle
#

Ohhhhhh it's that CT_Checkbox (or soemthing) bs right?

#

from the defines

ruby breach
still forum
#

no

#

just wait a sec

brave jungle
#

k

still forum
#

You need to retrieve the actual control from the dialog by it's idc

#

There is a command for that. Just need to find it

molten folio
#

@ruby breach which means its not a class?

still forum
brave jungle
#

Ah wonderful 😄

still forum
molten folio
#

i give up fuck the menu

lone glade
#

lul

#

you give up easily don't you 😄

still forum
#

That's the right decision now. You asked around for help for 3 or more days now. You got tons of people that helped you and threw the answers to your feet. Now you just need to copy-paste a single line of code.
And you give up.

molten folio
#

tell me where is the that fucking line

lone glade
#

find it

ruby breach
#

Your function returns a string (PlayerID), and then uses that string in a command that requires an Object (the player). Dedmen gave you a script that converts a PlayerID into a player Object.

still forum
#

Maybe you just have a blackout. Happens quite often. I would recommend to just sleep a night over it and get back to it with a clean head tomorrow

lone glade
#

yep^

still forum
#

You have 3 lines of script.
And I gave you one line of script that you have to insert somewhere. There aren't that many combinations.

molten folio
#

omg

#

thanks

#

i acutally need to sleep

#

xd

lone glade
#

From what i've observed, yes, yes you do.

still forum
#

The harder you bite down on a problem the harder it is to solve. You need to free your mind.
Like how you get the best ideas while showering or trying to sleep.
But when you sit there and try to get ideas you get nothing.

lone glade
#

if you get stuck walk away for 15 minutes and come back

ruby breach
#

...

plucky willow
#

from personal experience all my first attempt at problems are always way too complicated

lone glade
#

then you'll say out loud "FUUUUCK"

ruby breach
#

I'm a personal fan of the "explain it to someone like they're 5" method. You eventually get to the broken line and feel like an idiot

brave jungle
#

"from personal experience all my first attempt at problems are always way too complicated" All the time, then say third attempt, BAM! something simple

still forum
#

explain how to program to a five year old. Without saying "just take this thing. And put it there"

plucky willow
#

doesnt apply to sex

brave jungle
#

haha

still forum
#

That's meta 😄

lone glade
#

you can't explain shit to a 5 year old

#

they're mostly too stubborn or lack logic

austere hawk
#

not necessarily - they just lack all fundamental knowledge and skills - which they will learn over time in school. One of them beeing able to read and/or understand . The last propably beeing patience...

queen cargo
#

+1

lone glade
#

well yes, which is what I said but lengthier

queen cargo
#

not really

#

being stubborn is something entirely different

lone glade
#

kids are incredibly stubborn

queen cargo
#

they are literally stupid

lone glade
#

no shit

queen cargo
#

they are not even capable at a certain age to understand the concept of multiple consciousnesses

#

that continues up to the point where the brain is mature enough

drowsy axle
#

Hey guys. Could someone please explain to me what event handlers are, and where it's normally necessary to use them?

glad venture
#

is there a way to rename weapons/mags display name using ACE 3?