#arma3_scripting

1 messages · Page 512 of 1

verbal knoll
#

cause if you can see, when i hover the #1 button's text it doesnt activate the script that should be executed when you hover, and on the other buttons from #2 to #8 it does work like i planned.

winter rose
#

maybe make your buttons semi-visible at least to check their position

verbal knoll
#

i checked its position and its good.

#

what could be the problem

#
{
    idc = -1;
    type = 16;
    style = "0x02 + 0xC0";
    default = 0;
    shadow = 0;
    x = 0;
    y = 0;
    w = 0.095589;
    h = 0.039216;
    animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)";
    animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)";
    animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
    animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
    animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
    animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
    colorBackground[] = {0,0,0,0};
    colorBackgroundFocused[] = {0,0,0,0};
    colorBackground2[] = {0,0,0,0};
    color[] = {0,0,0,0};
    colorFocused[] = {0,0,0,0};
    color2[] = {0,0,0,0};
    colorText[] = {0,0,0,0};
    colorDisabled[] = {1,1,1,0.25};
    period = 1.2;
    periodFocus = 1.2;
    periodOver = 1.2;
    size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
    sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
    tooltipColorText[] = {1,1,1,1};
    tooltipColorBox[] = {1,1,1,1};
    tooltipColorShade[] = {0,0,0,0.65};;```
#

i couldn't send the whole class cause its long but this is it

winter rose
#

¯_(ツ)_/¯

#

I can't help you on that, because I'm no UI expert, and because I don't really get the full issue

verbal knoll
#

where can i post it to get helped?

winter rose
#

here @verbal knoll , just with another person ^_^
I would say it is the right channel, that or #arma3_config maybe

#

(╯°□°)╯︵ ┻━┻

winter rose
#

@tough abyss The car script

mint kraken
#

Anyone have a clue on the issue I had? I tried setting ctrlSetFocus then set the value to the MouseHandler idd. But still the same?

#

I set it to splendid camera instead and that worked but I dont want to use splendid camera

mint kraken
#

How stupid could I be!!! I used createDialog and not cutRsc lol, but now when clicking a player it wont select.

knotty arrow
#

how can i put a cutrsc over a dialog? I try with layer 0 and with layer 9999 and not working

#

any ideas?

robust hollow
#

pretty sure dialogs are always on top

knotty arrow
#

and can't put over?

robust hollow
#

not if its always on top... no.

#

i could be wrong, but im pretty sure this is the case.

knotty arrow
#

hint is over the dialog 😦

robust hollow
#

hint isnt a cutrsc though, is it?

knotty arrow
#

and what its?

robust hollow
#

uhh... cutrsc's are??
not sure what answer u are looking for there.

knotty arrow
#

maybe is not a cutrsc

#

but who knows haha

knotty arrow
#

thanks for u help @robust hollow

minor lance
#

He wants to display a CutRsc on top of a dialog

robust hollow
#

yea i got that.

drowsy axle
#

Hey guys, I'm getting an error at: _atmbase |#|setVariable [_var,"",true]; Error Type Object, expected String

#
// Create Prefined Helipad Objects
private _atmLocationsBase = [
    [atmOld_0,[3643.16,3848.06,0]],
    [atmOld_1,[3675.59,3300.71,0]],
    [atmOld_2,[2801.88,3722.89,0]],
    [atmOld_3,[4073.57,4433.83,0]],
    [atmOld_4,[3673.35,3104.09,0]],
    [atmOld_5,[3621.02,3308.61,0]],
    [atmOld_6,[5301.06,3396.56,0]],
    [atmOld_7,[5441.65,2852.52,0]]
];
private _atmLocations = [];
{
    _x params ["_var","_pos"];
    _atmbase = createVehicle ["Land_HelipadEmpty_F",_pos];
    private _varSTR = str _var;
    _atmbase setVariable [_varSTR,"",true];
    _atmLocations pushBack _var; // Passed Each atmOld_x so that it can be used later
} forEach _atmLocationsBase;
// Hide all ATMs in a radius around the Helipad Objects
private _atmClassnames = [
    "Land_Atm_01_F",
    "Land_Atm_02_F",
    "Land_ATM_01_malden_F",
    "Land_ATM_02_malden_F"
];
{
    private _pos = getPosATL _x;
    private _atmList = nearestObjects [_pos,_atmClassnames,15,false];
    {
        _x hideObjectGlobal true;
    } forEach _atmList;
} forEach _atmLocations;```
foggy moon
#

_atmbase setVariable [_varSTR,"",true]; 😉

drowsy axle
#

WOW!

#

Thanks ffs man.

foggy moon
#

lol I've done that so many times

drowsy axle
#

😃

foggy moon
#

what on earth? is _varStr reserved?

#

since you don't use it more than once, you could just do _atmbase setVariable [str _var,"",true];

drowsy axle
#

True

#

Would I need brackets?

foggy moon
#

for setVariable?

drowsy axle
#

Same error.

#
// Create Prefined Helipad Objects
 _atmLocationsBase = [
    [atmOld_0,[3643.16,3848.06,0]],
    [atmOld_1,[3675.59,3300.71,0]],
    [atmOld_2,[2801.88,3722.89,0]],
    [atmOld_3,[4073.57,4433.83,0]],
    [atmOld_4,[3673.35,3104.09,0]],
    [atmOld_5,[3621.02,3308.61,0]],
    [atmOld_6,[5301.06,3396.56,0]],
    [atmOld_7,[5441.65,2852.52,0]]
];
 _atmLocations = [];
{
    _x params ["_var","_pos"];
    _atmbase = createVehicle ["Land_HelipadEmpty_F",_pos];
    _atmbase setVariable [str _var,"",true];
    _atmLocations pushBack _var; // Passed Each atmOld_x so that it can be used later
} forEach _atmLocationsBase;
// Hide all ATMs in a radius around the Helipad Objects
 _atmClassnames = [
    "Land_Atm_01_F",
    "Land_Atm_02_F",
    "Land_ATM_01_malden_F",
    "Land_ATM_02_malden_F"
];
{
     _pos = getPosATL _x;
     _atmList = nearestTerrainObjects [_pos,_atmClassnames,15,false];
    {
        _x hideObjectGlobal true;
    } forEach _atmList;
} forEach _atmLocations;```
#

So it's not the actual line, I am assuming, that is the problem.

foggy moon
#

I've not stored objects in that way before, wonder if it's something weird with the string conversion

#

Do you spawn _atmbase for the sole purpose of storing the object list?

drowsy axle
#

I spawn it to spawn it. I then get the _var and pass it into an array.

foggy moon
#

ah yeah, small screen formatting was throwing me

drowsy axle
#

I just didn't want to define the

atmOld_1
 atmOld_2
 atmOld_3
 atmOld_4
 atmOld_5
 atmOld_6
 atmOld_7``` again
foggy moon
#

oh, so you want to create helipads and name them atmOld_0 through atmOld_7?

robust hollow
#

why not do somehting like this?

// Create Prefined Helipad Objects
 _atmLocationsBase = [
    [3643.16,3848.06,0],
    [3675.59,3300.71,0],
    [2801.88,3722.89,0],
    [4073.57,4433.83,0],
    [3673.35,3104.09,0],
    [3621.02,3308.61,0],
    [5301.06,3396.56,0],
    [5441.65,2852.52,0]
];
 _atmLocations = [];
{
    private _var = format["atmOld_%1",_forEachIndex];
    _atmbase = createVehicle ["Land_HelipadEmpty_F",_x];
    _atmbase setVariable [_var,"",true];
    _atmLocations pushBack _var; // Passed Each atmOld_x so that it can be used later
} forEach _atmLocationsBase;
.....
foggy moon
#

Yep, although I think he wants the object for the next loop:

{
    private _var = format["atmOld_%1",_forEachIndex];
    _atmbase = createVehicle ["Land_HelipadEmpty_F",_x];
    _atmbase setVehicleVarName _var;
    _atmLocations pushBack _atmbase; // Passed Each atmOld_x so that it can be used later
} forEach _atmLocationsBase;
drowsy axle
#
// Create Predefined Helipad Objects
private _atmLocationsPos = [
    [3643.16,3848.06,0],
    [3675.59,3300.71,0],
    [2801.88,3722.89,0],
    [4073.57,4433.83,0],
    [3673.35,3104.09,0],
    [3621.02,3308.61,0],
    [5301.06,3396.56,0],
    [5441.65,2852.52,0]
];
{
    private _atmbase = createVehicle ["Land_HelipadEmpty_F",_x];
} forEach _atmLocationsPos;
// Hide all ATMs in a radius around the Helipad Objects
private _atmLocationsClassnames = [
    atmOld_0,
    atmOld_1,
    atmOld_2,
    atmOld_3,
    atmOld_4,
    atmOld_5,
    atmOld_6,
    atmOld_7
];
{
    private _pos = getPosATL _x;
    private _atmList = nearestTerrainObjects [_pos,["Land_Atm_01_F","Land_Atm_02_F","Land_ATM_01_malden_F","Land_ATM_02_malden_F"],15,true,false];
    {
        _x hideObjectGlobal true;
    } forEach _atmList;
} forEach _atmLocationsClassnames;
``` Errors with: `_atmList = |#|nearestTerrainObjects [_pos,["Land_At` `0 elements provided, 3 expected`
#

Changed

#

wait

#

I need the variable

#

as I am creating the objects

#

then referencing them

#

updated: sqf // Create Prefined Helipad Objects _atmLocationsBase = [ [atmOld_0,[3643.16,3848.06,0]], [atmOld_1,[3675.59,3300.71,0]], [atmOld_2,[2801.88,3722.89,0]], [atmOld_3,[4073.57,4433.83,0]], [atmOld_4,[3673.35,3104.09,0]], [atmOld_5,[3621.02,3308.61,0]], [atmOld_6,[5301.06,3396.56,0]], [atmOld_7,[5441.65,2852.52,0]] ]; _atmLocations = []; { _x params ["_var","_pos"]; _atmbase = createVehicle ["Land_HelipadEmpty_F",_pos]; _atmbase setVariable [str _var,"",true]; _atmLocations pushBack _var; // Passed Each atmOld_x so that it can be used later } forEach _atmLocationsBase; // Hide all ATMs in a radius around the Helipad Objects _atmClassnames = [ "Land_Atm_01_F", "Land_Atm_02_F", "Land_ATM_01_malden_F", "Land_ATM_02_malden_F" ]; { _atmList = nearestTerrainObjects [getPosATL _x,["Land_Atm_01_F","Land_Atm_02_F","Land_ATM_01_malden_F","Land_ATM_02_malden_F"],15]; { _x hideObjectGlobal true; } forEach _atmList; } forEach _atmLocations;

foggy moon
#

_atmLocationsBase can't reference atmOld_x because they don't exist yet. This combines Connor's and my suggestions:

_atmLocationsBase = [
    [3643.16,3848.06,0],
    ...
];
 _atmLocations = [];
{
    private _varStr = format["atmOld_%1",_forEachIndex];
    _atmbase = createVehicle ["Land_HelipadEmpty_F",_x];
    missionNamespace setVariable [_varStr, _atmbase, true];
    _atmLocations pushBack _atmbase; // Passed Each atmOld_x so that it can be used later
} forEach _atmLocationsBase;
...
#

although publicVariable may be needed to broadcast the object, can't remember

#

only if you need to reference it on other clients that is

drowsy axle
#

like so? sqf // Create Prefined Helipad Objects _atmLocationsBase = [ [3643.16,3848.06,0], [3675.59,3300.71,0], [2801.88,3722.89,0], [4073.57,4433.83,0], [3673.35,3104.09,0], [3621.02,3308.61,0], [5301.06,3396.56,0], [5441.65,2852.52,0] ]; _atmLocations = []; { private _varStr = format["atmOld_%1",_forEachIndex]; _atmbase = createVehicle ["Land_HelipadEmpty_F",_x]; missionNamespace setVariable [_varStr, _atmbase, true]; publicVariable _varStr; _atmLocations pushBack _atmbase; // Passed Each atmOld_x so that it can be used later } forEach _atmLocationsBase; // Hide all ATMs in a radius around the Helipad Objects _atmClassnames = [ "Land_Atm_01_F", "Land_Atm_02_F", "Land_ATM_01_malden_F", "Land_ATM_02_malden_F" ]; { _atmList = nearestTerrainObjects [getPosATL _x,["Land_Atm_01_F","Land_Atm_02_F","Land_ATM_01_malden_F","Land_ATM_02_malden_F"],15]; { _x hideObjectGlobal true; } forEach _atmList; } forEach _atmLocations;

#

There are no visible errors. However, nothing is hidden.

#

After running the script, with Global Vars...

foggy moon
#

Ah, misunderstood the intent, don't need publicvariable since the end goal is hideObjectGlobal

#

is _atmLocationsBase getting populated?

#

_atmLocations rather

drowsy axle
#
// Create Prefined Helipad Objects
CAP_atmLocationsBase = [
    [3643.16,3848.06,0],
    [3675.59,3300.71,0],
    [2801.88,3722.89,0],
    [4073.57,4433.83,0],
    [3673.35,3104.09,0],
    [3621.02,3308.61,0],
    [5301.06,3396.56,0],
    [5441.65,2852.52,0]
];
CAP_atmLocations = [];
{
    private _varStr = format["atmOld_%1",_forEachIndex];
    CAP_atmbase = createVehicle ["Land_HelipadEmpty_F",_x];
    missionNamespace setVariable [_varStr, CAP_atmbase, true];
    CAP_atmLocations pushBack CAP_atmbase; // Passed Each atmOld_x so that it can be used later
} forEach CAP_atmLocationsBase;
// Hide all ATMs in a radius around the Helipad Objects
{
    CAP_atmList = nearestTerrainObjects [getPosATL _x,["Land_Atm_01_F","Land_Atm_02_F","Land_ATM_01_malden_F","Land_ATM_02_malden_F"],15];
    {
        _x hideObjectGlobal true;
    } forEach CAP_atmList;
} forEach CAP_atmLocations;```currently running ^
#

I do keep restarting the sneario

foggy moon
#

I think it's working, but your types filter isn't returning anything

#

if I just look for "house" I get objects returned

drowsy axle
#

right

#

is Land_Atm_01_F a house??

#

Welp it works

#

Just need to find the oh LAND

#

but then it would get all the stuff...? hm

foggy moon
#

what are you wanting to hide?

drowsy axle
#

The ATM

#

all of these: "Land_Atm_01_F","Land_Atm_02_F","Land_ATM_01_malden_F","Land_ATM_02_malden_F"

foggy moon
#

🤦 I was thinking those were generic types for some reason

drowsy axle
#

lol

#

xD

#

sorry

#

wow..

foggy moon
#

ha, forgot about that one

drowsy axle
#

I tried it.. but I only wanted that object..

#

I didn't think it was the other cat

foggy moon
#

I spend more time with code than modules 😂

drowsy axle
#

tru

#

anyway thanks for your help

foggy moon
#

sure thing

sharp grotto
#

I want to add a blacklist with 300m radius for every vehicle spawned (not sure if this is a good idea) but i need a way to restrict vehicles from spawning to close to each other.
So i was thinking about to "append" the blacklist array for BIS_fnc_findSafePos with the position of every spawnd car and these 300m distance. But i have no clue how to do it, anyone kind enough to help me out 😵

                    
                                    [[18313.8,15758.2,0], 4300 ],
                                    [[8139.13,14254,0], 800 ],
                                    [[12169.7,17815.9,0], 500 ],
                                    [[4734.24,7539,0], 500]
                    ];```
west grove
#

anyone knows if i can press a key via script? e.g. enter or whatever?

robust hollow
#

no, you cant

barren spindle
#

What are you trying to do @west grove

west grove
#

i want to switch the optics viewmode via script

#

e.g. start in a vehicle with optics mode and nvg on

#

going into optics mode is no big deal, but switching the view mode seems impossible

young current
#

Actions might have that.

west grove
#

nope

#

if there is, then i couldnt find it

west grove
#

is only for player characters

#

what i'm looking for is a way to change the optics vision mode in vehicles

#

being able to switch to thermal, etc

tough abyss
#

@knotty arrow what are you trying to put over what dialog? You can get dialog display and ctrlCreate over it

#

@west grove you can make an Arduino project with servo motor and some contraption to press a key and activate it over callExtension 😂

west grove
#

will be hard to ship that to every player

#

also most expensive

barren spindle
#

made me smile

tough abyss
#

Then maybe you can generate Windows event for key press via extension

young current
#

@west grove what's the actual thing you want to happen? On mission start players are in vehicle with certain type ov view mode on?

west grove
#

yes

#

i'm using switchCamera to get into the gunner optics, but that's all i can seem to do

#

there's quite some other camera related commands, but as far as i could see, it's only related to "real" created camera objects

#

if it is possible to use on the gunner viewpoint, then i have no idea how to do it

young current
#

Probably is not.

#

Not sure if I've ever seen mission start with certain type of view mode on.

barren spindle
#

Maybe via modding ? 😒 Probably not worth it

young current
#

You could try If AI could remote control the player for a sec and if it would switch vision mode.

#

@barren spindle can't really see a solution that way either

barren spindle
#

if the only vision mode avaible is nvg

young current
#

Well that but it would break other stuff

#

Not a proper solution

west grove
#

i guess it was simply never needed by anyone at BI, thus a command doesn't exist. is a bit weird to me, because there's commands for like anything else.

barren spindle
#

aggre

young current
#

@west grove yeah. Typically in scenarios I've played we have managed to put on view mode that is appropriate

barren spindle
#

what vehicule are you using ? Wanna do some testing for the lolz

west grove
#

try the nato hunter

#

or any other, doesn't really matter. i think most vehicles have multiple view modes, no?

#

sucks that we can't press a key via script. would solve the issue easily.

barren spindle
#

@young current suggested to replace player with AI, make AI swtich to NV and then back to player, I don't know sh** about AI but maybe it could work ?

young current
#

Could work yeah

west grove
#

but will the ai switch to nvg in vehicles? don't think i have ever seen that

barren spindle
#

no idea

young current
#

They probably go straight to thermal

barren spindle
#

disable TI then

young current
#

But you could disable thermal

#

Until player is back on the seat

west grove
#

at least drones won't auto-switch the vision modes.

#

i mean, in the end, the drone gunner is just the normal ai as well, no?

young current
#

Not sure.

#

But can't think of any other hacky way either

radiant needle
#

Any way to add dynamic text to an image?

robust hollow
#

if the image is shown as part of a dialog you can put a text control over top of it, but no, can't add text directly to the image itself.

radiant needle
#

I wonder how they do it with license plates

robust hollow
#

they have an image for each letter and number

mint kraken
#

Is there any way I could unblock WASD keys or Make the player move when using createDialog. I have a display open that is the EGSpectator camera. I have tried doing createDisplay for the dialog but that doesnt work because the camera is a display. Doing a cutrsc for the "dialog" kinda works, the camera can move but u cant click anything on the "dialog".

radiant egret
#

is there a command to check if a unit is controlled via remoteControl command ? Im switching into a gunner from a terminal and want to block access if a player is already using the unit.

fleet hazel
#

Guys. I'm capturing the flag. After the call addAction the script runs
for "_i" from 0 to _time step 1 do {
[_target,"inCapture",true] call CBA_fnc_setVarNet; //Setting the status flag to whoever was able to capture when the capture
hint format ["Capture %1 of %2",_i,_time];
if (speed player > 24 OR {player distance _pos > 20} OR {!alive player} OR {vehicle player != player} OR {isNull _caller}) exitWith {_exit = true;};
sleep 1;
};

#

When a person crashes When the person takes off the capture status does not change.

#

if (_exit) exitWith {
_target setVariable ["inCapture",nil,true];
};

still forum
#

@foggy moon what on earth? is _varStr reserved? No. "" is reserved. If _varStr is empty string... Error.

#

@radiant egret you can check who the player is remote controlling. But not whether a unit is currently being remote controlled

languid tundra
#

Maybe you can. I'll check out how it's done in the RC module.

lilac escarp
#

@fleet hazel Parameters cba_fnc_setVarNet
_object Object namespace <OBJECT, GROUP>
_varName Name of the public variable STRING
_value Value to broadcast <ANY>

fleet hazel
#

@lilac escarp [_target,"inCapture",true] call CBA_fnc_setVarNet;

#

addAction transfers params ["_target", "_caller", "_actionId", "_arguments"];

lilac escarp
#

_broadcasted = [player, "somefish", 50] call CBA_fnc_setVarNet;

fleet hazel
#

@lilac escarp I have no problem with that. I need. If a player is banned from the server use
[_target,"inCapture",false] call CBA_fnc_setVarNet;

#

or player disconnect

languid tundra
#

@radiant egret
Looks like there is no way as Dedmen already said, but the remote control module sets the variable "bis_fnc_moduleRemoteControl_owner" for the remote controlled unit. I would say this is the way to go. Just use this variable in your script for an exception handling.

fleet hazel
#

@lilac escarp ???

radiant egret
#

ty for the help

still forum
#

But that variable is probably not globally set right?

lilac escarp
#

@fleet hazel I don’t quite understand why this is necessary. but can try like that?

for "_i" from 0 to _time step 1 do {
hint format ["Capture %1 of %2",_i,_time];
if (speed player > 24 OR {player distance _pos > 20} OR {!alive player} OR {vehicle player != player} OR {isNull _caller}) exitWith {_exit = true;};
if (_i == _time) exitWith {
[_target,"inCapture",true] call CBA_fnc_setVarNet;
};
sleep 1;
};

languid tundra
#

It is set globally.

fleet hazel
#

When the player calls the script, the flag is superimposed
[_target,"inCapture",true] call CBA_fnc_setVarNet;
If the player disconnect, you need to have
[_target,"inCapture",false] call CBA_fnc_setVarNet; @lilac escarp

tough abyss
#
[] spawn {
//create UXO  
_uxo = "BombCluster_02_UXO1_Ammo_F" createVehicle position player; 
 
//Check if bomb has blown up / been defused 
waitUntil { 
 sleep 1;  
 !alive _uxo; 
}; 
systemChat "Bomb defused!";
};

Doesn't work when defusing. Works fine with any mine but not UXO's. Seems to be because they're not deleted the same way when defused. Could be because devs didn't want people being able to pickup and "plant" UXO's? Anyone know a fix?

neon snow
#

Can simple expressions be used in ParticleArray or setParticleParams? If not, can we choose which values override in config using setParticleParams?

compact maple
#

@cold pebble Yup, for dev purpose

cold pebble
#

Then no, it won't be as it never is used by clients 😛

coarse schooner
#

Getting an error that says 3 elements provided, 2 expected but setVariable is supposed to have/be able to have 3 right?

(findDisplay 999001) setVariable ["start", false, false];
still forum
#

no

#

public variable on a display makes no sense

#

also false is the default.. providing the public parameter false also makes no sense

tough abyss
still forum
#

Additionally it makes no sense that Arma error's when more than required values were provided. Not like it breaks anything..

tough abyss
#

It makes sense it is a different syntax internally

#

Public is optional param in the same syntax for object but not control or display

astral dawn
#

I think I've checked it once and it seemed to work... but having some clarification about locality of this function would be great

still forum
#

It makes sense it is a different syntax internally Not really. It's DISPLAY setVariable ARRAY
How many elements the array has is irrelevant

#

It doesn't have to read the 3rd parameter if it doesn't use it. It being there doesn't break anything

#

just a stupid ==2 instead of >= 2 check

tough abyss
#

Don’t pass 3rd param where there is none required - problem sorted

knotty arrow
#

@tough abyss i am trying put a cutrsc over a dialog

tough abyss
#

Try to pass more than 3 elements for position then and call it stupid if it errors

#

Why BI why u no give me pass 4

#

@knotty arrow yeah you said that before

astral dawn
#

I guess it's better to error in this case. What if we tried to set it to global with true global flag. It would ignore it and give no error. But currently it clearly shows that something is wrong.

knotty arrow
#

its impossible i think, i try with layer 0 , -1 and 9999

tough abyss
#

What is so special about cutrsc?

#

Why can’t you just ctrlCreate whatever or createDisplay it for that matter?

crystal schooner
#

Hello im making a holster trigger on my server so people cant spawnkill in base, but they still get forced holstered outside trigger can anyone help? :/

astral dawn
#

Am I right that when I deleteVehicle, the game doesn't erase all object data, but leaves some data to mark this object as deleted so that isNull command can work? If not, how does it still know that the object is Null if it does not exist any more? 🤔

languid tundra
#

Not sure about how it's done internally, but in theory the references could be reassigned to objNull when the deletion is handled.

astral dawn
#

Thx, I guess this is a better explanation (:

#

I was wondering if creating and instantly deleting an object leaks memory actually

languid tundra
#

Since Dedmen's reveal of the compile memory leak, I wouldn't be surprised anymore 😄

lilac escarp
#

@crystal schooner more detail please.

crystal schooner
#

@lilac escarp i fixed it, but is there a way to create map markers attached to group leaders? 😃

lilac escarp
#

I did not understand what I mean))

#

hmm do you mean drawIcon?

crystal schooner
#

I want a map marker attached to squad leaders to mark their squads location is that possible

lilac escarp
#

@crystal schooner try this:
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",
{
{
_leader = leader _x;
_this select 0 drawIcon
[
"iconStaticMG",
[1,0,0,1],
getPos _leader,
24,
24,
getDir _leader,
"Leader",
1,
0.03,
"TahomaB",
"right"
]
} forEach allGroups;
}];

thorn wraith
#

a quick check to see if I need to rethink my code structure, what will happen if i say: _unit addMagazineCargoGlobal [_smokegrenade, 0];

lilac escarp
#

@thorn wraith error )

thorn wraith
#

...crap

crystal schooner
#

@lilac escarp wont that mark enemy groups aswell

lilac escarp
#

if (side _leader == “WEST”) then {
_this select 0 drawIcon
[
...
...

crystal schooner
#

how should i execute the script

lilac escarp
#

insert into initPlayerLocal.sqf

crystal schooner
#

Roger

lilac escarp
#

Perhaps there are errors, because I wrote from the phone.

crystal schooner
#

Omg, i respect that

#

Got no errors, but no markers are created

lilac escarp
#

it's difficult to understand without errors))

#

is the side exactly right?

winter rose
#

if (side _leader == west) no need for quotes here

#

side is a type itself, not a string

crystal schooner
#

Ok i will try

#

Will this make a map marker or a 3d marker

austere granite
#

drawIcon = map

#

drawIcon3D =..... 3d 😄

lilac escarp
#

yeah. my mistake

crystal schooner
#

Yeah, idk if its me doing something wrong or the script but still not working.. 😦 I'll send a pastebin of it in a sec

lilac escarp
#

where are the mistakes? strange that they are not!)

#

you forgot to close if! };

#

@crystal schooner try this:
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",
{
{
_leader = leader _x;
if (side _leader == WEST) then {
_this select 0 drawIcon
[
"iconStaticMG",
[1,0,0,1],
getPos _leader,
24,
24,
getDir _leader,
"Leader",
1,
0.03,
"TahomaB",
"right"
]
};
} forEach allGroups;
}];

crystal schooner
#

OOh working

#

ty

#

lilac escarp
#

)))

crystal schooner
#

How to change the name of it to [Group Name, name leader _x] ?

#

And only for players

lilac escarp
#

My English is very bad. Explain what Roger and ty mean))

crystal schooner
#

Roger - Ok
TY - Thank you

lilac escarp
#

“Leader” => str(name _leader)

tough abyss
#

Name returns string why do you want str it?

lilac escarp
#

“Leader” => str([groupId _x, name _leader]);

crystal schooner
#

Ok ill try

lilac escarp
#

@tough abyss I do not know. I'm just scattered

crystal schooner
#

str([groupId _x, name _leader]);,
Error missing ]

tough abyss
#

Obviously error, you cannot have ; inside array

lilac escarp
#

Yep

crystal schooner
#

Yep, works as a charm just want a different icon on it now

lilac escarp
#

how can i remove or hide the tree after setDamage 1;?

#

I don’t remember the icon for the player. I can tell you later.

tough abyss
#

You can only hide it

lilac escarp
#

hide does not work for some reason

tough abyss
#

Does it still have a bug when you destroy tree by script but for JIP it is still standing?

young current
#

you could try moving it

#

dunno if that works though

lilac escarp
#

not. it falls and lies for all. but neither hideObject nor hideObjectGlobal works.

crystal schooner
#

Well how about u use the script that removes buildings on it

#

or cant you just repair the tree and then hideObjectGlobal?

lilac escarp
#

hide does not work on map objects. according to biki)

young current
#

@lilac escarp why do you need to hide it?

#

map object manipulation is very limited

crystal schooner
#

The edit terrain module works to remove trees

lilac escarp
#

@young current I hack it. it disappears and firewood appears

young current
#

that may not be possible in Arma. you can check what the hideTerrainObject module does

crystal schooner
#

{ _x hideObjectGlobal true } foreach (nearestTerrainObjects [this,[],50])

#

create a game logic

tough abyss
#

@lilac escarp where does it say on biki it doesn’t work for map objects?

crystal schooner
#

on tree pos

tough abyss
#

@crystal schooner never execute global commands from init field. Never

lilac escarp
#

@tough abyss
sorry. I am confused.
Can be used on all objects with class names, i.e. (typeOf object != "").

tough abyss
#

@lilac escarp that could also be an old note, hide object had many modifications since it was introduced, I wouldn’t be surprised if you can hide those objects as well now

lilac escarp
#

I try:
_tree setDamage 1;
deleteVehicle _tree;
And
_tree hideObjectGlobal true;

does not work

tough abyss
#

Of course it won’t work

lilac escarp
#

Hmmm

tough abyss
#

God knows what deleteVehicle does to the reference

halcyon hornet
#

is there any script that can get the p3d location of a cursor target?

tough abyss
#

p3d?

halcyon hornet
#

arma's model format

ruby breach
tough abyss
#

Oh the path to the model?

halcyon hornet
#

thanks

young current
#

hideobject should work

lilac escarp
#

What a fuck

crystal schooner
#

is there a way to use the drawicon command for local markers or nah

tough abyss
#

Yeah it draws icon, like marker, don’t get the question

crystal schooner
#

Does the drawicon command make makers globally or is it only local makers?

tough abyss
#

It draws it on your map only

crystal schooner
#

Oh ok ty

still forum
#

drawicon doesn't make any markers. It draws an icon

crystal schooner
#

Ye well you know what i mean

still forum
#

no I don't

crystal schooner
#

😦

still forum
#

createMarker creates markers globally. createMarkerLocal creates a local marker

crystal schooner
#

Ye i know

young current
#

what are you trying to do

crystal schooner
#

Well so know i got a drawicon for marking group leaders , but i want to make a drawicon for players that arent leaders aswell

#

so group leaders will be marked for everybody but players will only be marked for the player itself

tough abyss
#

You have to draw on every pc anyway and then you can put condition on what to draw

crystal schooner
#

this is what i got now

#

as initPlayerLocal

tough abyss
#

So you want each player to see themselves only + all leaders?

crystal schooner
#

Ye, and if you're the group leader instead of getting the group leader marker on yourself you should get the player marker

tough abyss
#

You need 2 drawIcon commands one for player and one forEach leaders minus player

crystal schooner
#

Would this work for the group leader marker

   if (side _leader == WEST && isPlayer _leader && !(_leader == player)) then {
tough abyss
#

You can use != you know

crystal schooner
#

What so _leader !=Player

winter rose
#

yyyup

crystal schooner
#

!(_leader == player)

#

does that work

bronze pewter
#

it's the same but uglier

#

!(true)

#

!(false)

#

It should invert the boolean

crystal schooner
#

Ah i see

bronze pewter
#

! is not

crystal schooner
#

well i'll fix that but elegant, when i test the script on editor it works but when my mate put it on a server noone saw the icons

bronze pewter
#

Server logic vs client logic?

crystal schooner
#

It was in Initplayerlocal

bronze pewter
#

I havent done much arma stuff so im useless here

crystal schooner
#

Ahh ok

#

@winter rose could you help?

winter rose
#

@crystal schooner help about?

crystal schooner
#
["InitializePlayer", [player, true]] call BIS_fnc_dynamicGroups;
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", 
{
{
   _leader = leader _x;
   if (side _leader == WEST && isPlayer _leader && !(_leader == player)) then {
    _this select 0 drawIcon 
    [
        "iconman",
        [0,0.3,0.6,1],
        getPos _leader,
        24,
        24,
        getDir _leader,
        str([groupId _x, name _leader]),
        1,
        0.03,
        "TahomaB",
        "right"
    ]
    };
} forEach allGroups;
}];
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", 
{
    _this select 0 drawIcon 
    [
        "iconman",
        [0,0.3,0.6,1],
        getPos player,
        24,
        24,
        getDir player,
        name player,
        1,
        0.03,
        "TahomaB",
        "right"
    ]
}];
#

This is my initplayerlocal and it has the icons in it but it doesnt show the map icons on the server but it worked for me locally on editor

tough abyss
#

Try waitUntil {!isNull findDisplay 12}; before everything

winter rose
#

yep, definitely

tough abyss
#

If there is briefing then one will need to wait for mission start

crystal schooner
#

waituntil {!isnull cameraon && getClientState != "MISSION RECEIVED" && getClientState != "GAME LOADED" && alive player};

#

got that in start is that enough or no

tough abyss
#

Probably just time>0 would do

tiny wadi
#

Any clue why I cant seem to retrieve my lbData?

{
    _index = lbAdd [1500, _x select 2];
    lbSetData [1500, _index, format ["%1", _x]];
} forEach _permissions;```
#

then this gets called when the listbox changes:

#
_control = _this select 0;
_value = _this select 1;
_data = lbData [_control, _value];

hint format ["%1 : %2 : %3", _control, _value, _data];```
#

Control and value both get returned so im pretty confused as to why I get lbData.

#

god damn it, fixed it

#

gotta do _control lbData _value

#

the other syntax is for explicit idc

astral dawn
#

Any easy way to get the real unit's side? I want to handle the condition when unit is captive and the game returns civilian side

robust hollow
#

_unit setVariable ["side",side _unit,true]; when the unit is created.

astral dawn
#

Allright... thought that maybe I can retrieve somehow without storing it myself. Thanks.

tough abyss
#

What side group unit returns?

astral dawn
#

good idea! Will check that.

peak plover
#

side is also defined in the config

#

so you could use that

#

easiest way is to setVar when unit created 'tho

finite cloud
#

Are there any decent guides/tutorials for developing addons? I've seen a few good scripting series on YouTube, but they're all focused on mission making, and I'm a little confused about how that differs from addon development, especially in terms of architecture/file structure

#

I've tried looking through the source code for a few of the functionality addons I use but they're always gargantuan so it's really difficult to follow the trail of breadcrumbs and make sense of it all

radiant needle
#

So I'm trying to teleport a player to an identical house in the identical spot and am using this

_Unit setPos (HouseTarg01 modelToWorldVisual (_House worldToModelVisual getPos _Unit));
#

however it seems to teleport me about 1m low so I get stuck in the staircase

tough abyss
#

Attach detach unit instead

#

Unless the house is map house then you can’t, would only work with editor placed one

#

In any case setPos is the wrong command for the job

radiant needle
#
_Unit attachTo [HouseTarg01, [(HouseTarg01 modelToWorldVisual (_House worldToModelVisual getPos _Unit))]];

this is giving me 1 element provided, 3 expected error

robust hollow
#

because you put the position (modelToWorldVisual) into an array. so its basically [[0,0,0]]. 1 element.

radiant needle
#

Oh yeah, that fixed it. But even with attachTo it's still placing me low

#

I just went back to setPos but did vectorAdd [0,0,1] and it works fine now

real mango
#

👋 Hello everyone, new here!

player setVariable ["side",side player,true];

I've a question about this, i'm using something very similar but to have a reliable way of retrieving a unit's name.

I assign this variable in the initialization of my game-mode engine locally to each client.

It does happen from time to time (for JIP players) that, exclusively for them, a unit name variable is not defined to them.
The documentation states that the broadcasting of said variable should happen reliably and for JIP as well, but does any of you share the same experience with variables that are set only once at the beginning of a mission?

I did code a workaround to query from a client to another client specifically to retrieve its name:

scriptName "fn_getUnitName";

if (isRemoteExecuted) exitWith {
  player setVariable ["name", name player, remoteExecutedOwner];
};

private _unit = param [0, objNull, [objNull]];
if (isNull _unit || !isPlayer _unit) exitWith {"ERROR: NULL UNIT"};
private _name = _unit getVariable ["name", ""];
if (_name isEqualTo "") then {
  [] remoteExec ["client_fnc_getUnitName", _unit];
  _name = "WARNING: Name Pending";
};

_name

Any thoughts?

robust hollow
#

I have run into a similar issue on a couple of occasions. it was quite rare, but when it happened, the unit the variables were set to was some kind of bugged out, eg: server didnt recognize the unit (netid returned null obj on server, even though it had a proper netid). Only happened after a the server had restarted the mission/switched to a new mission in the rotation.

If that isnt the circumstance your issue is occurring under then 🤷 i know ive had some JIP remoteexec messages go unreceived on the odd occasion but for the most part i find setVariable JIP to be quite reliable.

real mango
#

we'll see if this patches things up else I'll have to investigate further. I think > ideally < the setVariable is very reliable, however once you factor in network disruptions this might occur more often then we'd like to think. Most of the times I probably not notice it because from time to time I tend to refresh variables, however if they're only set once... there might be this chance 😦

slim oyster
#

Are there benefits to CBA function caching over the cfgFunctions library? I know CBA had a speed advantage over the standard preprocessfile function defines in the older games, is this the case with ArmA 3? Or is the main advantage the naming system?

still forum
#

cba compiles into uiNamespace once at gamestart

#

and then only "copies" the functions from there to missionnamespace

#

though afaik CfgFunctions does similar

#

over the standard preprocessfile function defines Usually every function is preprocessed, CBA and CfgFunctions both do that

#

The naming system is also the same

tough abyss
#

@slim oyster how do you figure CBA speed advantage?

still forum
#

Well technically CfgFunctions iterates through config. While CBA runs a script with constants.
So.. I guess technically it's faster? like.. a few microseconds or so?

winter rose
#

Hello dear Multiplayer people; does any of you know, in the case of a loaded MP game, if client's didJIP returns true or false?

tough abyss
#

Did client JIP or not?

winter rose
#

I don't remember how a loaded MP game happens, actually
let's say 4 players play a mission, the server saves. What happens if:

  • server loads the save
  • people disconnect, sleep, reconnect, server loads the save

I want to know the sneaky perks of didJIP

tough abyss
#

If people disconnect/reconnect they will be JIP obviously. As for save load one need to test

winter rose
#

who feels like it? 👀

astral dawn
#

Afaik saving/loading MP scenarios is broken like hell, I remember ranting about it at the feedback tracker 😄

#

Well I can help you test it if you want, @winter rose

#

Or you can actually run two arma clients on your own computer

winter rose
#

that's kind of you! well if anyone already has the info please tell me, else I will cook a test mission to check that someday

peak plover
#

it would probably be safer and more reliable to make your own save script

winter rose
#

I am actually trying to get didJIP behaviour for the wiki; the MP save system is a whole different story I am not sure I want to put my nose into!

compact galleon
#

I'd be surprised if didJIP would return true for loaded saves

winter rose
#

I hope not, but who knows. Just to be safe!
I will mention on the biki it only if it is the case.

compact galleon
#

I'm gonna predict a definite no. Saves don't have to be played with the same players in the same slots or players at all. JIP status would have to be saved as some separate state that'd have to coded explicitly.

finite cloud
#

Noob question: Are there any shorthand operators in SQF for incrementing/decrementing, etc.? Like ++, --, or += / -=?

astral dawn
#

no

#

But you can write a macro 😄

finite cloud
#

Nice, I'll have to look into macros

astral dawn
#

#define INCREASE_MY_STUFF_PLEASE(varName) varName = varName + 1

finite cloud
#

I've seen them used in other people's source code but I don't really get it

astral dawn
#

What? Macros? These are great. It's almost like C preprocessor, with some exceptions.

compact galleon
#

+= etc. wouldn't work in SQF without making them special constructs like the = "operator".

astral dawn
#

Maybe @still forum can add extra operators with Intercept 😄

finite cloud
#

I'm not really familiar with C, I'm coming from a JavaScript background which is just a little different, haha

astral dawn
#

Well... C preprocessor is like a tool above C which in theory can handle any files. It helps you replace strings with other strings, basicly. Most things which are valid for C preprocessor will be valid for SQF preprocessor, that's what I wanted to say.

still forum
#

I already told you in the past that it's not possible and why it's not

finite cloud
#

Gotcha, thanks!

astral dawn
#

Hmm... ok, don't remember, sorry

tough abyss
#

You can use =+

#

Arma preprocessor is not C preprocessor, it is made look like it but it is handrolled with own weirdness added @astral dawn

#

Most things which are valid for C preprocessor will be valid for SQF preprocessor quite a sweeping statement

astral dawn
#

Well, define, ifdef, else, endif work. Macro parameter passing is broken/different. Include paths are different. Most of the concept is still here, right?

tough abyss
#

Just because Arma preprocessor made to support some common C preprocessor directives doesn’t mean they are compatible

#

You probably missed lengthy discussions on here how fucked up Arma preprocessor is

astral dawn
#

I use it a lot in SQF (not configs), it's pretty dammaged, I know. I just wanted to guide the guy who has never experienced any preprocessor in the direction of C preprocessor explanation articles because there are much more articles about C preprocessor than about SQF

winter rose
#

dammaged damaged*, you OFP-era coder :p

tough abyss
#

😂

astral dawn
#

Haha I have a friend who thought that it's the right way to write the word because of this command

mortal nacelle
#

Just to confirm, IsEqualTo can be used in an if statement with an Array attached and == can only deal with strings right?

astral dawn
#

Yeah... can easily test it in the debug console

#

== accepts a larger variety of variable types though

mortal nacelle
#

yeah, ta!

compact galleon
#

they fixed dammaged, yet we still have behaviour

ruby breach
#

== accepts a larger variety of variable types though I doubt that, since isEqualTo accepts anything

astral dawn
#

I meant 'a larger amount of types than what you have said (can only deal with strings)', not == accepts more types than isEqualTo 🤔

ruby breach
#

Ahh. Gotchya

tough abyss
#

@compact galleon who fixed dammaged?

compact galleon
#

@tough abyss I mean they added damaged to fix the spelling of dammaged

vapid drift
#
"STY_Item_CamoNet_BLUFOR" in uniformItems ACE_player```
would `uniformItems ACE_player` require parenthesis?
compact galleon
#

Yet we still only have behaviour instead of behavior

tough abyss
#

BI added setDamage but Dammaged is EH and it is not changed

compact galleon
#

getDammage

tough abyss
#

Not quite Dammaged

compact galleon
#

That's besides the point

tough abyss
#

Right on point, Dammaged is still Dammaged

#

Also there is no getDamage only getDammage

ruby breach
#

The correction for getDammage was damage

tough abyss
#

Very consistent

still forum
#

@vapid drift no. unary>binary

vapid drift
#

@still forum I don't know what that means but ok, thanks

compact galleon
#

@vapid drift Unary operators have precedence over binary

#

"STY_Item_CamoNet_BLUFOR" in uniformItems ACE_player is implicitly "STY_Item_CamoNet_BLUFOR" in (uniformItems ACE_player)

vapid drift
#

Alrighty

winter rose
#

@compact galleon isn't behaviour British? therefore not wrong 😛

finite cloud
#

So I hope this isn't a ridiculous or overly broad question... I've been watching some scripting tutorials but they're all oriented towards mission making, whereas I'm mostly interested in making addons. Is there a big difference between the two in terms of project organization/architecture? Is there any structure that's considered standard or best practice? Where can I read or watch more about this topic?

compact galleon
#

@winter rose It's wrong because the rest is American English. like color

tough abyss
#

@winter rose technically wrong, sqf is American

winter rose
#

inconsistent, but yep

vapid drift
#

@finite cloud I had a hell of a time with that man... I ended up just digging through other addons and trying to learn that way

tough abyss
#

SerialiZe

vapid drift
#

@finite cloud pretty much everytime I see something that I like, I try to take it apart and understand it

#

sometimes it works... most the time I end up here

compact galleon
#

I wish american english would adopt some things from british english, though

#

like tyre instead of tire

finite cloud
#

Are there any relatively simple but well-written mods that you would recommend I take a look at @vapid drift ? I've looked through like, ACE and C2 and obviously they're both monstrously complicated (well, C2 less so) so it's really hard for me to follow how all of the pieces link together

compact galleon
#

"I'm tired of tires" is american english, "I'm tired of tyres" is british english.

winter rose
#

corn is both, but with different meaning!

#

Chips, crisps, fries… etc

vapid drift
#

@finite cloud I don't have anything off the top of my head but you could always get on the workshop and look for mods that don't have too many features

finite cloud
#

Copy that, I'll peruse

still forum
#

sqf is American is it? isn't it czech? 😉

finite cloud
#

Thanks for the advice!

vapid drift
#

Hope it helps

tough abyss
#

A lot of the approaches to organisation and such I ended up lifting from CBA. That is a project that is small enough to understand and learn from and does things well

compact galleon
#

depends on what "sqf is American" means. I mean, SQ stands for Status Quo which is latin

finite cloud
#

Nice, I'll definitely check that out

tough abyss
#

Since you probably want to be using CBA anyway becoming familiar with it is kind of important.

finite cloud
#

And it's on GitHub, bless

vapid drift
#

lol

finite cloud
#

I'm so tired of unpacking PBOs and unbinarizing configs

still forum
#

There is a ACE sample project. That shows you how to build a project the ACE/CBA style

finite cloud
#

Oh shit!

still forum
finite cloud
#

omg, amazing

#

Thank you so much

still forum
finite cloud
#

Gotcha

#

I stayed up all night to watch scripting videos and I got so bored with the 101 stuff I ended up spending most of the night rewriting the SQF syntax highlighter for VS Code

compact galleon
#

If ARMA 4 uses the Enfusion engine I sure hope they've rewritten the scripting engine for it

#

Otherwise, I'd prefer SQF

finite cloud
#

On the bright side, I have The Best syntax highlighting now

vapid drift
#

Pretty sure enfusion got rid of sqf didn't it?

#

wasn't that the big deal with one of these last updates of dayz?

compact galleon
#

It's still in Enfusion, but they got a new scripting engine with it when they bought the engine

#

but it's shit

vapid drift
#

awesome

#

@finite cloud What did you change?

compact galleon
#

Technically, it's retarded

tough abyss
#

SQF in Enfusion eh?

#

BI bought Enfusion eh??

finite cloud
#

Mostly separating control keywords like if/for/foreach etc. from the functions, highlighting a called function as a function instead of a variable, but most importantly adding syntax highlighting to expressions inside strings

mortal nacelle
#

Can somebody roast me to success? ```css
private['_chance','_blueprintArray','_blueprints','_check'];
_blueprints = ["Blueprint_P07","Blueprint_16Rnd_9x21_Mag"];
_check = nil;
{
if(!(player_itemClass in _x)) then {
_check = _x;
}
}forEach _blueprints;
if(isNil "_check") exitWith {["You do not have a blueprint in your hands!"]

vapid drift
#

oh nice dude... going to make that available?

finite cloud
#

Yeah I definitely could once it's a little more polished

mortal nacelle
#

wait

#

im an idiot

#

lmao

finite cloud
#

I kind of hacked some things into places where they don't belong but it works for now

vapid drift
#

lol

finite cloud
#

I'm sure there are still bugs I haven't caught

compact galleon
#

It can't do threaded calls or even recursive calls, because the way it works, is that all parameters and return values in a functiono is global variables. So if you make a function like int Add(int a, int b); behind the scenes there's a int Add_ReturnValue; int Add_ParamA; int Add_ParamB; which get set before a call. So if the function calls itself, it'll overwrite the values from the original, and if multiple threads access it, you'll have race conditions. Ugh.

winter rose
#

O.o

compact galleon
#

Effectively, this enfusion scripting language sample ```cpp
int Add(int a, int b)
{
return a + b;
}

void Main()
{
int result = Add(1, 2);
}

#

Is compiled to the equivalent of this

int Add_ReturnValue;
int Add_ParamA;
int Add_ParamB;
void Add()
{
    Add_ReturnValue = Add_ParamA + Add_ParamB;   
}

void Main()
{
    Add_ParamA = 1;
    Add_ParamB = 2;
    Add();
    int result = Add_ReturnValue;
}
tough abyss
#

And how do you know that

compact galleon
#

If ARMA 4 is gonna be on Enfusion, I just hope they've redesigned it

#

@tough abyss I reverse engineered it.

tough abyss
#

I don’t believe you

vapid drift
#

lol

still forum
#

BI bought Enfusion @tough abyss BI bought the company that made enfusion

compact galleon
#

@tough abyss Oh no... M242 doesn't believe me, my life is over 😢

#

🙄

vapid drift
#

🍿

still forum
#

Btw I tend to not talk that openly about that because it's still a EULA violation and might get you banned here

compact galleon
#

As a general game modder, I've broken every EULA out there already

#

Hell, Ubisoft's EULAs explicitly prohibit trainer making or usage even for purely singleplayer games

mortal nacelle
#
    private['_chance','_blueprintArray','_blueprints','_check'];
    _blueprints = ["Blueprint_P07","Blueprint_16Rnd_9x21_Mag"];
    _check = false;
    {
        if(!(player_itemClass in _x)) exitWith {
            _check = true;
        }
    }forEach _blueprints;
    if(!_check) exitWith {["You do not have a blueprint in your hands!"]```
still forum
#

look at private keyword and findIf

#

you are missing a }

mortal nacelle
#

😦

still forum
#

Are you sure player_itemClass variable is defined?

mortal nacelle
#

yes, it was working

#

i added this

still forum
#

in _x makes no sense. _x is a string

#

in in used to check if something exists inside an array

mortal nacelle
#

so what can i use as an alternative to check?

#

IsEqualTo?

still forum
#

seems like you want something like player_itemClass in _blueprints

compact galleon
#

That code snippet makes perfect sense 😂

mortal nacelle
#

i was using that originally, but it wasn't doing what i wanted it to do

tough abyss
#

@mortal nacelle closing } is missing this will not run script and no error will be produced

still forum
#

can you explain what you want to do then?

slim oyster
#

"You do not have a blueprint in your hands!" Implies you just want to do an _x in assignedItems player check

mortal nacelle
#

I am trying to check if the item in the player's hand (player_itemClass) is in the array blueprints, if it isn't then exit the function

compact galleon
#

_x == player_itemClass

#

or just in blueprints

still forum
#
    private _blueprints = ["Blueprint_P07","Blueprint_16Rnd_9x21_Mag"];
    if !(player_itemClass in _blueprints) exitWith {["You do not have a blueprint in your hands!"]};

like that?

compact galleon
#

was about to say something before that edit xD

mortal nacelle
#

so why the f am i using a foreach

#

lmfao

still forum
#

I'm no sure why you are returning array there. Don't know your api... It's weird but might very well be right

mortal nacelle
#

It's a pain in the arse to keep turning it on and off with TADST as well because with my shitbox PC it takes about 5 minutes to start..

#

@still forum That worked.. I'm an idiot and just over-complicate things apparently..

outer fjord
#

It mentions marker, but doesn't state if thats a literal marker, I need to name something, do a trigger zone, ect

#

I tried just placing a marker down, setting variable name to "city" then tried running
0 = ["city", 500, 500] execVM "Zen_GenerateVRArea.sqf";

#

nothing

winter rose
#

area marker

outer fjord
#

ooooo

#

Ow god, yes, my brain is definitely not working...

winter rose
#

mine isn't really better, don't worry about that

#

you must be a bit damaged to use SQF after all, heheee

late silo
#

Can someone walk me off the edge. This nonsense is driving my nuts. Why is it changing the value for _var2 when I'm using set on _var1?

_var2 = _var1;
_var2 set [1,6];
systemchat str _var2;
// outputs ["somevalue",6]
_var1 set [1,7];
systemchat str _var2;
// outputs ["somevalue",7]```
robust hollow
late silo
#

well that's interesting, can't believe I haven't run into this until now. Thanks!

finite cloud
#

Yeah, array variables are just references to the array in memory, not an actual copy of the array, so you have to explicitly make a copy of the array if you want two versions of it that can change values independently

#

So _var1 = _var2 in this case is just setting two different references to the same piece of data, change one and they both change

#

I know Connor already explained that but I figured I'd be more specific

late silo
#

yeah that's what I gathered, I somehow have never run into that with arma before so I didn't think it did that. Guess I've been lucky

finite cloud
#

@compact galleon I totally missed that earlier but that enfusion sample is fucking beautiful, it's so much more like a conventional strongly typed language

#

I really hate SQF syntax

compact galleon
#

@finite cloud Except the technical part

finite cloud
#

Who decided it was a good idea to put the parameters before the function name and the foreach after the code block, wtf

#

What technical part?

compact galleon
#

@finite cloud That it works like shit behind the scenes.

finite cloud
#

Ohh I see your post above that now

compact galleon
#

Also, SQF is the simplest language on the planet. It's purely expressions. Operators and operands, which is why forEach is after the code block. LEFT + RIGHT LEFT forEach RIGHT

finite cloud
#

I mean maybe that makes sense in terms of being semantic but it's completely backwards to every other programming language I've ever used, so as a programmer it's just needlessly confusing

#

Maybe there's some precedence to it though, idk, I've barely touched C++ and only programmed Arduinos with C

#

I do hope they fix the issue you brought up though, that's just really bizarre functionality. JavaScript has that weirdness too with for loops, where when you do this

for (var i = 0; i < something; i++) {
  // something
}

the i var isn't local to the for block, it's actually defined globally right above it

queen cargo
#

@finite cloud sqf works perfectly fine
Everyone having trouble because "it is so unusual" did not bothered to actually learm the language but rather assumed it is just some language

finite cloud
#

But it's almost never an issue in the real world, most JS programmers don't even realize that

#

I mean I'm on day two of trying to learn it, I'm not trashing it necessarily I just think it has some unconventional design decisions that makes it a steeper learning curve than it needed to be

#

But maybe the opposite is true for people who don't have a background in programming and are starting with SQF, and maybe that was the point

queen cargo
#

It is as @compact galleon said

#

Only expressions and thats it

#

Plus the variable stuff on top 🤷

finite cloud
#

I don't think I follow what you mean by "only expressions" but maybe it'll become clear when I learn more

compact galleon
#

It's so simple. If you understand basic algebra, SQF is easy. 5 + 2 is no different from 5 setRain 2

#

Other than the fact that the setRain operator has different functionality from the + operator

finite cloud
#

I still don't really understand what's supposed to go on the left side of the function and what's supposed to go on the right, and how the two "sides" interact with one another

#

I've seen functions get called with the parameters passed in from the left but then I've definitely seen functions that do stuff with a value on the right

queen cargo
#

Binary
Unary and nular Operators

#

Binary have left and right parameters

#

Unary only right side

#

And nular none *

#

Unary and nulars are easy to understand

finite cloud
#

Ohhhh, that's what you meant when you said that everything is operators and operands

compact galleon
#

Nulary operators take non at all

finite cloud
#

Functions are binary operators

queen cargo
#

And Binary ones follow a simple predecene

finite cloud
#

Or some of them are?

queen cargo
#

Yeah @compact galleon 🙈🙈 it is late

robust hollow
#

functions are just variables

compact galleon
#

An operator taking only a left operand. That's a new one 😛

queen cargo
#

There are no functions in sqf
Only Code type Variables

compact galleon
#

And a hell to parse

queen cargo
#

😂 😂 but be just a lil bit different
Should not be that hard 🤔🤔

finite cloud
#

So what's the difference between a function defined in, say, C#, and one in SQF besides in the syntax? Re: the "code type variables" thing

compact galleon
#

Operators can at most take 2 operands. But these can also be arrays, which some operators use to work around that limit

finite cloud
#

Well there are ternary operators in most languages 😉

queen cargo
#

@finite cloud that Code is literally a value type that gets used

#
Foo = { hint "Bar"; };
If true then Foo;

This eg.

compact galleon
#

SQF is just an expression evaluator. It parses expressions that consist purely of operators that take zero or more operands. Even if and else are operators cleverly used together in a way that makes them resemble traditional if-statements from "normal" languages

queen cargo
#

Else literally just Puts the code into an array... 😂😂

compact galleon
#

This is perfectly valid csharp _condition = if alive player; _code1 = { hint "You're alive!" }; _code2 = { hint "You're dead!" }; _codes = _code1 else _code2; _condition then _codes;

finite cloud
#

My brain cannot handle that

queen cargo
#
If true then [{hint "Foo"}, {hint "Bar"}] ```
#

Because you think in terms of control structures @finite cloud

compact galleon
#
_false = if call { true } then call { false }```
slim oyster
#

[_elseStatement,_thenStatement] select _value ?

finite cloud
#

Can you help me understand what these examples are actually doing? Like what they compile down to or whatever?

#

I'm not following at all

finite cloud
#

I promise I'm not trying to be obtuse, haha

#

Like, what are the calls doing in that last example?

compact galleon
#

@finite cloud It's all just operators like + and -, but instead of operating on and returning numbers, they operate on all kinds of types, from numbers to string and booleans

queen cargo
#

@compact galleon your example is wrong though... Then is only accepting Code and bool

#

For right side

compact galleon
#

Yes, was supposed to be csharp _false = if call { true } then call { { false } else { true } }

#

just to confuse

finite cloud
#

Is that supposed to work kind of like a ternary expression? Like

_value = condition ? _case1 : _case2;
#

Or will the value of _false always be false?

queen cargo
#
[WORK]	<STRING>	Node Type;Offset;Length;Content
SQF;0;64; _false = if call { true } then call { { false } else { true } }
	ASSIGNMENT;1;63;
		VARIABLE;1;6;_false
		BEXP4;10;139672794225463;
			UNARYEXPRESSION;10;16;
				UNARYOP;10;2;if
				UNARYEXPRESSION;13;13;
					UNARYOP;13;4;call
					CODE;18;8;
						NULAROP;20;4;true
			BINARYOP;27;4;then
			UNARYEXPRESSION;32;32;
				UNARYOP;32;4;call
				CODE;37;27;
					BEXP5;39;0;
						CODE;39;9;
							NULAROP;41;5;false
						BINARYOP;49;4;else
						CODE;54;8;
							NULAROP;56;4;true

����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������```
compact galleon
#
hint str call ({} else {1337} select 1)```
drifting copper
#

I am looking to enable Stress Damage on helos without having to run adv flight model cause pilots will kill us all if I did. But at the same time I do not want to see KOTH flying.

I found this but no idea how it works, takes effect or how to implement it. Can someone please adives?
https://community.bistudio.com/wiki/enableStressDamage

west venture
#

Negative, you'll have to enable AFM to use that. It's literally the same as toggling the option in the difficulty settings - it won't do anything if you toggle it while you're running BFM.

#

(Or, well, you could try, but I'm doubtful.)

drifting copper
#

Ouf. Any other way to limit pilots from "whipping like a ferarri"? Looking for ways to limit flight without having to AFM. And yeah, that is the quote they use in describing their piloting of a UH-60 that would otherwise break IRL.

west venture
#

This is pretty much exactly what AFM is for.

still forum
#

@finite cloud call command executes a function, which is a value of type CODE. And returns the result.
In that example above call {true} means it executes the function {true}. The last value in the function is what it returns, it's a true here. So the call returns true.
These guys are awesome at not actually answering the question but just posting more and more technically weird pieces of code 😄

#

SQF can only do 4 things.
command
command argument
argument command argument
variable = expression

What the commands do with the arguments is specific to the command. You can only know that by either thinking logicially or reading the command's page on the wiki.

tough abyss
high marsh
#

are there any more setter commands like,
setTerrainGrid,
setObjectViewDistance,
setViewDistance,
setShadowViewDistance,
etc.
I want to provide the most tuning options for ui.

tough abyss
#

setDetailMapBlendPars

high marsh
#

Ah, yeah I've already got that. Anything else?

still forum
#

aperture? 😄

high marsh
#

AHA! Another thing to fiddle with!

still forum
#

I had some fun toying with that. It can be really powerful if you wanna for example force a dark mission

high marsh
#

Yeah, this is super cool.

#

what's STD & stdLum ?

still forum
#

min,standard,max I guess something like gaussian curve like?
and standardAverageLuminance.. uh....
standard must be bigger than min, max must be bigger than standard.
and every value must be bigger 0.

The first 3 values are the aperture so.. how far open the pupils are... Kinda.
And the stdlum is how bright the overall scene should be in total.

So with the aperture values you can control the min and max. And the last value is the screen brightness if the aperture is in the center.

#

default values are 70,55,30,200 or whatever the CfgWorlds lighting config says. Check AiO config.

high marsh
#

Hmmm...sounds like something that needs a little tweaking and learning for sure.
Do you have a sort of scale I can run these numbers by? Is the CfgWorlds lighting config the "default" aperature? I see if you also set it to -1, that it'll automatically adjust?

still forum
#

Search aio config for apertureMin and you'll find all the values for the different wheather states

high marsh
#

Oh, sweet.

still forum
#

setting to -1 will let it honor the config values again

#
apertureMin
apertureStandard
apertureMax 
standardAvgLum

these are the config names

#

Actually never looked that deeply into it. So far I just plugged random values in and looked at the result :D
Seems like you'd probably want to make the last value tweakable in your ui. That has the most effect I think

high marsh
#

Yeah, especially when you're looking for a more dark appearance. Thanks!

tough abyss
#

does it still not reset aperture between the missions?

high marsh
#

Does it? Dunno

still forum
#

It should.. But I can see very well that it might not

high marsh
#

So in the case that it doesn't, should I reset the aperture after mission closure?

jagged field
#

Just wondering

#

but is it possible to change how an AI Path Finds in arma?

young current
#

no

#

you might be able to alter where it tries to find a path to

#

but the path finding mechanics are not open for tinkering

jagged field
#

ah damn

tough abyss
#

you can disable it and make your own if you think you could do better

jagged field
#

was just wondering because I was trying out Unreal Engine

#

and allowed my computer to run lots of ai, by just making them group and follow a "leader"

#

that would path find for them.

#

was wondering if I could mimic that for Zombies and Demons in arma 3.

tough abyss
#

you cannot compare Unreal to Arma RV

jagged field
#

RV?

tough abyss
#

Real Virtuality

jagged field
#

Alright, was just wondering

tough abyss
#

If you want zombies you could create agents and script them

#

There are enough commands for that

#

as well as some nice ones for intersection checking

#

not sure how many zombies you want to have, it could be a problem with large numbers

jagged field
#

yeah

high marsh
#

Lesser so with a HC

jagged field
#

my solution to large numbers was to mimic what I was doing in Unreal, and just make them copy a designated leader that would do that path finding calculations for them, then just apply an offset for each member of the group so they weren't single file. But I mean this is all me just theorising, I dont think its actually possible :/

high marsh
#

Like I said, an HC. The HC will do the work for you. Rather than the client and server.

#

HC = Headless CLient

tough abyss
#

you can have multiple HCs as well

high marsh
#

Cached page due to BI Pages on maintenance

jagged field
#

yeah

#

but they help with AI calculations?

tough abyss
#

HC is like running it on separate thread

jagged field
#

oh so just basically more cores for the server

tough abyss
#

yeah less work for the server

jagged field
#

alright

#

thanks for the help

tough abyss
#

HC is client instance like another player

#

connected to the server

high marsh
#

Except it has no interface.

#

So I guess you could check if it's an hc like so:

if(!isServer && !hasInterface) then
{

};
tough abyss
#

or

if (player == yourHCinstancevariablename) then {...}
high marsh
#

But like, what if you just wanna like throw it in there if it's an hc.

tough abyss
#

you can also connect more HCs dynamically

#

while the game is in progress

#

You could probably connect a proper self learning AI to the game via HC

#

And call it Chuck Norris

high marsh
#

Basically yeah

still forum
#

Anyone ever got the script error Tangents of 90 degrees ? :D
That's the weirdest script error
Right next to Assertation failed... Btw BI. It's Assertion. Not Assertation

tough abyss
#

You b0rked it

still forum
#

Currently implementing intercept stuff to set custom script errors and found these in the stringtables

winter rose
#

haha, nope never got them

astral dawn
#

Also Tangent, not Tangents 😄

eager prawn
#

@still forum assertion failed errors are par for the course in C++ :(

still forum
compact galleon
#

Assertation is not wrong

#

Depending on what they mean

still forum
#

well. if an assert was triggered.
You probably meant the Assertion

compact galleon
#

But assertion is both a verb and noun. Assertation is specifically a noun

tough abyss
#

But assertion is both a verb and noun wut?

still forum
#

to assert, the assertion.
Assertation can't be verbanized

edgy dune
#

:| English hard

elder karma
#

IDK if this is the exact right channel, but I'm trying to take some screenshots and such for the game as "promo"/cover for a fun-op I'm putting together for some friends. Is there a way that I could force IR lasers on, for models in static poses?

young current
#

ACE has visible toggleable lasers I think

elder karma
#

Would that be enabled in 3DEN or through Zeus?

young current
#

that I dont know

ruby breach
elder karma
#

Would I need to know the class name of the laser attachment in question?

winter rose
#

if they don't turn lasers on, set their behaviour to "combat"

tough abyss
#

use

soldier1 disableAI "Anim";
soldier1 action ["IRLaserOn", soldier1];
tame axle
#

I have an addaction on several units, which pass a variable, to my script file. The switch logic runs a line of code depending on which unit passed the action.

#
switch (_this select 1) do
{
    case 1:{removeAllActions Intel1;myVar = 1};
    case 2:{removeAllActions Intel2;myVar = 2};
    case 3:{removeAllActions Intel3;myVar = 3};
    case 4:{removeAllActions Intel4;myVar = 4};
    case 5:{removeAllActions Intel5;myVar = 5};
    sleep 1;
    };
publicVariable "myVar";
#

works fine as single player, and the addaction is removed once activated. But in MP, each player must complete the action to remove the addaction.

#

How can I ensure the addaction is removed for all players by any player?

ruby breach
#

Assuming Intel5 is defined and identical on all players anyway.

copper raven
#
private _index=_this select 1;
myVar = _index;
(missionNamespace getVariable format["Intel%1",_index]) remoteExec["removeAllActions",0];
sleep 1;//?
publicVariable "myVar";
tame axle
#

Thanks guys will give the remoteExec a try.

vapid drift
#

This is quick and dirty but is something like this even possible? Identifying terrainobjects near me and adding an action to them?

nul = [] spawn {
    _temp = nearestTerrainObjects [player, ["Bush"], 10];

    { _bush = _x;
        _bush addAction ["Harvest", { hint "Harvested"; }];
    } forEach _temp;
};```
tough abyss
#

You probably cannot add action to terrain objects

vapid drift
#

certainly doesn't seem that way

tough abyss
#

You can try (Tanoa)

player addAction 
[
    "Harvest", 
    {_obj = cursorObject; player playAction "PutDown"; sleep 0.75; _obj hideObject true },
    0,
    1.5, 
    true, 
    true, 
    "",
    "!isNull cursorObject && {player distance cursorObject < 2 && {getModelInfo cursorObject select 1 find ""shrub"" > -1}}"
];
vapid drift
#

ok, yeah, I'll give that a shot

#

Might be able to modify that to suit my needs

#

@tough abyss so far that's not yielding any results but I think that gets me going in the right direction

tough abyss
#

It is copy paste working example, not sure how it doesn’t work for you

vapid drift
#

Something in the condition not working properly. I never got the harvest action.

#

Maybe it's something to do with the tanoa vegetation?

finite cloud
#

In an #include line, does \x\ always refer to the mod's root directory? Or is this some sort of macro defined in the addon I'm looking at?

#

Oh wait, not the mod's root directory

#

Whatever directory is above that

#

Idk, I'm looking through the source for CBA and trying to understand it, and I'm seeing stuff like this:

#include "\x\cba\addons\main\script_mod.hpp"
robust hollow
#

cba starts their addon prefix with x\

vapid drift
#

and ace with z if I remember correctly

#

so looks like no plants have class names... is this correct?

tough abyss
#

@vapid drift On Tanoa bush is called shrub, I changed the example

vapid drift
#

@tough abyss oh ok, I had no idea. That's weird though because nearestTerrainObjects [player, ["Bush"], 3]; returns the info

tough abyss
#

It is not weird, figure out why and how the condition works and you will see

worldly locust
#

I'm trying to make a very quick power cut script for a mission where players have to blow a power station. Using the example here https://www.youtube.com/watch?v=VF7RpA3LxN4 I can do this no problem. The issue I have is that the classnames for the light sources for the map I'm using Bystrica do not match those in that example. I'd thought I could get them by turning on map ids, and using [0,0,0] nearestobject idnumber however it turns out that the lamp posts don't appear to have any id's within eden.

#

Any ideas how I can figure the classnames out?

tough abyss
worldly locust
#

Hi @tough abyss yes, sadly as it shows, you need ID's or class names. I can't get ID's from do3DENAction "ToggleMapIDs"; to show id's for the items.

#

And the classnames listed in KK's example are the ones I'm already using. However, the lights aren't of that class or they'd be going out.

tough abyss
#

What classname are they?

worldly locust
#

yeah. that's what i'm trying to figure out.

tough abyss
#

Point at the light and execute hint str typeof cursorobject there is not much to it

worldly locust
#

oh yeah. Forgot completely about that. Thanks.

#

🤦

tough abyss
#

So what are the classnames you have?

worldly locust
#

The one i was missing was "Land_PowLines_WoodL" by the looks of it.

#

your hint gave me the ability to find anything else that I've missed.

river slate
#

Anyone got any ideas how the arsenal gets this to happen for the rocket launcher?, not experienced at all but been looking it's sqf at things like lbdblclick, show weapon, selectweapon , etc for trying to replicate it. https://gfycat.com/ShockedHairyIrishterrier

velvet merlin
tough abyss
velvet merlin
#

well what is menu UI element?

still forum
#

I'd say context menu

#

that's why path and not just index

#

3DEN right click menu

velvet merlin
#

ok this makes sense

#

any idea what "audio time" should be?

still forum
#

audio get's paused when you tab out. game time might not be

winter rose
#

voice time maybe, also unrelated to in-game time? (like a "uiTime")

still forum
#

Not sure about that though. Audio stops playing. Don't know if music continues where it left of or if it just runs silently in the background

velvet merlin
#

didnt A2 campaign have this slow motion scene at the start?
but controls were still normal?

winter rose
#

nope, it was real-time (and only player-host would play, the others would switch internal camera to the unit and watch him)

#

I am about to cheat in MP for a slow-mo intro with setAnimSpeedCoef :3

velvet merlin
#

so player useAudioTimeForMoves true

#

makes you normal speed regardless of accTime

#

so fast in slowmo and slow in fast time

winter rose
#

I think it was more made about gesture/speech synchro, I don't know if it works with accTime

velvet merlin
#

should be handy for special SP experiences and for SP debug mode

winter rose
#

oh you mean you tested? great 🙂

#

good for Bullet Time experience indeed 😄

velvet merlin
#

i guess could be also used during cutscenes and such

#

(can catch your own grenade this way)
(low fps due to my laptop)

astral dawn
#

What is the best way to make clickable map markers? Should I iterate over all potentially clickable markers on map click event, or should I do such functionality with fake groups and high command events, or should I add controls to map and move them on each frame? 😫

tough abyss
#

First approach sounds more straightforward

winter rose
#

@velvet merlin thanks, I just can't wait to use it 😄

astral dawn
#

Yeah
Do you think that if I do it by adding controls to map display and using their event handlers, it will behave bad?
I suppose that ctrlCommit might take effect at next frame, so zooming in/out will look terrible as positions will lag behind

austere granite
#

should I do such functionality with fake groups and high command events

#

No

#

First thing is your option. If you only want specific markers clickable, just keep their names in an array and make sure they always get added through a function that adds them to said array

astral dawn
#

I'm really more looking at drawIcon at the moment... how many drawIcons per draw event will cause troubles?

#

I might have like 50 of them or even more

austere granite
#

Yep drawIcon works too. You can have quite a lot, map fps can get somewhat bad, but it's not directly an issue

#

That won't be an issue

#

However if you use drawIcon on GPS it starts suffering on FPS quite fast

astral dawn
#

So if I just add onDraw to the map display (finddisplay 12), it will not propagate to GPS, right?

tough abyss
#

50 icons? Wow, you sure you need that many?

astral dawn
#

Well it's an estimate, IDK yet 🤷 Will be all cities, outposts, everything

barren spindle
#

hey, guys is it possible to check if an object's inventory is already open by another player ? (Trying to fix this : https://youtu.be/Hr9nR-fFxPw )

#

I can't find anything on google

astral dawn
tiny wadi
#

Has anyone had issues with lbSetCurSel?

#

It crashes my game when I attempt to use it on a combo box

#
_index = -1;
for "_i" from 0 to ((lbSize 2100) - 1) do {
    if (lbText [2100, _i] isEqualTo _label) exitWith {
        _index = _i;
    };
};
if (_index >= lbSize 2100 || _index < -1) then {_index = -1;};

lbSetCurSel [2100, _index];```
austere granite
#

It's usually an endless loop

#

Do you have a lbcurselchanged eh?

tiny wadi
#

I dont

austere granite
#

Also I would highly recommend always using the ctrl syntax as a sidenote

#

More reliable then IDC syntax

tiny wadi
#

I would but I call that segment of code when another listbox is updated

#

so I dont have a copy of the control object

#

I guess I could find the control object with the display

#
_display = findDisplay 1010;
waitUntil {!isNull _display};
_comboControl = _display displayCtrl 2100;
_index = -1;

for "_i" from 0 to ((lbSize _comboControl) - 1) do {
    if ((_comboControl lbText _i) isEqualTo _label) exitWith {
        _index = _i;
    };
};
if (_index >= lbSize _comboControl || _index < -1) then {_index = -1;};

_comboControl lbSetCurSel _index;```
copper raven
#

Log _index before the lbSetCurSel and comment it, I've had similar issue aswell, don't remember what was the cause. But i'm pretty sure it was something with the index, some weird issue.

astral dawn
#

Which units does drawIcon use for width and height? Are these pixels scaled with UI size?

tough abyss
astral dawn
#

Oh you have just saved me time equivalent to two evenings of experiments, thanks!

#

I have started reading these wiki UI articles meanwhile... again... I hate these UI grids, really

tough abyss
#

Yeah I never got into grids myself seems you can dynamically resize without them just fine

#

Anyway try with different UI sizes after

astral dawn
#

Yeah will do, thanks
So, divide width by 640 and height by 480 to get absolute coordinates... wtf, what sense does it make...

tough abyss
#

640x480 is 4:3 viewport size, I wouldn’t be surprised if these values hardcoded for icon size, I gave up getting surprised when it comes to RV

#

Basically lemmie try to put it in words, if your viewport is 640x480 then to make icon of 24x24 pixels you need to pass 24,24 which will draw icon 24 x 24 pixels. But if your viewport is bigger or smaller the icon proportion would be adjusted accordingly from intended 24x24 and will be bigger or smaller depending on the current UI size. Something like that?

#

It would still preserve icon relative size to viewport size

astral dawn
#

Yes but this would make sense if they didn't have the absolute coordinate system (from 0 to 1) which is a common thing for everything UI related. Maybe they had to do it so that they definitely get integers somewhere in this long chain of coordinate conversions, I don't know.

tough abyss
#

Me too, it is mind boggling

austere granite
#

Which units does drawIcon use for width and height?
Magical map units

#

In some cases you need to compensate for worldsize too, unless they fixed that these days

#

In the past I remember if I wanted accurate markers in meters, I'd need to adjust them by worldSize/8192 iirc

astral dawn
#

adjust them by worldSize/8192 iirc
Oh this is even more amazing thank you 😄

tough abyss
#

But that doesn’t make sense, the icon size doesn’t change with map zoom but the grid size does

austere granite
#

lemme look at my old code for accurate vehicle marker sizes

tough abyss
#

I bet you used mapscale in it

austere granite
#

yeah they were autoresizing ones so they stayed accurate despite zoom

#

so its that combo

#

I guess mapScale is what changed

tough abyss
#

Which brings even more “magic”

austere granite
#
private _vehicleCfg = configFile >> "cfgVehicles" >> (typeOf _vehicle);
private _size = ((getNumber (_vehicleCfg >> "mapSize")) *  0.075) / GVAR(worldSizeCoef);
private _icon = getText (_vehicleCfg >> "icon");
if (isText (configFile >> "cfgVehicleIcons" >> _icon)) then {
    _icon = getText (configFile >> "cfgVehicleIcons" >> _icon);
};

private _code = {
    _width = (_height * (10^(abs log _mapScale))) max 18;
    _height = _width;
};
#
GVAR(worldSizeCoef) = (worldSize / 8192);
tough abyss
#

That looks like 1 for stratis

austere granite
#

i mean its what i use for all the maps, and it seems to be correct

#

2km and 40km terrains

drowsy axle
#

Does this work? sqf } forEach allPlayers - (entities "HeadlessClient_F")

copper raven
#

} forEach (allPlayers - entities "HeadlessClient_F")

drowsy axle
#

Okay thanks

#

Are logic stuff, that aren't playable.. in that list?

tough abyss
#

@copper raven subtraction will be done first there was nothing wrong with that code

copper raven
#

Right, too much select in my head, my bad, should've thought of that.

tough abyss
#

That table is great

copper raven
#

Yeah, i was actually looking at it alot in past few weeks. But then, i just write stupid shit like that 🤦

astral dawn
#

Just use brackets any time you are in slightest doubt

tough abyss
#

You were not wrong just unnecessary in this case

copper raven
#

I actually stopped putting () everywhere like i used to do. Just forgot about the math operators and others.

tough abyss
#

(((((1+1))))) there @astral dawn

copper raven
#

🤢

astral dawn
#

Did you have any more doubt after adding one pair of brackets? xD

tough abyss
#

On the Life forums they say 5 brackets is the best for performance, but use 7 when you have 100+ people on the server

astral dawn
#

Hmm yes because compiler finds precedence faster 🤔

tough abyss
#

Yeah it really likes brackets it feeds on them

#

Just thought a name for a band “seven bracket shitcode”

knotty sun
#
(...) remoteExec [functionName, targets, _box];
(...) remoteExec [functionName, targets, _box];```
If I were to bind the JIP to the netID of an object twice, will the second line still be remotely executed or ignored?
#

e.g. two remote execs to the same object

high marsh
#

I imagine if the ID is different that would be fine.

knotty sun
#

welp I tried and 2nd one doesn't run

languid tundra
#

I've noticed that using the same script command is not stackable when you use an objects netID.

#

With different custom IDs you would be fine.

#

Hmm, curious. Normally, it's the last one that only gets executed, since it overrides the first one.

knotty sun
#

well that or there's an error in here the RPT doesn't tell me sqf [_veh,["Open BIS Arsenal",{["Open", true] spawn BIS_fnc_arsenal},[],1,false,false,"","","5"]] remoteExec ["addAction",0,_veh]; [_veh,["Open ACE Arsenal","[player, player, true] call ace_arsenal_fnc_openBox;",[],1,false,false,"","","5"]] remoteExec ["addAction",0,_veh];

languid tundra
#

Yeah, I noticed the problem in a similar setting. I was using BIS_fnc_holdActionAdd though.

knotty sun
#

so just use ```sqf
remoteExec ["addAction",0,true];```` instead then?

languid tundra
#

Not exactly what you want. The advantage of the netID is that your stuff gets removed from the JIP queue once the object is deleted.

knotty sun
#

that is indeed true

#

but kinda useless if the 2nd exec doesn't even get executed

languid tundra
#

I see two approaches. Either remoteExec the raw code or a function that adds both of them or use custom JIP IDs together with a deleted EH.

#

Just as a reference, I used the first solution in my particular case.

knotty sun
#

hm how would that go in my case. I thought it may ruin some of the code to be executed

languid tundra
#

Just rewrite your stuff for a local machine without remoteExec, pack it in a function and remoteExec that function with the netID for the JIP parameter.

knotty sun
#

eh that sounds like a good idea

#

I've packed the stuff in a private _fnc_heal. How would that be called with remoteExec? Confused by the WIKI atm

languid tundra
#

Is this for a client side add-on?

knotty sun
#

server

languid tundra
#

server side only?

knotty sun
#

kind of a plugin

#

remote execs arsenals to certain objects

#

along with a dozen other stuff

#

but yea server side only

languid tundra
#

So the clients don't have the your config.

knotty sun
#

nope

languid tundra
#

if you use a private variable for the code, you would need to remoteExec call or spawn. Again you would run in the problem above if you would try it multiple times.

#

The better approach is to create a global variable and use publicVariable before you use remoteExec.

knotty sun
#

hm so here's a strange one... I execute a healing script with the name remoteexec and netID object

#

That one does run

languid tundra
#

Is it a function?

#

or did you remoteExec call/spawn?

knotty sun
#

yes

#
[_veh,["Open BIS Virtual Arsenal",_fnc_arsenal,[],2,false,false,"","",5]] remoteExec ["addAction",0,true];
        [_veh,["Request Medical Attention",_fnc_heal,[],1.5,false,false,"","",5]] remoteExec ["addAction",0,true];```
languid tundra
#

Why are you surprised, you got the true for JIP?

knotty sun
#

eh just noticed I'm looking at two different codes to achieve the "same" thing

languid tundra
#

Also to increase security by protecting the global variable, you could do something like compileFinal. Not sure anymore, but I thought the protection gets also broadcasted with publicVariable.

knotty sun
#

global variable?

languid tundra
#

I mean global variable, which you make public with publicVariable 😄

astral tendon
#

The edit terrain objec module has a bug that in dedicated server if we set the biulding to be in destroyed state it apears that has 2 biuldings in the same place, one destroyed and one intact, is there a fix for that?

languid tundra
#

Was just referring to my previous suggestion to make a global function rather than a private one.

knotty sun
#

what would be the advantage over the private function if it's code sent by server to be executed globally/locally if "player" is used

languid tundra
#

The disadvantage is that your private function can't be used directly as the functionName argument of remoteExec.

#

You would have to feed it as an argument for remotely executed call or spawn.

south rivet
#

Does anyone know why damage and getAllHitPointsDamage return different values. When I use setDamage, it affects both of the get commands, but when I use setHitIndex it only affects getAllHitPointsDamage; damage remains what it was before I used setHitIndex.

#

It is causing some weird issues where vehicles are not being repaired completely by my scripts and have "phantom" damage, so to say. It seems like the vehicle is fully repaired, but when you start it up the hull magically gets damaged.

#

The wiki pages aren't very enlightening

#

Could it be an issue with dependencies for hitpoints?

compact maple
#

Hey guys, Im currently adding new ace 3 actions on vehicle. Do you know if it is possible to put some color on theses ?

knotty sun
#

how would I go around putting raw code including variables created inside the script (that need to be private) in a remoteExec? @languid tundra

#

I'm not sure I can make it work with a public variable

#

since the script that does the remoteExec itself is called from an object

languid tundra
#

is called from an object what does that mean?

#

Are you talking about the init line?

knotty sun
#

yea

#

the script (function) is called from there

languid tundra
#

Oh

knotty sun
#

since I need to refer back the addaction to the same object(s)

languid tundra
#

That is a totoly different story 😄

#

So how does the plugin exactly work?

knotty sun
#

I call a function from the vehicle that I want to be 'special'. the function then adds addactions and some ACE3 features to this vehicle

languid tundra
#

Is it like the mission designer calls your "API" function in the init line?

knotty sun
#

well I planned on making it more plug 'n play using the object's variable name, e.g. arsenaltruck_X where X is any integer number

#

then scan for present object for arsenaltruck_ and then apply it

#

but for now it's just sqf this call/spawn X_fnc_Y;

#

can't for the life of me find a suitable way to solve this one 😛

tough abyss
#

@south rivet damage is set after the damage of all hitpoints calculated

south rivet
#

Yea, but when I have set each hitpoint damage to 0, as confirmed using getAllHitPointsDamage, damage still is the old value

languid tundra
#

Well, you could create a preinit function, which broadcast X_fnc_Y to all clients via publicVariable. The you just do everything locally in X_fnc_Y.

south rivet
#

I think it might be because the "total" dependency for the hull is not being set

tough abyss
south rivet
#

I can't use that, some vehicles in RHS have duplicate hit points. So I need to use setHitIndex to fix every point properly

#

And there is no version of BIS_fnc_setHitPointDamage that accepts the index of a hitpoint

languid tundra
#

Well, it seems that damage calculation gets triggered in certain instances, although delayed. When I set hithull damage to 1 with setHitIndex for a Hunter, for instance, it will explode after some delay.

south rivet
#

Yea, but I set it to 0. And in some circumstances (I think when I used setDamage) it will keep the damage on Total, and then when I start the vehicle the hithull damage is set to the same as Total.

#

The hull still looks damaged as well until I use setDamage 0

languid tundra
#

Play around with hitbody instead. hithull doesn't seem to be linked with visual changes.

south rivet
#

I'm going over every hitpoint with my script, so I should be setting both. And hitHull is the one with the dependency for Total

#

The vehicle I'm using doesn't even have a hitbody

languid tundra
#

Hmm, probably ppl from #arma3_model know more about such things considering they have to configure the models/textures accordingly.

south rivet
#

Yea

shell carbon
#

Hello there, does anyone know how i can store this:
_index = lbAdd [1003, "FOB Alpha"];
lbSetData [1003, 1, "respawn_west_1"];
into the profilenamespace? I would like to make it persistent without using a database. Thanks in advance 😃

astral tendon
#
PlayerPlayCutLoss = {
player setDamage 0;
[objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
player allowdamage false;
[1, "BLACK", 1, 1] spawn BIS_fnc_fadeEffect;


    _CutSceneCamera = "camera" camcreate (getPosATL CutCamera_1); 
    _CutSceneCamera cameraeffect ["internal","back"]; 
    _CutSceneCamera camPrepareFOV 1; 

    //artilhary
    //part 1
    _CutSceneCamera camSetTarget [8109.56,3346.99,0];
    _CutSceneCamera camPreparePos (getPosATL CutCamera_1);
    _CutSceneCamera camPrepareFOV 1;
    _CutSceneCamera camCommit 0;
    sleep 5;
    
    //part 2
    _CutSceneCamera camSetTarget [8082.92,3325.95,5.46325];
    _CutSceneCamera camPreparePos (getPosATL CutCamera_2); 
    _CutSceneCamera camPrepareFOV 1;
    _CutSceneCamera camCommit 0;
    
    sleep 5;
    //part 3
    _CutSceneCamera camSetTarget [8082.92,3325.95,5.46325];
    _CutSceneCamera camPreparePos (getPosATL CutCamera_3); 
    _CutSceneCamera camPrepareFOV 1;
    _CutSceneCamera camCommit 0;
    sleep 5;
    //Look at the sky
    _CutSceneCamera camSetTarget [6813.51,2524.4,21.3163];
    _CutSceneCamera camPreparePos [6827.18,2466.91,1];
    _CutSceneCamera camPrepareFOV 1;
    _CutSceneCamera camCommit 0;
    sleep 5;
    //pass by the desctruction
    _CutSceneCamera camSetTarget [6821.6,2497.96,0];
    _CutSceneCamera camPreparePos [6769.78,2441.82,1];
    _CutSceneCamera camPrepareFOV 1;
    _CutSceneCamera camCommit 0;
    _CutSceneCamera camSetTarget [6857.01,2461.51,-0.00268459];
    _CutSceneCamera camPreparePos [6805.19,2405.37,1];
    _CutSceneCamera camPrepareFOV 1;
    _CutSceneCamera camCommit 10;
};

Ok, looks like arma dones not like me but camPreparePos does not work, the camera still stuck in the same place that was created, anyone can figure?

tough abyss
astral tendon
#

Were did you see that?

#

Their descriptions are the same, basicly it mislead to say that they do the same thing and their name diference just exist for wattever reason

wanton swallow
#

Hi all. How to switch character to a default pose after playActionNow?

#

My case of playActionNow make persist pose of charactor, cant to switch default..

tough abyss
still forum
#

@languid tundra Not sure anymore, but I thought the protection gets also broadcasted with publicVariable.
Yes it does https://discordapp.com/channels/105462288051380224/105462984087728128/540308970209017859
@compact maple Hey guys, Im currently adding new ace 3 actions on vehicle. Do you know if it is possible to put some color on theses ? Custom icons, in color. ACE already has green/orange/red icons for medical you could reuse them.
https://github.com/acemod/ACE3/blob/master/addons/medical/functions/fnc_modifyMedicalAction.sqf#L34 Seems like it's only the medical cross tho, you probably want the dot, gotta make your own colored icons them.
@shell carbon I don't understand.... Just setVariable into profileNamespace and be done?

compact maple
#

@still forum right, thanks !

sturdy cape
#

is it possible to do something like sqf [ AllUnits, true ] remoteExec [ "setUnconscious", 0 ]; to set allunits unconscious on a certain event? from reading my example i would say "no" lol.i need to set all units including NPC unconscious at one time

robust hollow
#
{
    [_x,true] remoteExec ["setUnconscious",_x];
} foreach allUnits;

something like this should work

peak plover
#

Probably better do do a single remoteExec for call

robust hollow
#

yea just thinking that

sturdy cape
#

actually thought about doing this foreach

#

will try that

#

not sure bout the second _x tho as its the target param

still forum
#

setUnconscious is arg local. so that's correct

robust hollow
#

it sends the remoteexec to the owner of the unit, which is required cause setUnconscious required a local unit

sturdy cape
#

thanks for clearing that up for me.will check now

ornate sky
#

Why don't script placed Support Modules work? If I script-sync the pre-placed Support modules everything works, however if I do

module1 = _grp createUnit ["SupportRequester",[0,0,0],[],0,"NONE"];
module2 = _grp createUnit ["SupportProvider_Artillery",[0,0,0],[],0,"NONE"];

guy synchronizeObjectsAdd [module1];
module1 synchronizeObjectsAdd [module2];
module2 synchronizeObjectsAdd [arty];```

no support option appears. Using typeOf and synchronizedObjects tells me everything is spawned and properly synced though. Why does it not work then?
still forum
#

the modules init script is probably not called

#

there is some trick for that, BI broke that recently

ornate sky
#

I assumed it had something to do with inits, at least I know where to look, thanks.

still forum
#

I think it was some setVariable, not sure. Something very obscure

ornate sky
#

BIS_fnc_moduleSupportsInitRequester?

#

might be this, found this func

solar coyote
#

Hey guys, i'm making a mission on 1.82 (linux v) I have noticed that deleteVehicle does not delete it up intil next frame. So if i go
deleteVehicle x; isNull x // false
sleep 1;
isNull x //true

Is it a hiden feature or a bug also is it fixed in current version?

still forum
#

It's a "feature"

#

deleteVehicle just marks the vehicle for deletion

#

it won't be deleted until next simulation cycle

solar coyote
#

damn, gotta check if it is mentioned in wiki, spent 3hrs in 15 line code figuering out whats wrong thinking i'm complete imbicil

tough abyss
#

it is, you should have checked it first

solar coyote
#

Yep, it is nicly stated in wiki, after all i'm not an imbicil i'm just a little illiterate

ornate sky
#

got it, needs to be like this for scripted modules to work:


_module1 = _grp createUnit ["SupportRequester",[0,0,0],[],0,"NONE"];
_module1 setVariable ['BIS_SUPP_custom_HQ',"",true];;
_module1 setVariable ['BIS_SUPP_limit_Artillery',"-1",true];;
_module1 setVariable ['BIS_SUPP_limit_CAS_Bombing',"-1",true];;
_module1 setVariable ['BIS_SUPP_limit_CAS_Heli',"-1",true];;
_module1 setVariable ['BIS_SUPP_limit_Drop',"-1",true];;
_module1 setVariable ['BIS_SUPP_limit_Transport',"-1",true];;
_module1 setVariable ['BIS_SUPP_limit_UAV',"-1",true];;
_module1 setVariable ["BIS_fnc_initModules_disableAutoActivation",true];
//[_module1] call BIS_fnc_moduleSupportsInitRequester;

_module2 = _grp createUnit ["SupportProvider_Artillery",[0,0,0],[],0,"NONE"];
_module2 setVariable ["BIS_fnc_initModules_disableAutoActivation",true];
//[_module2] call BIS_fnc_moduleSupportsInitProvider;

guy synchronizeObjectsAdd [_module1];
_module1 synchronizeObjectsAdd [_module2];
_module2 synchronizeObjectsAdd [arty];

_module1 setVariable ["BIS_fnc_initModules_activate",true];
_module2 setVariable ["BIS_fnc_initModules_activate",true];
ember verge
#

Yo is it possible to change the escape menu with a dialog youve made ?

tough abyss
#

sure

#

Override keypress, create own dialog while at it

astral tendon
still forum
#

typeOf

astral tendon
#

type of return the config name but not the ones in isKindOf like "tank","car"

digital hollow
astral tendon
#

No idea how to use that

inheritsFrom (configFile >> "CfgVehicles" >> (typeOf cursorObject));