#arma3_scripting

1 messages Β· Page 227 of 1

past wagon
tulip ridge
versed trail
#

Am I missing something critical with how the tree view system works and the associated selection commands? I'm trying to deselect all selected elements in my tree and select a different element, but I can't convince tvSetSelected or tvIsSelected to return the outputs I think they should. I have a relatively simple script where I run it and then I go select an option in the treeview:

sleep 3;
_tree = (findDisplay 11100 displayCtrl 11103);
_selection = tvSelection _tree;
systemChat str _selection;
systemChat format ["_isSelected: %1", _tree tvIsSelected (_selection#0)];
{
   _tree tvSetSelected [_x, false];
} forEach _selection;
_selection = tvSelection _tree;
systemChat str _selection;
systemChat format ["_isSelected: %1", _tree tvIsSelected (_selection#0)];
systemChat "RAN";

which returns this, for example when I select a top level option:

[[2]]
_isSelected: false
[[2]]
_isSelected: false
RAN

So tvSelection sees what I've picked but querying it specifically with tvIsSelected doesn't work and tvSetSelected has no effect. Not sure what I'm doing wrong here

old owl
#

Hi friends!

Ever since I got HEMTT working with our repo yesterday here #arma3_scripting message (thanks to all of your guys wonderful help), I have been pecking away. I've got our custom commands linting (thanks Crumble!) and am currently linting with as little as possible so I can keep my commits clean for when I turn things on.

Today I ran into an issue though. Includes for things like #include "\a3\ui_f\hpp\defineDIKCodes.inc" were causing errors. I was able to fix this up by adding the following to my project.toml:

[hemtt.check]
pdrive = "require"

Which if I am understanding correctly has just a P drive in AppData\Local\Temp\hemtt_pdrive with those files per:
https://hemtt.dev/configuration/p-drive.html

Onward to my actual problem-
While this works locally, this creates issues with my Github action as it does not detect an Arma 3 installation:

 error[BBE6]: This project requires a P Drive but no P Drive was found nor can one be emulated from an Arma 3 installation.

I suspect I will likely need to do something like this #arma3_scripting message where I utilize an arma3-tools URL but honestly no idea what to do there. Am I just hosting a URL with an installation of Arma 3 tools on our domain?

As always appreciate all of your guys help and bearing with me for the yap πŸ™‚

#

-# Also unrelated note, but whoever Brett Mayson is, is a genius, and seriously gotta give them credit for just how insane HEMTT is. Crazy stuff.

agile pumice
#

They really made it difficult to edit .sqm files with the eden patch didnt they lol

old owl
#

Okay so decided to take a whack at it anyway and figured it out. For anyone who ends up search for the same solution- essentially you're just zipping up the main Arma 3 Tools root folder that is found in your steam common folder in the expected format found in arma-actions/arma3-tools@master. Also worthwhile noting you wanna make sure you're not zipping up the actual folder but instead it's contents.

Apologies for all the spam meowsweats

old owl
#

-# Oh well maybe I'm not fully there- looks to be linting again but isn't recognizing defines / p drive again maybe

old owl
#

Okay. So even with Arma 3 Tools and a P Drive (which I haven't quite gotten around to understanding what it really is), I feel like I'd be surprised if it would be a solution to my include issues. No way Arma 3 Tools is able to provide the reference files it's needed without the base game. Perhaps ACE and other repos that use HEMTT delegate those files in the includes folder manually?

rose pike
#

hi real quick question, what's the right formatting for a trigger that relies on multiple previous triggers having been activated?
in my case i have the players complete 3 tasks, then a 4th and final one appears.

warm hedge
#

triggerActivated?

rose pike
#

triggerActivated taskone;
triggerActivated tasktwo;
triggerActivated taskthree;

#

ya?

#

i shouldn't be doing this at 4 am this is really simple but my brain is dead

warm hedge
#

Wrap with and

rose pike
#

gotcha

cosmic lichen
old owl
#

Currently have been writing a script to try and find those manually, but just wanna make sure I'm not tossing a hack in if there is a better way

cosmic lichen
#

Afaik there is no automation..the files in the include folder are.copied from the base game manually once.

old owl
cosmic lichen
#

It's a drive dedicated to modding Arma 3. It contains your project files and unpacked game files.

I have never used it even before hemtt.

ivory lake
#

its mainly relevant for mods that involve models and terrains

#

as models will occasionally/usually reference vanilla game files like textures or materials (especially for like fire geometry materials)

old owl
#

Ahhhhhhh. Thank you both. Was scratching my head, as when I'd open it it'd be empty. That makes sense

cosmic lichen
#

Yeah. Wiki has 0 documentation about it as it seems πŸ™„

sharp moth
#

How do i add a dependency to my mod?

hallow mortar
#

More of an #arma3_config thing, but the short answer is CfgPatches

#

*dependency listing on the Workshop might be separate

zealous solstice
#

@agile pumice disable the binarising and you can read it again

#

;D

agile pumice
#

how does one do that?

#

whats even the point of binarizing the thing in the first place

zealous solstice
#

faster loading the file in the engine

modern plank
#

Hi all, a small one: how to split a big array in pairs in the elegant way: _in = [1,2,3,4,5,6]; => _out = [ [1,2], [3,4], [5,6] ];

#

I can do a for loop with a step 2, pushing pairs into a new array, but is there any fancier implem in SQF?

zealous solstice
#

you can change this under Attributes >> General >> Misc >> Binarize the Scenario File

#

you can switch the as often you want without running it problems

agile pumice
#

cool, thanks

zealous solstice
#

i did this if i release/play a mission and disable this while i build the mission

old owl
modern plank
#

thx, but I stick with an array, I don't need more. I did the for-loop implem, Î was just looking for function or whatever simpler.

old owl
modern plank
#

Something could be done with pairs or nestedElements, but obvious....

errant jasper
#

You can also modify either the producing or consuming side.

#

For example CBA old create marker function took optional "named parameters" without wrapping in associate key-value pair:

#

_marker = ["markername", [positionX,positionY], "Rectangle", [sizeX, sizeY], "COLOR:", "ColorYellow", "GLOBAL"] call CBA_fnc_createMarker;

modern plank
#

@pallid palm I have this manually-edited array that describes optional crates cargo that I want to keep dead simple since I am editing it every week.

// 8. Custom cargo
// Cargo is an array of arrays: [ backpack, Items, Weapons, Magazines ]
ATMTK_VEHICLE_INVENTORIES = createHashMapFromArray [
  [ "I_supplyCrate_F", [["B_Parachute", 10],["ACE_Altimeter", 10],[],[]] ],
  [ "rhsusf_gear_crate", [[], ["ACE_CableTie", 10], [], []]],
  [ "CUP_BOX_USMC_AmmoOrd_F", [[], ["DemoCharge_Remote_Mag", 3, "ACE_Clacker", 3], [], []]],
  [ "CUP_BOX_USMC_WpsLaunch_F", [[], [], ["CUP_launch_Mk153Mod0_blk",2], ["CUP_SMAW_HEAA_M",3]]]
];```

Then, I have a dynamic mission setup that generate the right vehicles -including crates- and I need some stuff to be added into the cargo.  Here is the function to load cargo:

atmtk_FALoadVehInventory = {
params["_veh"];
private _klass = typeOf _veh;
if (_klass in ATMTK_VEHICLE_INVENTORIES) then {
private _cargo = ATMTK_VEHICLE_INVENTORIES get _klass;
{
if (count _x > 0) then {
private _pairs = [];

            for "_i" from 0 to ((count _x) - 1) step 2 do {
                _pairs pushBack (_x select [_i, 2]);
            };

            switch(_forEachIndex) do {
                case 0: { { _veh addBackpackCargoGlobal _x; } forEach _pairs; };
                case 1: { { _veh addItemCargoGlobal _x; } forEach _pairs; };
                case 2: { { _veh addWeaponCargoGlobal _x; } forEach _pairs; };
                case 3: { { _veh addMagazineCargoGlobal _x; } forEach _pairs; };
            };
        };
    } forEach _cargo;
};

};

errant jasper
#

If you want easy editability, have you considered using the editor itself? Create a dummy storage crate, configure its inventory, then from init do something like: [this, "I_supplyCrate_F"] call ATMTK_fnc_ConfigureInventory;

modern plank
#

Could be done yes, but Editor is a pain for repetitive config, since I have to edit missions every week I prefer simple txt files which can be better for copy/paste/grep etc.... and all my customization is set into a unique file TODO.sqf, to define times, crates content, missions objectives etc...

#

I spent less time by copying/pasting from my previous missions than doing dozens of clicks in the UI to put a bunch of items in a crate.

still forum
#

"abc" serverCommand "#missions"
serverExec in debug console
->

Successfull attempt to execute serverCommand '#missions' by server.

Seems to be working just fine

still forum
steep rapids
still forum
granite sky
#

If serverCommand is executed on a client, it must be executed from UI context, such as "onButtonDown" or similar events

#

Not sure if addAction counts there...

still forum
#

Not what we're talking about

#

Its the server-side executed variant with password, that we're on

granite sky
#

Oh, that one's SE-only, right

split ruin
#

any way to destroy simple object during mission ? πŸ€”

modern plank
winter rose
#

lot of force

split ruin
#

@winter rose lot of damage ?

granite sky
#

Replace it with something that isn't a simple object, or fake it with particle effects?

winter rose
#

j/k; but if you want a simple object, it's a simple object
otherwise:

  • delete + fake effects (dust, etc)
  • delete + replace with real object + setDamage 1
split ruin
#

roger that

grim coyote
#

Hey, I'm trying to get drawIcon3D to rotate correctly relative to the 3DEN camera, but I can't figure out the right way to calculate _iconDir.
_position and _dir are fixed and can't be changed. The icon should rotate on screen based on the object's world direction relative to the camera's azimuth.

Here's what I have so far:

onEachFrame {
    _object = (get3DENSelected "object") select 0;
    if (!isNil "_object") then {
        _position = getPosAtl _object;
        _dir = (vectorDir _object);

        _iconDir = _dir getDirVisual (vectorDir get3DENCamera);

        drawIcon3D [
            "a3\3den\data\cfg3den\camera\cameraTexture_ca.paa",
            [0, 0, 1, 1],
            _position,
            2,
            2,
            _iconDir,
            "test",
            0,
            0.03,
            "PuristaMedium",
            "center",
            true
        ];
    };
};

getDirVisual returns a 3D angle between two vectors, not a flat bearing, so I'm not sure it's the right approach here. Anyone know how to correctly convert the object's world direction into a screen-space rotation angle for drawIcon3D?

cosmic lichen
#

What about getDir alt syntax between camera position and icon position?

grim coyote
#

Couldn't figure out anything with that unfortunately. One extra note:

_position = getPosAtl _object;
_dir = (vectorDir _object);

are the only variables that I can use to get this to work.
Would something like this maybe help me?

_yawDeg = (_dir select 0) atan2 (_dir select 1);
if (_yawDeg < 0) then { _yawDeg = _yawDeg + 360 };

I've been trying to figure out this now for over 2 hours :/

digital hollow
#

You want the icon to point (in 2d) the same way that the object is pointing (in 3d), right?

grim coyote
granite sky
#

I read this a few times and I still can't tell what you're trying to achieve :P

#

Is the object's heading supposed to matter or just its position relative to the camera?

grim coyote
#

Its rendering other client cameras that are connected in the Eden online extension server i'm creating. So those two values are the only ones I send over UDP; position and VectorDir of other player cameras.

#

Example: when a unit is placed in Eden, it renders the units direction below that unit when rotated. However I couldn't find a script example from bi functions, so I guess it's rendered by the engine.

cosmic lichen
granite sky
#

It sounds like you're just looking for getDir _object - getDir _camera

#

Hence if the object is looking east and the camera is looking east, you get 0 as the result.

grim coyote
#

Works if im in front of the unit or behind it however

granite sky
#

It works. I just can't tell what you're trying to do.

digital hollow
grim coyote
digital hollow
#

can you just screenshot a few arrangements and draw the desired direction? πŸ˜…

grim coyote
#

Cant upload screenshots unfortunately πŸ˜…

#

Sure i can get a online link. One sec

#

So for the right unit, the icon should be facing to the right

#

Code used:

    _objects = (get3DENSelected "object");
    {
        _object = _x;
        if (!isNil "_object") then {
            _position = getPosAtl _object vectorAdd [0,0,2];
            _dir = (vectorDir _object);
            _end = _position vectorAdd (_dir vectorMultiply 1000);

            _yawDeg = (_dir select 0) atan2 (_dir select 1);
            if (_yawDeg < 0) then { _yawDeg = _yawDeg + 360 };
            
            _p0 = worldToScreen (_object modelToWorld [0,0,0]);
            _p1 = worldToScreen (_object modelToWorld [0,1,0]);
            _iconDir = vectorDir get3DENCamera getDir (_p1 vectorDiff _p0);

            drawIcon3D [
                "a3\3den\data\cfg3den\camera\cameraTexture_ca.paa",
                [0, 0, 1, 1],
                _position,
                2,
                2,
                _iconDir,
                "test",
                0,
                0.05,
                "PuristaMedium",
                "center",
                true
            ];
        };
    } forEach _objects;
};```
digital hollow
#

oh yes I see. _iconDir = _p1 getDir _p0;

granite sky
#

Is this correct behaviour?

grim coyote
#

Yes!

granite sky
#

That's just getDir _camera - getDir _object. Apparently something is backwards.

grim coyote
#

That works... Thanks so muc πŸ˜„ No idea what went wrong and where, when I was testing things πŸ˜… Pretty sure I even tried that, but guess not

granite sky
#

It doesn't quite point in the direction of the model arrow because it's a plain 2d calc. You'd need the fancier stuff if you wanted that.

digital hollow
#

or just turn on the arrow? xD

granite sky
#

Ah right, icon directions are backwards and 90 degrees points left.

grim coyote
#

This is good enough for now. Maybe ill add the angle, if the camera is pointing upwards or downwards when looking from side later. And as I said earlier, it doesn't have to be 100% correct

grim coyote
#

Well the FOV is propably the biggest reason its going off, but it's more than good enough for now. Don't really care about this kind of things myself that much, for the extension, since there are so many other things that still need to be implemented

broken pivot
#

**Goood evening readers πŸ˜„ **

Im back at functions πŸ˜„ Ive a really good feeling compared to last times.
Im executing my function:

params ["_taskVar", "_taskName", "_taskDescription", "_taskTitel", "_taskState"];

if (isNil str _taskVar
    ) then {
    _taskVar = player createSimpleTask [_taskName];
    _taskVar setSimpleTaskDescription [_taskDescription ,_taskTitel,""];
    publicVariable str _taskVar;
    };
_taskVar setTaskState _taskState;

wiht my remoteExec: remoteScopeTargetPlayerBLUFOR = allPlayers select { side _x == west };

["TestTask", "TestTaskName", "TestTaskDescritpion", "TestTaskTitel", "failed"] remoteExec ["EBER_fnc_RemoteCreateSimpleTask", remoteScopeTargetPlayerBLUFOR,  true];

The problem appears in the second launch when I want to change the TaskState
It simply creates a second task and ignores the isNil

hallow mortar
#

Why are you doing str on something that's already a string?
Doing that just adds more quotes to it. It's possible that interferes with isNil.

errant jasper
#

The variable is never set locally.

#

Only _taskVar is.

broken pivot
#

Explanation:
I always worked around functions and miss basic knowledge. Thanks to @faint burrow for the source to read about.
Can someone (if you want) summarize me some basic needs and donts?

errant jasper
#

The JIP parameter can only be used if the targets parameter is 0 or a negative number.
^ regarding remoteExec

#

For your particular problem here: you are probably missing something like: missionNamespace setVariable [_taskVar, _taskVar] to actually define a global variable that isNil can pick up later.

#

Of course there are other options too, rather than global variable for each task you can use a hashMap and add the taskname as key.

broken pivot
hushed turtle
#

Couple of short strings will only take small amount of RAM

broken pivot
#

Hash maps sounds really usefull but I need to do all side quests. Step by step. So I like the globalize thing to test out.

broken pivot
old owl
#

Only skimmed but I believe the str since he says you're using it on a string

broken pivot
hushed turtle
errant jasper
#

Have to double check, but looks like createSimpleTask does not return string but a Task type. So it is actually a bit problematic you overwrite the variable name you use to track. So instead:

params ["_taskVar", "_taskName", "_taskDescription", "_taskTitel", "_taskState"];

// See if we already stored it
private _task = missionNamespace getVariable _taskVar;
if (isNil "_task") then {
    // No? Then create it.
    // Get task e.g.  _task = TASK
    _task = player createSimpleTask [_taskName];
    _task setSimpleTaskDescription [_taskDescription ,_taskTitel,""];
    // Here you set the var _taskVar="TestTask" in your case, to the task
    // Effectively: TestTask=TASK
    missionNamespace setVariable [_taskVar, _task];
    // This broadcasts TestTask to all other machines. You actually don't want this I think.
    // Task are not really meaningful across multiple machines, and this code already runs across each machine
    publicVariable _taskVar; // << Delete I would say
};
_task setTaskState _taskState;
broken pivot
hushed turtle
broken pivot
errant jasper
# broken pivot Am I using the wrong syntax? Thats not totally clear. Might be language barrier ...

Kinda.. isNil X takes an X that is either a variableName or code (I ignore code here). It checks if that variableName is defined.
So if you want to know whether MyCoolVariable is actually defined or not, you do isNil "MyCoolVariable".
You have _taskVar = "TestTask".
What you want to check is whether there is a variable TestTask. So you need to pass the string "TestTask" to isNil.
str X tries to represent X as a string. When you run str _taskVar you are effectively evaluating to str "TestTask". So str will say, to represent the string "TestTask" as a string I need to wrap it in ", so it will give ""TestTask"".
Then you are thus running isNil ""TestTask"". isNil looks at the string and deduces the variable you want to know if is nil or not is "TestTask" but you are trying to target TestTask.

broken pivot
#

Thanks for long text ill read instant

#

Is remoteExec giving the function the vlaue "TestTask"? Instead of TestTask (what I thought)

errant jasper
#

I fixed my own boobo isNil _task to isNil "_task" above in my code example.

broken pivot
#

I gues it was right without

errant jasper
#

You don't use the return value of remoteExec at all.

broken pivot
#

ufff

errant jasper
#

Well there is no real to do so either so..

broken pivot
errant jasper
#

remoteExec is giving the function the string "TestTask" , which represents the text itself of TestTask.

#

["TestTask", "TestTaskName", "TestTaskDescritpion", "TestTaskTitel", "failed"] remoteExec ["EBER_fnc_RemoteCreateSimpleTask", remoteScopeTargetPlayerBLUFOR, true];
calls your functions such that:

params ["_taskVar", "_taskName", "_taskDescription", "_taskTitel", "_taskState"];
// Effectively means
private _taskVar = "TestTask";
private _taskName = "TestTaskName";
private _taskDescription = "TestTaskDescritpion";
private _taskTitel = "TestTaskTitel";
private _taskState = "failed";
broken pivot
#

Your really a brother from another mother. Thank for that premium explanations ❀️ !

errant jasper
#

I'm off now, happy coding

broken pivot
#

Same to you. I will bring everything down to documentation. There also was many other people that sent in really usefull intel.

cursive tundra
#

do the pine trees on Altis not count under "Tree" in nearestTerrainObjects?

#

i want to detect forests but i cant seem to get the pine trees...

#

i know about selectBestPlaces but this returns forests even if im in the middle of the salt lake

#

can you even get them using SQF?

flint topaz
cursive tundra
#

okay seems like selectBestPlaces is the way to go as nothing else returns something resembling a forested place

cursive tundra
flint topaz
#

You can’t even detect them using nearestTerrainObjects at the global level? Aka no filter?

cursive tundra
#

nope

#

it returns smaller trees, not the pines

#

i can go right next to one and try again

flint topaz
#

Yeah I’d definitely check it fully before giving up.

#

Just do it with sort nearest and ensure the filter array is empty

cursive tundra
#

i stood right next to one, did

_count = count nearestTerrainObjects [player, [], 2];
hint str _count;
hinted 0.

#

array do be empty af

#

but selectBestPlaces works fine for now - and its really fast too, just have to tweak the values for a while...

granite sky
#

You might need more than 2m for that test.

#

Some tree trunks are not at the center of the model.

#

yeah that one needs 5m to detect reliably when you're next to it :/

#

These things are particularly lethal for spawning vehicles, because the trunk is small enough to dodge raycasts and the near objects fallback also misses it due to the offset.

cursive tundra
#

ill try again

#

nope - it only detects the small trees, not the large ones

#

in the middle of the forest, 10m radius, it returns 2 found trees, 2 small pines, none of the dozens of large ones

#

and a stone.. i think

granite sky
#

Can you point out a large one on the map, because I'm only seeing one size :P

cursive tundra
#

ofc, small ones in red, large ones in blue :p

granite sky
#

Yeah I think I have it down. t_pinuss2s_b_f.p3d is the larger one, t_pinuss2s_f.p3d is the smaller one?

cursive tundra
#

i dont know , hard to check

granite sky
#

The model centers are awful for both. Need 6m at some angles.

#

cursorObject works.

cursive tundra
#

im on 10m radius rn

#

even on the large one?

granite sky
#

hmm, I wonder if 2d mode matters for the detection as well as the order.

#

They stick some of them way underground.

#

Ah yeah, 2d mode is much better.

cursive tundra
#

2D mode wont return the big ones either πŸ™

#

find sthe smaller one 10m away tho

granite sky
#

Can you point at one and check the model with cursorObject

#

Because I'm still not sure that I'm looking at the right trees.

cursive tundra
#

big one

#

small one

granite sky
#

yeah there are at least three then :P

#

All three seem reliable with 3m + 2d mode for me.

cursive tundra
#

okay on 9m i got one

granite sky
#

Are you sure you're on 2d mode :P

cursive tundra
#

uhm

#

yes ofc haha i didnt set sort to true nope

#

ill have to retry my script with 2d mode on

#

maybe it works now.. cause it found some, but in the plains, not on the hills where i tested it

granite sky
#

Yeah without 2d mode it depends on how far down they put the tree.

modern plank
#

Hello, I fail to make a bot sit down on a chair in MP (works on local server, not on the dedicated).

Here is the code executed during the init:

if (isServer) then {
  0 spawn {
    sleep 5;
    BOT_6 disableAI "MOVE";
    BOT_6 attachTo [chair, [0,0,-0.5]];
    BOT_6 switchMove ["HubSittingChairUC_idle1"];
  };
};

switchMove is GE in the doc, so.... any obvious mistake?

warm hedge
#

Either attaching to the chair or not switchMove being LE

modern plank
#

Both are GE in the wiki. Will remoteExec though.

little raptor
#

are you sure BOT_6 is local to the server?

modern plank
#

There is no HC and it is a not playable bot.

little raptor
#

well still better check it to be 100% sure

modern plank
#

I will remoteExec on his owner yes

little raptor
#

did you run enableSimulation false on the chair btw?

acoustic abyss
#

I have an easy question-
My aim is to get a randomized (UAV) patrol within a given marker area.
If I run:

[(group opfordrone), getMarkerPos "marker_0", 200] call BIS_fnc_taskPatrol;

Then a single set of waypoints is repeated. See timestamp along top of screenshots.

What is an easy way of checking that the group has completed the waypoints, so that BIS_fnc_taskPatrol can run again?

tulip ridge
#

Should be able to just add a new cycle waypoint at the end though if you don't/can't use cba

hallow mortar
acoustic abyss
#

Sorry for the late response. Discord restricted me for 3 hours without explanation.
@tulip ridge thank you for the suggestion! Although I want to make this mission addon free, I will test this.
@hallow mortar to be clear; I don't want it to cycle the same waypoints. I want it to make new random waypoints in the area after the current array has been completed. On the mission time along the top of the screenshots, you'll see that they're all the same waypoints. I sped it 4x and waited to get these results.

I attempted to create a kind of loop using the event Handler WaypointComplete for my UAV opfordrone:

[(group opfordrone), getMarkerPos "marker_0", 200] call BIS_fnc_taskPatrol;

(group opfordrone) addEventHandler ["WaypointComplete", 
    { 
        [_group, getMarkerPos "marker_0", 200] call BIS_fnc_taskPatrol
    }
];

The result is now that when the unit completes the waypoints, it goes back and forth between the last 2 waypoints.
Is there an straightforward way of creating a new array of waypoints?

tulip ridge
modern plank
faint burrow
faint burrow
modern plank
# faint burrow AFAIR, you should wait for mission start.

It is the case, but still failing with:

if (isServer) then {
  waitUntil { time > 0 };  
  ["Sit down planned!"] remoteExec["systemChat",0];   << executed once in game
  0 spawn {    
    sleep 10;
    ["Sit down NOW!"] remoteExec["systemChat",0];  << executed once in game +10s
    BOT_6 disableAI "MOVE";
    BOT_6 attachTo [chair, [0,0,-0.5]];
    [BOT_6,"HubSittingChairUC_idle1"] remoteExec ["switchMove",BOT_6];
  };
};

The bot is successfully attached to the chair (it has been moved) but..... still stands up.

hallow mortar
#

try disableAI "ANIM" instead of "MOVE"

modern plank
#

(it works on the local EDEN server, issue happens only on the dedicated, so I am not sure to see the link)

hushed turtle
#

Is BOT_6 local?

hallow mortar
#

If this is an Editor-placed AI, not in a player group, then it will be local to the server (and this code is only running on the server)

hushed turtle
#

Strange to first check if code runs on server and then remote execute something on server, when you've just checked you are on server

modern plank
#

not playable bot placed into the editor.

modern plank
#

it works locally....

hallow mortar
#

I think you should try disableAI "ANIM" instead of "MOVE"

modern plank
#

test on-going... (doing both)

hushed turtle
#

With disabled ANIM, unit can't even switch weapons. so that could work

modern plank
#

nope, on the dedicated the "attachTo" works, because the bot stands up aside the armchair at the beginning, it is moved.... but switchMove just does nothing.

#

with that:

if (isServer) then {
  waitUntil { time > 0 };  
  ["Sit down planned!"] remoteExec["systemChat",0];   << executed once in game
  0 spawn {    
    sleep 10;
    ["Sit down NOW!"] remoteExec["systemChat",0];  << executed once in game +10s
    BOT_6 disableAI "MOVE";
    BOT_6 disableAI "ANIM";
    BOT_6 attachTo [chair, [0,0,-0.5]];
    [BOT_6,"HubSittingChairUC_idle1"] remoteExec ["switchMove",BOT_6];
  };
};
#

I really think switchMove is not GE

#

trying with remoteExec 0

hushed turtle
#

Wiki says it's LA

modern plank
#

ya, okay for the argument, but the effect is not global I think: LE instead of GE

hushed turtle
#

You can try to remote exec everywhere and see

modern plank
#

because of this comment too.... why remoteExec if GE?

hallow mortar
#

Don't just read the examples, but also the text explaining why, at the top of the page

modern plank
#

It says the contrary in the description: ``This command has a global effect when executed locally to the unit and will synchronise properly for JIP.`

#

Ah, I misunderstand what while on remote machines it will be transitional means.

#

I don't care if it takes a few additional seconds...

#

Works on dedicated with remoteExec 0. The GE which is not GE.

little raptor
#

it is GE. if it's not syncing then something is blocking it

#

try without attachTo

#

and your remoteExec is wrong. it should be

[BOT_6, ["HubSittingChairUC_idle1"]] remoteExec ["switchMove",BOT_6];
modern plank
#
if (isServer) then {
  waitUntil { time > 0 };  
  ["Sit down planned!"] remoteExec["systemChat",0];   << executed once in game
  0 spawn {    
    sleep 10;
    ["Sit down NOW!"] remoteExec["systemChat",0];  << executed once in game +10s
    BOT_6 disableAI "MOVE";
    BOT_6 attachTo [chair, [0,0,-0.5]];
    [BOT_6,"HubSittingChairUC_idle1"] remoteExec ["switchMove",0]; << works perfectly even with Syntax 1 ;)
  };
};
hallow mortar
agile pumice
#

quickest way to generate a random letter?

#

figured i could just do floor random 27 and then somehow convert the output to a letter somehow

jade abyss
#

toString ?

old owl
#

Okay so throughout this whole endeavor I've been on to add linting to our repo, I've encountered an interesting error:

warning[L-S12]: Invalid argument type for `[B:lnbSetValue]`
    β”Œβ”€ addons/project.Altis/folder/folder/fn_file.sqf:634:31
    β”‚
634 β”‚             _ctrl lnbSetValue [[_rowIdx, 0], _stringValue];
    β”‚                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^ type not expected
    β”‚
    = note: found    Array[(Array[(Number), (Number)]), (String, Array)]
            expected Array[(), (Number)]

For some odd reason (likely oversight) we are using a string for that last argument. The wiki link for the command says it only takes a number, so I'd expect for this to script error with an unexpected type. It doesn't appear to though. Is there an intended string syntax for this, or does the command just not check it's type? What happens in the case of it being passed a string?

#

Might be something for #arma3_feedback_tracker but just wanna confirm there isn't some additional syntax I am not aware of.

#

Well, looks like we never lnbValue so that's how it's never been caught...

#

No idea why on earth we were doing that πŸ₯€

#

Guessing that syntax for it isn't valid though?

errant jasper
#

Syntax looks fine, but you have to pass number not string value?

old owl
#

Yea that's what I am confused about. No idea why we pass a string, but there is no unexpeced type error that comes from using a string for that argument.

errant jasper
#

Maybe you wanted lnbSetData ?

old owl
#

You're probably right. Looks like we do use lnbData but the file is 1800 lines long and not very well written / documented so kinda difficult to see what controls we are using those commands on πŸ₯²

errant jasper
#

Value is used in sorting via lnbSortByValue.

#

Though data and text can be used via lnbSortBy.

old owl
#

I'm aware I've made ListNBox before. Just saying the file is a shit show and I don't really feel like looking lol.

errant jasper
#

Yeah, gotta, say a function with 634 lines named fn_file.sqf that is then dealing with UI does sound hella sus

#

πŸ˜…

old owl
#

Yea, it's because it's a placeholder- I am under NDA for the project I commit to so I just tend to rename file / var names prior to dropping here notlikemeow

#

Unfortunately the file is 1798 lines in total meowtrash

agile pumice
#

ummm

#

okay, so toString[97] to toString [122] is a-z

#

how can I select from this range?

tulip ridge
#

If that's ace arsenal, it just means it's favorited

#

You can favorite items (shift + double left click) and then there's a button at the bottom to only show favorited items

sharp moth
#

aaah

#

thanks!

agile pumice
#

nvm working on it

cursive tundra
#

i have a performance question - i now have a script now to detect forests. it returns an array of positions deemed "sufficiently foresty" or something.
it works by counting nearestTerrainObjects "TREE" and "BUSH", and calculates the density of these in cells.
the problem is, its pretty performance heavy, so i wanted to run it once on my machine and store the output as array to put directly in the mission files

#

however, for all of Altis, this Array is going to be like thousands of positions i think... ive never used an Array that big.
the plan is to use the positions for an AI script that uses them to plan pathing, combat positions etc., probably by checking if any positions of the array are in the Area the AI operates in (prob not larger than 2x2km each)
is this feasible?

#

or would it be maybe faster to run the script every time i need the positions but only for the 2x2 km area

errant jasper
#

Depends a lot on how would use it, how often you would use it, and what the resolution of your grid is.

tender fossil
#

HashMap as a data structure maybe...?

errant jasper
#

A 20x20km map into 100x100m grid is 40000 entries which is doable.

#

And that is without considering water being half of it.

#

But again all depends. I assume you aren't running only one nearestTerrainObjects search for a 2km x 2km area

jade abyss
#

With 1.55 you can select the range in random

cursive tundra
#

no, i have to run multiple.. i want to make the terrain somewhat "readable" for my AI script, so im checking for elevations, urban areas, forests and roads for now

#

the most intensive are elevation and forests so far

errant jasper
#

Been a while since I used getTerrainHeight, but don't really it being that heavy. (takes me 50ms for 100x100 grid over Altis. Server cpu, maybe double?)

#

precomputing is of course cheaper, but you lose some "dynamism" like bulldozing of forest, or players building huge fobs changing the "forestry" and "urban" values.,

jade abyss
cursive tundra
#

thats not really in the scope of whats planned - its more a RTS type scenario with both sides having their bases already and using High Command.
Im mainly working on getting a computer controlled enemy set up, which doesnt have to be super smart or anthing but should maybe not send its tanks in the cities or forests, hide its units in forests, and put observers on hills etc., so i need some terrain readings for it

errant jasper
#

Well I say precomputing a grid would depend on resolution. Like this counts up trees in 100m grid squares and takes ~670ms for me:

private _trees = nearestTerrainObjects [[15000, 15000], ["TREE"], 15000, false, true];

treeCount = [];
treeCount resize (330*330);
{treeCount set [_forEachIndex, 0]; } forEach treeCount;
{
   private _pos = getPos _x;
   private _x = floor ((_pos select 0) / 100);
   private _y = floor ((_pos select 1) / 100);
   private _idx = _x + _y * 330;
   treeCount set [_idx, treeCount # _idx + 1];
} forEach _trees;

This is without bushes.
The question is whether this resolution is good enough for you, for say placing observers, etc.

#

A resolution below 30m is getting pretty costly.

jade abyss
#

atm:
_Letter = (round(random(25))+97;
e.g. (97+(0-25))

cursive tundra
#

i mean, it would be fine, i could use the precomputed positions to check if even any forests are near my units, and then take the closest "forest" and find a more precise precision using a far smaller area check around the selected "forest"

#

its more about having a point to even start off from - ive never done anything as complex as im currently trying to do before, so a lot will be trial and error to see if its good enough

errant jasper
#
comment "Map config";
private _mapWidth = 30720;
private _mapHeight = 30720;
private _resolution = 100;
private _longAxis = (_mapWidth / 2) max (_mapHeight / 2);

comment "Find trees";
private _treeBushes =  nearestTerrainObjects [[_mapWidth / 2, _mapHeight / 2], ["TREE", "BUSH"], _longAxis, false, true];
private _treeCounts = [];

comment "Count trees";
private _xNumCells = ceil (_mapWidth / _resolution);
private _yNumCells = ceil (_mapHeight / _resolution);
_treeCounts resize (_xNumCells * _yNumCells);
{_treeCounts set [_forEachIndex, 0]; } forEach _treeCounts;
private _maxSample = 1;
{
   private _pos = getPos _x;
   private _xCell = floor (_pos # 0 / _resolution);
   private _yCell = floor (_pos # 1 / _resolution);
   private _idx = _xCell + _yCell * _xNumCells;
   private _count = (_treeCounts # _idx) + 1;
   _treeCounts set [_idx, _count];
   _maxSample = _maxSample max _count;
} forEach _treeBushes;

comment "Visualize trees";
private _halfRes = _resolution * 0.5;
for "_yCell" from 0 to (_yNumCells - 1) do {
   for "_xCell" from 0 to (_xNumCells - 1) do {
      private _idx = _xCell + _yCell * _xNumCells;
      private _x = _xCell * _resolution + _halfRes;
      private _y = _yCell * _resolution + _halfRes;
      private _mrk = createMarkerLocal [format ["TS_%1_%2", _xCell, _yCell], [_x, _y]];
      _mrk setMarkerShapeLocal "RECTANGLE";
      _mrk setMarkerSizeLocal [_halfRes, _halfRes];
      private _intensity = (_treeCounts # _idx) / _maxSample;
      private _color = format ["#(%1, %2, 0, 0.6*%2 + 0.2)", 1 - _intensity, _intensity];
      _mrk setMarkerColorLocal _color;
   };
};

Well this is a starting point to look at. I used comment instead of // so you can paste it in debug editor. Takes a couple of seconds to run though.

agile pumice
#

i went with something different

#

for [{_i=97}, {_i<123}, {_i=_i+1}] do {
_arr pushBack _i;
};

#

thanks though

lone glade
#

selectRandom is also faster than any other option for choosing a random value in an array btw

hushed turtle
#

Any way to pull up player's weapon when he holds his weapon down?

hallow mortar
#

I do not know that this will work, but you could try playActionNow with "WeaponOn" or "Combat"

hushed turtle
#

"Combat" does it

#

"WeaponOn" switches to launcher and back to primary, even you don't any launcher at all πŸ˜€

keen furnace
#

Hello, I'm doing a Moon mission and I remember that there is a way to use a trigger to set everyone's global sound to extremely low, to mimic the lack of sound travelling in the void. How would I go about this?

#

Ideally it should be local to each individual player. Will "5 fadeSound 0.1;" work in a trigger on activation?

versed ledge
#

Is there a function to add when spawning a boat rack to include a boat in the rack?

proven charm
hallow mortar
#

Boat racks are ViV, there's no need for attachTo

cursive tundra
errant jasper
#

Hmm should "only" take (4+) times longer.

#

Ah, it is probably the amount of markers being created making it extra slow maybe.

#

Yeah, marker increasing the timer.. Without markers 100 to 50 goes from 2.5s to 3s with bushes taking much of the time. With markers it its 3.2 to 4.9s when going from 100 to 50

#

But this is hardly a problem if you go the precompute way.

#

There are also other tricks. Rather than more fine resolution, you can do two more coarse resolution offset by half a grid from each other. Then Each "small" grid can be defined by, say, averaging the overlapping coarse grids.

cursive tundra
#

mhm - idk why but for me it wouldnt even finish after minutes

#

weird

errant jasper
#

? I ran it on Altis. Are you running the script in scheduled environment?

#

I just ran it debug editor

#

of course locked the game for couple of seconds

cursive tundra
#

copy pasted into debug console

errant jasper
#

am running CBA in the background, but none of this is cachable function definitions so shouldn't matter.

#

even 25m res finishes in 12s. Though map starts to lag with all the markers (which makes sense since there is now literally more than 1 million of them)

cursive tundra
#

im gonna throw out all the mods and try again

#

way faster now

errant jasper
#

Though that is really odd, because if you run it in debug console using "local exec" in the editor even, other mods "shouldn't" affect it since the scripting engine is essentially "locking" the game while it is forced to run.

If you could pin down what mod is affecting this much, I think many would like to know.

cursive tundra
#

something in my modlist is mining bitcoins ugh

errant jasper
#

^^ "well kinda". As written before if you find out what mod that is, would be curious to know.

cursive tundra
#

ill start investigating

granite sky
#

I guess if it's firing an EH when markers are created?

errant jasper
#

Yeah, that is the only reasonable explanation, since no other behavior is really observable from that piece of code.

cursive tundra
#

i narrowed down the list of suspects already i think

errant jasper
#

Adding ACE3 to the mix takes the 25m res from 12s to 17s. I guess ACE mod has some good reasons to track, and is not doing it with "negligent efficiency", so must be something else grossly increasing the runtime.

cursive tundra
#

i think its hiding among these

#

well, not the sound mod

#

and rhs

errant jasper
#

I would be most suspecting of Enhanced Map and Zeus Enhanced

#

Never used either, but based on name and assumed functionality

#

For development, you can also just not create the markers, or most of them, or temporarily disabled the guilty mod if possible. You are not going to show half a million markers during actual gameplay anyway.

cursive tundra
#

i think Zeus Enhanced is the culprit

#

if so, no biggie, i only need that when its in MP anyway

granite sky
#

IIRC deleting markers was O(n) with the number of markers created, so spamming them is a bad idea in general.

cursive tundra
#

yeah i only need them in the testing phase so i can see if the terrain analysis scripts work properly, they wont be created when the mission is played

#

just for debugging

#

yeah its zeus enhanced, i removed it, executed in seconds, added it again - locked out of the game for ages

#

idk why it does that, but deactivating it is a sacrifice i am willing to make

granite sky
#

Just checked the source, looks like it creates a UI control for each marker created.

#

Well, if this shit is true anyway:

markerShape _marker in ["RECTANGLE", "ELLIPSE"]
&& {GVAR(blacklist) findIf {_x in _marker} == -1}
&& {GVAR(editableMarkers) == EDITABLE_MARKERS_ALL || {QUOTE(ADDON) in _marker}}
#

GVAR(editableMarkers) is probably a CBA setting?

errant jasper
#

Looks like just a global variable

#

namespace to the mod and component

#

so something like zen_area_markers_editableMarkers

granite sky
#

Yes but that means it's probably a CBA setting :P

errant jasper
#

Ah, yeah.

#

Noticed there is also per frame handlers over GVAR(markers) that it is added to.

cursive tundra
#

so no bitcoing mining ingame`? great

#

the fact that it took me ages to run scripts like this even led to the idea of precomputing it all... damn

granite sky
#

Set that to "Zeus created only" and you're probably good. Although it might still be a bit slower.

cursive tundra
#

for mission making i dont need ZEN anyway - its only to use its tools ingame when we are playing so i can do stuff in Zeus if needed

granite sky
#

That functionality's pretty funny in Antistasi because they install it in postInit, which tends to run parallel with our marker creation. So sometimes you get marker icons spammed all over Zeus, and sometimes you don't.

agile pumice
#

doing that πŸ˜ƒ

versed trail
#

Is there any way to detect mines placed in the editor? vehicles, allMines, and 8 allobjects 6 all dont seem to work

fair drum
old owl
#

Another HEMTT question for anyone who may know:

Right now my SQF and String Table linting apears to be doing great. However nothing from the configs section:
https://hemtt.dev/lints/config.html

Appears to be bringing up linter errors when it should. I have everything in that page listed as enabled in my lints.toml. Is there anything anyone can think of why lints like [config.missing_semicolon] would not be working for me and what I might be doing wrong?

old owl
round hazel
#

Hey chaps, very silly question. Is there a way to spread out this script over multiple lines?

#

It continues on a little past the section in the image

sly cape
round hazel
#

Much obliged. I had hope there would be an easy work around, like multiline strings or something. I'll suffer with having to scroll until I have the energy to write a function lmao 🀣

digital hollow
#

You can turn on text wrap in your editor

tulip ridge
fallen crow
#

This is an Arma 3 script which creates a role based whitelisted for ACE, vanilla,
or mods Arsenal from one shared ammo box. Multiple boxes can be used for specific roles,
regardless only units defined in the script with specific classnames will see only
weapons, magazines, uniforms, vests, backpacks, items, and gear
whitelisted for that parti...

β–Ά Play video
honest spear
#

Is there any easy way to add prefixes to slots chosen from the selection screen? I'm using DUI Radar and would like to add ''rank'' like prefixes ppl's names in the list. Sort of like the img.

#

Yes I could make everyone add these to their names, but I'd prefer to add them to the roles they've chosen if that makes sense.

digital hollow
#

DUI has a variable you can set for that name, check the github wiki

fading gorge
#

what text editors are people using? i just downloaded visual studio code, it's beautiful. might finally replace notepad++

honest spear
#

I did, but that shows up when looking at the player, I tried the other methods but it replaces the players actual name. Unless I did something wrong but I don't think so.

lone glade
#

atom here, how is VS code ? I have the beta installed, not tried yet.

warped thicket
#

Atom here as well

round hazel
hushed turtle
#

I thought I could find these editor unit names in config, but I wasn't able to. Is there a way to find and read them in sqf? From any object during mission runtime

warm hedge
#

getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName")
Or simply
getText (configOf _unit >> "displayName")

hushed turtle
#

Thanks. I missed displayName somehow

bleak valley
hushed turtle
#

"6Rnd_155mm_Mo_AT_mine" magazine has "AT_Mine_155mm_AMOS_range" shells

bleak valley
#

thanks, but it doesn't work
I guess it's not about the shell, but the effect

knotty totem
#

Greatings, i'm trying to reproduce the lighting effect applied on the watch when showing up on screen. I've tried with a createDisplay and createDialog using a RscObjects linked to the vanilla watch object. Tho it doesn't work at all (see 2nd vid)

The final goal is to reproduce the effect on an phone

#
class MyWatch
{
    idd = -1;
    class objects
    {
        class Watch
        {
            access = 0;
            shadow = 0;
            idc = 101;
            type = 80;
            model = "a3\ui_f\objects\watch.p3d";
            selectionDate1 = "date1";
            selectionDate2 = "date2";
            selectionDay = "day";
            x = 0.7;
            xBack = 0.7;
            y = 0.12;
            yBack = 0.12;
            z = 0.22;
            zBack = 0.22;
            inBack = 0;
            enableZoom = 0;
            direction[] = { 0, 0, 1 };
            up[] = { 0, 1, 0 };
            zoomDuration = 1;
            scale = 0.7;
            waitForLoad = 0;
#
            class Animations
            {
                class WatchHour
                {
                    type = "rotation";
                    source = "clockHour";
                    selection = "hodinova";
                    axis = "osa";
                    memory = 1;
                    animPeriod = 0;
                    angle0 = 0;
                    angle1 = "rad 360";
                };
                class WatchMinute
                {
                    type = "rotation";
                    source = "clockMinute";
                    selection = "minutova";
                    axis = "osa";
                    memory = 1;
                    animPeriod = 0;
                    angle0 = 0;
                    angle1 = "rad 360";
                };
                class WatchSecond
                {
                    type = "rotation";
                    source = "clockSecond";
                    selection = "vterinova";
                    axis = "osa";
                    memory = 1;
                    animPeriod = 0;
                    angle0 = 0;
                    angle1 = "rad 360";
                };
            };
        };
    };
};```
#

(same as the example from BI documentation)

warm hedge
#

useGlobalLight=1; under class Watch

tepid gulch
#

Hello all noob question, but how do i stop my tasks module on dedicated server side to keep popping up whenever someone joins in or disconnect even when the tasks are done they still keep popping off to show, do I need to check the server only tab? or did I do something wrong?

knotty totem
#

does it have something to do with the way I load the objet ? createDialog/createDisplay

#

I can't figure out how the vanilla watch is shown up

tulip ridge
#

Its a cutRsc iirc

knotty totem
#

i don't get it at all ahah, here's with the cutRsc which has light effect but not the same as the vanilla watch

#
class MyWatch {
    idd = -1;
    name= "MyWatch";
    movingEnable = false;
    enableSimulation = true;
    duration = 10;

    class objects
    {
        class Watch
        {
            shadow = 1;
            idc = 101;
            type = 80;
            model = "a3\ui_f\objects\watch.p3d";
            selectionDate1 = "date1";
            selectionDate2 = "date2";
            selectionDay = "day";
            x = 0.7;
            xBack = 0.7;
            y = 1;
            yBack = 1;
            z = 0.22;
            zBack = 0.22;
            inBack = 0;
            enableZoom = 0;
            direction[] = { 0, 0, 1 };
            up[] = { 0, 1, 0 };
            zoomDuration = 1;
            scale = 1.5;
            waitForLoad = 0;
            useGlobalLight=1;
            class Animations
            {
                class WatchHour
                {
                    type = "rotation";
                    source = "clockHour";
                    selection = "hodinova";
                    axis = "osa";
                    memory = 1;
                    animPeriod = 0;
                    angle0 = 0;
                    angle1 = "rad 360";
                };
                class WatchMinute
                {
                    type = "rotation";
                    source = "clockMinute";
                    selection = "minutova";
                    axis = "osa";
                    memory = 1;
                    animPeriod = 0;
                    angle0 = 0;
                    angle1 = "rad 360";
                };
                class WatchSecond
                {
                    type = "rotation";
                    source = "clockSecond";
                    selection = "vterinova";
                    axis = "osa";
                    memory = 1;
                    animPeriod = 0;
                    angle0 = 0;
                    angle1 = "rad 360";
                };
            };
        };
    };
};```
#

that's the ressource

#

i tried this parameter minGlobalLightIntensity = 0; 0/1, which changed nothing

ivory lake
#

I'm interested in this too as useGlobalLight never returned similar results to the compass/watch

#

in my attempts

slim trout
#

Hello again. Im trying to learn from a firing range script by one of the communities. Trying to reproduce the script myself, but looks like I cant move forward after encountering this problem:

14:33:39 Error in expression <];
_x animate ['terc', 1];

_test100 = [targets100trigger,getPosAtl _x] call BIS>
14:33:39   Error position: <targets100trigger,getPosAtl _x] call BIS>
14:33:39   Error Undefined variable in expression: targets100trigger ````
#

part of the code error is about:

_x animate ['terc', 1];
_test100 = [targets100trigger,getPosAtl _x] call BIS_fnc_inTrigger;
lone glade
#

do you have a trigger called targets100trigger or a variable named that ? because you don't.

knotty totem
#

Mmh interesting

#

what about cutObjinstead of cutRsc? might fix the issue

slim trout
#

i got a trigger called that

lone glade
#

make sure the name is right

slim trout
#

targets100trigger

#

copy-pasted from the editor

#

Hmm, its weird. Tried changing the name of the trigger and another error popped out of the same line:

#

_test100 = [100trigger,getPosAtl _x] call BIS_fnc_inTri>
14:43:19   Error position: <trigger,getPosAtl _x] call BIS_fnc_inTri>
14:43:19   Error Missing ] ````
#

_test100 = [100trigger,getPosAtl _x] call BIS_fnc_inTrigger;

tulip ridge
#

I'm also trying to set up some of the model ui stuff, cutObj says it takes a class from CfgTitles, but wiki doesn't have any examples of the class structure, nor are there any classes in it ingame

#

So none of the examples on cutObj work, you just get an error saying that CfgTitles.Sphere (or whatever class) doesn't exist

tulip ridge
knotty totem
#

Couldn't we find the userAction config of the watch? to find the function which could help decrypting this

tulip ridge
#

Okay cool, I just had noticed that it was a different file path

tulip ridge
verbal shoal
#

hey yall need some help, I was able to force the vanilla ejection seat scripts (fn_planeejection.sqf and related sqfs) onto my helicopter based vehicle. It was working great and last night just used in our operation.

However im running into an issue where anyone thats not the pilot can press eject and it ejects the pilot lol. Im not super sure why and im not super versed in scripting so any and all help would be greatly appreciated!

#

for reference on the fn_planeejection.sqf i had to delete lines 270-272 to bypass an animation that required special mempoints that the helicopter based vehicle doesnt have (nor do i have access to add them)

hallow mortar
verbal shoal
winter rose
#
player == driver this && { speed this > 1 };
cursive tundra
#

okay quick question - why does {player reveal [_x,4]} forEach units east; not reveal the tanks on the map too? only the infantry shows when i look at the map?

hushed turtle
#

Maybe you need to reveal vehicles too?

wicked vale
#

try replacing getposatl _x with just _x

granite sky
#

Yeah, units is specifically "units". Which is not defined anywhere on the wiki :P

#

but in general, humanoid soldiers with an AI brain.

cursive tundra
#

this does leave the question: how do i get all the vehicles belonging to a side?
i thought something like

private _allUnitsKnown = units _enemySide select {_side knowsAbout _x > 0};
private _enemyIFVsInAO = _allUnitsKnown select {_x isKindOf "Tracked_APC" == true};

would work but if units doesnt return vehicles this is not viable

#

i thought crewed vehicles might count as units of their own but that doesnt seem to be the case then

granite sky
#

vehicles select { side _x == _enemySide } probably does what you want.

cursive tundra
#

but this would also return uncrewed vehicles still assigend to a group, right?

hushed turtle
#

There is crew, which returns crew of vehicle

cursive tundra
#

okay so need to check if its still crewed seperately

#

no point in giving orders to a detracked tank whos crew has bailed 10 hours ago lol

cursive tundra
#

oh? then thats good news, less work

#

i thought theyd still count until unassigned, as AI also engages empty vehicles belonging to a group

granite sky
#

oh hmm

hushed turtle
#

I know why, empty vehicles are civilian side 🀣

granite sky
#

addVehicle doesn't change the side but the side sticks after they've entered and left. Weird.

cursive tundra
granite sky
#

Probably a bug :P

cursive tundra
#

i will find out

granite sky
#

leaveVehicle does reset it.

cursive tundra
#

yeah that should unassign it from the group - i think it keeps its side as long as it still belongs to a group

granite sky
#

Oh well. Filter for actual crew if you need to.

cursive tundra
#

groups will return to their vehicle if a waypoint is far away so it makes sense

granite sky
#

Well, the broken bit is that it doesn't change the vehicle side just from addVehicle.

cursive tundra
#

oh - that could lead to weird stuff if u assign a previously enemy vehicle to a new group of a different side... will they blow it up if they get to it lol?

granite sky
#

It works second time :/

cursive tundra
#

if a crew bails out, is it like leaveVehicle so the vehicle gets unassigned or is it like unassignVehicle, so they side wont change?

verbal shoal
#

does anyone have a script (or know how) that allows passengers to do ace medical in vehicles (ie being able to open someones medical menu and do medical on them)

sly cape
verbal shoal
#

but im realizing i dont have it added on the config lmao

tulip ridge
#

It's added to all vehicles, it's only not there if you didn't inherit (or inherit correctly)

tulip ridge
knotty totem
#

but if we can sort things out and make it work that's would be great!

warped hornet
#

Hello, I am trying to attach objects to a helicopter however the helocopter is (presumably) detecting these and continuously flying upwards to try and match height, does anyone know if theres a way for me to tell the helicopter to ignore the objects?

tulip ridge
#

Would like to know if you find how, I had the same issue when trying to have AI helocast boats a long while ago

proven charm
#

do simpleobjects work better for that?

tulip ridge
#

I think I tried as a test and it didn't work any better

proven charm
#

ok

proven charm
#

is it possible to make the other plane not flicker with this code? ```addMissionEventHandler ["EachFrame",
{

_p = theplane;

_p2 = vehicle player;

_fpos = (getposASL _p2) getPos [15, getdir _p2 - 90];
_fpos set [2,getposASL _p2 # 2];

_p setVelocityTransformation [getposASL _p, _fpos, velocity _p, velocity _p2, vectorDir _p, vectorDir _p2, vectorUp _p2, vectorUp _p2, 1];

}];```They are supposed to fly in formation. Im just playing with this so nothing serious πŸ˜„

#

screenshot

winter rose
proven charm
winter rose
#

dangit

#

but what do you call "flicker"?

proven charm
#

the left plane nudges sometimes

winter rose
#

no need for setVelocityTransformation (given you only use it with 1), go straight setPosASL / setVectorDirAndUp?

digital hollow
#

Try Draw3d instead of Each frame as well

proven charm
#

ok i could try that but i thought there could be real flight feel in the plane

proven charm
digital hollow
#

Alas. Could also try addForce to correct the ai pilot xD

proven charm
#

well doesnt matter was just a test. they are flying alright in the formation

little raptor
#

and don't use getPosASL

#

use getPosWorldVisual

#

be sure to pass the origin to setVelTrans

proven charm
#

ok i set everything to visual commands but still same problem

little raptor
#

your _fPos is nonsense. use vectors

proven charm
#

i thought i did πŸ€”

little raptor
#

well actually you use position so I guess that's not a huge problem

proven charm
#

new code but not working good (actually worse) ```sqf
addMissionEventHandler ["EachFrame",
{

{
_p = _x;

_p2 = vehicle player;

_fpos = (getPosWorldVisual _p2) getPos [17 + (floor (_forEachIndex / 2)), getdir _p2 - ([90,-90] select (_forEachIndex mod 2))];
_fpos set [2,getPosWorldVisual _p2 # 2];

_p setVelocityTransformation [getPosWorldVisual _p, _fpos, velocity _p, velocity _p2, vectorDirVisual _p, vectorDirVisual _p2, vectorUpVisual _p2, vectorUpVisual _p2, 1, [0,0,0]];

} foreach formPlanes;

}];

#

sorry for the long lines πŸ˜‰

little raptor
#

you're still using getposasl

#

and like I said you need to provide the model center to setVelTrans

proven charm
#

ah forgot getPosWorldVisual

#

same prob, updated code above. guess i need that model center

little raptor
#

[0,0,0]

proven charm
little raptor
#

yeah

proven charm
#

ah ok

#

still no good . updated code

little raptor
#

does it flicker in MP or SP?

proven charm
#

editor, SP..

little raptor
#

are you running the code once btw?

#

that's a stacked EH

proven charm
#

yes init.sqf

winter rose
#

(why not something like this btw?)

addMissionEventHandler ["EachFrame",
{
  private _lead = vehicle player;
  private _leadWorldPos = getPosWorldVisual _lead;
  private _dirAndUp = [vectorDirVisual _lead, vectorUpVisual _lead];
  
  {
    private _offset = /* your calculations */;
    _x setPosWorld (_leadWorldPos vectorAdd _offset);
    _x setVectorDirAndUp _dirAndUp;
  } foreach formPlanes;
}];
proven charm
#

i thought setVelocityTransformation was the way. but i should try Lous way too, i guess...

winter rose
#

less code, less chance to make a mistake :p (but they will be wilder, believe me xD)

errant jasper
#

How well does a local EachFrame event handler handle such "forced position/orientation updates" in MP? I thought the benefit of setVelocityTransformation was that since it has parameters like velocity and includes both start and destination, that it would smooth better across network for non-local clients ?

proven charm
#

thx all, Lous code works very well πŸ™‚ at least in SP

errant jasper
#

I mean yeah, it's running each frame on that machine.
You literally can't miss a frame update.

#

Was thinking more whether there was a significant quality between rendering if in MP someone else is sittting 140ms away with 15% packet drop.

proven charm
#

setVelocityTransformation seems to be optimized for MP. reading the wiki here

versed ledge
#

Not sure if anyone can help or not, but I'm trying to spawn a module with a script and hitting a wall. The script spawns an LPD, a combat boat cradle in the pit area, a combat boat in the cradle cargo, and the EF module to transport the boat back into the cradle. Everything works except the module functions in game. No errors. This is the section about the module if anyone has time to think about it.

//Create Logic Position To Base Recorvery Module Location On

_cradleLogicPOS = _lpd1 modelToWorld [-41.8096, 15.3857, 0];
_cradleLogicGroup = createGroup sideLogic;
EF_ModuleCradle = objNull;

//Create EF Module To Recover Boats
"EF_ModuleCradle" createUnit [
    _cradleLogicPOS, 
    _cradleLogicGroup, 
    "this setVehicleVarName 'EF_ModuleCradle'; EF_ModuleCradle = this; publicVariable 'EF_ModuleCradle';"
];

waitUntil { !isNull EF_ModuleCradle};
sleep 0.1;

EF_ModuleCradle synchronizeObjectsAdd [_crack1];
EF_ModuleCradle setVariable ['EF_moduleCradle_showHelper',true];
[EF_ModuleCradle, nil, true] call BIS_fnc_moduleInit;```
errant jasper
#

Well you create the module but bind the variable to this.

You probably meant: EF_ModuleCradle = "EF_ModuleCradle" createUnit .....

#

Oh that is part of the init line.

versed ledge
#

Busted, that part came from google desperation.

errant jasper
#

Guess what you are doing in that regard should work.

tulip ridge
versed ledge
#

thank you, will do!

tulip ridge
#

The sqf bit matters too, it's for syntax highlighting

#
systemChat "text";
versed ledge
granite sky
#

So the only thing setVelocityTransformation does for you is the interval interpolation.

errant jasper
#

So the only thing setVelocityTransformation does for you is the interval interpolation.
"Only". Pretty crucial? Like if the local client is only doing 20 fps, then even under perfect network conditions I running 100 fps would look laggy.

granite sky
#

No, because that's just done locally. There's no additional network transmission as far as I can tell.

#

What gives you the network interpolation is the velocity.

errant jasper
#

Well I would assume interpolation is not done locally for the other command.

granite sky
#

IIRC some guy who was trying to make giant submarines proved otherwise :P

tulip ridge
#

KJW?

#

Because yeah, its not interpolated correctly at all in MP

errant jasper
#

@versed ledge Not sure where you got this from

[EF_ModuleCradle, nil, true] call BIS_fnc_moduleInit;
moduleInit is undocumented on BIKI, and even the code only takes two parameters.

granite sky
#

Since 2.18 there's also setAngularVelocity, which might be better than setVelocityTransformation for some uses.

tulip ridge
#

Yeah that's one of the commands he asked for, and it still wasn't interpolating correctly

errant jasper
#

But is slighty bizarre that setVelocityTransformation operates on interval "phase". Only way I can imagine it working is if remote clients internally compute the "speed of interval" changing, by sampling it from received packets.
But since they can't be sure it will even continue I guess they only do that for a few packet-latencies worth.

granite sky
#

Another thing is that you can't turn off the physics, so let's say you're manually repositioning a plane every frame, the values will be wrong whenever the physics updates, IIRC 15 frames per second.

#

This is true for both setVelocityTransformation and the manual version.

#

If you disable simulation then most sims just break down entirely and ignore chunks of your code.

#

As far as I can tell, there is no specific setVelocityTransformation network packet and it just breaks down to position/direction/velocity one-shots.

digital jacinth
#

figured, i am too dumb for setVectorDirandUp. I do want to point a user texture at the camera, so it also can rotate up and down.

so far I got this, which rotates it in die DIR direction just fine, but up and down is a mess, as it also rotates the object not just up and down, but also sideways

private _dirVector = ((positionCameraToWorld [0, 0, 0]) vectorFromTo (getPos _object));
_object setVectorDirandUp [_dirVector, [0, _dirVector select 2, 0]];
#

So my gues sis i need to adjust the UP verctor but to what degree, no idea

granite sky
#

Well, where do you want it to point?

digital jacinth
#

directly at the camera.

granite sky
#

The up vector?

digital jacinth
#

yup, no rotation to the left or right, just up and down basically

granite sky
#

well, your dirVector is pointing towards the camera (ish), right

digital jacinth
#

dirVecotr is fully fine, that one works

granite sky
#

What you probably want is the up vector to be in the same plane as [0,0,1]?

digital jacinth
#

without the up vector is points directly at the camera, but it does not look up or down

granite sky
#

Can't tell what you're saying. Try this and see if it does what you want:
_upVector = _dirVector vectorCrossProduct [0,0,1] vectorCrossProduct _dirVector;

digital jacinth
#

ypu that is exactly what i needed

#

thanks

granite sky
#

btw _dirVector is likely incorrect due to use of getPos. Probably want ASLtoAGL getPosASL _object instead, although you can't really trust the wiki on position formats returned.

#

You'd see the difference if object was placed on a building.

#

actually never mind, you really want to use ASL there :P

digital jacinth
#

ASLtoAGL with a getPasAGL? ah yeah that makes more sense.

granite sky
#

private _dirVector = ((AGLtoASL positionCameraToWorld [0, 0, 0]) vectorFromTo (getPosASL _object));

#

AGL/ATL/etc are never valid for 3d vector comparisons.

digital jacinth
#

well it would ahve broken over water then πŸ˜„

granite sky
#

breaks just on sloped terrain.

#

should probably be getPosWorld rather than getPosASL but that's not exactly documented.

digital jacinth
#

would be a bit bad with the positionCameraToWorld wouldn't it?

#

world pos is not fully the asme as posASL

granite sky
#

They're both ASL but world pos is model center rather than model base when used for an object.

#

model center is probably better here.

digital jacinth
#

probably is, still works as is so far for what i want it

#

thanks for your help

hushed turtle
#

How to run code on briefing screen? I want to move map to some other position

warm hedge
#

Usually init.sqf will run and that is enough

hushed turtle
#

I guess there is some other way to move map on briefing? Because this code prints messages on briefing, but does not move the map. Also visibleMap returns false.

0 spawn
{
    systemChat "Trying to move map";
    mapAnimAdd [ 0, 0.05, [ 0, 0, 0 ] ];
    mapAnimCommit;
    systemChat str visibleMap;
    systemChat "Moved map";
};
#

BIS_fnc_animatedBriefing I guess

cosmic lichen
#

There is a function to animate the map. Try that one.

hushed turtle
#

That just calls mapAnimAdd. I wan't able to find briefing display, it's macro is commented out and I didn't even find in config. I don't necessary need to move the map, so I guess I'm leaving it, at least for now.

pallid palm
#

@hushed turtle what about a hyperlink

#
player createDiaryRecord ["Diary",["Objective Map Link","<marker name='Enemy City'>Enemy City</marker> Enemy City"]];
hushed turtle
#

At that point player can click on task marker. I wanted something automatic

#

When configuring EGSpectator by setVariable, variable WhitelistedSides is expected to be array of STRINGS. But when calling BIS_fnc_EGSpectator function, parameter whitelistedSides is expected to be array of SIDES and wiki doesn't even bother to mention this difference. Man the SQF sometimes. meowsweats

uneven mortar
#

hallo does anyone know what script was used here? so that players can only see zombies/opfor when nvgs/thermals are on

https://www.youtube.com/watch?v=rBO1LbgzFz0

DEATH-WATCH is deployed to a region overwhelmed by the latest outbreak of Mortui Resurgent Pathogen in order to stop the spread and give the dead the rest they deserve.

The Watch series, the video intro animation, and the Arma mission are all written and created by Ignis member Toast.

After Mission Report by Toast: https://docs.google.com/doc...

β–Ά Play video
severe glade
mortal folio
# severe glade

Iirc the vanilla zeus modes have some that are faction limited, i suggest looking at that setup, otherwise someone else might know the exact functionality

Best thing i can think of off the top of my head is the... sides? Or whatever config property defines the side for a cfgvehicles and groups entry - select only ones for that side and boom

#

What chat-jippity didnt tell you is that you certainly dont have to brute force it like that πŸ˜„

#

Also the same logic would apply to factions within a side, its just looking at which "folder" they are under, i.e the subcategory,which is also visible in a config

proven charm
#

can the sound/volume of running be changed via script?

finite bone
radiant lark
#

I wonder if theres an EH for when you close the server via the close button on the A3Server console

hallow mortar
proven charm
#

doesnt seem to

#

its only for injured or fatigued but cant get it to work even for fatigued

jovial nebula
#

Were you talking about a map object ? (before)

oblique arrow
#

fastwave hii peeps, question is there nowadays a simple way to open a browser link from within an arma script, ideally from the main menu when a button is pressed?
I know it used to be possible via DLL iirc but thats too big brain for me and I havent followed recent changes to that topic closely

oblique arrow
#

Idea is to open a ts3 link when players press a main menu button

tulip ridge
errant iron
tulip ridge
#

Teamspeak links used to be blocked, but I think are now allowed again

#

Yeah

past wagon
#

is there any way to get rid of a vanilla/default marker on the map?

past wagon
#

how do I know the name?

fair drum
#

I'm assuming you mean locations? The ones baked into the map and not markers?

#

There's a list of location commands on the wiki.

past wagon
#

I made a game logic object with this in the init and nothing happened

private _bad = nearestLocation [this, "", 5];
deleteLocation _bad;
#

(its placed on top of the marker I want to get rid of)

#

thats what im asking

#

damn

#

thats weird

#

you can edit maps but not location markers for stuff on the map

#

ive seen servers edit terrains

#

idk how

hallow mortar
#

You can use hideTerrainObject and setTerrainHeight to make some changes

past wagon
#

so theres nothing to remove a location marker?

#

yeah

#

or in my instance a hill and gas station marker

hallow mortar
#

If you want to hide a terrain location name, you have to use createLocation to turn it into a slightly editable location and then change its type

#

see example 3 on createLocation page

past wagon
#

great that works

#

thanks!

fair drum
#

Obligatory plug that Modules Enhanced has a module for location names for ease of use.

radiant lark
#

what the fuck

fair drum
radiant lark
#

Kookaburra edition

tulip ridge
fair drum
#

The real April fools is that half of the world isn't on April 1st yet

radiant lark
#

Is there any EH that gets triggered when I close the server doing #shutdown or smth like that?

restive leaf
#

Mod override on the map's CfgWorlds... can add and modify easily and override the entire Locations class to remove ones to be gone

restive leaf
#

I mainly use it to add new POIs to a map

restive leaf
#

Yeah, I do it for permanent POIs, one's that would have been there for years, especially when modded maps don't mark them, but do have them

granite sky
#

We use it heavily because Antistasi uses the CfgWorlds names to identify towns, and on some maps the positions are really bad.

restive leaf
#

Way easy to change with a server mod though...

#

(Not server side, mod for server ofc)

granite sky
#

We fix some vanilla towns too.

#

Ideally we wouldn't either, but hey, tech debt :P

radiant lark
winter rose
#

sniff

versed ledge
#

I’m interested in learning how to create my own support helo. It would be spawned in through script and be available to the player at all times for transport with an rtb option once player is onboard. Any tips on the best approach?

radiant lark
#

This approach seems the best, endMissionServer, thanks Scotty

tepid gulch
versed ledge
#

Thanks, that’s very generous to share your work! Definitely interested in getting ideas from it.

#

I just got my first script working without errors. Very fun experience. I have it so the LPD from EF will spawn based on a marker location. It includes combat boat with deploy and recover actions, add crew action, small boat in the starboard side compartment, and LCC in the well. Helicopters are next!

remote cobalt
#

Hey folks,

I read on the Wiki that there are two ways to work with post process effects.

1st way on the wiki is with a "string" handle (for example "colorCorrection" or "filmgrain". The second way is with a handle you get with ppEffectCreate.

So, for me now, theres the question how this all works on the players machine.

If I use not the numeric handle but the string handle "colorCorrection" in multiple scripts to adjust an effect, does this mean they change the same effect. And does this on the other hand mean if I create a postProcess Effect with ppEffectCreate and use the handle to adjust parameters, that, when I create another post process effect with ppEffectCreate, that the two existing post process effects get layerd?

Anybody knows something more about this?

winter rose
remote cobalt
still forum
#

A FT ticket would be appropriate

winter rose
old owl
young mist
#

Whats the script that does the opposite of !alive

crimson lion
#

! just means 'is not'

young mist
#

Ah okie dokes! Thanks

tulip ridge
#

|| is or, && is and

#

Also equal signs probably aren't the best thing to use when talking about operators. Since != means not equal to and ||= is just an error

cosmic lichen
mortal folio
#

|&

#

where's my "maybe" operator: ??

old owl
#

Err

#

Actually that wouldn't work

#

Haha

mortal folio
old owl
#

Not sure about symbols but would also be doing

if (alive player true playerSide isEqualTo west) then {}
tender fossil
#

Eyyy, let's not break the spacetime

mortal folio
mortal folio
#

it does absolutely nothing with the input πŸ˜„

#

it's just there to exist

tender fossil
mortal folio
#

true

#

or should i say.... true?false

mortal folio
# old owl ```sqf #define |& selectRandom [true, false] ```

now while this wouldn't work unless you did some gymnastics to recompile everything before and after and redo the entire sqf parsing, you could just make it a questionable operator instead:

#define |& selectRandom [compile "&&", compile "||"]
old owl
mortal folio
#

yes but let's not worry about that, let's be concerned with the potential for chaos

#

im sure this would be most useful and completely necessary to make work blobcloseenjoy

hushed turtle
mortal folio
#

beautiful D_

hushed turtle
still forum
#

Just wait for me to

_x getVariable "a" ?? (call fn_getDefaultValue)
and bamboozle everyone

#
_infoItem = #{
title: `Welcome to ${G_PlaceName ?? (call G_fnc_getDefaultPlaceName)}`
}

🀑

#

Actually that would be take like.. 10 minutes to implement 🀣

tulip ridge
#

That'd be nice

still forum
#

The stupid way, same way as the string interpolation

x ?? y
->

if (isNil {x}) then [{y}, {x}];

But that's not very efficient

mortal folio
#

Oh god what have i done

#

Undo meowsweats

errant jasper
#

Translation need be more elaborate and not evaluate x potentially twice.

still forum
#

But I wanna be lazy

tender fossil
#

"Sweat now saves CPUΒ cycles later"

tulip ridge
#

What is sizeOf measuring? Specifically for units if it matters
I have an issue of one unit returning ~7 and another ~5 even though they're the same size visually

granite sky
#

bounding radius, isn't it? Which is a pretty bullshit value in general.

winter rose
#

don't forget about boundingBoxReal πŸ˜‚

granite sky
#

syntax 3 being the good one for some reason.

#

Not sure how well it works on units though.

hushed turtle
#

Seems like all units return same sizes

tulip ridge
#

Not mine apparently :P

#

Geo and FireGeo seem to be the same between them

mortal folio
#

we need boundingBoxFinalV2

mortal folio
tulip ridge
mortal folio
#

ah

#

yeah wasnt sure what you were doing

#

wait, are the two units playing different animations by any chance?

tulip ridge
#

Nope, it's just in Eden

mortal folio
#

hm

tulip ridge
#

I'm gonna try exporting the problem uniform with the working one's (Fire)Geo and see if that changes anything

#

Okay well that fixed it
They looked identical in blender though

#

Β―_(ツ)_/Β―

old owl
proven charm
#

if(condition1 ?? condition2) ?? for lazy evaluation wen

#

or &? for and lazy eval if(condition1 &? condition2)

hallow mortar
#

I don't see how you could make something like that meaningfully different from the existing && lazy eval syntax

hushed turtle
#

Don't have to bother with code blocks

proven charm
#

the existing lazy eval isnt very readable

hallow mortar
#

The requirement to use {} isn't a limitation of the command, it's a limitation of the language - you have to do it, otherwise the code will be evaluated now

proven charm
#

ya might be undoable

old owl
#

Would be kinda neat in the sense it would allow you to run a block of code upon the value being nil kinda like getOrDefaultCall. Also would be able to run code on absence of a value without needing an if or the like and potentially return. Although use case might still be kinda limited. Probably would be good though to have something different other than ?? for lazy eval

proven charm
#

&&? my favorite πŸ˜„

old owl
#

Now that I think about it for lazy eval not having it separate could cause large issues of not being able to do something like this securely:

_value ?? (uiNamespace getVariable ["whatever", false])

Of course if lazy eval support is implemented :)

proven charm
#

whats the problem exactly? sorry i dont get it πŸ™‚

old owl
#

Sorry probably could've worded that better- it would be an execution exploit in MP

mortal folio
mortal folio
#

but it indeed would be funny

drifting girder
#

is there a way to make sure cursorobject always works in mp?

#

sometimes i've had it where a task is triggered by cursorobject (requiring a player to spot a specific object) that gets seen by a drone and just doesn't pop

granite sky
#

You'd have to give a lot more detail about how you're expecting it to work. cursorObject has many issues but I doubt many of those would be relevant to your case.

old owl
drifting girder
#

from videos i've watched about it i think it works better for sp missions

granite sky
#

I'm not aware of any MP-specific cursorObject issues.

spare idol
#

I know this probably has been asked a million times and for more than a decade, but does anyone know the best way to create the illusion of an instant hitscan beam laser weapon? None of the mods I've tried cut it (they all still use laser projectiles). I don't think this can be done via config so that's why I ask here, let me know if I'm wrong tho.

old owl
past wagon
#

my HandleDamage EH prevents me from taking damage while parachuting, but my EntityKilled EH still thinks I die and fires.

even this doesnt work:

if (alive _killed) exitWith {};
hallow mortar
past wagon
#
[format ["%1 died!", name _killed]] remoteExec ["systemChat"];
``` says "Trioxide died!"
hallow mortar
#

Doing name on a vehicle will return the name of one of the crew

#

Try typeOf instead

#

Keep in mind that entityKilled absolutely is firing for the death of the parachute vehicle; it fires for the death of almost anything. The question is whether your filters are successfully excluding the firing for the parachute.

past wagon
hallow mortar
#

I think you should confirm that that's working by testing with typeOf

past wagon
#

ohh

#

nevermind, just did

#

its the parachute

#

thanks

#

should I use _killed isKindOf "CAManBase" instead of isPlayer _killed?

granite sky
#

Depends what you're trying to achieve? First one is units, second one is players.

past wagon
granite sky
#

Nah, you must have an error somewhere. name _vehicle does return the name of the crew but isPlayer _vehicle will still be false.

past wagon
#

If I do this, will it hide the object to everyone except the local player?

_object hideObjectGlobal true;
_object hideObject false;
tulip ridge
#

Yes

granite sky
#

In the localhost case it should.

#

In other cases, no.

tulip ridge
#

Or wait no, it's server exec right

past wagon
#

No, executed locally

granite sky
#

According to the wiki, hideObjectGlobal is server execution and has no effect elsewhere.

past wagon
#

I guess I remoteExec the first one on server

granite sky
#

IIRC this is true :P

#

The trouble is that if you remoteExec the hideObjectGlobal, then your hideObject will happen first.

#

Probably easiest to just broadcast a hideObject.

#

Not sure what JIP behaviour that has though.

sly cape
#

I'm afraid you can not do with using Arma 3 scripting.
But click it and click "Didn't ask" and it will go away.

hallow mortar
#

Fortunately for us all, it's a matter of fact, not opinion. || means or.
Technically, you could describe it as "and/or" - it isn't a XOR and will still return true if both arguments are true - but in order to avoid confusion, this type of logical check is called OR. In Arma, the || command is exactly the same as the or command; there is no andOr command.

spiral temple
#

Hello! I have a small issue with my preprocessor. I use the preprocessor in the way

DEFINITION(string, another string with (), number);

The problem is now, that the string with () is shown as string with() - so the whitespace is getting removed. Is there a way to fix this?

proven charm
#

pls post #define

hallow mortar
spare idol
#

Sorry to repeat myself, but does anyone know the best way to make a gun visually emit an instant beam from point A to B, with no travel time at all? Kinda like phaser weapons on star trek.

old owl
spare idol
#

Im vibecoding my way through but yeah, I rather have human input from experienced coders than fully having to rely on AI. My coding knowledge is near 0

spare idol
#

Thank you!

surreal urchin
#

Hello do u know who made the Evannex mod

shell kiln
#

Does anyone here know how to assign variable values to units spawned in by scripts?

#

I'm trying to set up a task that's completed when all spawned enemies in a group are killed.

mortal folio
shell kiln
mortal folio
#

sorry hold on - you need to assign a variable name or a value?

#

those two are different things

shell kiln
#

Variable name.

#

Something a task can use to identify when the spawned units have died.

mortal folio
#

okay well in that case you'd need to assign whichever variable name you want for that unit into the mission namespace and additionally (though technically optional) use setVehicleVarName on them (optional only if you're not explicitly referencing them with the vehicleVarName command and instead just use their raw assigned variable name in script)

sly cape
mortal folio
#

but yeah what sticky joe said is a better option

shell kiln
#

How would you approach that?

mortal folio
#

well you can just assign the result of the spawnGroup function to a variable and then feed that to a CBA WUAE function that checks until the units in group are all no longer alive

old owl
#

Not sure if I entirely understand what you are asking but if you're asking how for those variable names to be somehow unique you could do something like this:

player setVariable [format ["var_%1", _yourTaskName], _value];
shell kiln
shell kiln
#

Idk if thats possible with Zeus.

mortal folio
old owl
#

Which would be required for it to be seen by other players and/or server

shell kiln
#

But after they're spawned by script, I can't really check to see if the variables were actually assigned to them.

old owl
#

With getVariable you can- for example:

cursorObject getVariable [format ["var_%1", _yourTaskName], _valueIfNotExist];
mortal folio
#

well okay since he wants to just check if units within a spawned group are all dead you dont even need to assign variable names or set variables, just do the whole group (scheduled method):

spawnedgroup spawn {
 waitUntil {({alive _x} count (units _this)) isEqualTo 0}; // waits till all units in group are dead
 dostuff
};
mortal folio
#

but in either case the method is technically unnecessary for what he wants to do

shell kiln
#

PatrolUnit spawn {
 waitUntil {({alive _x} count (units _this)) isEqualTo 0}; };

["Patrol Elimination", "SUCCEEDED"] call BIS_fnc_taskSetState;```
#

So something like this?

mortal folio
#

the taskSetState call should be in the same code block as the waitUNtil check

#

idk if you were doing this in scheduled to begin with or not, but you can also just ignore the spawn completely if you're already in scheduled

#

just plop the waitUntil there without the spawn

shell kiln
#

If you can't tell, I'm not super familiar with scripting.

mortal folio
#

okay in that case just put the taskSetState in the spawn block πŸ˜„

mortal folio
old owl
mortal folio
#
private _patrolUnit = [getMarkerPos (selectRandom ["marker_1", "marker_2","marker_3", "marker_4"]), east, (configfile >> "CfgGroups" >> "East" >> "OPF_G_F" >> "Infantry" >> "O_G_InfSquad_Assault")] call BIS_fnc_spawnGroup;

_patrolUnit spawn {
 waitUntil {({alive _x} count (units _this)) isEqualTo 0}; 
["Patrol Elimination", "SUCCEEDED"] call BIS_fnc_taskSetState;
};
shell kiln
#

Why is the word private included?

mortal folio
mortal folio
#

if you are, remove it

old owl
mortal folio
mortal folio
old owl
#

Tbf it doesn't really matter

#

I am a serial code nitpicker

#

Unless you're using an on frame event handler or an insane amount of data, the performance impact is negligible anyway :D

#

So feel free to tell me to shut up ^_^

#

Wasn't really relevant towards his question anyway

mortal folio
#

oh me too trust me πŸ˜‚ like, i replaced every instance of == to isEqualTo unless im dealing with case insensitive strings lol - sometimes even don't do params and do _this selects etc to optimize the execution time (though only for non user functions)

#

result is my code is unreadable to anyone who isnt me

#

but oh well

shell kiln
#

Can't tell if the variable wasn't assigned correcty, or if its the task.

mortal folio
#

Uuh... @old owl you spot anything?

warm hedge
#

If you cannot even tell if it is actually running or failing silently, make sure the code is actually running. Use hint!

mortal folio
#

Might be with spawngroup, unless the group IS spawning

old owl
mortal folio
#

put a hint to output the groop and see if its valid inside the spawn block

old owl
#

Could be something is nil causing the script to end?

warm hedge
#

Also I can bet a dime if waitUntil is failing and deadlocking

old owl
#

Also very possible

shell kiln
#

Like this?


_patrolUnit spawn {
 waitUntil {({alive _x} count (units _this)) isEqualTo 0}; 
["Patrol Elimination", "SUCCEEDED"] call BIS_fnc_taskSetState;
};

hint "Testing!"```
#

It came through.

mortal folio
#

Inside the spawn code block

old owl
#

Could also add a systemChat/diag_log or something inside the waitUntil block too to see if it is running without exit

shell kiln
#

Idk what place inside of the script risks breaking it or something,

mortal folio
# shell kiln Where inside it?
_patrolUnit spawn {
hint format ["started - group: %1", _this];
 waitUntil {({alive _x} count (units _this)) isEqualTo 0};
systemChat "passed waituntil";
["Patrol Elimination", "SUCCEEDED"] call BIS_fnc_taskSetState;
systemChat "passed task";
};
#

the hint should tell you the group id, the system chat messages will tell you where you're at

#

if the hint doesnt show anything after "group: " then group is invalid for whatever reason

shell kiln
#

The units spawned, but I didn't get any hints.

#

They're vanilla units, so idk why they wouldn't be vaild.

mortal folio
#

that's... uuh.. honestly unless im too sleep deprived and ain't seeing it - to me it seems like spawngroup might just not be returning anything at all for whatever reason, but even a nil arg fed to hint should still at least give you the first text

shell kiln
#

Understandable.

cursive tundra
#
/// Script 1:
params ["_group","_missionTask"];
_debug = true;
_side = side leader _group;
_sideEnemy = sideEnemy;
switch (_side) do {
    case west:    {_sideEnemy == east};
    case east:    {_sideEnemy == west};
    };
while {_missionTask == "MTC" && count units _group > 0} do {
scopeName "stateLoopStart";
private _state = _group getVariable "groupStatus";
hint str _state;
switch (_state) do {
    case "noContact":    {
                            
                            if (combatMode _group != "GREEN") then {_group setCombatMode "GREEN";};
                            if (combatBehaviour _group != "AWARE") then {_group setBehaviour "AWARE";};
                            _allCloseEnemyContacts = leader _group nearTargets 1200 select {side (_x select 4) == _sideEnemy};
                            _closeEnemyContactsLand = _allCloseEnemyContacts select {_x isKindOf "AIR" == false};
                            if (count _closeEnemyContactsLand > 0) then 
                                {
                                    _nearestEnemy = (leader _group) findNearestEnemy (leader _group);
                                    _distanceNearestEnemy = (leader _group) distance _nearestEnemy;
                                    if (_distanceNearestEnemy <= 600) then {
                                        [_group, "enemyContact"] call AWP_fnc_tf_grp_setState; 
                                        breakTo "stateLoopStart"; 
                                    };
                                };
                            sleep 1;
                        };
};
///// Script 2:
AWP_fnc_tf_grp_setState:
params ["_group","_newState"];

_taskForceOldState  = _group getVariable "groupStatus";
if (_taskForceOldState == _newState) exitWith {_newState = _taskForceOldState};

_taskForceOldState  = _group setVariable ["groupStatus",_newState];

_newState;
#

hey, i currently am working on this script thats supposed to make groups behave more realistically, however, it currently doesnt seem to work.. the _state value never seems to change to "enemyContact" and therefore the code for enemy contact doesnt seem to get executed. Does anyone see the issue?

mortal folio
# shell kiln Understandable.
private _patrolUnit = [getMarkerPos (selectRandom ["marker_1", "marker_2","marker_3", "marker_4"]), east, (configfile >> "CfgGroups" >> "East" >> "OPF_G_F" >> "Infantry" >> "O_G_InfSquad_Assault")] call BIS_fnc_spawnGroup;

hint format ["started - group: %1", _patrolUnit];

try this

#

just put the hint after spawngroup basically

cursive tundra
#

im suspecting it has something to do with scopeName as i never used that before

#

so maybe im using it wrong

shell kiln
#

Just that and remove the variable script?

mortal folio
#

basically above the spawn

shell kiln
#

Got a value this time, Group 0, Alpha 1-6.

mortal folio
#

okay so it's just not being fed to the spawn thonk

#

quite honestly i've never seen this behaviour before and the syntax is correct (and it isnt the waitUntil hanging since you put the hint before it initially and it didnt appear)

#

sec imma test on my end

shell kiln
#

Kk

mortal folio
#

are you sure you used the code exactly as i pasted?

shell kiln
#

Paste what you used and I'll try it on my end.

mortal folio
#

private _patrolUnit = [getMarkerPos (selectRandom ["marker_1", "marker_2","marker_3", "marker_4"]), east, (configfile >> "CfgGroups" >> "East" >> "OPF_G_F" >> "Infantry" >> "O_G_InfSquad_Assault")] call BIS_fnc_spawnGroup;

_patrolUnit spawn {
waitUntil {({alive _x} count (units _this)) isEqualTo 0};
systemChat "no";
};

#

well, sorry hold on i put my debug message there since i dont have the task set up but... in any case you should just get a "no" in system chat there, after killing the units

#

the actual code you need without debugging was this:

private _patrolUnit = [getMarkerPos (selectRandom ["marker_1", "marker_2","marker_3", "marker_4"]), east, (configfile >> "CfgGroups" >> "East" >> "OPF_G_F" >> "Infantry" >> "O_G_InfSquad_Assault")] call BIS_fnc_spawnGroup;

_patrolUnit spawn {
 waitUntil {({alive _x} count (units _this)) isEqualTo 0}; 
["Patrol Elimination", "SUCCEEDED"] call BIS_fnc_taskSetState;
};
shell kiln
#

Got the message.

#

Alright, so now I assign the task and it should work?

mortal folio
#

yep

#

idk what you might've done wrong last time but if you got the message that means you cleared the waitUntil block, now anything after that is down to you

shell kiln
#

That did it!

#

Awesome!

#

Thanks for the help!

mortal folio
#

no problem πŸ˜„

cursive tundra
#

no, why?

mortal folio
#

the two switch statements are questionable and unnecessary, but besides that have you checked the RPT log and have script errors enabled? that'll tell you if the script is breaking before setting the groupstatus variable

cursive tundra
#

its an excerpt of a larger script i have more states so i figured id use switch

mortal folio
#

ah, right

cursive tundra
#

but i figured it out

#

i never used switch before i always did ugly nested if then monsters, so _side apparently never got assigned properly and stayed sideEnemy - so ofc the OPFOR group wouldnt be recognized as hostile...
_sideEnemy = switch (side leader _group) do {
case west: {east};
case east: {west};
};
this now seems to work (well, i still get an error, but its somewhere else now lol)

mortal folio
#

fair, good luck πŸ˜„

jovial jewel
#

Hello, I'm new to scripting and I'm putting 2 songs for an MP Coop mission with my friends. I have a problem that only one song works. I'm asking for help, please?

warm hedge
#

Post what you've done

jovial jewel
#

The_Rooster works but CD doesn't

warm hedge
#

And why you're sure one of them is not working?

jovial jewel
#

Yes

warm hedge
#

I said why, that's not a yes or no question

jovial jewel
#

Oh sorry

#

I placed a trigger that playMusic on activation. On Activation playMusic "The_Rooster"; is fine, but when I changed it to playMusic "CD"; it didn't play. I changed it to The_Rooster again it works.

warm hedge
#

You sure your description.ext is reloaded after you change? Ctrl+S to save and reload it?

jovial jewel
#

Yes

warm hedge
#

missionConfigFile >> "CfgMusic" >> "CD" in Debug, what it does say?

jovial jewel
#

Please let me take time to look

#

I didn't find "CD". I also didn't find "The_Rooster".

warm hedge
#

Did you find what? In what context?

#

What have you just done?

jovial jewel
#

I used the "Tools" on the top tab of Eden Editor and open the "Config Viewer..." then I scroll down to search for CfgMusic on left tab after I found CfgMusic, I was trying to find the "CD" and I couldn't find it.

warm hedge
#

Config Viewer is not what I meant. If you do it in Congig Viewer, you can find it in under missionConfigFile though

#

configFile is not missionConfigFile

jovial jewel
#

How do I open the missionConfigFile?

warm hedge
#

If you mean you are using vanilla Config Viewer, scroll it down to the bottom. Meanwhile, I just mean to execute the code I've sent to you in Debug Console, which is faster and easier to see the result

jovial jewel
#

Oh, thank you very much

#

This is what I got back

\Users\weem4\Documents\Arma 3 - Other Profiles\Weem\mpmissions\Battle_of_Lang_Vei.vn_khe_sanh\description.ext/CfgMusic/CD

Is this the right thing?

warm hedge
#

It does mean the game recognizes the music. description.ext is likely not the cause, but the script you run to play the music or music file itself.

jovial jewel
#

I think the music file is the problem because the The_Rooster works but CD doesn't.

#

Thank you very much, man. I got the answer now. You also taught me something very useful.

surreal urchin
#

Hello anyone here

hallow mortar
stark spade
#

where I can find it's class or something that I can call it in script
I think this module is from Zeus addition

hushed turtle
#

Place it somewhere. Right click -> show in config

shrewd mauve
#

good morning, Very clueless question.
i'm trying to make some small event handler about vehicle reparation.
with some tuto i make something very basic working but however there is an issue :

for exemple when a tire get splash and the vehicle is at 100% heatl it wont detect it has dammaged.

Any tips how to improve that

proven charm
shrewd mauve
#

oh thank man ! i'm absolutely beginer and i try the very basic to get in script logic

stark spade
stark spade
#

nah it did not open

faint burrow
shrewd mauve
#

but i take notes

cursive tundra
#

if have a question: if i have a script structure like this:

while {_condition} do {
  hint str _state;
  switch (_state) do {
      case "noContact":    {};
      case "enemyContact":    {};
      case "engagingEnemy": {};
      case "fallBack":    {   [...]
                            waitUntil {
                                      sleep 1;
                                      _conditionFallBackCompleted == true
                                   };
                           [...]
                          };
      case "observe":    {};

};

while the waitUntil condition also pause execution of the outer while loop or just pause execution of the script inside "fallBack"?

old owl
cursive tundra
#

but why does it then keep hinting the state and make the units flee far further than the 500m "_fallBackPos = _currentPos getPos [500,_dirAwayFromEnemy];" should make them flee πŸ™

old owl
#

Not sure, I'm very inexperienced when it comes to AI but if you post your code where that's done; someone else may be able to help with that πŸ™‚

cursive tundra
#

for testing purposes, i called it using the group leaders init field like this, idk if thats a problem

 group this setVariable ["groupStatus","enemyContact"];
[group this,"MTC"] spawn AWP_fnc_tf_grp_missionTaskMTC;
errant jasper
#

1: Well you are not showing expressions governing the state changes. So even without state changing it would keep hinting while _condition is true, including if the state remains in fallBack and _conditionFallBackCompleted remains true.
2: Spawning in init field is probably not what you want, unless you guard it at the top with a isLocal or isServer check. Any other machine in MP will run its own scripts.

cursive tundra
#

thanks!

#

it evaled as true immediately

split ruin
#

any way to recharge the battery of IED UAV from WS, it does not accept the ace battery like AR-2 ? πŸ€”

hallow mortar
#

I'm pretty sure UAV "battery" is just fuel, so setFuel

split ruin
#

@hallow mortar you are right πŸ˜‚ I just refuel the "battery" of UAV with fuel canister, immersion gone πŸ˜‚

surreal urchin
#

Is there anyone nice and friendly on here

winter rose
#

no, get out!

#

πŸ˜„ how can one help ya πŸ˜„

jagged mica
surreal urchin
#

I can tell

#

U ass hole s

jagged mica
#

Arma community could solve all world problems if they asked in the right channels

surreal urchin
#

I guess u guy never learned to be nice

#

Guess your parents never taught you to be nice to people that you don't even know but I guess they never taught you that

jagged mica
#

what is happening

granite sky
#

I think he's trying to get banned.

jagged mica
#

I casually open this channel once in a month and I come to this

surreal urchin
#

Trying to find the person that owns a damn mud and you guys are unwilling to be nice and helpful bastards

split ruin
#

he is just a troll ... I sensed it the moment he entered just to say hi without any question

granite sky
#

Didn't someone answer that question elsewhere? You haven't asked anything here.

surreal urchin
#

Man you don't know me stop assuming a****** I'm not in the mood now

#

I'm just going to start blocking all the people that are being assholes not playing

jagged mica
#

Im sure someone wouldve answered if they knew the creator of evannex mod whatever it is

hallow mortar
#

No one was actually being unfriendly or disrespectful. Saying "no" when someone asks "is anyone here" is, like, one of the classic examples of light-hearted ribbing. It's obviously not true because someone answered at all. All you had to do was have a sensible chuckle and then actually ask your question.

winter rose
#

!issueWarning 437454614741385237 name-calling - be respectful too if you want it to be kept civil, thanks

winter rose
#

with this out of the way; how can we help? πŸ™‚

surreal urchin
#

@winter rose then they dont need to be rude and be more helpful and stop judging

winter rose
surreal urchin
#

Im doing myself i found the creator of the mod now im figure out how to contact them

split ruin
#

I have seen drawn map icons, they don't have any color except the lines and are awesome for readability ... I am wondering how they manage to draw them? πŸ€”

proven charm
#

kiba pic?

split ruin
errant jasper
split ruin
#

via scripting ? meowawww

split ruin
#

this is serious math envolved ... maybe I will be able to draw ... a square πŸ˜΅β€πŸ’«

errant jasper
#

Well if you just want a line and have two positions then it is pretty simple:

posA params ["_x1", "_y1"];
posB params ["_x2", "_y2"];
myAwesomeMarker setMarkerPolyline [_x1, _y1, _x2, _y2];
#

A square is just two more positions and closing it by ending with _x1, y_1 again.

split ruin
#

I just want a marker on players pos with basic military symbology - infantry, air, naval, etc ...
so I just have to get 4 relative positions around player and then draw it ?

fleet sand
sly cape
split ruin
#

@fleet sand blue force tracker uses normal icons, I want just markers with outlines only, no fill color, not to mention I want player icons, not squad ones, ace Blue Force draw them one above the other and its very ugly and unreadble ...

fleet sand
split ruin
#

actually you can have custom markers without a mod, but this this is not what I want ... custom markers are not polyline markers

errant jasper
#

Not sure what you are looking for. There already are basic nato symbology markers in Arma?
But if you want to do stuff with polylines here is a example I just made that draws a star:

comment "config"; 
private _center = [2000, 2000]; 
private _radius = 300; 
private _innerRadius = _radius / 3; 
private _starPoints = 5; 
 
comment "Build coords"; 
private _angle = 360 / _starPoints; 
private _hAngle = _angle / 2; 
private _coords = []; 
for "_i" from 1 to _starPoints do { 
    private _tipAngle = _angle * (_i - 1); 
    private _tip = _center getPos [_radius, _tipAngle]; 
    private _inward = _center getPos [_innerRadius, _tipAngle + _hAngle]; 
    _tip resize 2; 
    _inward resize 2; 
   {_coords pushBack _x;} forEach _tip; 
   {_coords pushBack _x;} forEach _inward; 
}; 
comment "Close it";; 
_coords pushBack (_coords # 0); 
_coords pushBack (_coords # 1); 
 
comment "Make marker"; 
private _mrk = createMarker ["whatever", _center]; 
_mrk setMarkerColor "ColorRed"; 
_mrk setMarkerShape "POLYLINE"; 
_mrk setMarkerPolyline _coords;
split ruin
#

@errant jasper this is awesome, can you make a square ?

errant jasper
# split ruin <@99871942399504384> this is awesome, can you make a square ?
comment "Somehow get the center pos of your square";
private _center = [2000, 2000]
comment "The 'radius' of the square";
private _halfSize = 50;
_center params ["_cx", "_cy"];
comment "Find the edges on the two axis";
private _xLeft = _cx - _halfSize;
private _xRight = _cx + _halfSize;
private _yBottom = _cy - _halfSize;
private _yTop = _cy + _halfSize;
comment "Now just follow the corners around and close it";
private _coords = [
    _xLeft, _yTop,
    _xRight, _yTop,
    _xRight, _yBottom,
    _xLeft, _yBottom,
    _xLeft, _yTop
];
comment "Use _coords in setMarkerPolyLine";

Something like that. Didn't run it.

wise frigate
#

Anyway to change setPIPEffect NVG's to a different color? As in apply a different color overlay on a PIP camera

split ruin
#

@errant jasper tried but gives error "expect number"

comment "Somehow get the center pos of your square";
private _center = [2000, 2000];
comment "The 'radius' of the square";
private _halfSize = 50;
_center params ["_cx, _cy"];
comment "Find the edges on the two axis";
private _xLeft = _cx - _halfSize;
private _xRight = _cx + _halfSize;
private _yBottom = _cy - _halfSize;
private _yTop = _cy + _halfSize;
comment "Now just follow the corners around and close it";
private _coords = [
_xLeft, _yTop,
_xRight, _yTop,
_xRight, _yBottom,
_xLeft, _yBottom,
_xLeft, _yTop
];
comment "Use _coords in setMarkerPolyLine";

private _mrk = createMarker ["whatever", _center];
_mrk setMarkerColor "ColorRed";
_mrk setMarkerShape "POLYLINE";
_mrk setMarkerPolyline _coords;
past wagon
#

if I need to hide a player from every other player, is this how I should do it?

private _clientID = clientOwner;
[_player, true] remoteExec ["hideObject", -_clientID];
hallow mortar
#

That's one way of doing it. Note that that will only work if it's executed on the machine of the player who's being hidden, because clientOwner can only return the local machine's ID.

granite sky