#arma3_scripting
1 messages Β· Page 227 of 1
Comment on that page says the return value is different
The return value is different per keyboard/IME settings.
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
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.
Okay so looks like it's done like this?
https://github.com/arma-actions/arma3-tools/blob/master/action.yml
Seems to be what is being "expected" when using arma3-tools@master. Not really sure I understand a whole lot though outside of that it's unzipping a arma3tools.zip that is downloaded from an environment defined URL.
They really made it difficult to edit .sqm files with the eden patch didnt they lol
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 
-# Oh well maybe I'm not fully there- looks to be linting again but isn't recognizing defines / p drive again maybe
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?
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.
triggerActivated?
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
Wrap with and
gotcha
Files from the base game are put into an "include" folder and are referenced from there.
Gotcha thank you! Do you know if there something for HEMTT that does that automatically or is that an automation that ACE made manually?
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
Afaik there is no automation..the files in the include folder are.copied from the base game manually once.
Interesting. Also last question I'll toss as you, but do you know what the P Drive or Work Drive is? I tried looking at the Wiki but I didn't quite understand it's explaination. Seems to be reference of it along with how it finds those includes, but I don't quite understand what they are or what they do; other than it mounts a drive.
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.
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)
Ahhhhhhh. Thank you both. Was scratching my head, as when I'd open it it'd be empty. That makes sense
Yeah. Wiki has 0 documentation about it as it seems π
How do i add a dependency to my mod?
More of an #arma3_config thing, but the short answer is CfgPatches
*dependency listing on the Workshop might be separate
how does one do that?
whats even the point of binarizing the thing in the first place
faster loading the file in the engine
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?
you can change this under Attributes >> General >> Misc >> Binarize the Scenario File
you can switch the as often you want without running it problems
cool, thanks
i did this if i release/play a mission and disable this while i build the mission
Not sure what your use case is but you could split the array then use createHashMapFromArray alternative syntax to create a hashmap with keys and values. Obviously the return of that is gonna be a hashmap though, if you're still looking for an array then this isn't too helpful. If you were intending to use those array for such, then may be perfect π
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.
Ah okay. Maybe there's something here then- although honestly haven't looked so maybe not either but FWIW:
https://community.bistudio.com/wiki/Category:Function_Group:_Arrays
Something could be done with pairs or nestedElements, but obvious....
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;
@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;
};
};
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;
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.
"abc" serverCommand "#missions"
serverExec in debug console
->
Successfull attempt to execute serverCommand '#missions' by server.
Seems to be working just fine
Other mods like ACE solve this by copying the include files into their repository, and have them looked up from there.
But note that technically that is a copyright violation.
Is there a way to get it working through an add action or some other type of interaction on a prop?
It doesn't matter how its executed.
Just remoteExec to server, and it works fine for me...
["abc", "#missions"] remoteExec ["serverCommand", 2];
This also works fine for me.
I don't know why it wouldn't have worked for you guys 
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...
Not what we're talking about
Its the server-side executed variant with password, that we're on
Oh, that one's SE-only, right
any way to destroy simple object during mission ? π€
lot of force
not delete, I need destruction effects
@winter rose lot of damage ?
Replace it with something that isn't a simple object, or fake it with particle effects?
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
roger that
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?
What about getDir alt syntax between camera position and icon position?
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 :/
You want the icon to point (in 2d) the same way that the object is pointing (in 3d), right?
Yes, doesn't have to be 100% accurate tho, since I'm already rendering a line in front of the "unit" which gives out the more accurate direction.
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?
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.
It is. But that's simply the direction in 2d isn't it?
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.
Doesn't work unfortunately π
Works if im in front of the unit or behind it however
It works. I just can't tell what you're trying to do.
I think you want the icon aligned with the transformation widget arrow. https://community.bistudio.com/wiki/Eden_Editor:_Transformation_Widget#Changing_the_Reference_System
_p0 = worldToScreen (_object modelToWorld [0,0,0]);
_p1 = worldToScreen (_object modelToWorld [0,1,0]);
_iconDir = getDir (_p1 vectorDiff _p0);
Always pointing away from the 3den camera. Tried with both :
_iconDir = (vectorDir _object) getDir (_p1 vectorDiff _p0);
_iconDir = (vectorDir get3DENCamera) getDir (_p1 vectorDiff _p0);
Since getDir is expecting for a object at that point, unless first param is a 3d direction too.
can you just screenshot a few arrangements and draw the desired direction? π
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;
};```
oh yes I see. _iconDir = _p1 getDir _p0;
Is this correct behaviour?
Yes!
That's just getDir _camera - getDir _object. Apparently something is backwards.
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
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.
or just turn on the arrow? xD
Ah right, icon directions are backwards and 90 degrees points left.
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
Looks off, from certain angles, but I guess that would have to be fixed via using some more advanced math, or even changing the width and height of the icon dynamically
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
**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
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.
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?
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.
I always was feared to store things to the server ram. Now Ive enough ram to be confident. || were creative mode ||
Couple of short strings will only take small amount of RAM
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.
Where is the not str quote beeing added? By params?
Only skimmed but I believe the str since he says you're using it on a string
I tried only remoteExec without and fel really dumb after
You do isNil "_var" to check if _var is defined. str _var takes whatever is in _var and turns it into string. And if _var is not defined, it will likely throw error
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;
Am I using the wrong syntax? Thats not totally clear. Might be language barrier maybe.
You use variable name in string, as on example. isNil needs variable name, str takes value from variable, not it's name
Ohhhh... ...ahhhhhh. Im a bit rusty 
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.
Thanks for long text ill read instant
Is remoteExec giving the function the vlaue "TestTask"? Instead of TestTask (what I thought)
I fixed my own boobo isNil _task to isNil "_task" above in my code example.
I gues it was right without
You don't use the return value of remoteExec at all.
ufff
Well there is no real to do so either so..
Can you deny or agree my assumption
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";
Your really a brother from another mother. Thank for that premium explanations β€οΈ !
I'm off now, happy coding
Same to you. I will bring everything down to documentation. There also was many other people that sent in really usefull intel.
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?
Youβll definitely be able to detect them, just they are likely marked as something other than a tree, knowing arma itβs likely a rock or a bush.
okay seems like selectBestPlaces is the way to go as nothing else returns something resembling a forested place
i dont think you can, i cant figure out how if you could... i stooped as low as asking chatGPT...
You canβt even detect them using nearestTerrainObjects at the global level? Aka no filter?
nope
it returns smaller trees, not the pines
i can go right next to one and try again
Yeah Iβd definitely check it fully before giving up.
Just do it with sort nearest and ensure the filter array is empty
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...
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.
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
Can you point out a large one on the map, because I'm only seeing one size :P
ofc, small ones in red, large ones in blue :p
Yeah I think I have it down. t_pinuss2s_b_f.p3d is the larger one, t_pinuss2s_f.p3d is the smaller one?
i dont know , hard to check
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.
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.
yeah there are at least three then :P
All three seem reliable with 3m + 2d mode for me.
okay on 9m i got one
Are you sure you're on 2d mode :P
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
Yeah without 2d mode it depends on how far down they put the tree.
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?
Either attaching to the chair or not switchMove being LE
Both are GE in the wiki. Will remoteExec though.
are you sure BOT_6 is local to the server?
There is no HC and it is a not playable bot.
well still better check it to be 100% sure
I will remoteExec on his owner yes
did you run enableSimulation false on the chair btw?
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?
If you're using cba, their patrol function should cycle the waypoints
Should be able to just add a new cycle waypoint at the end though if you don't/can't use cba
The BIS function does cycle and there is a cycle WP in the picture.
I think they want to generate a new WP set after each cycle instead of repeating the same set.
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?
Couldn't remember what the cycle one looked like, thought it might've been something else
Nope, the 2 "simulation boxes" are checked.
AFAIR, you should wait for mission start.
Try this:
(group opfordrone) addEventHandler [
"WaypointComplete",
{
params ["_group", "_waypointIndex"];
_waypoints = waypoints _group;
if (_waypointIndex != ((_waypoints select -1) select 1)) exitWith { };
{
_group deleteWaypoint _x;
} forEachReversed _waypoints;
[_group, getMarkerPos "marker_0", selectMin (getMarkerSize "marker_0")] call BIS_fnc_taskPatrol;
}
];
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.
try disableAI "ANIM" instead of "MOVE"
(it works on the local EDEN server, issue happens only on the dedicated, so I am not sure to see the link)
Is BOT_6 local?
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)
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
not playable bot placed into the editor.
I added the remoteExec because of recommendations here to ensure the locality is good. And ity is, not issue, the remoteExec is useless for sure.
it works locally....
I think you should try disableAI "ANIM" instead of "MOVE"
test on-going... (doing both)
With disabled ANIM, unit can't even switch weapons. so that could work
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
Wiki says it's LA
ya, okay for the argument, but the effect is not global I think: LE instead of GE
You can try to remote exec everywhere and see
Don't just read the examples, but also the text explaining why, at the top of the page
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.
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];
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 ;)
};
};
Why is it wrong? It looks correct for syntax 1
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
toString ?
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?
Syntax looks fine, but you have to pass number not string value?
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.
Maybe you wanted lnbSetData ?
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 π₯²
Value is used in sorting via lnbSortByValue.
Though data and text can be used via lnbSortBy.
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.
Yeah, gotta, say a function with 634 lines named fn_file.sqf that is then dealing with UI does sound hella sus
π
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 
Unfortunately the file is 1798 lines in total 
ummm
okay, so toString[97] to toString [122] is a-z
how can I select from this range?
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
nvm working on it
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
Depends a lot on how would use it, how often you would use it, and what the resolution of your grid is.
HashMap as a data structure maybe...?
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
With 1.55 you can select the range in random
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
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.,
https://community.bistudio.com/wiki/random
Syntax:
random [min, mid, max] Since Arma 3 v1.55.133393
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
Maybe bis_fnc_findSafePos could help?
https://community.bistudio.com/wiki/BIS_fnc_findSafePos
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.
atm:
_Letter = (round(random(25))+97;
e.g. (97+(0-25))
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
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.
i went with something different
for [{_i=97}, {_i<123}, {_i=_i+1}] do {
_arr pushBack _i;
};
thanks though
selectRandom is also faster than any other option for choosing a random value in an array btw
Any way to pull up player's weapon when he holds his weapon down?
I do not know that this will work, but you could try playActionNow with "WeaponOn" or "Combat"
"Combat" does it
"WeaponOn" switches to launcher and back to primary, even you don't any launcher at all π
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?
Is there a function to add when spawning a boat rack to include a boat in the rack?
if no function exists use https://community.bistudio.com/wiki/attachTo to attach the boat
this does look really cool, setting the resolution to 50 makes it take ages to run tho
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.
? 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
copy pasted into debug console
dunno, fresh editor, altis, benchmark button https://i.imgur.com/7mTI0RM.png
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)
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.
something in my modlist is mining bitcoins ugh
^^ "well kinda". As written before if you find out what mod that is, would be curious to know.
ill start investigating
I guess if it's firing an EH when markers are created?
Yeah, that is the only reasonable explanation, since no other behavior is really observable from that piece of code.
i narrowed down the list of suspects already i think
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.
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.
i think Zeus Enhanced is the culprit
if so, no biggie, i only need that when its in MP anyway
IIRC deleting markers was O(n) with the number of markers created, so spamming them is a bad idea in general.
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
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?
Looks like just a global variable
namespace to the mod and component
so something like zen_area_markers_editableMarkers
Yes but that means it's probably a CBA setting :P
Ah, yeah.
Noticed there is also per frame handlers over GVAR(markers) that it is added to.
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
Set that to "Zeus created only" and you're probably good. Although it might still be a bit slower.
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
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.
doing that π
Is there any way to detect mines placed in the editor? vehicles, allMines, and 8 allobjects 6 all dont seem to work
You need to use the 3den commands.
https://community.bistudio.com/wiki/Category:Command_Group:_Eden_Editor
Normal commands don't work while in editor the way they do in live.
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?
Is your repo public?
Unfortunately not, sorry π
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
It's in a config, right? I think you'd need to make at a function that gets called.
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 π€£
You can turn on text wrap in your editor
Should be able to have newlines
thing = "systemChat '1';
blah blah blah";
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...
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.
DUI has a variable you can set for that name, check the github wiki
what text editors are people using? i just downloaded visual studio code, it's beautiful. might finally replace notepad++
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.
atom here, how is VS code ? I have the beta installed, not tried yet.
Atom here as well
Sorry for the late response; I did try however I recieved an error along the lines of; 'Newline detected instead of ;', or something similar
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
getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName")
Or simply
getText (configOf _unit >> "displayName")
Thanks. I missed displayName somehow
Hello, I want to replace 82mm explosion in an artillery script by 155mm explosion, but I can't find the classname, where can I find it ?
Btw, I already tried stuff listed here (https://community.bistudio.com/wiki/Arma_3:_CfgMagazines#6Rnd_155mm_Mo_AT_mine) to no avail
the original classname is "M_Mo_82mm_AT_LG"
"6Rnd_155mm_Mo_AT_mine" magazine has "AT_Mine_155mm_AMOS_range" shells
thanks, but it doesn't work
I guess it's not about the shell, but the effect
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)
useGlobalLight=1; under class Watch
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?
it changed something but not the right effect
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
Its a cutRsc iirc
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
use pboproject 
I'm interested in this too as useGlobalLight never returned similar results to the compass/watch
in my attempts
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;
do you have a trigger called targets100trigger or a variable named that ? because you don't.
i got a trigger called that
make sure the name is right
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;
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
Oh actually, I noticed that Enoch changed the model path for the watch. Have you tried using that file path instead? model = "\a3\UI_F_Enoch\Data\Objects\Watch.p3d";
exactly
Yes, i tried even before asking for help here. I'm really confused about how it is done
Couldn't we find the userAction config of the watch? to find the function which could help decrypting this
Okay cool, I just had noticed that it was a different file path
I don't think there is one, or its certainly not going to be like config side
Most stuff is probably all just engine
I think so too sadly
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)
You'd need to change the condition of the user action in config to restrict it to the pilot
gotchya, what would the correct condition be called to be just the pilot?
player == driver this
player == driver this && { speed this > 1 };
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?
Maybe you need to reveal vehicles too?
try replacing getposatl _x with just _x
Yeah, units is specifically "units". Which is not defined anywhere on the wiki :P
but in general, humanoid soldiers with an AI brain.
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
vehicles select { side _x == _enemySide } probably does what you want.
but this would also return uncrewed vehicles still assigend to a group, right?
There is crew, which returns crew of vehicle
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
Apparently not.
oh? then thats good news, less work
i thought theyd still count until unassigned, as AI also engages empty vehicles belonging to a group
oh hmm
I know why, empty vehicles are civilian side π€£
addVehicle doesn't change the side but the side sticks after they've entered and left. Weird.
empty and unassigned, yes, but crew got out, but still assigned to group?
Probably a bug :P
Don't know
i will find out
leaveVehicle does reset it.
yeah that should unassign it from the group - i think it keeps its side as long as it still belongs to a group
Oh well. Filter for actual crew if you need to.
groups will return to their vehicle if a waypoint is far away so it makes sense
Well, the broken bit is that it doesn't change the vehicle side just from addVehicle.
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?
It works second time :/
if a crew bails out, is it like leaveVehicle so the vehicle gets unassigned or is it like unassignVehicle, so they side wont change?
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)
Do the normal ACE action (just Windows key) instead of ACE self action, and do like passengers > whoeverwhoever > medical menu.
so im not getting the passanger menu on the interact
but im realizing i dont have it added on the config lmao
It's added to all vehicles, it's only not there if you didn't inherit (or inherit correctly)
Did you mess with this more?
I haven't gotten the lighting part fixed on my end, but I did finally fix animating my thing.
I can still move my object desipite having movingEnable = 0 on the display and object explicitly. Since there's an event handler for moving them I think it might not be possible to remove it.
I could use ctrlEnable false as a workaround though
I did not much as I so decided to make my phone an 2d texture
but if we can sort things out and make it work that's would be great!
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?
Would like to know if you find how, I had the same issue when trying to have AI helocast boats a long while ago
do simpleobjects work better for that?
I think I tried as a test and it didn't work any better
ok
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
attachTo and call it a day? :p
nope π
the left plane nudges sometimes
no need for setVelocityTransformation (given you only use it with 1), go straight setPosASL / setVectorDirAndUp?
Try Draw3d instead of Each frame as well
ok i could try that but i thought there could be real flight feel in the plane
tried, it was horrible π
Alas. Could also try addForce to correct the ai pilot xD
well doesnt matter was just a test. they are flying alright in the formation
use visual position
and don't use getPosASL
use getPosWorldVisual
be sure to pass the origin to setVelTrans
ok i set everything to visual commands but still same problem
your _fPos is nonsense. use vectors
i thought i did π€
well actually you use position so I guess that's not a huge problem
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 π
you're still using getposasl
and like I said you need to provide the model center to setVelTrans
ah forgot getPosWorldVisual
same prob, updated code above. guess i need that model center
[0,0,0]
you mean the customCenter ? param # 10
yeah
does it flicker in MP or SP?
editor, SP..
yes init.sqf
(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;
}];
i thought setVelocityTransformation was the way. but i should try Lous way too, i guess...
less code, less chance to make a mistake :p (but they will be wilder, believe me xD)
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 ?
thx all, Lous code works very well π at least in SP
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.
setVelocityTransformation seems to be optimized for MP. reading the wiki here
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;```
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.
Busted, that part came from google desperation.
Guess what you are doing in that regard should work.
Use triple backticks for code blocks
```sqf
code
```
thank you, will do!
The intent was to try and make sure it was global, but I don't know that it helped me at all. Thanks for thinking about it.
As far as I can tell it's identical to setting the same values (including velocity) directly from the same machine.
So the only thing setVelocityTransformation does for you is the interval interpolation.
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.
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.
Well I would assume interpolation is not done locally for the other command.
IIRC some guy who was trying to make giant submarines proved otherwise :P
@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.
Since 2.18 there's also setAngularVelocity, which might be better than setVelocityTransformation for some uses.
Yeah that's one of the commands he asked for, and it still wasn't interpolating correctly
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.
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.
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
Well, where do you want it to point?
directly at the camera.
The up vector?
yup, no rotation to the left or right, just up and down basically
well, your dirVector is pointing towards the camera (ish), right
dirVecotr is fully fine, that one works
What you probably want is the up vector to be in the same plane as [0,0,1]?
without the up vector is points directly at the camera, but it does not look up or down
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;
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
ASLtoAGL with a getPasAGL? ah yeah that makes more sense.
private _dirVector = ((AGLtoASL positionCameraToWorld [0, 0, 0]) vectorFromTo (getPosASL _object));
AGL/ATL/etc are never valid for 3d vector comparisons.
well it would ahve broken over water then π
breaks just on sloped terrain.
should probably be getPosWorld rather than getPosASL but that's not exactly documented.
would be a bit bad with the positionCameraToWorld wouldn't it?
world pos is not fully the asme as posASL
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.
How to run code on briefing screen? I want to move map to some other position
Usually init.sqf will run and that is enough
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
There is a function to animate the map. Try that one.
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.
@hushed turtle what about a hyperlink
player createDiaryRecord ["Diary",["Objective Map Link","<marker name='Enemy City'>Enemy City</marker> Enemy City"]];
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. 
hallo does anyone know what script was used here? so that players can only see zombies/opfor when nvgs/thermals are on
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...
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
can the sound/volume of running be changed via script?
run setObjectTexture locally on the player for the ai based on the currentVisionMode of the player
I wonder if theres an EH for when you close the server via the close button on the A3Server console
You could investigate the soundPlayed EH. It can modify sound volumes but I don't remember if it covers running
doesnt seem to
its only for injured or fatigued but cant get it to work even for fatigued
Were you talking about a map object ? (before)
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
what players hear
I mean it has worked fine for me
Hmm that looks interesting but not sure if it can do wehat I need it to do
Idea is to open a ts3 link when players press a main menu button
Should be able to just do something like this
#arma3_gui message
i think you'll need to wait until next update, ts3server: links are only supported in profiling/dev branch at the moment #arma3_branch_changelog message
is there any way to get rid of a vanilla/default marker on the map?
how do I know the name?
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.
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
You can use hideTerrainObject and setTerrainHeight to make some changes
so theres nothing to remove a location marker?
yeah
or in my instance a hill and gas station marker
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
Obligatory plug that Modules Enhanced has a module for location names for ease of use.
what the fuck
You downloaded the Australian version
Kookaburra edition
If you don't get it, check the date
The real April fools is that half of the world isn't on April 1st yet
Ik ik
Is there any EH that gets triggered when I close the server doing #shutdown or smth like that?
Try MPEnded mission event handler π
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#MPEnded
Mod override on the map's CfgWorlds... can add and modify easily and override the entire Locations class to remove ones to be gone
I mainly use it to add new POIs to a map
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
We use it heavily because Antistasi uses the CfgWorlds names to identify towns, and on some maps the positions are really bad.
Way easy to change with a server mod though...
(Not server side, mod for server ofc)
Didnt trigger when I tried idk why
sniff
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?
Yeah π«
This approach seems the best, endMissionServer, thanks Scotty
Can you make an example sccript of this please?
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!
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?
yes, the string version edits the same effect; handle creates one on top of another
Hey, thanks Lou. So, for ColorCorrection. If I change the colorCorrection effect with the string, is this the "version where the color correction of the player from the video options menue happens or is this even another layer?
This script command uses old error checking (before we cleaned it up and unified it)
and it doesn't do it like everyone else, when you provide wrong argument type, it SILENTLY errors and returns nil.
other commands like lnbGetPicture, lnbSetData, lnbGetData, lnbSetText, ... do it too.
All the lnb commands need refactoring to the new type checking
A FT ticket would be appropriate
it's "this scenario's color correction"; I assume user settings cannot be changed at all / overridden
Very interesting- I'll toss one up and link it in #arma3_feedback_tracker- thank you for the response π
Whats the script that does the opposite of !alive
https://community.bistudio.com/wiki/alive just remove the ! to check if something is alive
! just means 'is not'
Ah okie dokes! Thanks
|| 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
#define |& selectRandom [true, false]
Err
Actually that wouldn't work
Haha
would that even work 
pretty sure macros dont accept symbols, but if they do it would be funny to try
Not sure about symbols but would also be doing
if (alive player true playerSide isEqualTo west) then {}

Eyyy, let's not break the spacetime
no you see we have to brick the entire sqf syntax parsing just so we can have questionable probability
it would be if |&(alive player)
it does absolutely nothing with the input π
it's just there to exist
It would explain a lot of things if quantum mechanics were powered by SQF π /s
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 "||"]
Wouldn't that also not work since compile is just replace with code {}?
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 
#define MAYBE_OPERATOR(leftArg,rightArg) (selectRandom [leftArg || rightArg, leftArg && rightArg])
beautiful 

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 π€£
That'd be nice
The stupid way, same way as the string interpolation
x ?? y
->
if (isNil {x}) then [{y}, {x}];
But that's not very efficient
Translation need be more elaborate and not evaluate x potentially twice.
But I wanna be lazy
"Sweat now saves CPUΒ cycles later"
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
bounding radius, isn't it? Which is a pretty bullshit value in general.
don't forget about boundingBoxReal π
syntax 3 being the good one for some reason.
Not sure how well it works on units though.
Seems like all units return same sizes
we need boundingBoxFinalV2
that shouldnt be happening tho
Well I only care about sizeOf because that's what BIS_fnc_exportEditorPreviews uses
ah
yeah wasnt sure what you were doing
wait, are the two units playing different animations by any chance?
Nope, it's just in Eden
hm
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
Β―_(γ)_/Β―
NGL that syntax would be absolutely sick for select π
if(condition1 ?? condition2) ?? for lazy evaluation wen
or &? for and lazy eval if(condition1 &? condition2)
I don't see how you could make something like that meaningfully different from the existing && lazy eval syntax
Don't have to bother with code blocks
the existing lazy eval isnt very readable
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
ya might be undoable
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
&&? my favorite π
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 :)
whats the problem exactly? sorry i dont get it π
Sorry probably could've worded that better- it would be an execution exploit in MP
you have to understand we need more uncertainty in sqf

(also this whole thing was a joke dont overthink it)
but it indeed would be funny
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
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.
He's talking about what Dedmen said here #arma3_scripting message which would be real syntax π
fair point, i've figured out a way to not need to use cursorObject since asking which imo is my best course of action lol
from videos i've watched about it i think it works better for sp missions
ah, sorry
I'm not aware of any MP-specific cursorObject issues.
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.
IIrc it doesn't work for certain kinds of terrain objects. Not sure if that helps any but FWIW
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 {};
Are you sure the entityKilled EH is firing for you and not for the parachute vehicle?
yes
[format ["%1 died!", name _killed]] remoteExec ["systemChat"];
``` says "Trioxide died!"
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.
yes, theres this first:
if (!isPlayer _killed) exitWith {};
I think you should confirm that that's working by testing with typeOf
ohh
nevermind, just did
its the parachute
thanks
should I use _killed isKindOf "CAManBase" instead of isPlayer _killed?
Depends what you're trying to achieve? First one is units, second one is players.
isPlayer doesnt work for reasons explained above
Nah, you must have an error somewhere. name _vehicle does return the name of the crew but isPlayer _vehicle will still be false.
If I do this, will it hide the object to everyone except the local player?
_object hideObjectGlobal true;
_object hideObject false;
Yes
Or wait no, it's server exec right
No, executed locally
According to the wiki, hideObjectGlobal is server execution and has no effect elsewhere.
I guess I remoteExec the first one on server
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.
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.
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.
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?
pls post #define
https://en.wikipedia.org/wiki/Logic_gate
We don't have all of the types as commands, but this is where the names come from. There is standardised terminology for this.
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.
Could probably drawLine3D from the weapon on Fired event handler or something. Not sure the best way to get the muzzle position for weapon muzzle though off the top of my head. Others might have ideas there if needed
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
Thank you!
Hello do u know who made the Evannex mod
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.
private _unit = somegroup createUnit ...
_unit setVariable ["varname", value]
What if they're spawned with a spawnGroup command and all need unique variable names?
that function returns the group so just get the units from group and iterate over each of them
sorry hold on - you need to assign a variable name or a value?
those two are different things
Variable name.
Something a task can use to identify when the spawned units have died.
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)
I think you could just save the name of the group and see if it has any alive units.
but yeah what sticky joe said is a better option
How would you approach that?
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
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];
And is there a way to verify that they've been assigned after spawning?
The variables?
didnt you say you were spawning via script?
Yes.
You could use getVariable but if you use setVariable you're never really gonna have any issues unless you use the public flag to broadcast it across the network
Which would be required for it to be seen by other players and/or server
But after they're spawned by script, I can't really check to see if the variables were actually assigned to them.
With getVariable you can- for example:
cursorObject getVariable [format ["var_%1", _yourTaskName], _valueIfNotExist];
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
};
he did specify variable name, not actual variable assignment
but in either case the method is technically unnecessary for what he wants to do
PatrolUnit spawn {
waitUntil {({alive _x} count (units _this)) isEqualTo 0}; };
["Patrol Elimination", "SUCCEEDED"] call BIS_fnc_taskSetState;```
So something like this?
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
Don't even know what that means, lol.
If you can't tell, I'm not super familiar with scripting.
okay in that case just put the taskSetState in the spawn block π
its more about where the code is being executed
My bad I am probably misunderstanding the question then. For your example though you could probably use a findIf as that will exit if an alive unit is found
units _this findIf {alive _x} isEqualTo -1
Although not that it really matters tbh π
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;
};
Why is the word private included?
eh true, technically both iterate through all elements anyway (though yours is technically more correct)
you dont need to unnecessarily make patrolUnit a global variable unless you're accessing it elsewhere
if you are, remove it
The command findIf will exit early if a unit is to be found alive :D
oh, right
also edited it - added private before the spawn too by accident π
too tired to think sqf now, dont use findIf too regularly lol
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
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
Gave this a test, but it didn't work.
Can't tell if the variable wasn't assigned correcty, or if its the task.
Uuh... @old owl you spot anything?
If you cannot even tell if it is actually running or failing silently, make sure the code is actually running. Use hint!
Might be with spawngroup, unless the group IS spawning
It is.
Not off hand but I've never used those functions before
put a hint to output the groop and see if its valid inside the spawn block
Could be something is nil causing the script to end?
Also I can bet a dime if waitUntil is failing and deadlocking
Also very possible
Like this?
_patrolUnit spawn {
waitUntil {({alive _x} count (units _this)) isEqualTo 0};
["Patrol Elimination", "SUCCEEDED"] call BIS_fnc_taskSetState;
};
hint "Testing!"```
It came through.
Inside the spawn code block
Could also add a systemChat/diag_log or something inside the waitUntil block too to see if it is running without exit
Where inside it?
Idk what place inside of the script risks breaking it or something,
_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
The units spawned, but I didn't get any hints.
They're vanilla units, so idk why they wouldn't be vaild.
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
Understandable.
/// 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?
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
im suspecting it has something to do with scopeName as i never used that before
so maybe im using it wrong
Just that and remove the variable script?
no dont need to remove anything just make sure that hint is after the bis_fnc_spawngroup
basically above the spawn
Got a value this time, Group 0, Alpha 1-6.
okay so it's just not being fed to the spawn 
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
Kk
it works on my end lol
are you sure you used the code exactly as i pasted?
Paste what you used and I'll try it on my end.
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;
};
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
no problem π
did chatgpt give this to you?
no, why?
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
its an excerpt of a larger script i have more states so i figured id use switch
ah, right
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)
fair, good luck π
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?
Post what you've done
And why you're sure one of them is not working?
Yes
I said why, that's not a yes or no question
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.
You sure your description.ext is reloaded after you change? Ctrl+S to save and reload it?
Yes
missionConfigFile >> "CfgMusic" >> "CD" in Debug, what it does say?
Please let me take time to look
I didn't find "CD". I also didn't find "The_Rooster".
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.
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
How do I open the missionConfigFile?
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
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?
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.
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.
Hello anyone here
No
where I can find it's class or something that I can call it in script
I think this module is from Zeus addition
Place it somewhere. Right click -> show in config
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
you can do that with https://community.bistudio.com/wiki/getHitPointDamage for wheels
oh thank man ! i'm absolutely beginer and i try the very basic to get in script logic
its not available in eden editor. i have to place it through zeus. config will still open with right click ?
nah it did not open
Add the action directly to the vehicle.
i will try, i'm experimenting small script that make repair way longer and also consume repair kit
but i take notes
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"?
The waitUntil would pause the execution of the while loop as well since it's context is within the same script. If you wish to run that waitUntil asynchronously you could spawn it like:
_args spawn {
...
};
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 π
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 π
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;
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.
yeah, its only for script testing, it wont be called like this in the end - but you are right, a > was pointing the wrong way.. the full script is rather large, i didnt notice... was going insane and started to doubt if it would even pause in the first place
thanks!
it evaled as true immediately
any way to recharge the battery of IED UAV from WS, it does not accept the ace battery like AR-2 ? π€
I'm pretty sure UAV "battery" is just fuel, so setFuel
@hallow mortar you are right π I just refuel the "battery" of UAV with fuel canister, immersion gone π
Is there anyone nice and friendly on here
in this community? never
Arma community could solve all world problems if they asked in the right channels
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
what is happening
I think he's trying to get banned.
I casually open this channel once in a month and I come to this
Trying to find the person that owns a damn mud and you guys are unwilling to be nice and helpful bastards
he is just a troll ... I sensed it the moment he entered just to say hi without any question
Didn't someone answer that question elsewhere? You haven't asked anything here.
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
Im sure someone wouldve answered if they knew the creator of evannex mod whatever it is
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.
!issueWarning 437454614741385237 name-calling - be respectful too if you want it to be kept civil, thanks
Done.
with this out of the way; how can we help? π
@winter rose then they dont need to be rude and be more helpful and stop judging
they haven't been; now what do you need
Im doing myself i found the creator of the mod now im figure out how to contact them
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? π€
kiba pic?
@proven charm you can see them when they open the map, mostly for cas support and SLs
https://www.youtube.com/watch?v=rq_lptHgsgk&t=25s (1:09:20 for example)
βΊ About #ShackTac: https://shacktac.dslyecxi.com/
βΊ About this channel/my videos: http://dslyecxi.com/yt/
Bohemia Interactive, the creators of the Arma series from Operation Flashpoint to #Arma3, can be found here: http://www.bistudio.com
You mean via scripting or ingame? It is vanilla feature.
via scripting ? 
this is serious math envolved ... maybe I will be able to draw ... a square π΅βπ«
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.
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 ?
If you are using Ace you have Blueforce tracker that will give you that feature.
Why not use the built-in markers?
@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 ...
easy way would be just to create a custom mod with custom map markers and have that marker follow a unit.
actually you can have custom markers without a mod, but this this is not what I want ... custom markers are not polyline markers
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;
@errant jasper 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.
Anyway to change setPIPEffect NVG's to a different color? As in apply a different color overlay on a PIP camera
@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;
Error where?
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];
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.
The params line should be _center params ["_cx", "_cy"];
