#arma3_scripting

1 messages · Page 112 of 1

abstract gorge
#

hey again, im having trouble with a script im making to spawn a vehicle from an addaction. this is what i have to try and spawn an mrap for 25 points.


if (supplyPoints >= 15) then
{
hint "You deployed an MRAP Unarmed";
group_1 = createGroup west;
[getmarkerPos vehiclespawn, 180, "Athena_B_G_MRAP_01_F", west] call BIS_fnc_spawnVehicle;
supplyPoints = supplyPoints - 15;
sleep 3;
[module_zeus_1, [units group_1, true]] remoteExec ["addCuratorEditableObjects", 2];
hintSilent format ["Supply Points: %1", supplyPoints];
}
else {hint "You do not have enough supply points!";}

Im getting an error line 6 type object expected array.
lost to be honest again i could not get

_veh = createVehicle ["ah1w", position player, [], 0, "FLY"];

that format to work either making a complete mess of it

pale cradle
dreamy kestrel
#

any ideas why BIS_fnc_sortBy does not sort as expected?

mossy sorrel
#

What do you guys think is better for a mission: Saving (dynamic) configuration values in global variables and checking them by if(!isNil("var")) or writing them to missionNamespace and using getvariable command with optional default value?

fair drum
still forum
#

getVariable is way easier because you wont forget the isNil checks and is also a bit faster (a tiny bit)

still forum
#

you can just look at the code of sortBy to see what it does

dreamy kestrel
mossy sorrel
#

But it is a very different approach in comparison to the "old" style of using global variables

dreamy kestrel
#

would expect this:

// [["a",2],["b",3],["b",4],["b",6],["c",1]]
#

hmm, so why is it this works:

[_y, []] call bis_fnc_sortby;

but this does not?

[_y, [], {_x}] call bis_fnc_sortby;
#

similarly:

[_y, [], {}, 'descend'] call bis_fnc_sortby;

versus:

[_y, [], {_x}, 'descend'] call bis_fnc_sortby;
still forum
#

Well you learn by trying new things ^^ it doesnt hurt. But none of both methods actually is "better" getVariable looks better in script and is a little faster and easier to implement. But if youre used to the old style that may be better for you

mossy sorrel
#

I have no problem with switching to another coding style, I am always keen to improve my skills. But I am worried about the readability of my code to other people. I am not sure everybody already knows enough about the namespace stuff.

#

Oh and, this should work, right: somevar = "blah"; hint str (missionNamespace getvariable "somevar"); //should hint "blah";

willow hound
#

Have a look at drawLine3D if you want to render the bounding boxes ingame.

still forum
#

yeah.

mossy sorrel
#

Splendid!

still forum
#

Readability wise.. id say use the old system but initialize all variables first with default values. So you can skip the isNil check. Everyone understands the old system. Plus everyone has the default values in one view.

granite sky
#

@dreamy kestrel Documentation for BIS_fnc_sortBy is wrong. The function needs to return a number or string.

#

It's because it's creating arrays of [function output, initial placement index, original data] and then calling sort on those.

dreamy kestrel
still forum
#

I see that, by white box static analysis.
You mean.. By reading the code of BIS_fnc_sortBy by just looking it up in function browser?

#

"white box static analysis" aka reading code

dusk gust
#

Fancy words magic man

granite sky
#

BIS_fnc_sortBy is just a sort wrapped with a couple of apply anyway. Do it yourself.

still forum
#

Documentation for BIS_fnc_sortBy is wrong. The function needs to return a number or string.
Doesn't look wrong to me

granite sky
#

Array doesn't work.

still forum
#

Subarray elements other than String or Number will be ignored during sorting.
ah

granite sky
#

In the docs on the function itself it specifies scalar, but string should work too.

granite sky
#

Overshoot :P

dreamy kestrel
# granite sky In the docs on the function itself it specifies scalar, but string should work t...

except that I have a use case where I need to potentially sort by both, first a display name, then potentially also a scalar value, not necessarily in that order. but at any rate, I think I have a workaround, i.e.

_y = [
  [_mass, _displayName, _hashmapUnitOfWork]
  , ...
];
[_y, [], {}] call bis_fnc_sortby; // in either 'ascend' (default) or 'descend'

appears to do the right (expected) thing, then we should be able to lift the _hashmapUnitOfWork afterwards.

still forum
#

you are not doing a sortBy.. that's just a sort

#

wasting alot of performance by going through the script function instead of using sort directly

dreamy kestrel
#

there might be other filters we engage in the process, this is just one part of the workaround.

granite sky
#

plus making a couple of copies of the array :P

#

filter: _arr1 = _arr2 select { condition }

dreamy kestrel
#

effectively done first part of sortby, but fair points, all, touche

abstract gorge
glossy pine
#

compileFinal doesnt work on hashmaps or im dumb?

#
TEST_HASHMAPFINAL = createHashMap;
TEST_HASHMAPFINAL set ["key", "init"];
compileFinal TEST_HASHMAPFINAL;

// Shouldnt get added right?
TEST_HASHMAPFINAL set ["key2", "init2"];
dusk gust
abstract gorge
#

okay so i got my vehicle to spawn but its not being added to the zeus when it spawns, but im not getting any errors this is what i got so far


if (supplyPoints >= 55) then
{
hint "You deployed an L4 Tracked APC";
supplyPoints = supplyPoints - 55;
sleep 3;
group_1 = createGroup west;
[getmarkerPos ["vehiclespawn"], 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;

[module_zeus_1, [units group_1, true]] remoteExec ["addCuratorEditableObjects", 2];
hintSilent format ["Supply Points: %1", supplyPoints];
}
else {hint "You do not have enough supply points!";}

if (supplyPoints >= 55) then
{
hint "You deployed an L4 Tracked APC";
supplyPoints = supplyPoints - 55;
sleep 3;
vehicle_1 = createGroup west;
[getmarkerPos ["vehiclespawn"], 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;

[module_zeus_1, [vehicle_1, true]] remoteExec ["addCuratorEditableObjects", 2];
hintSilent format ["Supply Points: %1", supplyPoints];
}
else {hint "You do not have enough supply points!";}```
just tried this and got type group expect array, is this a commas issue?
#

or should i not even be creating a group with the vics

abstract gorge
#

if (supplyPoints >= 55) then
{
hint "You deployed an L4 Tracked APC";
supplyPoints = supplyPoints - 55;
sleep 3;
vehicle_1 = createGroup west;
[getmarkerPos ["vehiclespawn"], 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
_vehicles = [vehicle_1];
[module_zeus_1, [_vehicles, true]] remoteExec ["addCuratorEditableObjects", 2];
hintSilent format ["Supply Points: %1", supplyPoints];
}
else {hint "You do not have enough supply points!";}

getting type group expected object with this 😒

sullen sigil
#

vehicle_1 = createGroup west;

#

a group is not a vehicle

abstract gorge
#

a group is not a vheicle

#

i do not know how to rectify this

#


if (supplyPoints >= 55) then
{
hint "You deployed an L4 Tracked APC";
supplyPoints = supplyPoints - 55;
sleep 3;
vehicle_1 = createVehicle [getmarkerPos ["vehiclespawn"], 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
_vehicles = [vehicle_1];
[module_zeus_1, [vehicle_1, true]] remoteExec ["addCuratorEditableObjects", 2];
hintSilent format ["Supply Points: %1", supplyPoints];
}
else {hint "You do not have enough supply points!";}```

im butchering it
sullen sigil
#

however remoteexec for each unit isnt the greatest idea

warm hedge
#

One tip: if those variables are only used in the script and not really should be called somewhere else, you want local variables not global vars

abstract gorge
#

i dont know what any of these things mean 😦

warm hedge
#

Another: use indent is one way to get rid of your headaches

abstract gorge
#

i know what indent means hahhaa

#

yessss

abstract gorge
abstract gorge
#
if (supplyPoints >= 55) then
{
hint "You deployed an L4 Tracked APC";
supplyPoints = supplyPoints - 55;
sleep 3;
vehicle_1 = createVehicle [getmarkerPos ["vehiclespawn"], 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
_vehicles = [vehicle_1];
[module_zeus_1, [_vehicles, true]] remoteExec ["addCuratorEditableObjects", 2];
hintSilent format ["Supply Points: %1", supplyPoints];
}
else {hint "You do not have enough supply points!";}```
so i need to get an array of the vehicles , this gave me type array expected string 😒
#

does that mean i just wants a couple commas to hug it?

warm hedge
#

I forgot how do you use BIS_fnc_spawnVehicle but the syntax seems very wrong

#

Also getMarkerPos requires string not array

hallow mortar
#

Hold on, you're trying to do createVehicle and BIS_fnc_spawnVehicle at the same time in the same instruction.
You should.....not do that. Pick one.

abstract gorge
#

oh god

#

if (supplyPoints >= 55) then
    {
    hint "You deployed an L4 Tracked APC";
    supplyPoints = supplyPoints - 55;
    sleep 3;
    vehicle_1 = createGroup west;
    [getmarkerPos ["vehiclespawn"], 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
    _vehicles = [vehicle_1];
    [module_zeus_1, [_vehicles, true]] remoteExec ["addCuratorEditableObjects", 2];
    hintSilent format ["Supply Points: %1", supplyPoints];
    }
else {hint "You do not have enough supply points!";}
``` so that successfully spawns the vic but gives an error
#

thats an earlier version, so ive gotta gut either the create vic or the callspawn

hallow mortar
#

Because you're saving a group (the result of createGroup west ) to the vehicle_1 variable, not saving the result of the BIS_fnc_spawnVehicle to anything, and then trying to use vehicle_1 as if it contains a reference to a vehicle

#

Remove createGroup west; and move vehicle_1 = to the start of the next line

abstract gorge
#

if (supplyPoints >= 55) then
    {
    hint "You deployed an L4 Tracked APC";
    supplyPoints = supplyPoints - 55;
    sleep 3;
    vehicle_1 = [getmarkerPos ["vehiclespawn"], 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
    _vehicles = [vehicle_1];
    [module_zeus_1, [vehicle_1, true]] remoteExec ["addCuratorEditableObjects", 2];
    hintSilent format ["Supply Points: %1", supplyPoints];
    }
else {hint "You do not have enough supply points!";}

i tried this a couple different ways unsuccessfully type array expected object

hallow mortar
#

You also need to remove the [] around "vehiclespawn" in your getMarkerPos. The [] indicate to the game that something is an Array - a data structure containing other data types - but getMarkerPos doesn't work with Arrays, it works with Strings (like "vehiclespawn" )

abstract gorge
#

so vehicle_1 should not be in brackets? or am i way off the mark lol

#

oh

#

was i along the right lines then okok

hallow mortar
#

You've essentially given getMarkerPos a box containing the information it needs. But the command is not very smart and needs you to take the information out of the box so it can read it.

abstract gorge
# hallow mortar You've essentially given `getMarkerPos` a box containing the information it need...

if (supplyPoints >= 55) then
    {
    hint "You deployed an L4 Tracked APC";
    supplyPoints = supplyPoints - 55;
    sleep 3;
    vehicle_1 = [getmarkerPos "vehiclespawn", 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
    _vehicles = [vehicle_1];
    [module_zeus_1, "vehicle_1", true] remoteExec ["addCuratorEditableObjects", 2];
    hintSilent format ["Supply Points: %1", supplyPoints];
    }
else {hint "You do not have enough supply points!";}```
that was my latest attempt, no error but not editable in zeus, progress? haha
#

_vehicles = [vehicle_1]; im not sure bout the brackets on this bit

#
if (supplyPoints >= 55) then
    {
    hint "You deployed an L4 Tracked APC";
    supplyPoints = supplyPoints - 55;
    sleep 3;
    vehicle_1 = [getmarkerPos "vehiclespawn", 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
    _vehicles = [vehicle_1];
    [module_zeus_1, _vehicles, true] remoteExec ["addCuratorEditableObjects", 2];
    hintSilent format ["Supply Points: %1", supplyPoints];
    }
else {hint "You do not have enough supply points!";}``` trying that
#

no beuno

hallow mortar
#

That's almost correct, but you've converted the addCuratorEditableObjects syntax to remoteExec slightly wrong.

#

Excuse me while I type on mobile

abstract gorge
#

not a problem man thank you so much for your education lol

hallow mortar
#

In the non-RE syntax, the left argument is the curator module Object, and the right argument is an Array containing the objects (another Array) and whether to include crews (Boolean).

When you convert to RE, you need to take both left and right arguments and place them intact into another Array, to form the left argument for remoteExec.

You've put the left argument into this new Array intact - but you've taken the values in the right argument out of their original Array.

abstract gorge
#

okay wow this is actually really interesting haha excel on acid

hallow mortar
#

Original/wrong/right:

[curator, units, docrew] remoteExec ... ;
[curator, [units, docrew]] remoteExec ... ;```
abstract gorge
#

just letting my brain smell all the juices

#
if (supplyPoints >= 55) then
    {
    hint "You deployed an L4 Tracked APC";
    supplyPoints = supplyPoints - 55;
    sleep 3;
    vehicle_1 = [getmarkerPos "vehiclespawn", 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
    _vehicles = [vehicle_1];
    [module_zeus_1, [_vehicles, true]] remoteExec ["addCuratorEditableObjects", 2];
    hintSilent format ["Supply Points: %1", supplyPoints];
    }
else {hint "You do not have enough supply points!";}```

Now this didnt work, wasnt expecting it to, is it the right hand of ["addCuratorEditableObjects", 2] that needs something? so the amount of brackets is the same either side of remoteexec? or am i completely off the trail?
hallow mortar
#

I'm not certain what is the problem, but the number of brackets in the remoteExec is not it

#

The left argument of remoteExec has that number of brackets because one of the arguments for addCuratorEditableObjects is an Array. The stuff in the right argument of remoteExec is not influenced by what's happening in the left - the brackets on each side aren't connected and don't have to match.

#

Is module_zeus_1 the name of a curator module (classname ModuleCurator_F) or of a playable Zeus entity? It needs to be the first.

abstract gorge
#

im getting type array expected object with


if (supplyPoints >= 55) then
    {
    hint "You deployed an L4 Tracked APC";
    supplyPoints = supplyPoints - 55;
    sleep 3;
    vehicle_1 = [getmarkerPos "vehiclespawn", 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
    _vehicles = [vehicle_1];
    [module_zeus_1, [vehicle_1, true]] remoteExec ["addCuratorEditableObjects", 2];
    hintSilent format ["Supply Points: %1", supplyPoints];
    }
else {hint "You do not have enough supply points!";}```

also tried

```sqf

if (supplyPoints >= 55) then
    {
    hint "You deployed an L4 Tracked APC";
    supplyPoints = supplyPoints - 55;
    sleep 3;
    vehicle_1 = [getmarkerPos "vehiclespawn", 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
    _vehicles = [vehicle_1];
    [module_zeus_1, _vehicles, true] remoteExec ["addCuratorEditableObjects", 2];
    hintSilent format ["Supply Points: %1", supplyPoints];
    }
else {hint "You do not have enough supply points!";}```

tried removing brackets around _vehicles, true
#

second gave no error but not editable

hallow mortar
hallow mortar
abstract gorge
#

zeus_module_1 refers to the curator module

#

module_zeus_1 rather

hallow mortar
#

Remember, the right argument for addCuratorEditableObjects is an Array (outer brackets around _vehicles, true) containing another Array, which is currently saved inside _vehicles, by the previous line _vehicles = [vehicle_1].

#

Strictly speaking, you could just skip _vehicles since there's only the one, and do it like this:

[module_zeus_1, [[vehicle_1], true]] remoteExec ... ;```
abstract gorge
#

["addCuratorEditableObjects", 2]; is this part incorrect?

hallow mortar
#

No, there's nothing wrong with that.

#

vehicle_1 is inside another Array because the addCuratorEditableObjects parameter it corresponds to can accept multiple vehicles at once. We're not doing that here, but the command is set up to handle it, so it requires a list of vehicles. So we give it a list that just happens to only have one thing in it.

abstract gorge
#

yes i understand that i think man thanks

#

3:22:29 Error in expression <supplyPoints - 55;
sleep 3;
vehicle_1 = createVehicle [getmarkerPos ["vehiclespa>
3:22:29 Error position: <createVehicle [getmarkerPos ["vehiclespa>
3:22:29 Error Type Array, expected String
3:22:29 File C:\Users\paul_\Documents\Arma 3 - Other Profiles\PVT%2e%20P%2e%20Frogg\missions\WW3%20RTS.Altis\scripts\buyapc1.sqf..., line 7

this is what the rpt says when i run


if (supplyPoints >= 55) then
    {
    hint "You deployed an L4 Tracked APC";
    supplyPoints = supplyPoints - 55;
    sleep 3;
    vehicle_1 = [getmarkerPos "vehiclespawn", 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
    _vehicles = [vehicle_1];
    [module_zeus_1, [[vehicles], true]] remoteExec ["addCuratorEditableObjects", 2];
    hintSilent format ["Supply Points: %1", supplyPoints];
    }
else {hint "You do not have enough supply points!";}```
#

dang man

hallow mortar
#

Save the file

#

The error is reporting that getMarkerPos has an array in it again, but you already fixed that

abstract gorge
#

type array expected object, i thought it wanted an array hahahah i put "_vehicles" not "vehicles"

hallow mortar
#

You've gone too deep. It does want an array, but you've put an array inside an array inside an array

#

See how vehicles is orange in the syntax highlighting? That's a command. It returns an array of every vehicle currently in the mission.

abstract gorge
#

if (supplyPoints >= 55) then
    {
    hint "You deployed an L4 Tracked APC";
    supplyPoints = supplyPoints - 55;
    sleep 3;
    vehicle_1 = [getmarkerPos "vehiclespawn", 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
    _vehicles = [vehicle_1];
    [module_zeus_1, [[_vehicles], true]] remoteExec ["addCuratorEditableObjects", 2];
    hintSilent format ["Supply Points: %1", supplyPoints];
    }
else {hint "You do not have enough supply points!";}```
4:34:46 "3den Enhanced: Debug Options initialized."
 4:34:51 Error in expression <(_this select 0) addcuratoreditableobjects (_this select >
 4:34:51   Error position: <addcuratoreditableobjects (_this select >
 4:34:51   Error Type Array, expected Object
warm hedge
#

You need a sleep

hallow mortar
#
_vehicles = [vehicle_1];
[module_zeus_1, [_vehicles, true]] remoteExec [ ... ];
// SAME AS
[module_zeus_1, [[vehicle_1], true]] remoteExec [ ... ];
// DON'T MIX```
You're combining two different solutions when you just need to choose one.
abstract gorge
hallow mortar
#

When you do _vehicles = [vehicle_1];, that means that using _vehicles is exactly the same as using [vehicle_1] from now on. If you do [_vehicles], that's like putting [[vehicle_1]] - too deep!

abstract gorge
#

if (supplyPoints >= 55) then
    {
    hint "You deployed an L4 Tracked APC";
    supplyPoints = supplyPoints - 55;
    sleep 3;
    vehicle_1 = [getmarkerPos "vehiclespawn", 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
    _vehicles = vehicle_1;
    [module_zeus_1, [_vehicles, true]] remoteExec ["addCuratorEditableObjects", 2];
    hintSilent format ["Supply Points: %1", supplyPoints];
    }
else {hint "You do not have enough supply points!";}```

so i took the brackets from the "vehicle_1"
 and got error
```sqf
4:42:22 Error in expression <(_this select 0) addcuratoreditableobjects (_this select >
 4:42:22   Error position: <addcuratoreditableobjects (_this select >
 4:42:22   Error Type Array, expected Object```
#

god im running out of steam

#

im losing my fighting spirit

hallow mortar
#

#arma3_scripting message
Either of these is a valid solution exactly as written (except the right half of remoteExec obviously). The problem is that you keep doing half of each.

#

I would recommend choosing the second one, because saving the single-element array as _vehicles is clearly adding an unhelpful layer of abstraction.

abstract gorge
#

if (supplyPoints >= 55) then
    {
    hint "You deployed an L4 Tracked APC";
    supplyPoints = supplyPoints - 55;
    sleep 3;
    vehicle_1 = [getmarkerPos "vehiclespawn", 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
    _vehicles = vehicle_1;
    [module_zeus_1, [[vehicle_1], true]] remoteExec ["addCuratorEditableObjects", 2];
    hintSilent format ["Supply Points: %1", supplyPoints];
    }
else {hint "You do not have enough supply points!";}```
i have tried to do as you say and got type array expected object ```sqf
4:49:09 Error in expression <(_this select 0) addcuratoreditableobjects (_this select >
 4:49:09   Error position: <addcuratoreditableobjects (_this select >
 4:49:09   Error Type Array, expected Object```
#

sorry brother

#

thanks so much for tryng to help me man sorry im so clueless right now

hallow mortar
#

Okay well this one is slightly on me now, because I did not realise that BIS_fnc_spawnVehicle actually returns an Array, not just the vehicle

abstract gorge
#

my brain says if its saying that so make "[vehicle_1]" " "vehicle_1"

hallow mortar
#

So everything I said before was correct, and you have now implemented it correctly, but there is another layer

abstract gorge
#

okay

hallow mortar
#

You can remove _vehicles = vehicle_1;, it's not doing anything now and we don't need it

abstract gorge
#

hell yeah i thought so

hallow mortar
#

Now, where you have [vehicle_1] in the remoteExec, replace it with [vehicle_1 select 0].
This selects the first (0th) element in the array given by BIS_fnc_spawnVehicle, which is the actual vehicle object.

abstract gorge
#

ahhhh okay

#

omg bro

#

thank you man

#

eagle has landed

#

if (supplyPoints >= 55) then
    {
    hint "You deployed an L4 Tracked APC";
    supplyPoints = supplyPoints - 55;
    sleep 3;
    vehicle_1 = [getmarkerPos "vehiclespawn", 180, "Athena_B_G_APC_Tracked_01_rcws_F", west] call BIS_fnc_spawnVehicle;
    [module_zeus_1, [[vehicle_1 select 0], true]] remoteExec ["addCuratorEditableObjects", 2];
    hintSilent format ["Supply Points: %1", supplyPoints];
    }
else {hint "You do not have enough supply points!";}```

the ticket!
hallow mortar
#

Now go to bed

abstract gorge
#

yes im just applying it to my other vehicle spawn options and testing then sleepy time

#

thank you dad

#

honestly though thank you so much everyone for contributing so much time and understanding helping me.

#

this has all ben for aa mission using that wargame RTS mod with the path planning, excellent stuff, bit of a gamechanger the path planning mode

#

nighty night sorry bye

queen cargo
#

What do you guys think is better for a mission: Saving (dynamic) configuration values in global variables and checking them by if(!isNil("var")) or writing them to missionNamespace and using getvariable command with optional default value?

Neither of them
pre-set your "dynamic" variables and then just use em

#

if you dont want to "mess up" the missionNamespace create a new location and use that as your variable holder

vapid scarab
#

is there a command that can manually respawn a player?

fair drum
#

forceRespawn

jade nova
#

Hey guys, is there a script I can use to display a bit of text on screen in a MP Zeus scenario? I'm trying to achieve an effect like in Halo, where the letterbox effect happens on screen and a few words pop up at the bottom left hand corner.

hallow mortar
winged ice
#

Hello Community. recently I have asked for general guidance on Computer Vision Bounding Boxes for Arma3.
An awesome member gave me a really sophisticated code, which I was able to use for learning and adapting to my project.

In the changed code, I do not manage to align the box properly with the unit object. Everything else is absolutely perfect. I think it is more of an math issue I do not get. Maybe someone can help me out to better understand the issue with that _proxy variable ❤️

meager granite
#

Sometimes I wish there was if ARRAY and if HASHMAP which would quickly check if array or hashmap empty to save on count X > 0

#

Maybe even if ENTITY as a short for !isNull ENTITY

open hollow
#

i just saw a supposed longest shot record on arma of +5000m, but ive testing and... bullet desapear after 3400m, im missing somthing here? or its fake?

  • Same weapon
  • I have ACE loaded
  • SP
  • viewdistance and object in +12000
sleek token
#

Projectiles have a TTL (time to live)

#

it's a config value

#

but at least for vanilla weapons it is easy over 10sec

open hollow
sleek token
#

but 3,5km is way to short

#

should go 10km with ease

open hollow
sleek token
#

what kind of weapon are you using though?

open hollow
#

M200 Intervention

abstract gorge
open hollow
#

that it seems lol

abstract gorge
#

lol, just wanted to thank everyone for helping me last night this mission im making should be fun

open hollow
#

well... all shots aint made with a vanilla weapons, even with 45s TTL its imposible to get more than 5000m at same level, to do further than that, you need to be shoting a target way under your position

open hollow
#
this addAction ["<t color='#FF0000'>fight</t>",{
  _randompos = selectrandom["m","m_1"];
  _posf = getmarkerpos _randompos;
  player setpos _posf;
}, [],1,true,true,"","_this distance _target < 3"]

use variables pal! they are free!

verbal sleet
split scarab
#

My Vehicle Respawn Module won't stop respawning vehicles even though I have a trigger assigned with the condition uavSabotaged != true and I know for a fact that uavSabotaged becomes true

#

Deleting the vehicle respawn module doesn't work either

opal zephyr
#

Is that variable being checked un a while statement? And are you positive its being broadcast correctly? Trying printing its value with systemchat or a hint

split scarab
#

Yeah, got a activated hint in activation which shows up when I load into the mission and a deactivated hint appears when I do my action that sets the variable uavSabotaged to true

opal zephyr
#

In whatever part of the script checkd if uavSabatoges doesnt equal true, you should also check the variable, do it just before the while statement

#

Its possible its value isnt being broadcast correctly

split scarab
#

I wouldn't know tbh, I'll show what I got.
I've got this in the init field of an object:

if (isServer) then
{
    uavSabotaged = false;
    [this, ["<t color='#FF0000'>Sabotage UAV terminal</t>", { 0 spawn sabotageUav; }, nil, 5, true, true]] remoteExec ["addAction", independent];
};

sabotageUav = {
    uavSabotaged = true;
    reaper_uav setFuel 0;
    sleep 300;
    "Someone has sabotaged our UAV comms terminal at the airfield." remoteExec ["systemChat", blufor];
    sleep 300;
    deleteVehicle reaper_uav;
};

And this is my Trigger (which you can see is synced to the vehicle respawn module on the left)

stable dune
#
    uavSabotaged = true; // will only be updated on client that uses addAction, will not be updated on server
split scarab
#

But the Trigger recognizes it becoming true?

#

And shows deactivated hint

stable dune
#

Are you testing on local host?

split scarab
#

Testing on local MP server yeah

stable dune
#

Yeh, then you are server , then it will work on your client

#

but not for other clients

split scarab
#

So I should remoteExec that line as well? How would I send that to only the server?

sullen sigil
#

publicVariableServer

split scarab
#

Like so?

if (isServer) then
{
    publicVariableServer uavSabotaged = false;
    [this, ["<t color='#FF0000'>Sabotage UAV terminal</t>", { 0 spawn sabotageUav; }, nil, 5, true, true]] remoteExec ["addAction", independent];
};

sabotageUav = {
    publicVariableServer uavSabotaged = true;
    reaper_uav setFuel 0;
    sleep 300;
    "Someone has sabotaged our UAV comms terminal at the airfield." remoteExec ["systemChat", blufor];
    sleep 300;
    deleteVehicle reaper_uav;
};
sullen sigil
#

no

split scarab
#

Or only for the true statement

sullen sigil
#

publicVariableServer sends the variable update to the server

#

read the biki for it

fallen locust
#

^^ ConfigFile for settings, and dynamic stuff with precompute, and store it in uiNamespace/object/location

split scarab
#

Vehicle still respawns

#

Fuck it, I'm just gonna delete the vehicle sooner

vapid scarab
#

an index 0 wont ever throw an error.

granite sky
#

Uh, _array isEqualTo [] is faster.

#

Probably can't do that for hashmaps though.

vapid scarab
#

Not when you have a filled array.

granite sky
#

Checked. It is.

vapid scarab
#

wild huh? I do use isEaulTo [] when Im not worried about performance.

granite sky
#

No, I mean isEqualTo is faster.

vapid scarab
#

hmm? I let rerun my test

#

that that it matters 99% of the time. Im just curious now

granite sky
#

Regardless of 10 or 1000 entry array:
arr isEqualTo []: 0.0006
count arr == 0: 0.0007
_a = arr#0; isNil "_a": 0.0009

digital hollow
granite sky
#

Not unless it has an optimization for createHashMap where it doesn't actually create the thing. I suspect this does happen with [], because normally creating an array is quite slow.

#

Amusingly isNil {arr#0} is slower than the version with the temp var, probably because it doesn't create the temp var when it's nil. Nope, it's not nil in this example.

sullen sigil
#

0.0007ms for an array with 10k elements to be compared to []

still forum
#

createHashMap behaves same as []
Or same result. One is a command the other is a instruction

granite sky
#

Maybe arrays are only slow to create when they have stuff in them :P

#

isEqualTo createHashMap does appear to be the same speed.

digital hollow
#

Would be nice to add that to the command biki

versed belfry
#

Question,
Is there a way to detect when parseSimpleArray finishes?
I can detect when it runs into a parsing error with a ScriptError mission event handler, but I can't detect if it runs into no issue in my script.
The solution I have is a sleep 3 followed by a check of if (!(player getVariable "AET_importPlan_parseFlag")) then {...};.

granite sky
#

Does the difference between a parse failure and a correctly-parsed empty array matter?

still forum
#

If the input string was larger than 2 characters. And the result array is empty. Then you know it errored

#

If the input string was 2 characters long, then empty array is valid. that's also the only possible result you can get with 2 characters

granite sky
#

nah, parseSimpleArray "aa". You'd have to check specifically that the input was "[]"

#

Can't think of any other valid input that returns an empty array though, so that should be fine.

still forum
#

But thats not valid is it?

#

Ah I guess. If you have clearly absolutely unparsable input

#

but.. I assume the input is always supposed to be an array and the worry is only about its contents?

versed belfry
granite sky
#
if (_input isEqualTo "[]") exitWith {
   // input is an empty array
};
_result = parseSimpleArray _input;
if (_result isEqualTo []) exitWith {
  // input is garbage
};
// input is valid data
versed belfry
granite sky
#

oh, nice

versed belfry
#

It does, and I use it

#

My current duct tape solution is:

  1. Set variable as a flag with a default value of -1
  2. Set a ScriptError mission event handler.
  3. If format parse error is triggered, set flag to 1.
  4. Sleep 3; wait 3 seconds and if the flag is not equal to 1 then set it to 0.
  5. WaitUntil the flag is not equal to -1.
  6. Proceed with if statement based on flag value.
granite sky
#

I would expect it to reliably trigger within a frame, at worst. This sort of timing doesn't tend to be documented though, so you have to test.

versed belfry
#
addMissionEventHandler ["ScriptError", {
    params ["_errorText", "_sourceFile", "_lineNumber", "_errorPos", "_content", "_stackTraceOutput"];
    if (_errorText == "parseSimpleArray format error") then {
        player setVariable ["AET_importPlan_parseFlag", 1, false];
    };
}];

is what I have for the mission event handler.

granite sky
#

Depending on what the acceptable contents of this array are, I'd seriously consider parsing manually at this point.

versed belfry
granite sky
#

holy shit. Is this really user input?

versed belfry
#

Yes >_>

drowsy sparrow
#

is there a way to give particle effects a direction/velocity? I'm making a jetpack and during takeoff the particle fire effect can obviously just trail the player since that looks correct; however on landing I need the fire effect to project "downwards" as the jet of fire is obviously meant to look as if it is "slowing" the player down. Unfortunately if I just let movement do the work the fire trails upwards because the particle effect trail follows the players movement currently

#

or is that more something I'd have to make a new effect for?

hallow mortar
limber thunder
#

Hello guys,
I have a script which checks how many players are on the server and how many players are in the mission area. With the If function a second script is executed when all players are in the mission area.
The problem is that you can select a loadout and it spawns on a respawn position.
However, the script recognizes the player who is in the loadout menu as already being in the mission area.
Does anyone have an idea how I can make it so that a second script is not executed until all players that are on the server actually exist in the world and not in the loadout selection?

Here is my script:

ctr = true;

while {ctr} do {
   private _allPlayers = allPlayers;                         
   private _inArea = allPlayers inAreaArray "gameStart";    
   private _cnt1 = count _allPlayers;
   private _cnt2 = count _inArea;
   sleep 2;
   if (_cnt1 == _cnt2) then {
       
       execVM "mechanics\gameStop.sqf";
       sleep 3;
       
       ctr = false;
   };
};

willow hound
#

What's _cnt1?

cosmic lichen
#

What loadout selection? Arsenal?

limber thunder
limber thunder
willow hound
#

I would start debuggin by logging _inArea.

versed belfry
# granite sky holy shit. Is this really user input?

Welp, unless some how 3 seconds of waiting doesn't turn out to be enough, which in no world should happen afaik.

This is the final version of the script to process the input if ya care: https://github.com/SkippieDippie/A3A-Event-Standard-Files/blob/Nomas_dev/A3AEventMissionBase/Functions/Players/fn_importPlan.sqf

The actual player input is as follows in the attached file, and here is also a video of how it looks like:

willow hound
cosmic lichen
limber thunder
cosmic lichen
#

Sorry, I meant variable, not function.

limber thunder
#

okay I will try this 🙂

split scarab
#

Anyone able to tell my whe the else is not reached every 10 seconds and only when the player is 50 meters away from the latest marker?

huntedJourney = {
    _t = 0;
    while { gameStarted } do {
        {
            _journey = _x getVariable "journey";
            if (isNil "_journey") then {
                _markerName = "journey_" + name _x + "_0";
                _marker = createMarker [_markerName, getPos _x];
                _marker setMarkerType "Contact_dot1";
                _markerName setMarkerAlpha 1;
                _markerName setMarkerColor "color" + str (side _x);
                _x setVariable ["journey", [_marker]];
            } else {
                if (_t == 10 || getmarkerpos (_journey select (count _journey -1)) distance2D _x >= 50) then {
                    _markerName = format ["journey_%1_%2", name _x, (str count _journey)];
                    _marker = createMarker [_markerName, getPos _x];
                    _marker setMarkerType "Contact_dot1";
                    _markerName setMarkerAlpha 1;
                    _markerName setMarkerColor "color" + str (side _x);
                    _journey pushback _marker;
                    _x setVariable ["journey", _journey];
                    _t = 0;
                };
            };
        } foreach playableUnits;
        sleep 1;
        _t = _t + 1;
    };
};
split scarab
#

Hmm actually, it enters the if inside the else but the marker is not created unless they're further than 50 meters from last marker??

still forum
south swan
#

also, since 2.12 _array select -1 is a valid syntax to get the last element of said array, no need for count _array - 1

split scarab
sullen sigil
#

you can do it for select -2 too 😮

split scarab
#

-2 also grabs the last element in a array?

dusk gust
sullen sigil
#

[1,2,3,4,5,6,7,8,9] select -2 will return 8

split scarab
#

Since a unit does not appear in playableUnits if they're dead, is there another array like that, that would include the unit even though it's dead?

opal zephyr
#

do you want units that are controlled by ai as well or just the actual players?

split scarab
#

All units that have a playable slot

#

Basically the same as playableUnits but that also includes them if the unit is dead

#

Just thought of a workaround but if there's an array that already does that then that'd be better

opal zephyr
#

cant think of one off the top of my head

hidden wadi
#

Anyone know how to make a "readable" document in Eden? Like they use the object and it gives information

opal zephyr
#

You could use createDiaryRecord

#

plus an addAction on the object

hidden wadi
#

Okay does that have it appear globally or on the person who used it?

opal zephyr
#

createDiaryRecord is a local command, but you can easily execute it on everyone with remoteExec

hidden wadi
#

Okay Okay. I'll look up how to implement that

digital hollow
hidden wadi
#

Aye

#

What would be the addaction to trigger the create diary record?

teal flare
#

best way to get a forEach to iterate all typeOf ModuleCurator_F in a mission?

granite sky
#

allCurators?

teal flare
granite sky
#

It returns the objects.

teal flare
#

the logic?

granite sky
#

Logic objects, yes.

teal flare
#

might work, gimme a mo, thanks

teal flare
#

did work, I've literally used that before so I have no idea why I thought it returned the unit assigned to the logic

meager edge
#

Hi, I'm looking for the next big idea to develop a mode for in Arma.
Recent big ideas as far as I see them are KOTH and Life servers.
Who got the idea and want to partner up?

iron jacinth
#

I have a trigger with "35 setfog 0; 35 setrain 0; 10 setlightnings 0;" in the activation however the fog doesn't change...but the rain and lightning changes?

warm hedge
#

Try forceWeatherChange

iron jacinth
#

Figured it out. ''Zapat
Posted on Dec 15, 2015 - 14:32 (UTC)
setTimeMultiplier DOES affect transition time.'' My 0.1x timescale was hurting me.

plucky pewter
#

I'm struggling a little bit with passing arguments. I wrote a script to respawn Helicopters for target practice.


_heloOld setVariable ["pos", _spawnMarker];

_heloOld addEventHandler ["Killed", { 
    params ["_unit", "_killer", "_instigator", "_useEffects"];
    [_unit] spawn {
        params["_deleteMe"];
        sleep 5;
        _heloNew = createVehicle[typeOf _deleteMe, _deleteMe getVariable "pos", [], 0, "FLY"];
        hint "Made new Helo.";
        hint format ["Location: %1", _deleteMe getVariable "pos"];
        createVehicleCrew _heloNew;
        _heloNew setCombatMode "BLUE";
        _heloNew setCombatBehaviour "CARELESS";
        [_heloNew, _spawnMarker] execVM "heloRespawn.sqf";
        deleteVehicleCrew _deleteMe;
        deleteVehicle _deleteMe;
        } 
}];```
#

The goal is for a helicopter to respawn after being destroyed. I can get the respawn down, but I'm struggling to pass an argument with the starting position. I tried using a marker for this, where you could pass the marker in and it would respawn on the marker

#

But In line 3 there, I am getting a variable undeclared issue for _spawnMarker

#

It's up there in the params though? It should be present. Not sure why it isn't.

warm hedge
#

_spawnMarker is indeed undefined

granite sky
#

Issue is this line:
[_heloNew, _spawnMarker] execVM "heloRespawn.sqf";

#

Or the other place where you're calling the function.

warm hedge
#

I don't think you can pass an undefined into like that tho

granite sky
#

There has to be another place because otherwise you're just passing a value around in a circle.

#

which is never actually set anywhere

warm hedge
#

Basically, what you have - EH is a "different script"

#

Which means it does not have and inherit what your initial script does

plucky pewter
#

So the very first thing is
[this, "marker1"] execVM "heloRespawn.sqf"

granite sky
#

What I said then.

#

_spawnMarker doesn't exist in this line:
[_heloNew, _spawnMarker] execVM "heloRespawn.sqf";

#

should be _deleteMe getVariable "pos" instead.

plucky pewter
#

OK. So it must be something wrong with my initial call in init, then. When you pass a marker, is there a better way than the name; i.e. as "marker1" in my init?

plucky pewter
granite sky
#

Second issue is that it looks like you're trying to pass a marker in as the second parameter of createVehicle, and it needs posAGL.

plucky pewter
#

Ok.

keen wing
#

Is it against the rules to ask a question without knowing anything about scripting?

warm hedge
#

No, why it is

burnt cobalt
#

hi guys, struggling a bit to create a non functional cfgWeapons item for the GPS/Terminal slot (612). I can not seem to figure out how to make that happen, I was only able to inherit from 'itemGPS' or 'InventoryItem_Base_F'. Admittedly I have no clue what I'm doing. Anyone pointers welcome.

hallow mortar
warm hedge
#

You're making a Mod and is not a script but #arma3_config 's topic. And bring your actual config for more insights

keen wing
# warm hedge No, why it is

Because I want to display markers for civilian units on the map with a script other than Arma's difficulty settings, but I don't have the knowledge.

burnt cobalt
#

you're right, apologies. will move!

keen wing
warm hedge
#

I don't think there is a way

hallow mortar
keen wing
hallow mortar
#

That's what the other commands I mentioned are for. You don't filter by side in createMarker itself - you use units to get a list of all civilian units, and then use forEach to createMarker for each unit in that list.

keen wing
#

Then should I write a command for each unit one by one?

hallow mortar
#

No, you use forEach to apply the same command to a list of units.

keen wing
#

So, I have to write down the list of units one by one, right?

hallow mortar
#

No, you use units to automatically get a list of all civilian units.

#

Here. Put this in init.sqf in your mission folder.

psycool_var_civilianMarkerLoop = true;

// Create a continuous loop.To stop the loop later, set psycool_var_civilianMarkerLoop = false
while {psycool_var_civilianMarkerLoop} do {
    // Everything here will be done once for all units on the civilian side.
    {
        // Generate a unique marker name for the current unit
        private _markerName = format ["psycool_mkr_%1",str _x];
        // If no marker with that name exists, t hen...
        if (markerShape _markerName != "ICON") then {
            // ...create one and give it some attributes
            createMarkerLocal [_markerName, getPosATL _x];
            _markerName setMarkerShapeLocal "ICON";
            _markerName setMarkerTypeLocal "hd_arrow";
            _markerName setMarkerColorLocal "ColorCIV";
            _markerName setMarkerDirLocal direction _x);
        /// if a marker does already exist, then...
        } else {
            // just update its position
            _markerName setMarkerPosLocal getPosATL _x;
            _markerName setMarkerDirLocal direction _x;
        };
    } forEach (units civilian);
    // the loop will repeat once per second.
    sleep 1;
};```
primal quiver
#

This more than a year later but I'm curious to ask if there's a script for this?

keen wing
fair drum
keen wing
#

It contains all semicolons, but an error occurs saying that the semicolon is missing from _markerName setMarkerDirLocal direction _x);.

hallow mortar
primal quiver
hallow mortar
primal quiver
keen wing
#

If I want to adjust the size of the marker, is it correct to write this additionally?
_markerName setMarkerSizeLocal [0.5, 0.5];

hallow mortar
#

Yes

barren valve
#
private _allTurrets = allTurrets [_vehicle, false];
    
{    
      private _unit = _group createUnit [selectRandom _crewTypes, [0,0,0], [], 0, "NONE"];
    _unit assignAsTurret [_vehicle, _x];
    _unit moveInTurret [_vehicle, _x];
        
    _units pushBack _unit;
        
    sleep 0.1;
} forEach _allTurrets;

I'm using this to fill all turret positions in a vehicle, however there are some CUP vehicles for example "CUP_B_nM1025_SOV_Mk19_ION" that seems to return an additional turret that I cannot move a unit into, so this code will always create a unit outside of this particular vehicle, is there something I can check for to skip that turret?

sullen sigil
#

createvehiclecrew..? thonk

hallow mortar
#

createVehicleCrew is useful if you want to use units from the vehicle's home faction, less so if you want to use a different faction.
I guess you could use it as a template, by doing createVehicleCrew, recording what turrets it fills, removing the auto crew and then replacing them with your own. Bit clunky though.

sullen sigil
#

yeah performance for that is probably worse than just looking in the config for it

barren valve
#

Thanks, yep I need to create units from any faction, I peeked into the createVehicleCrew function and found that checking the config _turretConfig >> "dontCreateAI" did what I needed, thanks

digital hollow
digital hollow
#

If you want to get hurt, look at Hatchet H-60 FLIR. It's a custom camera.

astral bone
#

3den enhanced removed batch replace, so now I am making my own. While I'm at it, I am also making it able to randomize direction. 3den ehanced has that, but mine will be more for specific randomization x3
any object will be replaced be the avaiable replacement objects, then if selected, will add a random value from an array to the objects rotation.

#

there isn't a question (yet) btw xD

formal stirrup
#

Linusstare Do I dare ask what is the question?

dreamy kestrel
#

got a couple of potential improvements for sortBy if anyone is interested. key points, select instead of array copy (+), also better use of filter, etc. addressed the matter of algorithm shapes in the process as well.

queen cargo
#

uiNamespace ....

#

no grim

#

just

#

no

#

you do not want such stuff to maybe carry over into other missions

#

configFile settings are slow as fuck

limber thunder
#

Can someone help me with the syntax for the remoteExec?
I have already tried a bit but can not find the right syntax. I want to run the following command for all players and the server via remoteExec:

a0 = 0;
playSound "hacking" spawn
{waitUntil 
  {sleep 0.5;
  a0 == 1;}; deleteVehicle _this;};
willow hound
#

The sloppy, not recommended option:

{ /* Your code here */ } remoteExec ["call", 0];
```The clean option:
```sqf
remoteExec ["MIN_fnc_playHackingSound", 0];
limber thunder
#

thanks, i give it a try

limber thunder
willow hound
#

I don't quite understand what you mean.

limber thunder
#

nvm I think I solved it 🙂

digital hollow
#

I feel like this could be simplified further, but I'm not seeing it. AnyoneLeopard see it?

fnc_pointOnLineClosestToPoint = {
    params ["_p1", "_d1", "_p2"]; // linePoint, lineDir, pointToApproach
    
    _p1p2 = _p2 vectorDiff _p1;
    _d2 = _d1 vectorCrossProduct _p1p2;
    _n = _d1 vectorCrossProduct _d2;
    _n2 = _d2 vectorCrossProduct _n;

    _p1 vectorAdd (
        _d1 vectorMultiply (
            (_p1p2 vectorDotProduct _n2)
            /
            (_d1 vectorDotProduct _n2)
        )
    )
};
granite sky
#

I assume that's an infinite line as you have no conditionals.

digital hollow
#

Yes

granite sky
#

Line is p1 to p2 or p1 + n*d1?

digital hollow
#

latter

granite sky
#

I think that's just p1 + ((p2 - p1) dot d1) * d1

#

no cross products required. I don't know what you're doing there.

#

Oh, your d1 isn't normalized?

digital hollow
#

ohh. let me try that.

#

Thank you. I dunno how I made that so mangled.

opal zephyr
#

Anyone know of a way to close the game through script? Its fine if its just abusing something that makes it crash

#

hm closing display 46 is good enough

fallen locust
#

it wont 99% of times ;)

#

and config file is not that slow

#
  • if it carries over to other missions its kinda their / BI issue
queen cargo
#

uiNamespace is not cleared grim ... so more in 99% it will whilst in 1% of the times you crashed the game

fallen locust
#

it is cleard but... cant say

queen cargo
#

last time i checked config file variable getting it was ~3x slower

fallen locust
#

it shouldnt be tbh

#

in error margin

queen cargo
#

interesting

#

the performance improved

split scarab
#

Is there a way to skip current iteration in a for loop? Kinda like return; in C# does. As in, not exiting the loop but just skipping this iteration of the loop

foggy stratus
#

Anybody know the path for the group indicator white hexagon icons that you see on your squad mates? I need to make these for other units not in your squad...

split scarab
#

Hmm yeah that's what I've been using, only downside is having to flip all of your conditions basically

vapid scarab
#

break?

#

What do you mean by skip current iteration if not continue?

granite sky
#

(it's continue)

split scarab
#

C# return and SQF continue are pretty much the same except opposites

granite sky
#

C# doesn't have continue?

split scarab
#

return just makes more sense for me logic wise imo

#

It does but it's also got return

granite sky
#

SQF doesn't have return because it doesn't really have functions.

vapid scarab
# foggy stratus Anybody know the path for the group indicator white hexagon icons that you see o...

https://pastebin.com/x9RGYUrg use this script to find some of the icons. Load up a mission in editor and then pop this into the debug console. You can click on the icons to copy the path to clipboard. Start with the keywords "icon" and "squad"

granite sky
#

you can fudge it with breakOut if your code is too spaghetti.

queen cargo
urban flicker
#

How do you make team ai respawn on dome tent if available? They always respawn on respawn_west which is far back

pulsar bluff
#

isnt it just a tent? how many people can fit in a tent

urban flicker
tough abyss
urban flicker
#

Im doing a sector control mission but i want squad ai to respawn on the tent instead of respawn marker

stable dune
#

_ You can have multiple markers simply by adding any text behind the name, e.g. respawn_west1, respawn_westBase etc. When no markers are defined, player is respawned on position where he started the mission. More about marker respawn can be found here. Alternatively you can also use the Respawn Position module._

errant jay
#

is it possible to add custom optics for vehicle gunner and/or thermals to vic gunner in a mission?

little phoenix
#

How do-able would it be to detect a player around an object? From what I've seen it only appears to be possible the other way around (detecting an object near a player - which I don't particularly want to run as it might get a bit laggy)

hallow mortar
#

Players are objects

little phoenix
#

I'm aware - what I mean is let's say I have an object called x, can I check object x to see if a player is in lets say a 5m radius without running that on the player to see if it's in radius of x, just as that'd likely be more optimised.

hallow mortar
#
private _nearPlayers = (playableUnits + switchableUnits) select {(_x distance _object) < 5};
if (count _nearPlayers > 0) then {
  {
    // do stuff
  } forEach _nearPlayers;
};```
(this is just an example, there are several ways to approach this from different angles)
You could also make an Any Player trigger and attach it to the object.
willow hound
#

forEach is not scared of empty arrays 🙂

hallow mortar
#

That's true, but using forEach is also just an example. You might have some code in there that's less safe, or you might just want to know if there is a player and not necessarily do anything to that player in particular.

meager granite
#

Though in my example having if ARRAY and if HASHMAP won't be enough, you'll also need BOOL && ARRAY, BOOL && HASHMAP, ARRAY && BOOL, HASHMAP && BOOL, ARRAY && CODE, HASHMAP && CODE and same with || so it would make sense

#

and also all possible combinations with ENTITY

open hollow
opal zephyr
#

Ill see what that does, thanks!

open hollow
meager granite
#

Trying to add custom key binds to Zeus interface, Display 46 key down doesn't fire, adding KeyDown to Zeus display doesn't seem to work either (Display 312). Anyone dealt with it?

proven charm
meager granite
proven charm
#

I just use waitUntil { !isNull findDisplay 312 }; but that probably isnt the problem

still forum
still forum
hallow mortar
#

In addAction, setting the radius parameter to -1 "disables the radius". Does this mean it disables the limit (the action can be reached from anywhere), or disables the ability to use the action outside of the target object (the action cannot be reached unless you are the target)?

drowsy geyser
#

i need help i want to create a static camera and spawn a bullet from the camera position and fire that bullet to where the mouse cursor is pointing,
but i does not consider the z value.
the code:
https://sqfbin.com/ecurekepabovopigutat

tough falcon
#

So Im making a menu where members can select premade loadouts. But i have gotten a small problem. I have made the menu and its working. But i have one SQF file for each loadout and the menu calls the sqf
And i have 2 old loadouts and they work they can be loaded via the menu. But now when i made new loadouts in the ACE arsenal and clicks export i get the loadout. When i then putt it in the SQF file like this.

player setUnitLoadout [[["rhs_weap_m4a1_blockII_KAC","Tier1_SOCOM556_2_Mini_DE","Tier1_M4BII_LA5_M300C","rhsusf_acc_su230_c",["rhs_mag_30Rnd_556x45_Mk262_PMAG",30],[],""],[],["rhsusf_weap_glock17g4","","","",["Tier1_20Rnd_9x19_FMJ",20],[],""],["tlb_Gen3_Gen3_rs_mex_cb_Flag_uniform",[["ItemAndroid",1],["ACE_CableTie",4],["ACE_EarPlugs",2],["ACE_MapTools",1],["ACE_RangeCard",1],["ACE_Flashlight_MX991",1],["ACE_SpraypaintGreen",1],["ItemcTabHCam",1]]],["Viking_viking_avs_567",[["ACRE_PRC152",1],["Tier1_20Rnd_9x19_FMJ",1,20],["rhs_mag_30Rnd_556x45_Mk262_PMAG",7,30],["DEVGRU_CTS72906",4,1],["HandGrenade",4,1],["SmokeShell",4,1],["MS_Strobe_Mag_2",1,1]]],["backpanel_1",[["ACE_elasticBandage",5],["ACE_packingBandage",5],["ACE_tourniquet",4],["ACE_EntrenchingTool",1],["tlb_Beret_Rangers",1],["tlb_PVS31E_BLK_Gold_WP",1],["milgp_f_face_shield_tactical_shemagh_khk",1]]],"tlb_MT1_AMP_H5_Light_1_U_On","tlb_Mframe_BLK",["ACE_Vector","","","",[],[],""],["ItemMap","","","ItemCompass","ACE_Altimeter",""]],[["aceax_textureOptions",[]]]];

But i get an error where it says error generic error in expression.
Anyone that know what the problem are?

granite sky
#

I think the first element of that array is an Arma loadout and the rest is ACE stuff, so you have to strip it down to use it with setUnitLoadout.

digital hollow
cobalt path
#

Any ideas why this doesnt save loadout every 60s? Its in initPlayerLocal.sqf

if (!isServer) exitWith {};
while {true} do 
{
    if (Alive Player) then 
    {
        profileNamespace setVariable ["aebh01_loadout_01", (getUnitLoadout player)];
        saveProfileNamespace;
    };
    Sleep 60;
};
proven charm
#

i think you meant if (isServer) exitWith {}; to run only at client

hallow mortar
#

I don't think you should have an isServer check of any kind tbh.
Running on DS, it's pointless; initPlayerLocal.sqf doesn't run on the DS machine anyway.
In local hosting and SP, it will prevent loadouts saving for the hosting player, which is probably not what you want.

manic kettle
#

Plus it would run on headless clients, if it were general code not in local player init...

#

I prefer hasInterface

cobalt path
timid echo
#

How can I do a shrinking and growing vignette like ace has during unconsciousness?

vapid scarab
tulip ridge
timid echo
#

thanks man feedback is the one folder i neglected to check

fickle lava
#

Anyone have experience with Ace extended arsenal?

ornate whale
#

Is there any way how to spawn/teleport multiple units into a building to a single room, but prevent collisions with the walls or other units? I found this command which is very useful 'BIS_fnc_buildingPositions', but there is a limited number of positions for each room. I thought that I would use the predefined positions as a pivot points and then search the area for empty space with other commands, but it seems that all the other position commands are meant to be used on empty terrain, not for searching for positions inside buildings (in/under/above other objects). I intend to use it for scenarion randomization.

ashen ridge
#

Can i use a script or a mod to increase the smoke particles draw limit? Now it is about 3000 meters.

vast hemlock
#

hey gents in stumped on getting a script i found to work on my exile server. if anyone can help see how dumb i am and missing something stupid lmk

opal zephyr
#

whats the script?

vast hemlock
opal zephyr
#

We're gonna need a little more info here in order to help, like how you're trying to execute it, etc

vast hemlock
#

oh sorry i tried following the instructions on the github but unless im not reading it correctly idk where im going wrong

opal zephyr
#

did you put that code in the init.sqf or initPlayerLocal.sqf scripts?

vast hemlock
#

initplayerlocal, i dont see a init sqf anywhere

opal zephyr
#

this is in a mission folder right?

vast hemlock
#

i put the sqf in the mission folder and the exec in the init is that the right ?

opal zephyr
#

yes thats correct

#

Its a very old script, perhaps exile changed their variable names

vast hemlock
#

mission file was made in the 2d, so i dont think so but thats beyond my small understanding of this stuff

opal zephyr
#

The script your using, the one you linked in github, is old

vast hemlock
#

yea, i get that, the mission file for exile is from like 2017, when you import it it gives you a acheivement for importing something in from the 2d editor. im just stumped

opal zephyr
#

In the difficulty section of your mission, do you have third person enabled?

vast hemlock
#

thats the issue unless its deep than i understand, the difficulty settings its either regular or hardcore you can edit the variable like on a regular mission file

opal zephyr
#

why not? Is that an exile thing?

vast hemlock
#

cant*

#

yea it seems to be an exile thing, i mean generally id love for the script to work. i dislike 3rd person in combat but for base building it helps

#

if i could just turn off 3rd person that would be ok for now, turning hardcore on messes with loot tables and party systems so i dont want to go that route

#

if you have time to jump in a call and we can screen share it would be great if not no worries

opal zephyr
#

in your exile server can you go into third person right now?

vast hemlock
#

yes you can go into 3rd as of right now on exileregular

opal zephyr
#

ok, try editing the fn_switchCamera.sqf to be this instead:

    while {true} do {
        waitUntil {cameraView == "EXTERNAL" || cameraView == "GROUP"};
        sleep 0.1;
        if  ((vehicle player) == player) then {
                if(ExileClientPlayerIsInCombat) then {
                    player switchCamera "INTERNAL";
                } else {
                    if(!(ExileClientIsInConstructionMode)) then {
                        sleep 3;
                        player switchCamera "INTERNAL";
                    };
                };
        }; 
        if (((vehicle player) != player) && (ExileClientPlayerIsInCombat)) then {
            (vehicle player) switchCamera "Internal";
        };
        sleep 0.1;
    }
vast hemlock
#

oh shit cool lll try that asap!

opal zephyr
#

all I did was remove the check to see if thirdPerson was enabled in the difficulty setting. The one used in the script was obsolete and was replaced, but in theory should have worked still. This is to test that. If that doesnt work then Its likely because EXILE no longer uses the ExileClientPlayerIsInCombat variable

vast hemlock
#

does the []execvm part that goes into the playerlocal need the ` around it btw?

opal zephyr
#

no, it shouldnt have it

#

it should say exactly:
[]execVM "fn_switchCamera.sqf";

#

the full quotations do need to stay though

#

for that to work the sqf must be in the root (I think) folder of the mission

vast hemlock
#

yep its tossed in the main folder, tossing it back on the server now, report back in a sec, i REALLY appriciate the help even if it doesnt work i know to stop trying and just leave it be move on to the next task

opal zephyr
#

You could always write your own if the exile variables are no longer correct, however determining when a player is in combat is always tricky business, common methods would be to see if they have shot or been shot at recently

#

Another workaround might be to actually block the keybind that makes you go thirdperson, going to test that now

vast hemlock
#

it works!

#

you are a chad thank you so much!

opal zephyr
#

hooray, glad I could help!

vast hemlock
#

on to the next issue of admin tool box and figuring out why we cant force mods even tho theyre all signed

opal zephyr
#

ah goodluck, I have no experience there unfortunately

vast hemlock
#

i think i should be able to figure that out on my own, again im really greatful have a good rest of your night

opal zephyr
#

Since you already figured it out, you dont need this, but I wanted to try it anyway. This script would allow you to block a keypress based on the keybinding the player has assigned to it. It should be much more efficient since its not checking every frame like the github one is:

findDisplay 46 displayAddEventHandler ["KeyDown", {
    params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"];

    if (inputAction "personView" > 0) then{
        _key == _key;
    };
    
}];
#

^in that case it prevents them from pressing whichever key makes them go third person

#

This doesnt seem to work if the user has bound the bind to their mouse though.. think_turtle

vast hemlock
opal zephyr
vast hemlock
#

well thats beyond our wheel house lol were not very smart at this

#

while im here last question, does anyone here know if it possible to add a mod exception to verfiy signatures for the server? admin tool box breaks with the client side mod is added to the command line. so either no verify and i can use it or i only allow the mods we want and it doesnt work, idk why tho

hallow mortar
vast hemlock
sharp grotto
#

ExileClientPlayerIsInCombat is still used
Can just put that first person force switch into this client thread (loop) ExileClient_object_player_stats_update.
Or maybe better for performance into the function ExileClient_gui_hud_toggleCombatIcon (https://github.com/Andrew-S90/ExileMod-Files/blob/main/Client/exile_client/code/ExileClient_gui_hud_toggleCombatIcon.sqf)
Via the Exile Customcode override system and the two new functions, easy and quick.

ExileClient_enableForcedFirstPerson: https://sqfbin.com/hubunomumavusurajoso
ExileClient_disableForcedFirstPerson: https://sqfbin.com/vuhufamomebowiveyeya
https://cdn.discordapp.com/attachments/796951068230549516/1166581940128841738/image.png?ex=654b0318&is=65388e18&hm=0c7dc1414ae5e745f9efcea40323f3d358bffa7acdba9d5048aebae4d3eec939&

#

@vast hemlock

vast hemlock
sharp grotto
# vast hemlock break it down to monkey lvl, is this completely forcing 1st or just in combat?

Make two new functions for ExileClient_enableForcedFirstPerson & ExileClient_disableForcedFirstPerson with the provided code.
ExileClient_enableForcedFirstPerson: https://sqfbin.com/hubunomumavusurajoso
ExileClient_disableForcedFirstPerson: https://sqfbin.com/vuhufamomebowiveyeya
Easy way just via missionfile initplayerlocal.sqf (put the two function files in your missionfile (adjust pathes if necessary).

https://sqfbin.com/imaxuwawisilizonilot

Make a new Customcode override via Exile Customcode override system for ExileClient_gui_hud_toggleCombatIcon (Search in missionfile config.cpp for CfgExileCustomCode).
This way we override the default function that toggles the combat icon for the player, so it will also enable/disable the forced first person for the player.
https://cdn.discordapp.com/attachments/796951068230549516/1166588369644552323/image.png?ex=654b0915&is=65389415&hm=2e94e19c40a7ab3c35f4f903f8bd54538a455b441a8d4fe2015f23a77f89b695&

https://sqfbin.com/ratececirepuronucemo

vast hemlock
#

aighty ill forward this to my buddy thats slight better than me at this lol

jade nova
upbeat hill
#

is it possible to make a vehicle invisible but you can still drive it?

warm hedge
#

Not really

#

You can probably use an empty texture (aka "") but I think this is not what you want

proven charm
hallow mortar
meager granite
#

I'm trying to have my script-created Zeus have access to all addons I have enabled with this script:

c addCuratorAddons ("true" configClasses (configFile >> "CfgPatches") apply {configName _x})
```with `c` being `ModuleCurator_F` (`createUnit` in `sideLogic` group)
#

But it doesn't seem to have addon units in the menu, only vanilla ones. Deleting all addons removes assets from the menu properly and this line adds these back, yet modded stuff is still unavailable

#

When I create Zeus in 3DEN and set it to "all addons including unofficial ones" it has modded stuff properly

#

What am I missing?

#

Only activated addons can be added (i.e., addons preloaded by the mission)., I was missing activating my addons with activateAddons first thonk

split scarab
#

If a unit dies and respawns is it techinically a new unit or still the same unit? Say if I stored all playableUnits in another array hUnits and iterate through hUnits every 5 seconds, when the unit respawns is said unit in playableUnits no longer the same unit that is stored in hUnits?

upbeat hill
warm hedge
#

I said "" and literally

upbeat hill
#

dosent work

warm hedge
#

How?

upbeat hill
#

cat setObjectTextureGlobal [0, ""]; do this right?

warm hedge
#

Yes

upbeat hill
proven charm
warm hedge
#
for "_i" from 0 to 9 do {
  cat setObjectTextureGlobal [_i,""]
};```9 or something is the biggest index you need
upbeat hill
#

sorry i assume im missing something

warm hedge
#

Oof I forgot to add some

#

Fixed

upbeat hill
warm hedge
#

If you can't you can't

#

Not every textured mesh are retexturable

upbeat hill
#

i see thanks for all your help learnt a lot from this

slow brook
#

What's the correct way to get the Unit Type from an object? IE SoldierWG

warm hedge
#

typeOf

slow brook
#

Cheers Pol

green kettle
#

Had a question, is it possible to change weather or fog with a triggger, prepping a spooky op for my unit and i want the weather to change when they enter a valley, any ideas?

warm hedge
#

setFog

astral bone
#

oh idea- Right now, I have a script that looks through all selected logic, gets anything affected by edit terrain object, or hide terrain object models, and then replaces them, copying the scale, position and rotation. But, some objects it doesn't know. Mainly fences, rocks, stuff that isn't simulated since it doesn't need to be. what if I made it so the replacer also searches for selected objects. If a selected object has the same model as a protected object, it will use that one- could be neat, no?

flint topaz
#

rocks, fences, stuff are just models not actual objects

astral bone
#

Ye

#

Right now, I have a replacement thing that I give it the model name and an object name. if it's a provided, protected object/model thing, it will create the object also provided.

#
private _manualReplacer = [["sidewalk_01_corner_f.p3d","land_sidewalk_01_corner_f"],["sidewalk_01_narrow_2m_f.p3d","land_sidewalk_01_narrow_2m_f"],["sidewalk_01_narrow_4m_f.p3d","land_sidewalk_01_narrow_4m_f"],["sidewalk_01_narrow_8m_f.p3d","land_sidewalk_01_narrow_8m_f"],
.....];

#

if no valid object is found, it can create a VR Selector object, and then just gives that the data of the protected item

#

Since they still have the position, rotation, scale stuff

#

So, it could have another thing to check against

#

also, using my script, I have discovered- one of my concrete walls in my map is like-

#

1.00008 larger or something xD

twin oar
#

Any idea of a way to change a vehicles cargo? Like say I want to put an abrams into a C-130 is that possible dude to the C-130 having a large enough cargo space

opal zephyr
#

Like for ace cargo?

woeful kiln
#

Is it possible to not allow a weapon on a vehicle to fire until the vehicle has stopped moving?

twin oar
opal zephyr
twin oar
#

Gotcha.

late parrot
#

Is there anyway to make this a PIP?

player addEventHandler["Fired",{[(_this select 0)] call BIS_fnc_diagBulletCam;_EhIndex = _unit getVariable "bis_fnc_diagBulletCam_fired"; (_this select 0) removeEventHandler ["fired",_EhIndex];}];
#

It's always the small things that stump me

kindred zephyr
late parrot
#

Right, but I'm struggling on where to place everything in that line.

#

OH

#

No yeah, the way I have it written makes it difficult to select the weapon and projectile

ancient mantle
#

how do i fix this?!?!

hallow mortar
ornate whale
#

How to find all houses within a radius? When I use "house" as a type filter, I also get silly things like wells, carts, tents, etc.

granite sky
#

Yeah that's Arma. Categorization is trash.

#

You can filter down to objects with building positions although not all of those are what you'd call a house.

#

Note also that "House" in nearestTerrainObjects is not the same as "House" in the isKindOf functions (eg nearestObject), but neither of them is usable without filtering.

ornate whale
granite sky
#

I'm not sure if there's a way to detect the presence of a path LOD other than nearestBuilding.

ornate whale
#

I don´t even know what LOD in Arma's terms mean, TBH. 😄

granite sky
#

You'd think that selectionNames could do it but the examples suggest otherwise.

#

oh, allLODs maybe.

#

a LOD in Arma is just any collection of model geometry

#

Some of them are for rendering. A lot of them aren't.

ornate whale
#

OK, so I am looking for some with interior nav meshes or something likee that -ish? 😄

granite sky
#

That's what nearestBuilding does. Bear in mind that this isn't absolute either. Normandy hedgerows have path LODs, for example.

ornate whale
granite sky
#

well, we use buildingPositions plus a blacklist.

ornate whale
#

Blacklist on class names?

granite sky
#

yeah. I'm not sure if anything has buildingPositions and doesn't have a class...

#

It hasn't come up anyway.

ornate whale
#

Thanks alot.

digital hollow
#

allLODs does return paths lod

fickle swift
#

Uhm, question.. is it possible too make a prison script, for altisserver. Using prison at lifetime, without ability too escape instead of a serverban. Then separate the timeout and the lifeterm prisoners... so only the timeout can escape/get freed by friends...

little phoenix
#

I'm trying to play a video with BIS_fnc_playVideo, but when it plays both covering the entire screen of a user and as a texture on a screen it seems to be sped up compared to the actual file, any idea what would cause that? I've used it just fine previously without it being sped up so kinda confused (given I literally copy and pasted what I used prior and it was fine). The file is not sped up - I've triple checked.

#

It plays as if the video is sped up but audio isn't, really odd

winter rose
little phoenix
#

👍 weird cause a bunch of videos were converted the same way iirc and only one has the issue.

winter rose
#

I believe you - unfortunately SQF cannot help here, it's directly in-engine
but weird indeed

little phoenix
#

I'll play around with it for a bit and see if I can figure the mystery out, thanks 👍

manic sigil
#

Friend brought up how to fly helicopters, which has temporarily instilled some energy in finishing my helicopter flight training mission x_x

Is there any way to create a model of a vehicle that doesn't have collision? The core conceit of my scenario is that you record your flight position every second, then can display how you flew... but as it stands, you have to fly away from the area or risk getting telefragged :/

#

My backup plan is to just have a rolling 'if X object on the list of display models gets within 10m of the player, it gets hidden, every N seconds unhide all objects on the list' but that sounds expensive and finnicky.

hallow mortar
#

You could try _object disableCollisionWith vehicle player.
Another approach could be to make the player return to a safe location before they can activate the replay, or straight teleport them when they activate it.

manic sigil
#

I tried disableCollision but memory serves since they're simulation disabled it doesn't work - something to that effect at least, it's not an option here.

I had considred a teleport, but then it's a matter of finding a good safe spot that's logically consistent. If they do a purely vertical landing, I can't have them just teleport straight up. If they're going slow enough, I can't teleport them to the first position. They could be anywhere on Altis, so I can't just teleport them back to the airfield and make them fly back...

#

Actually, the eachFrame hideobject is turning out pretty good, tho only in SP testing so far... hrn.

#

Okay, it works, but only as a safety to fly into, not spawn on top of you :/

hallow mortar
#

Have you considered not spawning objects at all if they're too close? It might leave a small gap, but that's probably better than exploding.

manic sigil
#

Actually just got that worked in; a waitUntil in the dummy spawner, wait for the player to be 15m away before creating the dummy. Seems to be working.

#

The gap is important - since each model represents one second apart, you get a feeling for speed and time taken.

ornate whale
#

What is the difference between doMove, move and moveTo?

tender sable
#

commandMove and doMove are commands given to unit by the leader. They are usually executed and then the leader (if AI) will call them back once completed. Move command I think affects whole group (disregarding waypoints, etc.. until completed) . MoveTo command is typically only used in an FSM executed with doFSM because doMove and commandMove will halt and override the FSM if called within it. It has a bit of a nuance to it also that I could explain further in like a DM or something if you need it. It's a special case for sure.

tender sable
real tartan
#

can you get index of array inside apply ?

little raptor
#

only if you count manually

digital hollow
#

What's less costly for processing:

  1. Hidden unit, how Tracers Module works and Zeus Enhanced also
  2. Hidden turret with uav_ai gunner ("\A3\characters_F\Common\invisibleMan.p3d"), like WS gun drone (can be literally just 2 mempts, I think?)
real tartan
#

is there a getter for setVehicleAmmo ?

digital hollow
crimson apex
#
while {true} do {
    _allDead = true;

    {
        if (alive _x) then {
            _allDead = false;
            exitWith {true};
        };
     } forEach units _enemyGroup;

    if (_allDead) then {
        hint "All enemies dead";
    };

    sleep 1;
}
``` I keep receiving an error that there's a ```;``` missing after exitWith {true}, is there any reason or is it a bug?
warm hedge
#

This is not how exitWith works

#

if (true) exitWith {}; this is the syntax

crimson apex
#

oh god... thank you

crimson apex
#

Whats the difference between setTaskResult and setTaskState?

alpine mountain
#

any way render static image for texture, r2t is like a video, what I’m looking for is like capture image. Or I need extension?

#

Which the purpose like take a photo in camera, then I can use the image to screen (setObjectTexture)

warm hedge
#

You can use ui to tex

fair drum
digital hollow
#

Anyone know of a particle- or lightpoint- based muzzleflash effect that I can reference?

ancient mantle
#

anybody know of a mod that removes g forces?

fair drum
ancient mantle
#

i mean i cant even bank left or right without going into G-LOC

warm hedge
#

"I mean" here is nothing for us. It is not a vanilla feature

#

Which means what Hypoxic said

fair drum
#

@ancient mantle

Which means if ACE is actually enabled, then you can go to Addon Settings and go to the G-Forces tab to disable G-forces entirely

digital hollow
#

is there a way to check if an object came from createVehicleLocal?

warm hedge
#

Do you mean if it is only in local computer but nobody?

grizzled cliff
#

so even though carma is fast, like close to sqf raw fast... i still want faster, so taking a little break tonight from the carma compiler to tackle patching again

digital hollow
#

yeah, and in singleplayer there is no netID regardless

warm hedge
#

Good question 🤔

meager granite
warm hedge
digital hollow
#

In SP they both return the same information for createVehicleLocal and createVehicle. I mean I guess the 2 commands are supposed to act the same in SP.

pulsar bluff
#

how would i make a number = 1 between 45-315 degrees and have it gradually = 0 at 0 degrees

meager granite
digital hollow
digital hollow
pulsar bluff
#

hmm

#

yep that worked thanks 😄

#

comparing vehicle dir to gun dir

#
onEachFrame {
    _vehicle = cameraOn;
    _vehicleDir = getDir _vehicle;
    _weaponDir = (_vehicle weaponDirection (currentMuzzle player));
    _deg = (_weaponDir # 0) atan2 (_weaponDir # 1);
    _other = (abs ([_deg, _vehicleDir] call BIS_fnc_getAngleDelta) / 45) min 1;
    hintsilent str [_vehicleDir,_deg,_other];
};```
digital hollow
#

cba has vect2polar, which is nice, or I guess just animationSource phase of the turret anim?

pulsar bluff
#

ahh i just check weaponDirection, seems to work fine with this

tough abyss
#

["onLoad",_this,"RscDisplayOptionsAudio",'GUI']

think360

#

Broken game is broken

obsidian mirage
#

is there an event handler for when a player places down a mine?

hallow mortar
#

Not specifically, but they can be detected by the ProjectileCreated mission EH

#

(Yes, even though the mine does not appear to be a projectile)

sharp grotto
#

Fired EH can detect it, _weapon param will be "Put" for mines/charges.

obsidian mirage
#

thanks

little raptor
#

iirc mines were detected via EntityCreated?

hallow mortar
#

I'm pretty sure I was doing exactly that just a couple of days ago

#

it was all in debug console though so I don't have the code any more

#

Tested and yes, for player-placed mines ProjectileCreated detects them.
Mines created by other means might not be detected, probably depending on whether they use the mine's CfgVehicles class (as with Editor placement) or its CfgAmmo class

#

Easy test: NATO Mine Specialist unit,

addMissionEventHandler ["ProjectileCreated", {
    params ["_projectile"];
    systemChat typeOf _projectile;
}];```
twin oar
#

How do I set a ambient light source to a building

#

I looked at setlightsource

fair drum
split scarab
#

How do you edit the Briefing section in the map?

#

I just want to add one big description of how the mission works

fair drum
split scarab
#

Ah very nice

#

Thought it would've just been somewhere in the General mission settings

warm hedge
#

@dreamy kestrel Text with a link is forbidden for literally everyone, for the security reason

dreamy kestrel
#

no problem, thanks...

pale wagon
#

Dumb question: How do I have a trigger detect if a specific synced unit is killed?

#

(and then have it display a message that that unit is dead)

warm hedge
#

Killed eventhandler

pale wagon
#

Gotcha, thank you

mystic scarab
#

Hello, can anyone explain to me how damage works with vehicles? Does each hit point have a health value that gets reduced with each hit?
I'm using this to see the damage done to an off-road with an MX rifle and with a static HMG: this addEventHandler ["HandleDamage",{hint format ["Damage done %1!", _this #2];}];
I'm trying to make it so a car can be disabled but not completely destroyed and replaced by a wreck and don't understand if the car gets wrecked if it receives a single hit above a threshold or if more instances of damage add up. For example, the HMG eventually blows it up, but the MX rifle doesn't.

hallow mortar
#

Vehicles have a system of separate (but related) health pools for individual components and for the overall "hull structure". Damage to components is based on where the vehicle is hit, and the penetration path of the projectile is modelled. Some components can cause the vehicle to be destroyed when they run out of HP (e.g. ammo racks) while others just stop working. The vehicle will also be destroyed if the overall structure runs out of HP.
Vehicles also have armour, which projectiles must penetrate in order to damage the vehicle. The offroad's armour is probably not very good, but at the same time, the MX has relatively poor armour penetration, will lose velocity (and therefore damage) quickly after penetration, and has essentially no "splash damage".

So to prevent the vehicle from being totally destroyed, you'll want to put a cap on how much damage can be done to the overall structure (the "" selection, as returned by handleDamage) and to certain critical components like the fuel tank.

Note that the damage level returned by handleDamage is the final total of damage to the given selection or component, after the hit is applied. You can use this to cap total damage, e.g.

if (_damage > 0.8) then { _damage = 0.8 };```
but if you want to find the damage done by the hit, you'll need to subtract the _current_ value (found with `getHit`) from the final total given by handleDamage.
rough dagger
#

Is there a trick to destroying ammo boxes with explosives? I’ve seen mixed results where sometimes they disappear and sometimes they don’t. Should I be using some sort of EH with a deleteVehicle script attached?

lone vapor
#

Hey guys I hope someone can help me.
I'm working on a new Airbus H145 for Arma 3 and I will add new AddActions for starting the engine.

But before I add the new Addactions, I want to remove the default engine on functions from my helicopter. Is there anyway to remove the default engine on/off Addaction?

mystic scarab
# hallow mortar Vehicles have a system of separate (but related) health pools for individual com...

Thank you for the detailed response, I'm trying to understand how it works now. Is the overall structure represented by "hull" or is it different? I've tried to disable damage done to the hull and fuel tank with the following line but the car still blows up:
this addEventHandler ["HandleDamage",{if (_this#7 in ["hithull", "hitfuel"]) then { 0;} else {};}];

To add another question, if I cap the damage like in your example, wouldn't it eventually still add up to destroying the vehicle?

proven charm
lone vapor
hallow mortar
# mystic scarab Thank you for the detailed response, I'm trying to understand how it works now....

The overall structure is supposedly represented by the "" selection (_this#1).

The cap in my example will prevent the final total damage going above 0.8. Remember, the _damage in handleDamage is the final total. Not the damage applied by the current hit, the final total. The code in my example means that if the current hit would put the final total above 0.8, it instead puts it at 0.8. It doesn't mean that every hit adds a maximum of 0.8 damage, it means that the total damage state of the selection, after the hit is applied, can't be more than 0.8. So it won't add up.

#

0.8 is a ballpark number btw, you'll want to tune that depending on exactly where you want the limit to be.

mystic scarab
hallow mortar
#

Expanded example:

this addEventHandler ["HandleDamage", {
  params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit"];
  // Get the damage state of the selection _before_ the hit.
  private _oldDamage = _unit getHit _selection;
  // Determine the damage added by the hit, by subtracting the old damage total from the final total.
  private _hit = _damage - _oldDamage;

  // Example: reduce the impact of the individual hit by 50%, and return the result to override the original result
  _oldDamage + (_hit / 2);
  // Example: prevent the final damage state exceeding 0.8
  if (_damage > 0.8) then { 0.8 };
}];```
hallow mortar
limber thunder
#

I am looking for a method to save and edit data across mission restarts.

We are currently scripting a round based multiplayer game mode. After each round, the mission is restarted and a winner and loser team is determined. Now we are looking for a way to track the won rounds per team and the team that has three points first is the winner.
The problem is that with each the mission restarts, the variables are overwritten.
Does anyone have an idea how to achieve it so that the points per round are counted regardless of the mission?

Thanks for your help

mystic scarab
# hallow mortar This is probably because you were hitting different selections and components wh...

Thank you for all the help, it's a lot clearer now! This is what I used:

this addEventHandler ["HandleDamage", {
  params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
  private _oldDamage = _unit getHit _selection;
  private _hit = _damage - _oldDamage;
  _oldDamage + (_hit / 2);
  if (_this#1 in [""]) then { if (_damage > 0.8) then { 0.8 }; };
}];

It still blows up if the fuel component is hit, but I can use it. Thanks again!

rough dagger
#

@limber thunder I’ve had good results using profileNameSpace. The iniDB option is good for bigger data sets I think, but for basic stats like player scores, kills etc profileNameSpace is a good starting point to research

#

(getVariable / setVariable etc)

#

I’ll leave it to the experts to expand, but in my limited experience this allows me to manage persistant data in my missions.

pastel pier
#

Anybody seen this error before and knows how to fix it? It's an issue with the corrupter of webknights zombies and creatures.

10:54:00 File /z/ace/addons/medical_engine/functions/fnc_handleDamage.sqf..., line 430
10:54:00 Error in expression <) then {
    private _armorCoef = _armor/_armorScaled;
    private _damageCoef =>
10:54:00   Error position: </_armorScaled;
    private _damageCoef =>
10:54:00   Error Zero divisor
limber thunder
limber thunder
rough dagger
#

@limber thunder I am happy to share what I know, but might not be the best place (here) to try to explore/explain. Happy to do a DM convo, you can then come back and summarise for anyone else who might be interested?

hallow mortar
# mystic scarab Thank you for all the help, it's a lot clearer now! This is what I used: ``` thi...

You can check against both at the same time. (note: you can do getAllHitPointsDamage on a vehicle to find all its selection and hitpoint names - it's not guaranteed that there's only one fuel tank selection, so add any more you find.)

this addEventHandler ["HandleDamage", {
  params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
  private _oldDamage = _unit getHit _selection;
  private _hit = _damage - _oldDamage;
 
  if (toLower (_this#1) in ["", "hitfuel"]) then { if (_damage > 0.8) then { 0.8 }; } else {  _oldDamage + (_hit / 2);};
}];```
limber thunder
mystic scarab
hallow mortar
#

As for selections and hitpoints, they're tied together. Hitpoints have selections which determine which parts of the model are associated with that hitpoint. So just checking against the selection should be fine.

rough dagger
#

Thanks @proven charm I'll research that 🙂

hallow mortar
#

You just need to make sure you have all the relevant selections in the array to check against. Like, a helicopter for example may have multiple fuel tanks, and you'd want to check all of them because any one exploding could destroy the vehicle.

mystic scarab
# hallow mortar As for selections and hitpoints, they're tied together. Hitpoints have selection...

I don't understand it. The car still blows up if hit in the fuel selection:

this addEventHandler ["HandleDamage", {
  params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
  private _oldDamage = _unit getHit _selection;
  private _hit = _damage - _oldDamage;
  if (toLower (_this#1) in ["", "hitfuel", "hithull", "hitbody"]) then { if (_damage > 0.8) then { 0.8 }; } else { };
}];

This is getAllHitPointsDamage after firing at it and it was stable:

And this is the result after firing at it when it exploded (it exploded like 2 seconds after I stopped firing and got the result):

[["hitlfwheel","hitlf2wheel","hitrfwheel","hitrf2wheel","hitfuel","hitengine","hitbody","hitglass1","hitglass2","hitrglass","hitlglass","hitglass3","hitglass4","hitglass5","hitglass6","hitlbwheel","hitlmwheel","hitrbwheel","hitrmwheel","hithull","#light_l","#light_r","#light_l","#light_r","#light_l","#light_r"],["wheel_1_1_steering","wheel_1_2_steering","wheel_2_1_steering","wheel_2_2_steering","palivo","motor","karoserie","glass1","glass2","","","","","","","","","","","palivo","light_l","light_r","light_l","light_r","light_l","light_r"],[1,1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1]]

The only real difference seems to be that hitfuel and palivo got destroyed. I googled czech to english and palivo apparently means fuel.

hallow mortar
#

You should put palivo in the array as well then

mystic scarab
# hallow mortar You should put `palivo` in the array as well then

That did it, thank you! I don't understand one thing, though. With _this#1 I get a selection name and I check it against my array, but with getAllHitPointsDamage I see the complete list of selection names and hitfuel, hithull and hitbody are not selection names according to getAllHitPointsDamage, they're hitpoints which I could get by referncing #7. Why do they still match?

hallow mortar
#

Take 'em out and see what happens

mystic scarab
hallow mortar
#

hitHull and hitFuel are likely to be the equivalent hitPoint names to the "" and palivo selections...at least for this vehicle.
It might be worth leaving them in, in case you want to reuse this for other vehicles where the selections and hitpoint names do match

mystic scarab
# hallow mortar `hitHull` and `hitFuel` are likely to be the equivalent hitPoint names to the `"...

I played around with it a bit more and got the vehicle disabled and not explode while losing fuel and everything. Leaving the code snippet here, thank you for all the help @hallow mortar

this addEventHandler ["HandleDamage", {
  params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
  private _oldDamage = _unit getHit _selection;
  private _hit = _damage - _oldDamage;
  if (toLower (_this#1) in ["", "palivo"]) then { if (_damage > 0.8) then { _unit setHitPointDamage ["hitfuel", 1.0];
    0.8; }; } else { };
}];
split scarab
#

Can you have normal repawns for one faction but then either block repawns for another faction or turn them into spectators on death?

split scarab
#

Also how can you check if a unit is downed and need reviving? (with vanilla revive system)

proven charm
split scarab
astral bone
#

ah yes, I am smart, I jsut ran code I was working on. I added a start loading screen, but forgot to also add the end loading screen xD

astral bone
#

err- how do i set a marker's color in 3den?

#

_marker set3DENAttribute ["baseColor",[0.4,0,0.5,1]];
is it not this?

#

oh-

#

_marker set3DENAttribute ["baseColor","colorciv"];

#

I ended up using an object instead but eh well xD

winter rose
next kraken
#

hey guys, - ive got a simple code / script, which runs only correctly, if i execute it via the debug console with "execute local". just spawning an agent animal, keeping it in a radius, to make it work on dedicated servers. putting it into the serverInit, localplayerinit, executing in via trigger....makes it break. it just doubles the animal. what "special" does execute local in the debug console do that all other methods do not work ?

#

i execute the script via [zeus43] execVM "animals.sqf";

#

because if i call it on the server, or other players, the animals get doubled. problem is, as i mentioned, the goat gets doubled with all other methods, only executing it via that scriptcall with debug console execute local does the job

#

this is tested on dedicated server with 2 players connected.

dreamy kestrel
meager granite
next kraken
#

Ok. Yea thats what i thought, but how would i execute the script like its executed via debug console local ? because if i do that, every player has the same goats and they get not doubled / executed on server or client too

#

or is the only way to use the debug console

next kraken
#

yea, problem is the animals agents and its function are bugged serverside;-( thats why i need them to spawn locally using only one player executing them

meager granite
#

(on mission start)

next kraken
#

there´s no way to make the animals move if using server execution sadly

meager granite
#

If that player leaves, goat becomes server side and your spawn thread stops

meager granite
next kraken
#

yes=im trying to get animals working for ages on dedicated servers. modules are bugged, they dont move, functions dont work too. in "normal" MP they do work fine. Dedicated servers still need script solutions.

meager granite
#

Are you running your functions from client side trying to control dedicated server owner animal?

winter briar
#

if you create a hashmap on the server, make it final then u broadcast it with publicvariable then this hashmap is not final on client side its this a bug?

next kraken
#

nope. i exectued the animal functions on the server. they are all broken. only way is creating animals local for only one player

winter briar
#

doesnt happen with other data types string,code so i guess it might be a bug

slow brook
#

What's the eventhandler that forces AI to get out of a vehicle when it gets damaged?

little raptor
#

it's not an "event handler". it's done by the game

#

try allowCrewInImmobile

slow brook
#

Na there's an event they're tied to right

tulip ridge
#

There's not
If you wanted to run something when the vehicle is destroyed, you could use "Killed"

slow brook
#

Ai get out of a vehicle when it takes x amount of damage

tulip ridge
#

There's not an event handler for it

sullen sigil
#

check damaged EH

#

problem solved

tulip ridge
#

You could check whenever the vehicle takes damage, and check if it's damaged enough

#

Oh my internet's being weird, KJW's message just now showed up lol

tender sable
tender sable
split scarab
#

Any way to spawn a new playable unit during a Zeus mission?

meager granite
#

If you mean a lobby slot then no

chilly scarab
#

Was trying to figure out notifications without an objective state, and looked into cfgNotifications, I'd like to use this mid-game via the console to create notifications while using zeus, is there anyway to do that?

Seems it isn't possible to add new task classes while everything is running unless I'm doing it wrong.

split oxide
#

Is there a simple way to check if a player is aiming down sights?

digital hollow
#

cameraView I think?

split oxide
#

thank

astral bone
#

ah huh- so buildings are broke again. Which I think means it's a mod I got.

winter briar
hallow mortar
#

If you think it's a bug, make an FT ticket so it can be properly tracked

ornate whale
#

Is there any inventory command to add a facewear to a player? Similar to addHeadgear?

granite sky
#

I don't think A3 has volumetric fog?

#

Well, it does have a shader of some kind with altitude variance. There is also a separate z-fog wall placed around view distance.

jade tendon
#

Can anyone see anything wrong here?

Started getting "Error Missing ;" on line 5 "format [" Date: %3.%2.%1<br/>",date select 0,date select 1,date select 2]"

private ["_mission", "_diary_text", "_system", "_credits"];
_mission = toUpper (format ["%1",getText (missionconfigfile >> "onLoadName")]);

_diary_text = _mission + "<br/>"
format [" Date: %3.%2.%1<br/>",date select 0,date select 1,date select 2]
format [" Location: %1<br/>",worldName]
format [" Typ: %1<br/>",getText (missionconfigfile >> "Header" >> "gameType")]
format [" Authors: %1<br/><br/>",getText (missionconfigfile >> "author")]
"<br/>"

TIA

jade tendon
dusk gust
jade tendon
#

ok will test it now

dusk gust
# jade tendon ok will test it now

Keep in mind that if you wanted that entire thing one string, it will not return what you want.

_diary_text = _mission + "<br/>" +
(format [" Date: %3.%2.%1<br/>",date select 0,date select 1,date select 2]) + 
(format [" Location: %1<br/>",worldName]) + 
(format [" Typ: %1<br/>",getText (missionconfigfile >> "Header" >> "gameType")]) + 
(format [" Authors: %1<br/><br/>",getText (missionconfigfile >> "author")]) + 
"<br/>";

Would probably be what you want though

meager granite
#

There is no assignedWeapons-like command that would only return weapons in slots, right? (weapons returns weapons in containers too)

cyan dust
meager granite
meager granite
#
  1. Player has "arifle_MX_F" on full auto
  2. player weaponState "arifle_MX_F" => ["arifle_MX_F","arifle_MX_F","FullAuto","30Rnd_65x39_caseless_mag",30,0,0]
  3. Player switches to pistol
  4. player weaponState "arifle_MX_F" => ["arifle_MX_F","arifle_MX_F","Single","30Rnd_65x39_caseless_mag",30,0,0]
  5. Player switches back to primary
  6. player weaponState "arifle_MX_F" => ["arifle_MX_F","arifle_MX_F","FullAuto","30Rnd_65x39_caseless_mag",30,0,0]

Is this a problem of weaponState command or this is just how engine works by storing previous muzzle and fire mode outside of the weapon and restoring it once its selected again?

hushed tendon
#

So I’m trying to get the value from the scroll wheel as someone uses it and this is what I’ve got which seems to be right but isn’t working. (findDisplay 46) displayAddEventHandler [“mouseZchanged”,”hint str (_this select 1)”];

drifting sky
#

is there a quick way to do array to string printing curly brackets instead of square brackets?

meager granite
#

You have unicode quotes instead of proper quotes there btw, I hope you're not using them in code

hushed tendon
#

I have exactly that and it isn’t working meowsweats

meager granite
#
findDisplay 46 displayAddEventHandler ["mouseZchanged","hint str _this"]
hushed tendon
#

I just tried exactly that 😭

#

Would having it in initPlayerLocal do anything? I feel like it wouldn’t tho

meager granite
#

Ah, you're doing it on init. Display 46 is not ready on init yet.

hushed tendon
#

Oh

#

I don’t do display stuff

meager granite
#
0 spawn {
    waitUntil{!isNull findDisplay 46};
    findDisplay 46 displayAddEventHandler ["mouseZchanged","hint str _this"];
};
hushed tendon
#

Thx 🙏

#

Yup it works thx a bunch

vivid bridge
#

Hey guys! how to make bots when landing from a helicopter look at each sector?

meager granite
#

lookAt, commandWatch ?

vivid bridge
meager granite
#

So just have a vector between a bot and a heli

vivid bridge
#

could you please give me an example?

meager granite
#
_bot lookAt (vectorNormalized(_heli vectorFromTo _bot) vectorMultiply 10)
#

Something like this

#
_bot lookAt (_heli vectorFromTo _bot)
```or just that, not sure if look distance or Z matters for AI.
vivid bridge
#

none of the options worked

meager granite
#
getPosWorld heli vectorFromTo getPosWorld b1
vivid bridge
#

Is it possible to set a condition when the bot is at the position the animation is played?

formal stirrup
#

waitUntil {(getPos b1) == (getPos middle)}

#

Maybe something like that?

pulsar bluff
#

small issue... if I am using "cursorObject" on a gun carried by a unit, how can I tell that it is a proxy/part of a unit?

pulsar bluff
#

like if i just spawn the gun model on the ground and "cursorObject" on it, how can i tell the difference between that and "cursorObject" on the same gun model carried by a unit

hallow mortar
#

objectParent?

pulsar bluff
#

you'd think so but it returns objnull

#
systemchat str [cursorobject,objectParent cursorObject]```
#

//[NOID mx_gl_f.p3d,<NULL-object>]

little raptor
#

if it's an actual object is must have a non-negative ID

forest charm
#

Is there a way to test whether a passed parameter is a marker or an object like a unit/item/house etc? I'm creating a function where I would want to be able to pass either one and do different stuff based on the type (use getMarkerSize or use a default radius around the object).

warm hedge
#

A marker is a String, an object is an object

forest charm
#

Awesome, thanks a lot.

pulsar bluff
#

attaching something to a surface, would like to exclude surfaces like weapons in players hand

meager granite
#

Stuff like bullet holes, footsteps and other crap don't have id either though

#

str cursorObject find "NOID" == 0

forest charm
#
params ["_lightSetting", "_object", ["_radius": 100]];
private ["_objectPos"];

// True = lights on, false = lights off
switch _lightSetting do {
    case true: {
        _lightSetting = 0;
    };
        case false: {
        _lightSetting = 0.95;
    };
};

switch (typeName _object) do {
    case "STRING": {
        _objectPos = getMarkerPos _object;
            _radius = (getMarkerSize _object) # 0;
    };
        case "OBJECT": {
        _objectPos = getPosATL _object;
    };
};

This code is returning Error :: Type String, expected switch - pointing to the first line (params). I'm calling the function with 0 = [false, player] execVM fnc_name. What might be causing the issue?

hallow mortar
#

["_radius": 100] --> ["_radius", 100]

#

: is not a valid array separator. It is used in switch cases, which is why the game is confused.

forest charm
#

Perfect, thank you!

drowsy geyser
#

is there a way to determine if a projectile hit is from a bullet\explosive etc.?
just an example code (dosent work):

this addEventHandler ["HitPart",
{ 
    _this spawn
    {
        (_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"];
        if (_ammo isKindOf "BulletBase") then
        {
                hint "hit by bullet";
        };
    };
}];
hallow mortar
#

In what way does that not work?
Does it fail to detect bullets that really are bullets? Does it detect things that you don't want it to?

drowsy geyser
#

getting error isKindOf: type array, expected string/object

hallow mortar
#

ammo: Array - ammo info: [hit value, indirect hit value, indirect hit range, explosive damage, ammo class name];

drowsy geyser
#

okay but how would i only return hits by a bullet, i want to sort between bullets and other type of projectiles

hallow mortar
#

Filtering by isKindOf "BulletBase" (or "BulletCore" ) would probably be part of it. You can use that to distinguish between bullet-like projectiles and shells, rockets, and missiles.

#

However, some projectiles which you don't think of as bullets, such as autocannon rounds, are also simulated as basically big bullets, so it can be complex to identify them properly.

#

You could check the projectile's warheadName config property. For high-calibre "bullets", this will usually be AP, HE, etc., while for small-calibre bullets it's usually not present at all.

#

Oh, before doing any select on the _ammo param to get the ammo class, you should count it. If the hit was caused by a physics collision, it contains a different array which is one element shorter, and doing select 4 on that would cause an error.

drowsy geyser
#

Okay thanks. Do you know the names of the ammunition classes other than “bulletbase”? or where can i find them?

hallow mortar
#

Just go through CfgAmmo in the config viewer and see what various things inherit from

#

It might be better to use *Core rather than *Base as there are some things that don't have a *Base - BombCore for example

drowsy geyser
#

ah okay thank you

pulsar bluff
flint topaz
sullen sigil
#

does setmass 1 not work on it

hallow mortar
#

Since when does setMass disable collisions?

sullen sigil
#

low masses disable collisions for some sim types

hallow mortar
#

I don't think mass is considered at all for simple objects since they aren't PhysX, anyway

flint topaz
#

^

#

like I can try it

#

why 1 btw?

rugged coral
#

Hey guys, just wanted to finish an old script which is using tree views in its ui but it does somehow not fill the tree views as it should. Maybe I am just blind right now but shouldn't it be correct this way?

if(!dialog) then {
    createDialog "baumenue";
};
disableSerialization;

private _display = findDisplay 9200;
private _bm_gebaudeliste_tree = _display displayCtrl 1500; 
private _bm_close_btn = _display displayCtrl 1607;
private _bm_bauen_btn = display displayCtrl 1606;
private _bm_kredit_check = display displayCtrl 1600;
private _bm_offentlich_check = display displayCtrl 1601;
private _treeViewMainFunctionalBuilding = _bm_gebaudeliste_tree tvAdd [ [],"Funktionelle Gebäude"];
...
flint topaz
#

what do you mean by "doesn't fill as it should"

#

what is it doing what did you expect

rugged coral
#

well I do not get a tree view entry in the ui

flint topaz
#

show

rugged coral
#

have sent you the picture per dm

ornate whale
#

How is it possible to project some particles like snow or dust on the screen?

hallow mortar
#

There is a snowflake texture in the game for use with those, I'm just looking up the path now

#

a3\data_f\snowflake16_ca.paa (also 8 and 32 for different resolutions)

ornate whale
hallow mortar
#

You use Syntax 2 to use the options specifically for turning rain into snow. Or anything else you can find a suitable particle texture for.

ornate whale
#

The thing is, I have tried a popular script from Workshop (Snow Storm Demo), and it really took the performance down from 120 fps to like 60. So I will probably create something lighter myself.

hallow mortar
#

Particles can have a serious effect on performance if there are a lot of them, yes. Same way your performance tanks if there are a lot of smoke grenades around. There's no solution to that, you'll just have to find the balance between how dense you want the effects to be and an acceptable performance level.

vivid bridge
hallow mortar
#

First: they seem to have got confused and tried to use "middle" - the stance name - as a variable name for a world position reference, which it isn't.
Second: you shouldn't use == to compare positions, because unit movement is not precise enough. Being off by only a couple of centimetres would cause the comparison to fail, even though the unit is basically in the right place.

#

There's also not much point in using waitUntil in a trigger condition, because trigger conditions are already a form of "waitUntil", at heart. Use waitUntil if you want to wait for a condition to be true in a script outside of a trigger.

#

Try this:

(unitName distance destination_position_here) < 1```
vivid bridge
hallow mortar
#

I feel like I didn't make that one that hard to figure out :U

little raptor
#

maybe particles too but I don't think you want those anyway (and cursorObject doesn't return those)

nocturne bluff
#

patching?

sinful monolith
#

Hello everyone. Im kind of new in scripting and started learning littlebit just really basic stuff. Im wondering how difficult is to have cost for different units in zeus, i have used the zeus modules and its ok but the mission i want to make is this fairly new rts mod and i would like to have different cost for lets say anti tank guy and rifleman or heavy tank and light tank. I have read BI Wiki curator stuff a lot now and tried googling but it seems like nobody has figured out how to put individual costs each unit. Or im just blind or don t understand BI Wiki too well. Thanks for answers

strong shard
#

there are any way to detect if vehicle has driver/commander/gunner seats from config? has* doesn't work for all vehicles (for example, O_MBT_02_cannon_F doesn't have hasGunner and hasCommander, but have this seats)

granite sky
sinful monolith
#

yeah and i have read it probably like 30 times today i have tried many different combinations but if i dont get error messages, it doesnt give error but either its not working. It can be that my english understanding isnt too good either :/

hallow mortar
#

Well, I was wrong about the 32-frame version, there isn't one, it's only 4, 8, and 16-frame versions.
But the others should work, and the 16-frame version I know does work (for rain) since I've used it

ornate whale
hallow mortar
#

https://community.bistudio.com/wiki/Arma_3:_CfgWorlds_Config_Reference#class_RainParticles
The texture contains a number of frames - like animation frames - which are used to provide variance in the drops, so they're not all exactly the same. The number of frames affects the size of the texture in memory, which affects performance, which is why there are options with more or less frames.
The texDropCount parameter, as described here (linked from setRain syntax 2) is used to tell the game how many frames the texture has, because it doesn't automatically know.

strong shard
meager granite
#

primary, hasGunner, commanding

#

there is also primaryGunner

#

I don't recall how engine behaves if you have two commanding turrets for example, but there is some logic for it

#

Also primaryObserver

strong shard
#

looks like need to find turret with maximum commanding and primary = 1

meager granite
#

You need to check each turret including subclass ones

#

That would be [0,0] turret which is commander

strong shard
#

ok, now question: has* matter? (hasGunner, hasCommander)

#

or it's some sort of hint for "human"?

strong shard
meager granite
#

No docs for commanding, primary seems to be obsolete

meager granite
strong shard
#

ah, it's turret parameter

#

not main vehicle class

meager granite
#

Yeah looks like there is hasGunner in main class in some vehicles, no idea what it does

#

"getNumber(_x >> 'hasGunner') > 0" configClasses (configFile >> "CfgVehicles") apply {configName _x} => ["Plane_Civil_01_base_F","C_Plane_Civil_01_F","C_Plane_Civil_01_racing_F","I_C_Plane_Civil_01_F","AAA_System_01_base_F","B_AAA_System_01_F","SAM_System_01_base_F","B_SAM_System_01_F","SAM_System_02_base_F","B_SAM_System_02_F","B_Ship_Gun_01_base_F","B_Ship_Gun_01_F","B_Ship_MRLS_01_base_F","B_Ship_MRLS_01_F","Radar_System_01_base_F","B_Radar_System_01_F","Radar_System_02_base_F","O_Radar_System_02_F","SAM_System_03_base_F","B_SAM_System_03_F","SAM_System_04_base_F","O_SAM_System_04_F","I_E_Radar_System_01_F","I_E_SAM_System_03_F"]
List isn't that big. No idea what its for, maybe doesn't mean anything and got there by accident.

digital hollow
#

Otoh fullCrew returns a driver position for static weapons, which can be annoying.

digital hollow
#

pretty sure it's just all of them. just tested no mods

fullcrew [vehicle player, "", true]
// [[<NULL-object>,"driver",-1,[],false,<NULL-object>,"$STR_POSITION_DRIVER"],[B Alpha 1-1:1,"gunner",-1,[0],false,B Alpha 1-1:1,"$STR_POSITION_GUNNER"]]
upbeat valve
#

Trying to make a trigger that creates a new ai squad and groups it to the player when the player's squad is dead, and the player's in the respawn area. Been at this for maybe an hour and nothing works
Condition:
(count units player == 0) && (player inArea "respawnArea_1")

On act

private _squad = [_position, WEST, (  
configfile >> "CfgGroups" >> "West" >> "rhsgref_faction_cdf_ground_b" >> "rhsgref_group_cdf_b_reg_infantry" >> "rhsgref_group_cdf_b_reg_infantry_squad"  
)] call BIS_fnc_spawnGroup; 
private _leader = leader _squad;  
deleteVehicle _leader;  
units _squad join player;```

This is for multiplayer
meager granite
#

Likely assumes there is always a driver in a vehicle

digital hollow
#

most likely. thankfully hasDriver does seem consistent enough to fiter.

digital hollow
upbeat valve
#

Alright ill see if 1 fixes it

upbeat valve
#

I did try something along the lines of units player findIf {alive _x && !isPlayer _x} == 0 earlier, but it didn't work. Maybe i just applied it wrong

digital hollow
#

Use the condition of count, not findif

digital hollow
digital hollow
#

Yes but is there a poor driver ai that gets insta deleted

real tartan
#

is there a better way to update marker position for vehicle ? perhaps some event handler ? Or update marker position only when player open a map? note: for dedicated server where there are multiple players online

[_vehicle, _marker] spawn 
{
    params ["_vehicle", "_marker"];

    while { alive _vehicle } do 
    {
        sleep 0.5;
        _marker setMarkerPos ( getPos _vehicle );
    };
};
hallow mortar
#

You could use local markers to save network traffic. Otherwise that's about it.

real tartan
#

is there an event handler for player connect to UAV ? or take control of gunner turret ?

upbeat valve
# upbeat valve Trying to make a trigger that creates a new ai squad and groups it to the player...

For those who might have this problem in the future, this is how I fixed it
Condition
(units player findIf {alive _x && !isPlayer _x} == -1) && (player inArea "respawnArea_1")

On act

private _squad = [_position, WEST, (  
configfile >> "CfgGroups" >> "West" >> "rhsgref_faction_cdf_ground_b" >> "rhsgref_group_cdf_b_reg_infantry" >> "rhsgref_group_cdf_b_reg_infantry_squad"  
)] call BIS_fnc_spawnGroup; 
private _leader = leader _squad;  
deleteVehicle _leader;  
units _squad join player;```
stark granite
#

I'm a bit stuck with somthing and would love some input!

I'm building a GUI based building system using the ACE fortify deployables.

Because of this the player is required to have the fortify tool, which subsiquently shows them all of the objects registered due to cost.

I'd like to have them not be able to see this menu.

I can add the tool on deployment start, but then I need to remove the tool again on sucess (easy) and if cancled early (stuck here)

Another option is to remove the Fortify action branch from the self interaction tree (this I also can't figure out how to do)

if anyone has any suggestions for those, or an alternative solution I'd love to here it 🙂 Thx ❤️

#

tldr: I just wan't to hide the default fortify menu when not currently deploying an object

sullen sigil
#

the menu being the ace interaction menu? im not too well versed in fortify framework

stark granite
#

Yeah, Should be able to use the ace remove action func but I need to figure out how to specifically target the fortify branch

 * Author: commy2, NouberNou and esteldunedain
 * Removes an action from an object
 *
 * Arguments:
 * 0: Object the action is assigned to <OBJECT>
 * 1: Type of action, 0 for actions, 1 for self-actions <NUMBER>
 * 2: Full path of the action to remove <ARRAY>
 *
 * Return Value:
 * None
 *
 * Example:
 * [cursorTarget,0,["ACE_TapShoulderRight","VulcanPinch"]] call ace_interact_menu_fnc_removeActionFromObject;
#

Alternativly I just need to figure out when the player left clicks to cancle, and then remove the fortify tool, as I can do the same on success using the event that already runs. Works fine for sucess, just if you left click to cancle there is no event so the tool remains

#

Worse case scenario I just have to leave them with the tool and the visable menu, but that sorta defetes the point of the ui 😂

sullen sigil
#

imo keeping it would be best for people with muscle memory with their current radial menu and/or ace fortify itself, however

i think fortify has an action for each type of object from (briefly) looking at the code, cant get ingame to look. what happens if you try removeaction and just have "ACE_Fortify"?

stark granite
#

unfortunatly nothing happens there

sullen sigil
#

how is the menu organised? each object available?

stark granite
#

I can't find a function to pull the tree to see 😂

sullen sigil
#

nah i mean like on the user-facing end

stark granite
#

If I knew the names of the branches I might have a shot at remoing them

sullen sigil
#

is it split into subcategories or what

stark granite
#

Ah

#

By default just one big category

#

I was half way through this UI madness before I realised they could be split into categories

sullen sigil
#

Ah

stark granite
#

So ye, Isn;t the end of the world

#

Just wayyyy too many items for a radial menu

sullen sigil
#

yeah understandable
i would revert to my previous statement then, just keep it tbh

stark granite
#

That's my thinking

#

Only the person who can build has the tool anyway

sullen sigil
#

UI can make it easier if people go "fuck that" but if people have subcategories set up then no need to intrude on that anyways

stark granite
#

so if he builds somthing It isn't gunna cause issues

#

Just kinda ugly

#

Can always sub cat the stuff too thats true

#

even if I don't plan on using it it looks nicer regardless

sullen sigil
#

Ya I've just never used ace fortify so dunno how it works

stark granite
#

It'll work out I guess 😂

#

Bigger fish to fry

#

at worst I can come back to a menu in ur slf interact

#

its hardly game breaking at this point haahaha

#

Thanks for the help tho

#

rly appreciate someone just to talk it through with

#

could of been hours talking to chat gpt 😂

sullen sigil
#

chatgpt is useless for sqf

stark granite
#

alright for bits and bats

sullen sigil
#

the only time ive found it useful is for summarising documentation or interpreting it -- which it doesnt do well for sqf

stark granite
#

speeding things up when you have half of it already done

#

ye literally

#

Its a tool not a coder

#

Still gotta big brain somtimes

sullen sigil
#

only time its actually helped is learning regex

stark granite
#

I found it p.usefull for ui bits and bobs too

#

safezone math can die

manic kettle
#

Anyone know if it's possible to binarize or obfuscate a ogg/wss/mp3 sound file? Don't want anyone to open the mission pbo and hear the sounds

#

Currently I'm thinking of adding noise to the file and using in game filtering to remove the added noise frequencies. That or a simple pitch change. Though I've not played with those settings before.

pulsar bluff
#

i think worrying about the sound file will lower your quality of life

manic kettle
#

Not going to disagree lol, but if it's an easy solution I don't mind trying it. Throwing the net out to see if anyone knows. If it's too much hassle then yeah I won't bother

hidden finch
#

Hello guys. I am really a newbie in scripting and I just wanted to know how to use synchronizeObjectsRemove. I made my own scenario and I have some AI's recruitable using the MCC recruit script. However, these AIs are being sync to a trigger for show/hide module. I want them to desync from the trigger for show/hide module once I recruit them. Can anyone help me?

terse pulsar
#

Ello I have error I cannot figure out what im doing wrong i am = too infant in modding skill it is suppose to be a retexture mod ive been fucking with this for 14 hours now if anyone can pass along some info that would be amazing

terse pulsar
#

I just realized im stupid and didnt poster the error lol im too tired for this here

cyan dust
#

Sorry for necro, but I just tested "EpeContactStart / EpeContactEnd" and results are wild:

  1. It does ignore terrain collision for wheels (only detects body->terrain)
  2. It can give 3 starts and 2 ends on collision with another object (wut?!)
    So not reliable, unfortunately
hallow mortar
limber thunder
#

Hello guys,
can someone tell me how to make it so that players who are unconscious can no longer die? So they should not get any more damage. I already tried it with allowDamage false but that didn't work somehow.

limber thunder
warm coral
#

i have an issue with a trigger script

#

its supposed to destroy all vehicles that enter the trigger area but keep the units alive

#
{_x setDamage 1;} foreach (thisList - allUnits);
#

looks like this

#

and it works fine when only vehicles enter

#

but as soon as a unit enters the entire trigger breaks

#

and nothing gets destroyed anymore

manic sigil
limber thunder
sullen sigil
#

are you actually passing the unit to allowdamage

manic sigil
limber thunder
#

I have already tried to use the basic mode, but there it is just the same

limber thunder
granite sky
#

blinks

#

allowDamage false works fine, although you need to run it locally to the unit.