#arma3_scripting

1 messages Β· Page 213 of 1

pallid palm
#

@burnt matrix yeah you can lock vehicle

#

after all are in the vehicle: this lock true; or this lock false; in the init of the vehicle

#

but then it seems more real to me that they jump out πŸ™‚

#

i remember i had to do that on a chopper cuz the players would just jump out lol πŸ™‚

#

Rambo players that is πŸ™‚

#

and they would die and burn up all the respawn tickets πŸ™‚

hallow mortar
#

Locking can work; you can also try setUnloadInCombat

pallid palm
#

oh nice

#

how does that work

granite sky
#

hmm, I figured that was only for AIs.

pallid palm
#

this setUnloadInCombat false;

pallid palm
#

oh cool

#

oh ok cool

hallow mortar
pallid palm
#

agree

granite sky
#

Ah yeah, I guess you can't do that to players :P

pallid palm
#

lol

#

if you make a script you can πŸ™‚

#

1 mission i was in the guy teleported me to 0.0.0 in the water cuz i got more kills then him πŸ™‚

#

i did not go back there πŸ™‚

#

you can use eaither way

thin fox
#

I think you can make this work by just changing their behaviour to careless

#

when they reach the trigger, change to combat

pallid palm
#

or AWARE

#

what ever way is easyer you can do

#

changing behaviour seems like more cost to me though

#

but i guess not

#

i don't know much i'm just a nooby πŸ™‚

#

i dream of someday when and if: my name trun's Blue Woohoo πŸ™‚ like 30 years from now πŸ™‚ oh shit w8 lets see 64 + 30 hmmm oh shit lol πŸ™‚

hushed turtle
#

They switch to combat automatically anyway

pallid palm
#

thats a roger πŸ™‚

#

you bet my pleasure

frail skiff
#

Hello there, sorry if I'm interrupting,

I was wondering whether there was a way to execute a script for each unit in the area of a trigger, kinda like {} forEach units inArea triggerName but actually functional.

Thanks!

pallid palm
#

your not interrupting

#

i'll let the pros do this so i don't mess it up

#

i hardly ever use triggers πŸ™‚

#

well sometimes

frail skiff
#

I'm trying to reduce my use of them as well, but in this case it's the only option (without super heavy scripting ig)

hallow mortar
# frail skiff Hello there, sorry if I'm interrupting, I was wondering whether there was a wa...

If your trigger's activation conditions are set up to detect the units in question (e.g. BLUFOR PRESENT will only report BLUFOR units, ANY PLAYER PRESENT will only report players, ANY PRESENT will report most objects) then you can use thisList.
If the trigger's activation conditions won't support it (or your code is running from somewhere other than the trigger's code fields), you could try using inAreaArray.

pallid palm
#

its not to heavy of scripting

//activate when OPFOR are in the _r  trigger
_r = createTrigger ["EmptyDetector",_pos];
_r setTriggerArea [200,200,0,true];
_r setTriggerActivation ["EAST","PRESENT",true];
_r setTriggerStatements ["this && {((getPosATL _x) select 2) < 70} count thislist > 0","",""];
_r setTriggerType "NONE";
_r;
stable dune
pallid palm
#

rgr that m8 Awsome

#

@stable dune so that would go in the setTriggerStatements ?

earnest valve
#

Hey guys. Is there any noticable difference in speed for "myfile.sqf" call compileFinal .... and .... call compileFinal preprocessFileLineNumbers "myfile.sqf"

tulip ridge
#

I don't know the comparison, but I assume it's marginal at best. The reason you should use [] is to explicitly say you're passing "nothing".

If you're unfamiliar with the code, you can't be sure whether 0 means "nothing" if it's some magic number

granite sky
#

inAreaArray and forEach are both binary commands, and you want inAreaArray to run first, so:
{} forEach (_units inAreaArray triggerName)

frail skiff
#

Thanks a bunch!

keen crag
#

I'm sorry for asking this question, but I've already tried it several times and it didn't work out. Does anyone have an example of a mod for zeus modules? Preferably with literally 1 module, so that I can understand the structure and how it works in general.

tulip ridge
#

Uses CBA macros for convenience, nothing complicated really

tulip ridge
#

Zeus modules that need a UI are a little more complicated, since you need to make the UI yourself

keen crag
#

I already have experience working with UI, I hope I'll figure it out.

modern plank
#

I have this to change the weather in MP, and it just works. Question: can it be improved?
I know that I am not the only guy to do such things, so, let's share to be better.

// atmtk_set_weather usage:
// [0.7,0.3,0.3,0.5,true,true,false] call atmtk_set_weather;
// overcast,rain,fog,humidity,ambientLife,ambientSound,snow

atmtk_set_weather = {
    _this remoteExec["atmtk_set_local_weather", 0, true];
    remoteExecCall["atmtk_im_force_weather", 2, true];
};

atmtk_im_force_weather = {
    [] spawn {
        sleep 2;
        call forceWeatherChange;
    };
};

atmtk_set_local_weather = {
    0 setOvercast (_this select 0);
    0 setRain (_this select 1);
    0 setFog (_this select 2);
    setHumidity (_this select 3);
    enableEnvironment [_this select 4,_this select 5];
    private _rain_params = call atmtk_get_rain_params;
    if (_this select 6) then {_rain_params = call atmtk_get_snow_params; };
    _rain_params call BIS_fnc_setRain;
};

atmtk_get_rain_params = {
    [
        "a3\data_f\rainnormal_ca.paa",    // rainDropTexture - 4 means it has 4 flakes in it. Other available textures: snowflake8_ca.paa, snowflake16_ca.paa
        4,                // texDropCount - 4 because we are using texture with 4 flakes. Change to 8 or 16 in accordance with other textures used
        0.01,            // minRainDensity
        15,                // effectRadius
        0.05,            // windCoef
        25,            // dropSpeed
        0.2,            // rndSpeed
        0.02,            // rndDir
        0.02,            // dropWidth
        0.8,            // dropHeight
        [0.101961, 0.101961, 0.101961, 0.14902],    // dropColor
        0.1,            // lumSunFront
        0.1,            // lumSunBack
        0.5,            // refractCoef
        0.3,            // refractSaturation
        false,            // snow
        false            // dropColorStrong
    ];
};

atmtk_get_snow_params = {
    [
        "a3\data_f\snowflake8_ca.paa",    // rainDropTexture - 4 means it has 4 flakes in it. Other available textures: snowflake8_ca.paa, snowflake16_ca.paa
        8,                // texDropCount - 4 because we are using texture with 4 flakes. Change to 8 or 16 in accordance with other textures used
        0.01,            // minRainDensity
        25,                // effectRadius
        0.05,            // windCoef
        2.5,            // dropSpeed
        0.5,            // rndSpeed
        0.5,            // rndDir
        0.07,            // dropWidth
        0.07,            // dropHeight
        [1, 1, 1, 0.5],    // dropColor
        0.0,            // lumSunFront
        0.2,            // lumSunBack
        0.5,            // refractCoef
        0.5,            // refractSaturation
        true,            // snow
        false            // dropColorStrong
    ];
};
analog mulch
#

i wanted to use the music that comes with SOG cdlc in a trigger using playMusic but it doesn't seem to fire:

Any Player
Present

playMusic "\vn\music_f_vietnam\fks_music\vn_the_village.ogg";
hushed turtle
#

You need to use class, not path to file

analog mulch
#

ahhh

#

ty

hushed turtle
#
playMusic "vn_prayer_for_the_fallen";

I don't know class of village track

analog mulch
#

got it to work with

playMusic "vn_the_village";
#

the jukebox in 3den is very useful

#

ty

tulip ridge
#

it's a script command, you'd just run it in the debug console. But setAccTime will prevent you from moving as well because the whole game functionally freezes

hallow mortar
#

If they're making a mission they probably want to put it in initServer.sqf

latent ridge
#

Howdy do guys! so, I typically dont have issues; but today for whatever reason I am having problem with making a drone "explode" like a suicide drone. I've tried to different way and neither has worked, any help would be fantastic.

// suidrone is a drone placed in the editor
private _pos = getPosATL suidrone;

"ammo_Bomb_SmallDiameterBase" createVehicle _pos; // first attempt
bomb="ammo_Bomb_SmallDiameterBase" createVehicle (getPosATL _sudr); // second attempt which I got from a YT video

playMusic "Music_FreeRoam_Suspended_Loop_01";
granite sky
#

Missing a description of when exactly you want it to explode.

latent ridge
#

-# I just realized I didnt even call it for the script to fire lol

granite sky
#

IIRC when creating bombs you have to give them a bit of velocity before they'll fall. But if you just want it to explode immediately then use setDamage or triggerAmmo.

latent ridge
#

well; ideally I'd like it to just explode upon spawning if that makes sense? cause the drone hovers over a window then explodes is my idea. but lemme actually set the trigger right first lol

tulip ridge
#

Use triggerAmmo

latent ridge
#

got it, thank you!

versed trail
#

How would I grab the direction that a tank gunner is looking / which direction their camera is facing? Looking to create a sort of gun-mounted missile "dazzler" and I'm trying to figure out which angles I need to calculate

granite sky
versed trail
#

Thanks

pallid palm
#

Hello All:

so lets say i have my time set to 11:00am
by the params in the description.ext:

and i have the Date set to (Feb 4 2014): in the Game (Attributes/Environment)

and the (time set in the game (Attributes/Environment) set to (00:00)
so that my description.ext: params can match up

how do i ensure that all that matches up
if someone runs my mission on their own Hosted server
how does that work

hallow mortar
#

All those things you mentioned are packed into the mission file, they're part of the mission. They should work the same no matter who hosts it (unless they have a mod that changes the time)

pallid palm
#

oh cool thx so much @Nikko i was woundering πŸ™‚

#

man thats really cool Awsome Arma 3 hell yeah

#

man that's so cool i'm glad that's all in the mission

#

and thx for the link m8 πŸ™‚

hallow mortar
#

There are a couple of scripting ways you could do that, but it is slightly more complicated than you might think because of the way triggers detect and report the units that activate them.
Before getting into that, you could try simply limiting the height of the trigger, if it's flying aircraft that are the issue

granite sky
#

I would recommend learning how to do this stuff without triggers. Their limitations are gonna get increasingly annoying for you.

pallid palm
#

so @burnt matrix maybe explane more on where the trigger is: meaning is the trigger around the enemy: and how big the trigger is: and why does hiding behind mountains: effect the trigger:

hushed turtle
#

You could use vehicle to check if player is in any kind of vehicle. If it needs to be specifically aircraft then it gets more complicated

tulip ridge
#

isNull objectParent is a bit faster iirc

#

And not that much more complicated, you'd just do an isKindOf check

old owl
#

Something like this would probably work. If it's just the player and not a variety the findIf isn't necessary

thisList findIf {!isNull objectParent _x} isNotEqualTo -1;

By the looks of the Wiki objectParent is better as Dart mentioned. Less command usage so suppose makes sense it's faster but apparently it's also more reliable which I didn't know tbh

#

Oh

#

Wait

#

I trolled

#

Uhhh hold on

#

There fixed catnod

granite sky
#

if you're checking air as well then you can combine the checks: objectParent _x isKindOf "Air"

#

because objNull isKindOf "Air" returns false.

dark viper
#

what's the default value for a function parameter if it's not passed a value when called? i assume it's nil

warm hedge
#

Likely, if we understand the question

#

If you pasa no value to a function, yes _this will be nil

dark viper
#

params [["_parameter", nil]]; same thing as params ["_parameter"];

warm hedge
#

If _this is nil, _parameter will be nil too

dark viper
#

hmm i forgot what _this is inside a function

#

is it parameter array?

warm hedge
#

Not sure what it dows mean

#
123 call {/*_this is 123 here*/};
[player, 123] call {/*_this is [player, 123] here*/};```
dark viper
#

ah yeah i haven't been using _this thanks

warm hedge
#

And params reads _this if you don't specify the array

hallow mortar
#

Inside a function when used with call, _this is the passed arguments if there are any (may not be an array if an array wasn't passed), if any arguments were given. If no arguments are given, _this can be the _this from the parent scope instead, if there is one.
With spawn, the parent scope's _this can't be inherited so it's either arguments or nothing.

modern plank
#

Need

I want the bot to be disabled and moved back to spawn position when a player disconnects. He would take it at its initial position if he picks it up again.

Code

addMissionEventHandler ["HandleDisconnect", {
  params ["_unit", "_id", "_uid", "_name"];
  ["DISCONNECT: START", "DEBUG", true] call atmtk_log;

  _unit enableSimulationGlobal false;
  _unit setPosATL [3892.79,6154.74,0];

  private _pos = _unit getVariable["ATMTK_PLAYER_INITIAL_POSITION", nil];
  if (!isNil "_pos") then { 
    ["DISCONNECT: unit=" + str(_unit) + " - with initial pos:" + str(_pos), "DEBUG", true] call atmtk_log;
    _unit setPosATL _pos;
  };

  ["DISCONNECT: END", "DEBUG", true] call atmtk_log;
  true;
}];

Server logs

9:04:54 Game started.
9:04:55 [ACE] (csw) WARNING: <NULL-object> not alive
9:04:55 [ACE] (csw) WARNING: <NULL-object> not alive
9:04:58 Warning: Steam Query data overflow, Mods/Signatures will not be correctly received by clients. Remove unused mods or change your server configuration to allow for more data to be sent.
9:04:59 "TFAR_RadioRequestEvent [[""TFAR_anprc152""],B Alpha 1-1:1 (galevsky) REMOTE] 50.808"
9:04:59 "Send TFAR_RadioRequestResponseEvent [1] 50.808"
9:05:09 [ATMTK] DEBUG: DISCONNECT: END
9:05:09 [ATMTK] DEBUG: DISCONNECT: END
9:05:09 [ATMTK] DEBUG: DISCONNECT: END
9:05:09 [ATMTK] DEBUG: DISCONNECT: END
9:05:09 [ATMTK] DEBUG: DISCONNECT: END
9:05:09 [ATMTK] DEBUG: DISCONNECT: END
9:05:09 [ATMTK] DEBUG: DISCONNECT: START
9:05:09 [ATMTK] DEBUG: DISCONNECT: START
9:05:09 [ATMTK] DEBUG: DISCONNECT: START
9:05:09 [ATMTK] DEBUG: DISCONNECT: START
9:05:09 [ATMTK] DEBUG: DISCONNECT: START
9:05:09 [ATMTK] DEBUG: DISCONNECT: START
9:05:09 [ATMTK] DEBUG: DISCONNECT: START
9:05:09 [ATMTK] DEBUG: DISCONNECT: START
9:05:09 [ATMTK] DEBUG: DISCONNECT: START
9:05:09 [ATMTK] DEBUG: DISCONNECT: END
9:05:09 [ATMTK] DEBUG: DISCONNECT: END
9:05:09 [ATMTK] DEBUG: DISCONNECT: END

I have just picked a unit, moved it away from the initial position, then left the game back to the lobby.

Why so many logs???
Then I reconnected... here is what I have seen: I am inside another unit, and there are many bots on the hardcoded location.

cosmic lichen
#

Have you added it multiple times by accident?

modern plank
#

the addMissionEventHandler ["HandleDisconnect" is inside a if(isServer) then { };

#

added once in an init.sqf

queen cargo
#

@earnest valve depends on your HDD speed and the used preprocessor commands
in the end: use preprocessFileLineNumbers when you use preprocessor commands and/or want script errors with proper line informations

cosmic lichen
#

Idk then. It also seems to print in the wrong order.

queen cargo
#

in general ...

modern plank
#

yep. variable set on "player" is not found but OKAY, I can store init pos in a missionNamespace hashmap, but here it is very weird....

queen cargo
#

dont use call compile <insertYourFavLoadFileCommandHere> at all please ...

#

always put your code into variables ....

still forum
#

No.

spawn X is nil spawn X
it does not pass _this

modern plank
#
12:08:38 Game started.
12:08:39 [ACE] (csw) WARNING: <NULL-object> not alive
12:08:39 [ACE] (csw) WARNING: <NULL-object> not alive
12:08:43 Warning: Steam Query data overflow, Mods/Signatures will not be correctly received by clients. Remove unused mods or change your server configuration to allow for more data to be sent.
12:08:43 "TFAR_RadioRequestEvent [[""TFAR_anprc152""],B Alpha 1-1:1 (galevsky) REMOTE] 84.945"
12:08:43 "Send TFAR_RadioRequestResponseEvent [1] 84.945"
12:08:55 [ATMTK] DEBUG: DISCONNECT: END
12:08:55 [ATMTK] DEBUG: DISCONNECT: END
12:08:55 [ATMTK] DEBUG: DISCONNECT: END
12:08:55 [ATMTK] DEBUG: DISCONNECT: END
12:08:55 [ATMTK] DEBUG: DISCONNECT: END
12:08:55 [ATMTK] DEBUG: DISCONNECT: END
12:08:55 [ATMTK] DEBUG: DISCONNECT: START _unit=B Alpha 1-1:5 - _id=1.6893e+09 - _uid="76561198008556308" - _name="galevsky"
12:08:55 [ATMTK] DEBUG: DISCONNECT: START _unit=B Alpha 1-1:1 - _id=1.6893e+09 - _uid="76561198008556308" - _name="galevsky"
12:08:55 [ATMTK] DEBUG: DISCONNECT: START _unit=B Alpha 1-1:6 - _id=1.6893e+09 - _uid="76561198008556308" - _name="galevsky"
12:08:55 [ATMTK] DEBUG: DISCONNECT: START _unit=B Alpha 1-1:3 - _id=1.6893e+09 - _uid="76561198008556308" - _name="galevsky"
12:08:55 [ATMTK] DEBUG: DISCONNECT: START _unit=B Alpha 1-1:8 - _id=1.6893e+09 - _uid="76561198008556308" - _name="galevsky"
12:08:55 [ATMTK] DEBUG: DISCONNECT: START _unit=B Alpha 1-1:7 - _id=1.6893e+09 - _uid="76561198008556308" - _name="galevsky"
12:08:55 [ATMTK] DEBUG: DISCONNECT: START _unit=B Alpha 1-1:4 - _id=1.6893e+09 - _uid="76561198008556308" - _name="galevsky"
12:08:55 [ATMTK] DEBUG: DISCONNECT: START _unit=B Alpha 1-1:9 - _id=1.6893e+09 - _uid="76561198008556308" - _name="galevsky"
12:08:55 [ATMTK] DEBUG: DISCONNECT: START _unit=B Alpha 1-1:2 - _id=1.6893e+09 - _uid="76561198008556308" - _name="galevsky"
12:08:55 [ATMTK] DEBUG: DISCONNECT: END
12:08:55 [ATMTK] DEBUG: DISCONNECT: END
12:08:55 [ATMTK] DEBUG: DISCONNECT: END

I added the content of the params.... for the same user (I am the unique connected client), it fires 9x events, for all the bots I own in my group I guess.... will try with an if(isPlayer _unit) check.
EDIT> no one is player at that time.

still forum
#

You would be if its a spawn, because it doesn't see local variables of parent scope. Which is why we're not doing that

#

You are attributing too much "magic" to magic variables. They are not magic, they are just variables

#

They don't work any different than normal variables

hushed turtle
#

I don't even like calling them magic. It's just engine defined variable

still forum
#

_this is specifically set to nil.
Its not undefined, but it is nil

hushed turtle
#

I thought nil and undefined are the same thing in sqf. At least I didn't notice any difference

winter rose
#

oh don't get them started about that, they will turn your brain upside down; I gave up a long time ago! πŸ˜„

hushed turtle
#

I thought nil it's just strange name for undefined πŸ˜†

still forum
#

nil vs undefined makes a difference with child scopes.

{
// _this is undefined here
if (true) then {_this = 5;}
// _this is still undefined here
}
{
// _this is nil here
if (true) then {_this = 5;}
// _this is 5 here
}
old owl
hushed turtle
#

I see

#

So, nil still behaves kinda like value. Variable is defined and has nil value

errant jasper
modern plank
#

yes I am logging currently in scheduled env, forget about the order

#

The 9 iterations = the 8x bots + myself

#

Trying to identify when I am player, but no one is player.

#

Switching to PlayerDisconnected.... hoping I will get this info

#

but how can I get the unit itself....

#

PlayerDisconnected is fired once, but need to get the unit object from the params now.

errant jasper
#

Are these 9 units in the same group?

thin fox
dark viper
#

can a group finish a waypoint if they're all dead?

hushed turtle
#

Groups with all dead get deleted by the engine

winter rose
#

perhaps during the time between last man's death and group deletion, but that may imply velocity πŸ˜„

errant jasper
#

Any sufficiently advanced variable is indistinguishable from magic

thin fox
#

πŸ˜‚

dark viper
modern plank
dark viper
#

it's like a garbage collection and not instant right?

errant jasper
old owl
#

-# Sorry, that was bad

sharp grotto
#

onHandleDisconnect

params["_unit","_id","_uid","_name"];
if(isNull _unit) exitWith {};
if !(_uid in ["", "__SERVER__", "__HEADLESS__"]) then
{
    // Only runs on player units

};
#

@modern plank That's how ExileMod does it, might work for you.

modern plank
#

perfect!

#

thanks a lot

modern plank
#

And the _uid check provided by @sharp grotto is what I need.

sharp grotto
errant jasper
#

Like some accidental interleaving of the player exiting, with also perhaps taking over the second-in command while the game is exiting and so on.

modern plank
#

Can be, or just "leaving" means here changing the locality. Should be documented since there is no such diff with playerDisconnected into the wiki. If done on purpose for sure.

errant jasper
#

No, look at your log, and the debug names. All the disconnect events are for your name and UID (this part doesn't fit if it was only (misnamed) for locality change).

#

While the wiki may be inaccurate (which I doubt here since), the actual event name "HandleDisconnect" is also from the engine.

#

Externally it appears like you joined and exited each unit in sequence.

dark viper
#

I can use the deleted event handler to do some of my own garbage collection before it gets deleted by the engine, cause I have some groups stored in other data structures

I should use the hashValue of group in hashMap for this purpose iirc

#

Deleted event handler won't have a grpNull _group variable right?

errant jasper
#

deleteGroupWhenEmpty seems like something intended for niche uses like editor defined groups? Script created groups default to deletion, right? But for a editor defined group with a name, that name might be used for scripts so normally one would want to keep it around if, say JIP's refill it again, I would guess.

dark viper
#

I don't know what a JIP is and I keep seeing other people talk about it

hushed turtle
#

Join in progress

#

I would guess "Deleted" gets fired right before group gets deleted and _group will reference the group

dark viper
#

So I guess in the example it would be awkward for a JIP player if it tries to be placed in a defined group that got deleted by the engine

hushed turtle
#

"HandleDamage" also fires right before damage gets inflicted, so you can edit the damage your liking πŸ˜€

hallow mortar
tulip ridge
hushed turtle
#

How is that any different?

still forum
# tulip ridge Why make it different from call

It isn't, practically.
call doesn't set the variable.
spawn "doesn't" set the variable (nil is basically undefined, in most cases). Its just simpler code wise for me to pass nil instead of making it undefined

earnest valve
#

k, thanks guys. πŸ˜ƒ

hallow mortar
# tulip ridge Why make it different from call

call [without arguments] doesn't actively pass _this to the called code, it just has access to it by inheritance because it's a subscope, same as it can access any other variable from the parent scope (that's why private is important).
spawn creates an independent scope that is no longer attached and doesn't inherit variables.

hushed turtle
#

I got so confused yesterday, when someone told me call takes _this by default, if I don't provide left side argument.

hallow mortar
#

(and of course referencing _this directly does too)

hushed turtle
#

I think two following calls would lead to different results

_this = [1,2,3];

_this call
{
  // _this is [1,2,3]
  privateAll;
  // _this is [1,2,3] // _this is from this scope
};

call
{
  // _this is [1,2,3]
  privateAll;
  // _this is now undefined or nil because it's from parent scope and after privateAll we don't have access to it
};

Haven't tested this, but I think this is what would happen.

#

Which also means if I call function with some parameters and then from that function I call another function without any parameters, then it will use _this from parent function and I may get param errors or at least unexpected results

#

I might start using privateAll on the first line of all my functions(with all optional params) just to make sure this madness can't happen

proven charm
#

does anyone know how to end revive using script? I have AI medics but using "_unit setUnconscious false;" alone is not enough

errant jasper
#

Regarding parent scope, since SQF is dynamically scoped, there is no meaningful parent scope for spawned code.

granite sky
proven charm
modern plank
proven charm
thin fox
thin fox
sharp grotto
thin fox
pallid palm
#

@old owl i found that setOxygenRemaining only seems to work for divers: btw i'm not sure what you were asking: or saying

#

@proven charm ```sqf
_unit setVariable ["BIS_fnc_revive_incapacitated", false];

pallid palm
#

ok cool m8

pallid palm
#

@dark viper you can delete the group count: or groups as it were: but that don't mean the Actual Ai of that group is dead: after the living Ai get KIA: then they get delete by the Corpse Removal or your clean up script

#

i think you used to be able to have 144 groups count: but i think its higher now:

#

that's the reason to Delete groups: So you keep the group count down low: so you can keep spawning in Enemy

#

like every 60 seconds i have this run in a loop: in my cleanUP script ```sqf
{
if ((count units _x) == 0) then {deleteGroup _x};
} forEach allGroups;

#

with other stuff also of corse

#

yes it runs on the Server

#

also sometimes i make the mission counts the groups: for the reason to have a mission win: so in that case you would not want to run this part ```sqf
// {if ((count units _x) == 0) then {deleteGroup _x};} forEach allGroups;

proven charm
pallid palm
#

yes sir

#

i guess that's why i run the cleanUP every 60 seconds: right

#

i only host so the groups are always local to my machine

#

plus i have a script: that keeps me being the leader: all the time so the leader: don't change also

#

so what i guess i should of said was: if the group is still Alive all the other groups: get deleted and then as the last group gets deleted after they die is what i ment

#

thx man @proven charm

proven charm
#

arent player groups local to client?

pallid palm
#

the leader owns the group iirc

#

that's why i made that script that keeps the host or player1 being the leader: cuz that can change if the leader dies

#

is what i found

#

so yes if in a hosted server: someone other then the host gets the leader pos then yes: the client owns the group iirc

pallid palm
#

oh nice right m8 thx

#

locality changes so fast in this game oh man πŸ™‚

split ruin
#

i would be happy for some general tips on how to make a crate with equipment save-able πŸ€”

pallid palm
#

you mean like save loadout ?

split ruin
#

no, a crate with weapons, ammo, etc

pallid palm
#

theres many ways

#

i kinda do it the old way but it works great

split ruin
#

no matter just throw me something I can think on πŸ™‚

#

this is cool but it just adds gear to a crate, I need to save it whatever is inside

#

something like saving it to a variable in profile namespace

pallid palm
#

you can change it to what ever you want

#

or just put this in any ammo box

#
this addAction ["<t color='#ff1111'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}]; 
split ruin
#

I need this in the opposite way, it should read classnames and number and save it to a (mission) profile namespace, then load it when the missions starts

pallid palm
#

why did you need a variable in profile namespace

split ruin
#

just my guess on how to save it between mission sessions

pallid palm
#

oh umm i see ummm

#

did you ever look at the End_Game Mission: you should rip that mission apart and look in there

#

in there is what your looking for

#

you really don't need a variable in profile namespace

split ruin
#

you are overestimating my reverse engineering abilities, if i was that good I will just find what I need in Antistasi ... πŸ˜”

split ruin
pallid palm
#

all you need is this and you can just copy your box and put it in all your missions

this addAction ["<t color='#ff1111'>BIS Arsenal</t>", {["Open",true] spawn BIS_fnc_arsenal},"",1,false,true,"","(_target distance _this) < 5"];
#

maybe im not sure what you need

split ruin
#

this adds virtual arsenal
I want to save a crate with physical items

pallid palm
#

physical items ummmm

split ruin
#

the items that have certain numbers

#

unlike the virtual arsenal ones, that are infinite

pallid palm
#

so do you mean you want to see the Actual gunns inside a open Box ?

split ruin
#

yes, the ones you can put inside and then get back from the crate

pallid palm
#

thats what my A3Wep box does m8

#

up there

split ruin
#

your script adds certain numbers of items in the crate
I want to save the items that are already in the crate, placed by the player

pallid palm
#

you can ajust the count on any thing you want to put in that box

#

oh i see now hmmm

#

yeah my way the box would always reset to the way it is

split ruin
#

during the mission player will put items inside the crate, I want to save them so the player can have exactly the same items when the mission start over

pallid palm
#

i see now ok hmmm

#

so is this on a Ded server ?

split ruin
#

the game has similar mechanic between missions but I think its deprecated or SP only

pallid palm
#

or hosted server

split ruin
#

I use local host

pallid palm
#

im guessing hosted

#

rgr that

#

so you would need to make a script that counts the wep in the box on a loop i guess sand saves it

split ruin
#

just get the classnames and the number of items for each classname, save it somehow and then read the classnames and number to load them in the crate on missions beginning

pallid palm
#

but let me say m8 Some functions may not continue running properly after loading a saved game,

split ruin
#

I am not using the "normal" save

pallid palm
#

right right i get that

split ruin
#

for now I save player position just fine

pallid palm
#

ok cool

split ruin
#

every 5 min

pallid palm
#

ok now i know in the END_Game mission is what your looking for

#

you must un-PBO that mission and look in there ok m8

#

you will like it

split ruin
#

this is how I save and load player's pos

//initPlayerLocal.sqf
//save
private _posHandle = 0 spawn
{
    if ((str player == "ugly1") || (str player == "reaper1") || (str player == "reaper2")) exitWith {};
    while {true} do
    {
        if (isTouchingGround player) then
        {
            private _ppos = getPosATL player;
            missionProfileNamespace setVariable ["KIB_playerPosition", _ppos];
            saveMissionProfileNamespace;
        } else {};
        sleep 300;
    };
};
//load
waitUntil {player == player};
private _ppos = missionProfileNamespace getVariable "KIB_playerPosition";
player setPosATL _ppos;

I need something similar but for a crate ...

pallid palm
#

lol ugly1 πŸ™‚

split ruin
#

yeah, that the dedicated fighter pilot lol πŸ™‚

pallid palm
#

lol hahaah thats funny

#

so this is for a moded hosted server ?

split ruin
#

vanilla

pallid palm
#

oh ok hmmmm

#

so i'm telling you my friend: if you look in to the END_Game mission: you will find close to what your looking for ok m8

#

and then you can use that stuff in there to make your save ammo box thingy your taking about

#

just w8 till you see in that mission yull love it

past pollen
#

you probably want to look towards database to store info

pallid palm
#

i was just thinking that

#

but i didnt want to lol πŸ™‚

#

my brain already sore from scripting last night lol

past pollen
#

INIDBI2, extDB3, etc.

split ruin
#

there should be a scripting way and I will find it

pallid palm
#

yes i think so: i'm trying to think about how to it as well

past pollen
#

I had found this in one post, but a bit old:
"For single player / private multiplayer, profileNamespace would be your best bet. For everything else, extDB3.

iniDBI is really only useful in the same context that profileNamespace is, so it's redundant. Any large scale, performance reliant data basing is going to require SQL.

Everything is serverside only so you don't have to worry about that, but if you use profileNamespace you need to make sure that it's being used on the serverside so that you're not writing little databases on each client."

split ruin
granite sky
#

If you're loading all saved data at startup then there's not a lot of value in using extDB.

split ruin
#

getBackpackCargo
getMagazineCargo
getWeaponCargo
🀩 πŸ₯³

past pollen
#

Aren't you trying to save contents of crate, loadout, etc. between missions? Those are just getters

split ruin
#

I have to get the classnames first, right, then save them as an array in a variable just I did with the player position

past pollen
#

so, your issue is not persistent data, or transferring between missions, but retrieving crate contents?

split ruin
#

nothing to save if don't get what I am saving first -> classnames and numbers and then when mission starts I spawn what I have saved

pallid palm
#

imho

split ruin
#

I should set a different variable for every type of item
then it will work
and I will be using initPlayerLocal.sqf because I want this box to be personal for every player

sharp grotto
#

It can get quiet complex, depending on what you want to save and how precise (Ammo count for example).
Stuff is all over the place in terms of needed commands (getItemCargo,everyContainer,magazinesAmmoCargo,weaponsItemsCargo and the same again for any containers inside the container.

split ruin
#

yeah, its a mess really ...

pallid palm
#

sounds like more work then its worth m8

split ruin
#

its worth

#

πŸ™‚

pallid palm
#

ok lol

past pollen
sharp grotto
#

There should be a getContainerLoadout / setContainerLoadout that does everything πŸ˜†

pallid palm
#

oh nice

split ruin
#

I want it to exist so badly, maybe in 2.22 πŸ˜‚

pallid palm
#

you can do it m8 i believe in you

split ruin
#

thank you guys, I have the path, I will get to write the damn thing 🀘

pallid palm
sharp grotto
#

After all this years we really should have getContainerLoadout / setContainerLoadout and for vehicles getVehicleLoadout / setVehicleLoadout
This would make alot of stuff easier for beginners and everyone else ^^
And last time I tried to simplify/improve a player loading function of a mod with persistence (ExileMod) with the help of getUnitloadout/setUnitloadout, it was buggy (empty gear for others etc) notlikemeow

fleet sand
errant jasper
#

Well it would prevent complete loss on a crash

sharp grotto
#

You do both usually yea

blissful current
#

Which variables is it good practice to name like this so they don't conflict with mods? Of course not all need it. Is it just the ones you mean to broadcast?

missionNamespace getVariable ["foxClub_var_createCheevos", false]
granite sky
#

If it's a mod then you should do for every variable.

#

If it's a mission then you can hope that none of your mods are poorly written :P

winter rose
#

global variables yes, broadcast or not

blissful current
#

I just have a bunch of server-only trigger conditions written like the above, but was wondering if I really need the foxClub bit.

granite sky
#

Well, think about it. All SQF code shares missionNamespace. If two separate routines are using a global variable with the same name but expecting different things in it, then they're going to break.

#

If you're writing a mod then the expectation is that it's compatible with other arbitrary mods. Or at least that it's not incompatible for dumb and easily avoidable reasons.

blissful current
#

Oh so I don't have to specifically declare missionNamespace for code to be in that "container".

tidal idol
#

Any help on why the code in the if statement isn't executing?
In the version that works, I used if (condition) exitWith {myCode};

However, that didn't want to play nice with the sleep statement so I adjusted it to exitwith after running the sleep, but now not even the hint is displaying when the code is ran.

Fig 1: Broken version (if-then with exitWith inside then), not even the hints will fire
Fig 2: The working version (exitWith, commented lines) works so far as executing the code inside successfully, but doesn't work with sleep

fair drum
tidal idol
#

I call a function which points to this file. Nothing particularly fancy.
Also put in an if statement for the case I'm trying to make work on the off chance it freaked out the compiler or smthn. //if (engineOn _plane == false) exitWith{_plane engineOn true;};

#

Sleep command works just fine elsewhere in the script, I think Arma just didn't like putting a sleep command in an extiWith
The other sleep in the script uses a spawn, I think that should help me out

granite sky
blissful current
granite sky
#

Not for these reasons, no.

#

Adding prefixes like var_ or fnc_ is a convention for your own benefit or not.

pallid palm
#
SFA_EX_ChopperFinish =
SFA_EX_ChopperStart =
sharp grotto
#

Can help with order/searchability/readability etc

TAG_Group_FunctionName
TAG_Group1_SubGroup1_FunctionName

TAG_Group_VarName
TAG_Group1_SubGroup1_VarName 

ExileMod did that name convention good for most of the stuff and it makes it so much easier to work with, compared to other stuff I saw.

tidal idol
granite sky
#

breaks how?

#

you have a bad underscore on private btw

tidal idol
#

no effect ingame with no error messages - no hints, the call_bis_fire doesn't happen, etc., like the script didn't run.
ah thanks for that underscore fix... that actually fixed it up to where I am so far as seen above
Looks like uncommenting the last if-exitwith line still breaks it all... hmmm

blissful current
#

What is the thought process of when to move code from an addAction to a separate sqf, if any? I was going to put a bunch of code in it but thought I can also execVM or put it in a funciton.

#

I'm not sure the optimal use case for each of those.

stable dune
thin fox
fair drum
blissful current
fair drum
#

over 1000+ you probably should break it up (or use #includes if you need it to be in one function)

blissful current
fair drum
#

its all about organization when you have a bunch of people working on one codebase

#

lots of tech debt is bad organization

blissful current
#

So my mission should run okay still. And since I'm the only one working on it then no problem?

sharp grotto
tidal idol
fair drum
vagrant cedar
#

when setting an object texture is there a way to make it not repeat?

#

I have a 40m x 40m object and the texture repeats like this

#

my current work around is scaling a 5m x 5m object by 8

hallow mortar
#

It's pretty much down to the interaction between the texture itself and the object model.
If the texture itself contains tiling, then that's what'll appear (solution: use a different texture). If the model's texture map is tiled, then that's what'll appear (solution: use a different object). There's no control over that through scripts.

vagrant cedar
opal zephyr
#

anyone familiar with the setPlayerRespawnTime function? It says its local and the wording implies it only affects the player its used on. However, in practice it seems to apply globally, and only when the server executes it.. but it doesnt feel consistent, not sure whats up. Looking for insight if anyone has it

dark viper
#

and I like to do avoid any polling when possible as I assume the performance will be impacted

even Triggers themselves are just glorified polling scripts. Thats why too many break your performance, at least thats what I've heard

I appreciate the amount of Events in ARMA 3, should be much more performant than constant polling if you have a lot of logic

tulip ridge
#

That and the default interval is way too low for 99% of use cases

#

Most things don't need to run every 0.5 seconds

azure mural
#

has anyone else run into "No Entry" errors with removeItems? for some reason its throwing an error after attempting to query CfgWeapons for inventory items

fair drum
azure mural
#

sure! one sec

azure mural
#

im iterating over a list of items from I believe the apex DLC

fair drum
#

no mods?

warm hedge
#

Nope.

azure mural
warm hedge
#

What is the code you run and supposed to achievve

azure mural
# warm hedge What is the code you run and supposed to achievve

the code snippet causing the error is just this:

//missionNamespace var defined in init.sqf
PB_IntelItems = ["Item_Files","Item_MobilePhone","Item_SmartPhone","Item_Laptop_Unfolded","Item_FileTopSecret","Item_FlashDisk","Item_SatPhone"];

{_unit removeItems _x} foreach _intelList;
#

I can post the full 55 line function if you'd like, didnt want to clog the channel

warm hedge
#

No...? _intelList is undefined to me

hallow mortar
azure mural
warm hedge
#

What on Earth line 12 to 17 supposed to achieve

azure mural
warm hedge
#

It seems completely nonsense to me

azure mural
#

i found in testing that when put these items in the units inventory their classname completely changes

hallow mortar
#

So the "items" you can place in the Editor are not actually the item, they're just an invisible container that's preloaded with the actual inventory item

hallow mortar
#

Inventory items can't exist in the world on their own, they only exist as inventory records. They always have to be in a container.

warm hedge
#

tldr: inventory classname and the classname you put in Eden is NOT equal

azure mural
#

interesting okay so I guess theres a discrepency between the item name itself and the container name then

hallow mortar
#

You can see what item a preloaded container contains by looking at its TransportItems config

#

Files is a valid name of an inventory item class, but it's technically a magazine, not a weapon. The error you're getting implies that something is trying to treat it as a weapon.

azure mural
#

yeah I saw it was classed as a magazine, is there a another function that is meant only for magazines or something?

hallow mortar
#

Based on the documentation and similarity to addItem I would expect removeItems to also work with magazines though. Need to do a little testing. Also it should probably be a less catastrophic error even if it gets an invalid classname.

azure mural
#

yep it works

modern plank
#

How to investigate "undefined behavior: waitUntil returned nil. True or False expected" errors?

My scriptDone is failing:

_hdl = _im_id spawn { 
  _this call atmtk_reinit_vehicles; 
  ["ScriptDone", 'DEBUG', true] call atmtk_log;
};
waitUntil { scriptDone _hld };

But the spawn exec looks good, I have my log "ScriptDone" printed out.

#

Should the spawn return a specific value?

hallow mortar
#

Variable name is spelled wrong

#

You save the script handle to _hdl and then check whether _hld is done. That variable doesn't exist, returns nil, script error

modern plank
#

thank you!

#

sometimes you work too much, just have a break!

analog mulch
#

i would like to alter the inventory of spawned vehicles players will come across and insert limited items like smokes and grenades

analog mulch
old owl
#

Should do the trick assuming it's global:

clearBackpackCargoGlobal _container;
clearWeaponCargoGlobal _container;
clearMagazineCargoGlobal _container;
clearItemCargoGlobal _container;
analog mulch
#

ty

prime aspen
#

Hello !
I saw that the sea level had been raised. Is there a command that allows me to do this ?

winter rose
#

No, but you can lower the terrain

pallid palm
#

or this here in almost anything

#
clearMagazineCargoGlobal this;
clearWeaponCargoGlobal this;
clearItemCargoGlobal this;
clearBackpackCargoGlobal this;
tender fossil
#

I would like to create a small mod that requires advanced medical mod, like ACE medical stuff or KAT as dependency. I wonder whether they support replacing a wounded human player with AI (on the fly) or not? Like so that the AI has same medical status as the human player after the swap

pallid palm
#

and btw if you say no mods and then say just CBA and Ace them are Mods πŸ™‚

tender fossil
#

Me? I tried to express that I actually need to have either one of them as dependency

pallid palm
#

no no not you m8

tender fossil
#

Ah aight πŸ˜„

pallid palm
#

up there Hypoxic ask a guy if he had any mods and he said no: just CBA and Ace

#

like that's a standerd or something πŸ™‚

#

you know: i cut my teeth in Arma: "meaning i was friends with and started playing Arma with" one of the guys that started CBA and ACE

#

his Nick was Sickboy

thin fox
pallid palm
#

oh thx @thin fox

thin fox
#

🀣 🀣 🀣

pallid palm
thin fox
#

πŸ‘

pallid palm
#

lol πŸ™‚

pallid palm
#

hello again m8s: umm is there a way to switch to left handness like you know for your gun

pallid palm
#

really

#

so its like select All but only in game

#

@tender fossil ummm is that linked to a controll what's the name if it is: cuz it dont seem to work

granite sky
tender fossil
#

That's nice. Basically what I'm aiming for is a system that replaces human player with AI when a medic starts treatment (human player respawns then). If medic(s) manage to keep the patient alive and well till arrival to base or field hospital with medevac, the team gets a respawn ticket (or equal reward) per patient. The point of the system is to let players focus on combat while still allowing simulation of full medevac chain for medics

tulip ridge
tender fossil
#

Thanks! I'll have a look πŸ‘

hallow mortar
# tender fossil That's nice. Basically what I'm aiming for is a system that replaces human playe...

It might be tricky to define your conditions here. ACE/KAT can be quite complex. For example, it's possible for a player to just be briefly knocked out, and they'll get back up on their own after a short time. What happens if someone sticks a bandage on them during that time? It doesn't make any difference to their recovery chances, they were going to be fine anyway, but does it count as starting treatment and force them to respawn?

tender fossil
granite sky
#

With common ACE settings that's pretty situational. There's no health state that you can't recover from.

#

(aside from actual death)

hoary saddle
#

I'm trying to create an action that delete a wall, and puts a different wall in its place.

I've used createVehicle with 3D coords, and it kept spawning a couple meters away, never in the proper spot,

Ive tried using a marker, the wall never spawns at all.

ive tried spawning the wall on the previous wall before deleting first wall.

I'm not really sure what else to try

tender fossil
tulip ridge
#

Probably works best, can make a treatment action for it so they can do it right from the medical menu

granite sky
hoary saddle
#

its the exact same wall, just a door that faces the opposite way

granite sky
#

Use getPosWorld/setPosWorld then.

#

createVehicle with CAN_COLLIDE might be ok but if you want a precision copy then getPosWorld/setPosWorld is the way.

hoary saddle
#

Thanks, that gets it actually deleting and spawning. Still 1m to the front though. Gonna try the offset

#

nvm, its not working at all and without errors lol

hoary saddle
#

obj = nearestObjects [[5129,3186,0], ["Land_Bro_MSWR_Doorway_Rubber"], 3];
door = "Land_Bro_MSWR_Doorway_Mirrored_Rubber" createVehicle setPos "obj";
door getPosWorld setPosWorld obj;
deleteVehicle obj;

no clue why its not working.

granite sky
#

Is the original object a map object?

hoary saddle
#

it was placed down in 3den

granite sky
#

The setPos there is wrong anyway.

#

Doesn't that generate a script error?

hoary saddle
#

ah yea thats just one of the things i tried

granite sky
#

It's not a thing to try, it's a syntax error :/

hoary saddle
#

yea im aware now, but nothing else was working. So i just started typin stuff

granite sky
#

also the other line is wrong too.

hoary saddle
#

what otherline?

granite sky
#

door setPosWorld getPosWorld obj;. You have it backwards.

#

Which is also a syntax error. Are you running without show script errors enabled?

hoary saddle
#

_obj setPosWorld getPosWorld _obj;

this is what the biki says.

and no, I'm getting errors, and when I wasnt getting errors, it still wasnt working.

granite sky
#

This is your code:

door getPosWorld setPosWorld obj;

hoary saddle
#

{
_obj = nearestObjects [[5129,3186,0], ["Land_Bro_MSWR_Doorway_Rubber"], 3];
door = "Land_Bro_MSWR_Doorway_Mirrored_Rubber" createVehicle position obj;
deleteVehicle obj;
door setPosWorld getPosWorld obj;
};

my bad, I posted the wrong thing. This is the lasted code i've tried with 0 errors and not working.

granite sky
#

obj/_obj confusion there.

#

And maybe don't delete the original before you read the position from it.

hoary saddle
#

can you explain the confusion? because I've gone back and forth with it

granite sky
#

You have _obj in the first line and obj everywhere else.

#

These are two different variables.

#

All the variables here should really be local & private, but consistency will work.

hoary saddle
#

error postion. type array, expected object, location

granite sky
#
private _obj = nearestObject [[5129,3186,0], "Land_Bro_MSWR_Doorway_Rubber"];
private _door = "Land_Bro_MSWR_Doorway_Mirrored_Rubber" createVehicle position _obj; 
private _pos = getPosWorld _obj;
deleteVehicle _obj; 
_door setPosWorld _pos;
#

ah wait

#

you used nearestObjects rather than nearestObject.

#

Could also throw a select 0 on the end, but this should work in context.

#

nearestObjects returns an array, and you want the first entry of that.

hoary saddle
#

gotcha, working now.

so dont use getposworld and setposworld in the same line, use them to get a _pos and then set it? thats best practice how you have it?

hallow mortar
#

It's not that you can't use them in the same line, it's that you can't use getPosWorld on an object after you've deleted it

hoary saddle
#

yea that makes sense. I appreciate it.

agile pumice
#

Having an issue with addAction, I run a loop on several objects to add an addaction, but for some reason, 2 actions are being added for every object. I tripple checked my missionfile, and I dont have the loop running twice

indigo snow
#

quadruplecheck? are you looping the wrong array of objects? even though addaction is local, some other kind of locality issue, like someone JIPing?

agile pumice
#

nope, just me

#

i returned the array in a hint, it looked right to me

last cave
#

Dedicated server problem >>>
I have an interesting situation with a HashMap Object.
I created this structure code.

_a= [1,2,3,4,5,n,n,n];
_Array=_a apply {

_hmo=createHashMapObject [_declaration, [_x]];
if (count _hmo == 0) then {diag_log formattext ["ErrorCreate %1",_x]};
[_x, _hmo];
};
_Hm=createHashMapFromArray _Array;

missionNamespace setvariable ["WorldZoneHMO",_Hm,true];

Using the RTP file with the #delete method, I discovered that all of my HashMap Objects were being deleted twice and recreated three times.
Could this be because I wrapped the references to the HashMap Objects in a HashMap? This is certainly usable to some extent, but it's incredibly silly when instead of making changes, I'm recreating the entire HashMap Object. And I have a lot of data in it, and I have 43 HashMap Objects inside the HashMap.

What is the best way to send my HashMap Objects to players that the server updates locally?
Should I create a global variable for each HashMap Object?

queen cargo
#

@tough abyss even then you should put the code into a variable

#

@agile pumice 99% of the times, its the programmers fault
so give us some proper examples and we might be capable of helping

otherwise i will get some "fancy bugs" i still have in my pockets into this chat where you can guess where the problem is located at

last cave
#

So, I checked. I realized something. In my situation, sending the hashmap object to players doesn't make sense, since they're recreated with every new change rather than attempting to modify elements within themselves. I'll need to send internal changes to players using a remote call with arguments bound to the required key. Total crap. It's easier to create "Logic" and update all setvariables in it, but it's a shame to have wasted 2 days already.

#

In the end, I decided that the Hashmap object will always be local to the server. I'll also have a regular hashmap in which I'll store all the dynamic data players need to see and update the variable every second.

hushed turtle
#

When you're replacing hashmap then yeah, entire hashmap will get replaced. It's to be expected

modern plank
#

As soon as I am considering broadcasting a big object like a hashmap, I am asking if it is not preferable to let eveyrone build the hashmap up locally, like the whole list of objectives/vehicles/whatever and so on.... and just broadcast the current index/key of it. The less on the network, the better. At least for MP.

hushed turtle
last cave
# modern plank As soon as I am considering broadcasting a big object like a hashmap, I am askin...

Yeah, I thought about that too. So now I'm thinking about the best way to create a function that will replace data using arguments. The problem is that I also need these changes in JIP, but then sending individual changes loses the point. Because I also need to change the data in JIP, and JIP can't be created without a global call. So, individual changes aren't suitable either. Because even if I send them to JIP, what's better: one JIP or 150 JIP calls with detailed changes, each with the required argument.

hushed turtle
#

Maybe it's not too bad idea to send entire hashmap for once for JIP

modern plank
#

Build your local WorldZoneHMO hasmap on all computers, with initial values (can be empty, but your 43 hashmap created).
Then the server runs [key,val] remoteExec["update_my_hasmap", 0, true] whenever it needs... if you need to update just a few pairs at once.

#

If you have suddenly to update all of your 43 hashmaps, you have an architecture problem and your implem should be completely different.

hushed turtle
#

It could be multiple pairs per one remoteExec

modern plank
#

can be an hashmap as param if it needs.

#

But again, stay low.

hushed turtle
#

Also name of the hashmap needs to be in params otherwise you would need function per hashmap

last cave
#

Another headache is that I have a first hashmap that stores map area polygons (updated every second). The second hashmap contains hashmap objects with methods and properties, and it's linked by keys to the first hashmap (used to build and configure missions with pre-prepared data). Now I need a third hashmap linked to the first and second hashmaps with hashmap elements that stores the property keys of the second hashmap.

modern plank
#

Wow wait. Explain what you are trying to achieve.

#

Why everybody needs to get them and so on.

#

Because instead of refreshing polygons everywhere, it could worth to request the server only when clients need to use these polygons.

#

I mean.... I doubt that all players will use all of the polygons every second or two.

#

Are the polygons static or do they change also (I mean their shape)?

#

Cause polygons may exists only on the server and the server throws events like zone taken.... He has the position of all units and can evaluate in a scheduled spawn the who is where every 2s and so on...

errant jasper
#

Static compute each machine. Dynamic use a CBA namespace and setVariable with public=true.

modern plank
#

So explain your usecase....

last cave
#

My mission processes 5,273 coordinate points that were previously unloaded from the editor, and I can even load them back into the editor and display them as markers using my tool. I created all these points manually using Ctrl+V in the editor. The server processes this data and sends the finished hashmap to the players. On my client, the game would freeze for about 10 seconds, but I didn't notice this on the server. That's why I have to go to so much trouble to remove processing requirements from clients. A polygon can have over 200 positions, which means 200 coordinates are stored in a single key in the hashmap in the array view. And I have 43 polygons, as you can see.

modern plank
#

πŸ€”

#

Curious to see what you do with this.

errant jasper
#

Still doesn't answer galevsky's question whether it changes or not. If not then put the precompute the data into the mission.

last cave
#

I'll then assign parameters to these polygons (areas/zones). These include the side that captured it, which control points need to be captured, which side is attacking, and what the players' side's reputation is with the area. And so on, the list will grow as the mission expands and new capabilities are added.

errant jasper
#

So the mesh is completely static? Only associated data changes?

modern plank
#

Ahahah

#

Ok

#

So you have a simple array of polygons... A second array containing a hashmap that defines a set of properties.

#

On server only.

last cave
#

Roughly speaking, instead of Inarea, I now have Inpolygon and I use positions not in circles or rectangles, but in polygons

modern plank
#

And clients sends data to server only when necessary. For their position it is useless for example.

agile pumice
modern plank
#

And server will send zones updates whenever a zone is captured. And I doubt that all zones will change at the same time.

errant jasper
#

Are you sure you need associated data to be global? What are the clients doing with it that is not triggered directly by an update?

last cave
#

Of course, I could simply create a separate global variable for each zone with a hashmap containing the property keys. And associate it with another variable using an array or hashmap: Key->hashmap variable. Then I could change the zone properties individually without transferring data from all zones.

agile pumice
#

will copy the return of gangFlags in a sec

errant jasper
#

I suggested CBA namespaces because that is basically just an object, so you can update "keys" individually and publish them. You could of course use any object CBA namespaces just picks something efficient.

last cave
#

The player can select which zone to capture via the map with a mouse click. However, I currently don't have information about which side has captured the zone because I haven't passed the hashmap object to the player that contains this property. (I've disabled variable broadcasting at the moment. The capture mission works, but players have no idea what's happening with the zone.) I can manually activate the capture via the console using a method in the hashmap object.

last cave
errant jasper
#

So to update say, I dunno owner side of a zone something like this:

private _zoneEntry = TAG_Zones get "13"; // Returns the "namespace object".
_zoneEntry setVariable ["TAG_OWNER", east, true];
agile pumice
#

the array is built using pushBack in the flag's init in the sqm

modern plank
#

Something like that, I am just updating the owner property, but just add other processing into the updates made by the server.

#

zones are known eveywhere... to create markers on cli, to manage associated porperties on the server.

#

The server -every 3s (example)- maintains zones properties...and thows events only when and where it is necessary

errant jasper
#

Note "can be -2" this won't be invoked on hosted server machine.

modern plank
#

this is why there is a BUT πŸ˜‰

#

I also prefer doing a remoteExec on '0' then protect the function content with a if(hasInterface)

#

Well, it is the concept, then extend to your needs, but as you see, everything is optimized: cli just executes markers update when necessary... so no extra process for nothing ; And server processes the updates... that can be optimized too.

#

Here I am checking every 3s forEach ZONES forEach players which is big, 43x times the number of players.

#

You may optimize it with bigger sectors....

#

like divide the map in 4/5 big sectors (= a cluster of polygons)

#

Then you check if the player is in the sector and check the inPolygon only for the polygons of the sector... which becomes 10x times the number of players. Better.

agile pumice
#

gangFlags returns [gang_8,gang_1,gang_6,gang_2,gang_3,gang_9,gang_4,gang,gang_7]

modern plank
#

Because it is useless to test the player on sectors on the other side of the map...

#

You can also compute the sector dynamically first from the current position. (this method is called 'boxing', it is done this way to manage to display a mockup with millions of parts in a computer: you first define a restricted area and load for display only the ones that may be needed.... not the millions ones.)

errant jasper
#

Just store the last known polygon the player was in on the object. Verify it, and if miss, find out what the new one is.

modern plank
#

ya, could be, the boxing has to match your requirements. You get the sectors aside, maybe 4 or 5, and you are done.... but it does not work if you can have jets and flying players matter. If not it is ok. Well, do the boxing you need.

errant jasper
#

That is why it is crucial to know what the exact purpose and requirements are. Because yeah, distance objects won't be anywhere near realtime up-to-date on player machines whose player is far away.

#

The only way to even include a fast-mover in this would be for the server to forcible send owner-status/position updates out explicitly, just to see a 0.5s flicker of ownership change back and forth over a zone.

modern plank
#

Ya. The easier is to say "capturing players are on the ground" and you avoid a lot of burden. πŸ˜…

modern plank
#

@last cave you may prefer this more generic implem:

#

Here all the cli have a local copy of properties updated when necessary by the server, then do the local processing you want. ( ⚠️ not tested, but I am quite confident that this kind of implem matches your needs)
You can also build a hashmap into the server spawn {} and push changes inside.... then call once the cli_update_zone_property with the hashmap instead of prop_name and prop_value.

timid zealot
#

Where's gang_5?

sullen marsh
#

Hiding

agile pumice
#

it died

#

is it the way I build the array?

indigo snow
#

In MP? Yes

#

Well

#

Maybe

#

Do you publicvariable the array at any point?

#

Also why even pushback from the init when i assume you know as mission maker which ones are planted but thats another issue

queen cargo
hexed sundial
#

is there a way to check when an artillery projectile has been fired?

warm hedge
#

"Fired" EventHandler?

hexed sundial
#

i managed to do it using artillery shell mission handler

agile pumice
#

i dont publicvariable it

#

its just easier for me to copy and paste the flag several times and not worry about remembering to rebuild the array manualy

indigo snow
#

Well your addAction is going over every flag twice, there is no bug where multiple actions are added

agile pumice
#

i dont understand why its occuring twice, could you explain it to me?

indigo snow
#

Because you made a mistake somewhere

#

I cant tell where from what youve shared

#

But addaction works fine

#

It all starts with properly debugging what youre doing - try adding a bunch of diag_logs, see where things go wierd

#

Try from a blank mission

#

Go wild

hushed turtle
#

Any way to create a flashlight by scripting? I can create light, but I'm unable to shape it. It casts light on entire area in all directions. setLightVolumeShape doesn't seem to do anything

serene olive
thin fox
hushed turtle
serene olive
#

That works with the LandGear, unfortunately throttle did not work.
But that is ok.

thin fox
#

because that command only works for player unit

serene olive
#

https://community.bistudio.com/wiki/setAirplaneThrottle does not set throttle to 0.5
Examplescript:

params ["_target", "_player", "_planeClass", "_startAltitude", "_startDirection", "_startSpeedProportion"];
if (isNull (objectParent _player)) exitWith {};
if (_target != (objectParent _player)) exitWith {};

_player assignAsDriver (objectParent _player);   
_player moveInDriver (objectParent _player); 
(objectParent _player) engineOn true; 
_player action ["LandGearUp", (objectParent _player)]; 
   
private _maxSpeed = getNumber (configFile >> "CfgVehicles" >> _planeClass >> "maxSpeed");   
private _speed = (_startSpeedProportion * _maxSpeed);   
private _velocity = ([sin _startDirection, cos _startDirection, 0] vectorMultiply (_speed / 3.6));   
  
(objectParent _player) setDir _startDirection;   
(objectParent _player) setPos [0, 0, _startAltitude];   
(objectParent _player) setVelocity  _velocity;
// does not work:
(objectParent _player) setAirplaneThrottle  0.5;

But then the player can set the throttle manually

fair drum
serene olive
#

Nevermind, now it works ... sometimes

hallow mortar
torn stream
#

Help me out here,

The AMT - Support mod creates a dapsBlacklist Global variable, it is found within the start.sqf which runs in CBA's Extended_PostInit_EventHandlers, being it post init, how can i ensure i can create a mod/script that will run only after the start.sqf script runs, so i can add my unit's ammo to it?

tulip ridge
torn stream
tulip ridge
#

All of CBA's extended event handlers do

#

Couldn't tell you with vanilla CfgFunctions' pre/postInit = 1, but those run scheduled anyway so meh

torn stream
keen crag
#

Does anyone know an open source rcon client? I mean, a client where you can watch a chat, write there, ban / kick

eternal spruce
#

I'm trying to setup a teleport script for a squad of AI, man1, man2, man3, man4, man5 I have a trigger and on activation they each teleport to a specified location
The problem I have is what do i put in the Condition field so they teleport one at a time when each unit gets inside the trigger

stable dune
eternal spruce
#

correct

stable dune
# eternal spruce correct
//Condition 
[man1, man2, man3, man4, man5] findIf {_x inArea thisTrigger} != -1
//On activation 
private _units = [man1, man2, man3, man4, man5] select {_x inArea thisTrigger};
{
   _x setPosATL yourXxPos;
} forEach _units;
#

You could do something like this

eternal spruce
#

Thank you I’ll try this

pallid palm
#

@stable dune you the man: you help us so good: i like you m8

hushed turtle
#

What am I doing wrong? Why does my "#lightreflector" lights up some objects and some just doesn't?

private _reflector = createVehicleLocal [ "#lightreflector", [0,0,0], [], 0, "CAN_COLLIDE" ];
_reflector attachTo [ player, [0.0, 0.15, 0.15], "Head", true ];
_reflector setLightColor [1, 1, 1];
_reflector setLightAmbient [1, 1, 1];
_reflector setLightIntensity 10000;
_reflector setLightConePars [60, 10, 1];

_reflector setVectorDirAndUp [ [-0.35,1,0.2],[0,0,1] ];
hallow mortar
#

Have you tried the same position with a "known good" reflector (e.g. weapon flashlight)? It could just be a weird interaction between the notoriously dubious lighting engine and that specific object, not something you're doing wrong.

hushed turtle
#

With pistol flashlight everything works.

#

Also just trying reflector light in town and in jungle and buildings and trees work just fine. There might be issue with tunnel objects

granite sky
#

If you keep moving into the tunnel, does it light up?

hushed turtle
#

It does not

granite sky
#

Sounds like an engine bug anyway. Make an issue with replication details and maybe it'll get fixed.

#

I'm guessing that it's an object bug too, and there's a small difference between #lightreflector and the engine weapon light implementation.

hushed turtle
#

It behaves same even with S.O.G. Nickel Steel mod

teal fog
#

Hey, im trying to change the scale or size of some NPC's and no luck for now

#

Someone know how to do it?

winter rose
#

what did you try already?

teal fog
#

setObjectScale

winter rose
#

that's the one

hushed turtle
edgy dune
#

Hello ,so I have a script on a tank that when the vehicle fires it should eject a shell. I am running into a problem where sometimes it would eject two shells. I noticed it happens more often if I switch ammo on the maingun from shell to rocket ammo (haha funny tank that can shoot shells and rocket). The gunner has the main gun, coax mg and a laser des as its weapons. Initially I thought it was cause I didnt have a local check, and I do a check to make sure it runs only on the gunners pc right after but that didnt seem to help, any ideas what could be possible problem?

The script is called from the Fired EH on the vehicle it self.

here is the script, minus the long part of actually spawning teh shell cause its long but I can post if needed


params["_firedEHParams","_extraParams"];

_extraParams params [
    ["_animations",[]],
    "_ejectionPos",
    "_ejectionEnd"
];
_firedEHParams params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];

_player = missionNamespace getVariable ['bis_fnc_moduleRemoteControl_unit', player];


if(!(local _unit)) exitWith {}; //turns out this is needed lol
if(!(_player isEqualTo _gunner)) exitWith {}; //prevent driver from triggering the shell ejection
///    only for shells
if ((_ammo isKindOf 'ShellBase') ||(_ammo isKindOf 'MissileBase') ) then {
    if (!alive _unit) exitWith {};

    //lots of stuff to spawn shell, gets its position etc etc, but main thing is im using createVehicle
    //shellmodel createVehicle position

};
ivory lake
#

unrelated to the issue itself but why on the vehicle and not on the weapon?

#

but most likely your issue is in the part you didnt post

#

personally i'd put debug in the fired eventhandler to see if the eh is firing twice or not

#

but most likely depending on how you're spawnign the shell it's probably somewhere there

edgy dune
#

ah 1 sec message was too long

hushed turtle
#

Use pastebin if it's to long

edgy dune
#

ahhhhhhhh

#

okay pastebin

ivory lake
edgy dune
#

not sure why it added span class="re5"> to the start of the pastebin

ivory lake
#

ooh ok you're using an actual object

edgy dune
edgy dune
ivory lake
#

word of advice I suggest using class Thing; for that rather than ThingX

#

it looks worse but physx loves sending things to the moon

edgy dune
#

wym by worse?

#

I figured thingX since I wanted it to collide on people and hurt them kekega

ivory lake
#

the physics are a bit jittery

#

compared to physx

edgy dune
#

will it still cause dmg if it hits players?

ivory lake
#

idk

edgy dune
#

okay I will try Thing

ivory lake
#

I always set their mass low so it doesn't cause any issues

edgy dune
#

and see wat happens

ivory lake
#

its what the AT gun shells etc use in spearhead

#

and the like, side skirts breaking off tanks

edgy dune
#

ohhhh okay

#

Okay ill make note to try thing instead of thingx

ivory lake
#

cuz we had like, a side skirt blasting off a panzer iv and it'd hit the tank that was near it and send it to the moon

edgy dune
#

I did notice the ejeting shells would cause other tanks era to go off when hit with it kekega

ivory lake
#

but anyway as for the problem the only thing I can see happening is the fired eh is running twice - you put a locality check which stops it from MP

#

so idk what could be causing that

edgy dune
#

ill try weapon maybe that fixes the problem

muted fulcrum
#

hello i was wondering, im new to scripting and trying to learn arma scripts why is that some scripts using the debug menu work for global exec and local exec but not for server exec?

warm hedge
#

We cannot tell the answer without the actual code and situation

muted fulcrum
#

im testing out how execs work on a server right now im trying to have players and targeted factions specific voices so they dont sound weird e.g russians using the arma 3 english voice

atomic niche
#

without the actual code

errant jasper
#

Most of those functions setIdentity, setFace, setSpeaker are local effect only

atomic niche
#

All 3 execute buttons do entirely different things, so it makes sense the same code doesn't "work" for all 3

errant jasper
#

So server exec has pretty much no meaning on a dedicated server for those commands

muted fulcrum
#

ah i see

#

thanks!

hushed turtle
#

Is it possible to allow player to use NVG and weapon flashlights only under certain conditions? There is VisionModeChanged event handler and it seems like that could be used to remove NVG from inventory and put it back, on vision mode change to make it unusable. But I don't see anything like that for flashlight.

atomic niche
#

I don't think there is an EVH that gets triggered when turning on/off weapon attachments
I guess you could just check isFlashlightOn every frame and turn it back off

if (player isFlashlightOn currentWeapon player) then {player action ["GunLightOff", player]};
hallow mortar
#

There is the user action EH for that action (headlights?)

atomic niche
#

that shouldβ„’ work

hushed turtle
#

I was about to ask if there is a way to detect when light key gets pressed. I could turn of his flashlight every time he attempts to use it

thin fox
old owl
#

I was almost wanting to suggest that but wasn't sure if that was too hacky. You could probably run a keyDown event handler with the isFlashlight command to handle it

thin fox
hushed turtle
hallow mortar
#

The main game display is a display (findDisplay 46)

#

But I think you should try the user action EH first, it's more plug-and-play and less chance of false detections

hushed turtle
old owl
#

I remember a while ago unpacking a bunch of Arma PBOs just to kinda try and better understand Arma more under the hood. Entire perspective changes when you realize everything in Arma from the moment you boot is a mission and everything you look at is displays with controls. Joining a multiplayer mission just takes you from one to another. Kinda art 🎨

hushed turtle
#

If I remember correctly, in CoD1 main menu is mission

errant jasper
hushed turtle
#

Checking files I don't see any menu map. I've seen menu mentioned in soundaliases file(defines sounds for missions) between missions. So, I guess it's not actually mission. Whatever

delicate tangle
#

Are variable names with bis_ protected? For instance, I want to setvariable [β€œbis_type”, _type] on a group.

I think a bis_ function tag is prohibited but Im not sure about variable names.

hushed turtle
#

Technically only compileFinal functions and Hashmaps are final.

delicate tangle
#

So variables with bis_ are not prohibited?

tulip ridge
#

You can overwrite it, yes

hushed turtle
#

This is how to disable player's weapon flashlights. Maybe someone is curious. πŸ”¦

addUserActionEventHandler ["headlights", "Activate",
{
    TAG_holdsL = true;
    
    // Without following EH, flashlight will be turned on while L is pressed
    addMissionEventHandler ["EachFrame",
    {
        player action ["GunLightOff", player];
        if !(TAG_holdsL) then
            { removeMissionEventHandler ["EachFrame", _thisEventHandler]; };
    }];
}];

addUserActionEventHandler ["headlights", "Deactivate",
{
    TAG_holdsL = false;
    player action ["GunLightOff", player];
}];

I was playing around with it for while and this is what I've figured out. Laser would need "IRLaserOff" action instead. Maybe it would be more clean to check if player is pressing his light switch key, instead of using global variable?

Originally I used while loop in spawn without any suspension, instead of EH and it lowered my framerate from 140 fps to 110. 🀣

tulip ridge
#

Yeah scheduled will do that

drowsy geyser
foggy stratus
#

I use the following Fired event handler below to capture muzzle, ammo, and projectile names. Works fine with player weapons. But when I fire a grenade launcher from a gunner position on a PBR boat, this eventhandler does not fire. How do I capture this info when gunner in a vehicle?

#

player addEventhandler ["fired",{copyToClipboard format["%1",_this]; hint format["%1",_this];}];

#

I just answered my own question lol. This works:

#

vehicle player addEventhandler ["fired",{copyToClipboard format["%1",_this]; hint format["%1",_this];}];

errant iron
# foggy stratus I just answered my own question lol. This works:

alternatively, it might save you some time using the FiredMan event to log player and vehicle weapons together:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#FiredMan

This EH must be attached to a soldier and unlike with "Fired" EH, it will fire regardless of whether the soldier is on foot or firing vehicle weapon.

this addEventHandler ["FiredMan", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];
}];
analog mulch
#

How do I apply a certain camo scheme on a certain vehicle class name that gets spawned?
Also how to fetch all camo names that can be applied on a certain vehicle class name?

tulip ridge
analog mulch
tulip ridge
#

TextureSources class in the vehicle config. Somewhat related but there's also the textureList property which sets weighted randoms for what skin is picked.

TextureSources can also be limited to a specific faction with the camo's faction property

#

So tl;dr, grab stuff with configProperties and filter by faction if its not an empty string

edgy dune
#

if I remember right there isnt an eventhandler to detect when the zeroing of a vehicle mounted weapon is changed, what would be the best way to detect then? listen to when the inputAction for zeroingUp, zeroingDown, gunElevAuto are pressed?

edgy dune
#

okay cool thanks

drowsy geyser
#

Is there a similar command to setDriveOnPath but for units, something like walk on path?

still forum
analog mulch
# tulip ridge TextureSources class in the vehicle config. Somewhat related but there's also th...

i've gotten the texture i want to be applied on all I_APC_Wheeled_03_cannon_F that get spawned

texture from config viewer

textures[] = {"A3\Data_F_Tacops\data\APC_Wheeled_03_Ext_IG_03_CO.paa","A3\Data_F_Tacops\data\APC_Wheeled_03_Ext2_IG_03_CO.paa","A3\Data_F_Tacops\data\RCWS30_IG_03_CO.paa","A3\Data_F_Tacops\data\APC_Wheeled_03_Ext_alpha_IG_03_CO.paa","A3\Armor_F\Data\camonet_AAF_FIA_green_CO.paa","A3\armor_f\data\cage_G3_co.paa"};
pallid palm
#

what would be some reasons to ```sqf
addEventHandler ["FiredMan", {

};

#

i can't think of any

hallow mortar
#

The reason to add an event handler to a unit, which activates when that unit fires, is usually so you can detect when that unit fires.

pallid palm
#

hmmm and why would you need to know that: ummm

#

is that just for testing

hallow mortar
#

Maybe you want to work with stealth mechanics and alert (or de-alert) nearby enemies.
Maybe you want to delete the bullets.
Maybe you want to add event handlers to the bullets so they can have some scripted effect.
Maybe you want to make an infinite ammo system.
Maybe you want to track shots fired for statistics.
Maybe you want to attach something to the bullets.
Maybe you want to make nearby allies wait for your shot.
There's lots of reasons. People do a lot of things with scripting.

pallid palm
#

oh nice i see thats cool good ideas man

#

delete the bullets hay that would be good for training πŸ™‚

#

really nice @hallow mortar thx so much for your explantion m8

next gust
#

Events and Evemthandlers are the most awesome way to interact with a system. Really Glad arma has Them and we can even expand on Them.

pallid palm
#

yes sir i use addMissionEventHandler to my missions alot

old owl
#

Hi friends!

Does anyone have any good developer tools they commonly use or situationally tend to find super helpful they would like to share?

I very rarely ever do anything with particle effects due to not wanting to deal with the setting of all the parameters. It did get me thinking though, something like that probably is better created in a UI.

Alike- does anyone have any good tools for network monitoring? I feel like I recall Dedmen sending some maybe sending some in #perf_prof_branch or #dev_rc_branch somewhere at some point but couldn't find where.

proven charm
#

there was wiki page but cant find it

old owl
#

Oh yeah! I think I remember Lou sending that at one point! Is everything on there "reputable" per se? I see stuff from Leopard20 which is a name I know and trust (πŸ™‚) but also see a lot of other really neat looking stuff but just kinda have a tin foil hat. Is everything sorta vetted before being added?

still forum
#

I once made a external particle editor that let you live-edit particle parameters while the effect was running in-game.
Someone made a ingame UI that lets you edit particle effects in Eden, its not linked on the wiki page. Its some workshop mod.

#

Don't know of any comprehensive tool for network monitoring.
There used to be ArmaServerMonitor (ASM) for Arma 2, but that wouldn't really do much, just graph the fps and playercount.

Nowadays you could build something bigger, that could graph per-player bandwidths, queue sizes, maybe message types.

I did prepare something in engine to get really deep access to networking code and statistics via an extension.
Live per-player info of number of messages/bytes in/out.
Per message-type number/bytes in/out.
Variables/remoteExec's by name
Basically what networkDiagInterval does, but all the info instead of only the top10 items.

But I never had the time to actually do something with it.

still forum
tame coral
#

Looking for script assistance for detecting a satchel charge being planted within a trigger zone.

_plantedBombs = nearestObjects (getPosATL bombTrigger) [_bombClass, _bombClass, 10];
_bombsInArea = [];
{
  if (_x inArea bombTrigger) then {
    _bombsInArea pushBack _x;
  };
} forEach _plantedBombs;
if (count _bombsInArea > 0) then {
  hint "Bomb planted successfully!";
  bombTrigger setTriggerActivation ["NONE", "NONE", false];
};
};```

this is what I have but i'm not really sure this working, no errors thrown but not functional either. Can anyone help?
hallow mortar
hallow mortar
#

projectileCreated mission EH might also be helpful for you

still forum
old owl
#

@still forum If the particle tool you made is available to the public would love to try it out if you have it somewhere! Also same with the networking tools. I think even having the ability to see live player info, messages, variables, etc would be huge in being able to see what we could do better. If you were willing to send links to either of those- would love to give them a whirl πŸ™‚

still forum
#

Should be pretty easy to test though.
Plant a satchel.
Stand next to it, run in debug console
nearestObjects [getPosATL bombTrigger, [], 10] apply {typeOf _x} and see if your satchel class appears

tame coral
#

okay, I'll give it a go here

still forum
#

Your forEach loop can be replaced by inAreaArray.

_bombClass = "DemoCharge_Remote_Mag"; // #TODO fix this name
_plantedBombs = nearestObjects [getPosATL bombTrigger, [_bombClass], 10]; // Find all bombs in roughly the trigger area.
_bombsInArea = _plantedBombs inAreaArray bombTrigger; // Filter to only bombs that are actually inside the real trigger area
if (_bombsInArea isNotEqualTo []) then {
  hint "Bomb planted successfully!";
  bombTrigger setTriggerActivation ["NONE", "NONE", false];
};
still forum
#

Oh yeah I do have the source, last working for Arma 2.04 πŸ˜„

#

That networking tool also doesn't exist, its just something I wanted to build, I never did and likely won't

old owl
old owl
tame coral
#

is the satchel charge ammunition named SatchelCharge_F or is that only its world model?

hallow mortar
#

SatchelCharge_Remote_Ammo for satchels, DemoCharge_Remote_Ammo for demo charge

#

If you're using ACE, the ACE Arsenal also shows a magazine's ammo class in the top left panel when you select it

hushed turtle
#

There is also ACE Arsenal mod. Adding just arsenal from ACE without anything else

tame coral
#

Unfortunately I don't see the ammunition class with ACE in the arsenal just the magazine name when hovering over the magazine in question. But the biki was informative. No errors thrown but the hints don't show up as needed. probably an issue on my part since I'm just trying to do this with a trigger instead of an SQF

hushed turtle
#

ACE has some kind of small box showing additionall info about weapons and magazines

tame coral
#

only one page no additional information.

hallow mortar
#

Oh they don't show the details for explosives magazines because ????

#

Thanks ACE

#

Anyway, the wiki page is correct for vanilla and the config viewer will work for everything else

tame coral
#

its okay, I need to try this script from an SQF πŸ™‚ thank you for all your help

hoary saddle
#

Hey guys, what would be the correct way to use an array, hideObject and forEach?

i've got private _array = ["1-42 varNames"];

and Id like to hide/Unhide the array.

hallow mortar
hushed turtle
#

You gonna need getVariable, if you have var names in strings, rather than just var names

hoary saddle
hallow mortar
#

Then it's what Jouklik said, you've listed your variable names as "strings" rather than justTheVariableName. Use getVariable to retrieve the variable from a string of its name, or make them not strings

hoary saddle
#

I will give that a shot. Thanks guys.

still forum
#

Keep in mind if this is about playable units (I assume its not because you wouldn't hide players) you need to be careful because the variables might not be set and just be nil, which can throw errors.
(I wanted to fix that, I can easily fix that but..... That would probably break scripts that use isNil to check if a player slot is empty ☠️ )

mortal folio
#

technically ain't gonna follow an exact path but the unit will go through walls if it needs to and go in a straight line towards the destination

#

so you could technically keyframe path points and voila you got a path

granite sky
#

Yeah you can do the animation thing, but what you can't do is just give an AI path directly to the engine.

#

Which is kinda silly because you can read the path with the PathCalculated EH.

mortal folio
#

true

agile pumice
#

Well, I moved come code around and the issue's been resolved

#

I made a new function, and call it from the flag's init in the sqm

kind hatch
#

Hello, quick question: how do I make it so that when the scenario starts, it shows me in the bottom right where I am and what time it is? And can one more year be added before 'Ostwind'?

young linden
#

Could someone please give me a hand real quick? Can I in any way replace the singular unit name in bold with an array of unit names? I want to define multiple.

    if (vehicle player == player) exitWith {};
    if (typeOf (vehicle player) != **"TBD_MTLB_VMK"**) exitWith {};
    GVAR(ZERO_LINE) = GVAR(ZERO_LINE) + 0.03;
}, {

}, [DIK_PGUP, [false, false, false]], true] call CBA_fnc_addKeybind;```
hushed turtle
winter rose
blissful current
#

Is it possible to create a server only trigger from a .sqf that isn't initServer.sqf?

_trg = createTrigger ["EmptyDetector", objNull, true]; // don't need a location for it
_trg setTriggerStatements ["missionNamespace getvariable ["foxClub_var_XYZ", false]","missionNamespace setVariable ["foxClub_var_XYZ", true, true];",""];
hushed turtle
#

Set third parameter to false and execute it only on the server

#

May need to do isServer check

young linden
blissful current
#

Or maybe put it in it's own .sqf and remoteExec that instead?

vagrant cedar
#

InitServer.sqf

hushed turtle
#

He wants to execute it from client by the look of it

blissful current
#

Correct. I've only done editor triggers so this is my first time writing one.

hushed turtle
#

Recommended approach is to create function and remote execute that function

#

Instead of sending code through network

blissful current
#

It will only be done once. I often hear that functions are for multiple uses. So why a function instead of execVM?

hushed turtle
#

Functions from function library get compiled on loading, avoiding potential performance loss from compiling during mission runtime. That being said this is short script and won't any harm

blissful current
#

Awesome thanks for the help!

blissful current
# hushed turtle Functions from function library get compiled on loading, avoiding potential perf...

How does this look? It seems to work fine, but is there a way to verify it's only running on the server?

_trg = createTrigger [
    "EmptyDetector", // type
    objNull, // position
    false // makes global
];

private _conditionPerfectMission = {
    (missionNamespace getVariable ['foxClub_var_XYZ', false])
};

private _activationPerfectMission = {
    ["cheevo_perfectScore","SUCCEEDED"] call BIS_fnc_taskSetState;
    hint "fired";
};

_trg setTriggerStatements [
    toString _conditionPerfectMission,
    toString _activationPerfectMission,
    ""
];
#

Called with:

["scripts\achievementTriggers.sqf"] remoteExec ["execVM", 2];
tulip ridge
#

remoteExec ["execVM"...]
Why...

pallid palm
pallid palm
#

i do it the way you taught me @tulip ridge

#
[.......] remoteExec ["SFA_fnc_INS_ChopperFinish", 2];
```but of course this here is with a function
#

or who ever is was that taught me that i forget: it may have been Jouklik

tulip ridge
#

Yeah the proper way is to just make a function and use CBA events or remoteExecCall it

pallid palm
#

well i dont use CBA so well you know

blissful current
pallid palm
#

oh yeah then execVM is ok

blissful current
#

I understand now that the function is more performant for long code since it's compiled at start.

pallid palm
#

yes sir

blissful current
#

But is there any other reason that a function is the "proper" method? I'm not challenging the statement btw, just trying to learn.

pallid palm
#

yeah functions only compile 1 time like this

SFA_fnc_RTB_Chopper = compileFinal preprocessFileLineNumbers "INSEX_Chopper\RTB_Chopper.sqf";
``` so they never compile again:  but the execVM compiles every time its run:
blissful current
pallid palm
#

hmm that looks correct to me but i don't know much

#

this is how i do it @blissful current ```sqf
_r = createTrigger ["EmptyDetector",_pos];
_r setTriggerArea [300,300,0,true];
_r setTriggerActivation ["EAST","PRESENT",true];
_r setTriggerStatements ["this && {((getPosATL _x) select 2) < 70} count thislist > 0","",""];
_r setTriggerType "NONE";
_r;

while {true} do {
if(triggerActivated _r) then {
sleep 3;
_mkrname setMarkerColor "ColorRED";
deleteVehicle _r;
};
};

tulip ridge
#

So it's not defined when you try to delete it from ADT

pallid palm
#

ahh yes i see now

blissful current
#

So I just need to delete the underscore (which makes the var global IIRC)?

pallid palm
#

btw what is ADT

tulip ridge
#

Advanced Developer Tools, it's a mod

pallid palm
#

oh shit ok lol: no wonder i didn't know

tulip ridge
blissful current
pallid palm
#

can you put a if statement in the trigger script

blissful current
#

Well, I'm pretty sure it exists in initServer.sqf cause I remoteExec the code that creates the trigger to just the server.

pallid palm
#

so if someone joins the server then it can be deleted is that what you want

#

is this a dedacated server

#

or hosted server

blissful current
#

I allow players to create and delete this server-only trigger. That's basically it. I've completed to code to create the trigger on the server. Now I just need to write the code to delete it. Sounds like all I need to do is make it a global var but I'm curious to see why Dart was asking why I need to do that.

pallid palm
#

cus if its hosted server then the host will never be able to delete the trigger

blissful current
#

Why not?

pallid palm
#

cuz you have the delete trigger in the initPlayerLocal.sqf whitch is for JIP iirc

blissful current
#

That doesn't seem like it should matter. In my experience so far anyway (could be and often are wrong)

pallid palm
#

well like i said i dont know much m8 just trying to help

blissful current
#

No worries, neither do I 🀣

pallid palm
#

so the initSever.sqf and the init.sqf is for all players that are in the lobby at start

blissful current
pallid palm
#

i found that the initPlayerLocal.sqf is kinda only for JIP players at least thats what i was thinking

#

i guess it all depends on how you script it

tulip ridge
pallid palm
#

what about playing on the net ?

blissful current
#

It's not only because my code within it works fine for clients and local-host. I can say that at least.

pallid palm
#

ok i see

blissful current
#

"Executed locally when player joins mission (includes both mission start and JIP). See Initialisation Order for details about when exactly the script is executed."

#

That's what the wiki says.

pallid palm
#

hmmmm

#

ok

blissful current
#

"(includes both mission start and JIP"

pallid palm
#

ok copy that

#

no wounder my missions work so good πŸ™‚

#

if you saw my initPlayerLocal: you may crap your pants it loaded πŸ™‚

#

well its only 52 lines πŸ™‚

#

but i get alot done in there πŸ™‚

#

why do we even have all them sqf if they all do the same thing πŸ™‚

#

i know i know lol πŸ™‚

#

i guess we could do everything in the init.sqf if we really wanted to right

#

its just the order of exec that would be the bees knees i guess in there πŸ™‚

#

and all the #includes and stuff

fair drum
pallid palm
#

well see i have many locations that the trigger making script gets exec at: i didn't show the whole script: but it w8's till the trigger get triggerActivated: so the loop delete's the trigger as per needed

fair drum
#

then use a scriptedEventHandler instead, you'll then only have the trigger checking instead of multiple other things checking to see if that trigger is done

pallid palm
#

so if i show the whole script you can show me the best way ?

#

i never used scriptedEventHandler

#

so i would be lost

#

or could you give a sample

fair drum
#
_r = createTrigger ["EmptyDetector",_pos];
_r setTriggerArea [300,300,0,true];
_r setTriggerActivation ["EAST","PRESENT",true];
_r setTriggerStatements [
    toString {this && {((getPosATL _x) select 2) < 70} count thislist > 0},
    toString {
        [missionNamespace, "ScottyTriggerEvent", []] call BIS_fnc_callScriptedEventHandler
    },
    ""
];
_r setTriggerType "NONE";
// Somewhere else
[missionNamespace, "ScottyTriggerEvent", {
    // Do something
}] call BIS_fnc_addScriptedEventHandler;
// Somewhere even different
[missionNamespace, "ScottyTriggerEvent", {
    // Do something different
}] call BIS_fnc_addScriptedEventHandler;

now when trigger pops, it executes all these codes in different places. Its like the Observer pattern.

pallid palm
#

oh wow cool man

#

holy cow thx man Awsome

fair drum
#

this is similar to using CBA events

#

just BI's version

pallid palm
#

oh i see yeah: i don't use any mods so that's killer what you showed me thx m8 @fair drum

#

holy shit man that's so cool: wow totaly Awsome m8 thx @fair drum

#

i love BIS version stuff

fair drum
#

this is also how you allow people to interact with your mod without making a mod itself.

say I have a mod script that causes a player to be flashbanged:

// logic for flashbang

// ui changes for flashbang

// broadcast that the event happened
[missionNamespace, "TAG_playerFlashBanged", [_player, _amount]] call BIS_fnc_callScriptedEventHandler;

now if someone wants to say, make the player explode if they are flashed over 50%, they could add:

[missionNamespace, "TAG_playerFlashBanged", {
    params ["_player", "_amount"];

    if (_amount > 0.5) then {
        // stuff here to make _player explode
    };
}] call BIS_fnc_addScriptedEventHandler;
pallid palm
#

ahhh i see

fair drum
#

this is why you have a event variable table on most big mods. Those events you can use to modify the experience of the mod, without making changes to the mod itself. like doing something when the arsenal is opened/closed, etc. You basically create your own custom event handlers.

pallid palm
#

oh nice really nice

thin fox
# pallid palm oh nice really nice

Here's an example of what Hypoxic is saying:

["lambs_danger_OnArtilleryCalled", {
    params["_caller", "_groupCaller", "_artilleryGun", "_targetPos"];

    private _playersInArea = allPlayers select {_x distance2d _targetPos < 200};
    ["KPLIB_artilleryFiring", [gunner _artilleryGun, _targetPos], _playersInArea] call CBA_fnc_targetEvent;
}] call CBA_fnc_addEventHandler;

I'm adding a lambs event handler raised when a registered enemy artillery piece fires, so I use this EH to warn players in the target area
https://github.com/nk3nny/LambsDanger/wiki/Event-handlers

pallid palm
#

i see ok nice

#

my full script is 117 lines πŸ™‚

#

ok i have a Questions what Actually deletes the triggers or e'm i missing something: or e'm i not understanding this correctly:

hushed turtle
pallid palm
#

@thin fox ok cool or in my case ```sqf
deleteVehicle _r;

drowsy geyser
hallow mortar
hushed turtle
#

Oh yeah, typical Arma AI. Enables noclip cheat anytime it decides to. Goes through objects, possibly getting stuck in them. Gives zero *****.

grim yoke
#

Hey,
I'm looking for a way to use the β€œflicker effect” from the memories in the β€œRemnants of War” campaign from the Laws of War DLC in my own mission.
I don't mean the transitions, but rather the flickering β€œballs” that show where I can awaken a memory.

So also with this glowing effect.

Does anyone have any ideas?
Because I can't find anything about it on the internet.

hushed turtle
#

Try to find it in campaign files

hallow mortar
warm hedge
torn stream
#

is there a way to check for NaN's? i have a small case where a variable is scalar NaN, but it only returns that in hints, every time i do a check using that variable nothing works

torn stream
#

if i do

if !(_variable == 0) then {hint "text"};

which is supposedly false because it's not 0 it's NaN, but that just doesn't work,

still forum
still forum
torn stream
still forum
#

Oh

#

your variable is nil then

#

not NaN

#

also known as "undefined"

#

isNil "_variable" in that case

torn stream
still forum
#

the quotes matter

#

But I recommend finding out where that comes from and fixing it there, instead of handling it everywhere else πŸ˜„

torn stream
#

i see, ty

#

i'm playing with vectors
-# which i hate
and when it points to nothing, such as the sky it returns that, the quotations made it, ty

that's why i wanted a check for it, so in case that happened i can do something else

hallow mortar
# blissful current But is there any other reason that a function is the "proper" method? I'm not ch...
  • being a function makes it visible in CfgFunctions and so inspectable in the Config Viewer, which is better for accessibility
  • being a function makes it easier to call if needed
  • it's easier to write the name
  • if you change file paths, you can do all updating in one pass in CfgFunctions, rather than having to hunt down every existing reference in your script files
    There are plenty of cases where it doesn't make a lot of substantial difference - one-time executions of single simple files with no performance sensitivity. But it's good to get into the habit of just using functions all the time. Small efficiencies add up. And if nothing else, it looks tidier.
#

In the case of remoteExec specifically, using execVM adds another layer of complexity in how you formulate the remoteExec parameters, and there's no reason to do that to yourself

kind hatch
still forum
#

https://community.bistudio.com/wiki/BIS_fnc_typeText
https://community.bistudio.com/wiki/BIS_fnc_textTiles

Support structured text.
https://community.bistudio.com/wiki/Structured_Text

[
  [
    ["2034-05-10 ", "align='center' shadow='1' size = '0.7'"],
    ["08:15", "align='center' shadow='1' size='0.7' font='PuristaBold'"],
    ["", "<br/>"], // line break
    ["KORE, WESTALTIS", "align='center' shadow='1' size = '0.7'"],
    ["", "<br/>"], // line break
    ["1 Jahr ", "align='center' shadow='1' size='0.7' font='PuristaBold'"],
    ["VOR STRATIS", "align='center' shadow='1' size = '0.7'"]
  ]
] spawn BIS_fnc_typeText2;
#

I'm sure there is some function that actually puts the time and players location there, but I can't find it

sharp grotto
#

For the time

([daytime, "HH:MM"] call BIS_fnc_timeToString);```
kind hatch
hushed turtle
#

You can put it anywhere

tulip ridge
#

Just do it in initPlayerLocal.sqf

hushed turtle
#

Typo detected πŸ€–

drowsy geyser
#

is there any way i can disable the head bob via script for a sp mission?

cosmic lichen
#

No

old owl
#
if true then {
    ["Happy Thanksgiving everyone :)"] remoteExec [-2, "hint"];
};
tulip ridge
#
private _menu = ["turkey", "ham", "mashed potatoes"];
skipTime -1000;
_menu deleteAt (_menu find "turkey");
fair drum
#
playSoundUI ["gobble_gobble", 1e12, 1, false, 0, true];
last cave
#

If you're tired of bots being unable to find their way while patrolling, or if they've spawned near objects they can't exit, here's a minimal solution. (added for each unit created)

_unit addEventHandler ["PathCalculated", {
    params ["_unit", "_path"];
    if (count _path == 0 ) then {
        if ({_unit distance _x <= 600} count allplayers == 0) then {
            _pos=getposatl _unit findEmptyPosition [5, 100,typeof _unit];
            _unit setposatl _pos;
        };
    };

}];
#

But in rocks can be problem... no know why but 'findEmptyPosition' select position in rocks...

hushed turtle
#

Maybe there was 5 meters of clearance inside of rocks? 🀣

granite sky
#

findEmptyPosition is garbage :/

hushed turtle
#

You might want to look at BIS_fnc_findSafePos to find safe position

granite sky
#

findSafePos is also garbage. Although I think it does protect you from rocks at least.

#

findSafePos is basically a nearObjects check plus a raycast from above.

#

I never quite figured what findEmptyPosition is doing but it's not good.

last cave
#
_distances=nearestTerrainObjects [player, ["ROCK"], 50,true] apply {[((boundingBox _x) select 2) / 2,_x getdir player ]};
player setposatl (player getpos (_distances#0))
``` )
hushed turtle
#

If it only checks for objects positions and it doesn't care about actual object size, then it is indeed garbage πŸ˜†

#

Use boundingBoxReal instead to be more accurate, since boundingBox returns box you see in the editor. Like ones on your screenshots on some units.

last cave
#

The сomposition position is beautiful (dynamically selected through selectBestPlaces), but the bots can sometimes walk one meter back and forth, back and forth, even if there is no obstacle in front of them (ROOOOCK).

hushed turtle
#

And you would probably want to move them some where outside of any no interior object, not just rocks

last cave
#

He in trap

hushed turtle
#

AI in this game was always struggling in high objects density areas. Failing to move and just staying on spot forever.

last cave
#

What's funny is that bots cancel a waypoint when they can't reach it.

#

Sometimes they even ignore walls.

#

Bruh x2

#

I don't know what algorithm is used, but clearly if there is an opportunity to jump, they won't hesitate to do so.

split ruin
#

any way to put a helipad on a carrier deck ? πŸ€”

tulip ridge
split ruin
#

it is invisible

tulip ridge
#

Probably inside of it

split ruin
#

I already tried to replace it vertically with alt + mouse drag but even its on the deck it stays invisible

tulip ridge
#

Oh the vanilla ones are decals, the texture will always stick to the ground

split ruin
#

any way to have helipad on the deck ?

tulip ridge
#

I don't think there's vanilla models for the helipads that aren't like that
The helipad is still physically there though, the texture will just be on the sea floor

split ruin
#

so it will work normally just it won't be visible ?

tulip ridge
#

Won't be visible on the carrier, correct

split ruin
#

I need it so we can return to base with a heli transport support

tulip ridge
#

Yeah, you can getPosASL if you want to verify though

#

Carrier might also having helipads built into the model, no clue though

split ruin
#

I will test it with the transpot module ...

#

it has to land somewhere I guess

#

@tulip ridge AI heli just hover high above the deck of the carries and won't land

#

without halipad

tulip ridge
#

Use a PFH with an interval of 10 seconds, check if ceil random 10 == 10

tulip ridge
split ruin
#

lol with "invisible" helipad the heli transport is hovering and spinning above the deck wtf πŸ˜‚

pallid palm
#

yeah iv been trying the same thing no luck yet

#

but i was trying to get heli to land on the front of a destroyer πŸ™‚

#

maybe set a marker in the midd of the helipad:

#

and make chopper land at marker

#

maybe move the marker up or down by alt key

sage marsh
#

Sometimes instead of SQF files scripts, i see people set up missionflow.fsm or something

#

What is that and how does people figure that shit out

winter rose
fair drum
hallow mortar
pallid palm
#

sweet

#

i did get the chopper to land or hard land on the deck: but its not what i want πŸ™‚

finite bone
#

How do I convert this sqf [[_microAirVehicle, "prop_end"],"rhs_fnc_sayGlobal"] call BIS_fnc_MP; to remoteExec as BIS_fnc_MP is deprecated?

I think this will work

[_microAirVehicle, "prop_end"] remoteExec ["rhs_fnc_sayGlobal", 0];
low swallow
#

Hello Guys,

I'm encountering a problem with my mission's debriefing system and would appreciate some help.

The Problem:
I have defined multiple debriefing classes in my description.ext (e.g., End1, End2, End3) to cover different mission outcomes. My intention is for a specific ending to trigger based on in-game conditions (e.g., if OPFOR wins, show End2).

However, no matter what conditions I set in my triggers or which trigger fires, the mission always ends with the debriefing defined in class End1. Even when Red team (OPFOR) kills Blue team (BLUFOR), it still shows the "Blue team won" debriefing (which is currently End1 by default).

I am trying to achieve this using triggers. For example, a trigger activates when "OPFOR is absent" (meaning count (sideUnits opfor) == 0).

Here's my CfgDebriefing block from description.ext:

class CfgDebriefing
{
class End1
{
title = "USA Victory!!"; // (Currently defaults to this regardless of outcome)
subtitle = "Convoy passed!";
description = "Democratization of Vietnam is successful!";
pictureBackground = "";
picture = "";
pictureColor[] = {1,0,0,1};
};

class End2
{
title = "Vietcong Victory!";
subtitle = "Americans stopped!";
description = "For Uncle HO!";
pictureBackground = "";
picture = "b_inf";
pictureColor[] = {1,0,0,1};
};

class End3
{
title = "USA Victory!";
subtitle = "Vietcong eliminated!";
description = "For Uncle Sam!";
pictureBackground = "";
picture = "b_inf";
pictureColor[] = {1,0,0,1};
};
};

My Question:
What do I need to do to make sure that each specific ending (e.g., End2, End3) is correctly activated by its respective trigger, instead of always defaulting to class End1?

Thank you in advance for your help!

old owl
pallid palm
#

@low swallow from what i can see in you post

#
// not sure what your Condition is ?

//this would be a mission Win onActiveation 
["end1"] remoteExec ["BIS_fnc_endMission"];

//------------------------------------------------
// Condition is
{side _x == West} count allUnits == 0;

//this would be mission failure onActiveation
//VC Ai win Here  
["end2", false] remoteExec ["BIS_fnc_endMission"];

//-------------------------------------------------
// Condition is
{side _x == EAST} count allUnits == 0;

//this would be mission Win onActiveation
//US players win Here 
["end3"] remoteExec ["BIS_fnc_endMission"];


//=========================================================
// not sure what your Condition is ?

//this would be mission failure
["end4", false] remoteExec ["BIS_fnc_endMission"];

// not sure what your Condition is ?

//this would be a mission failure
["end5", false] remoteExec ["BIS_fnc_endMission"];
#

you have 3 win Conditions you need to set all 3 like you see up there: but we really need to see the Trigger Conditions : You must have diff Conditions: in each trigger: to fire each diff trigger ```sqf
//you can't have the same thing in each Condition Of the triggers
// or it will default to the 1st Win Condition

or the count down: of each trigger   is critical:
depending on your Respawn time:
cosmic lichen
#

!code

wicked roostBOT
#

Please use !sqf from now on (!enforcescript soonβ„’)

cosmic lichen
#

!sqf

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓ turns into ↓

// your code here
hint "good!";
cosmic lichen
#

@pallid palm You can just type !sqf to show to to format sqf code

pallid palm
#

oh really

#

ok i did not know

modern plank
#

Any function(s) to add an offset easily on a position? Something like [initPos] move To(dir, dist) that returns the array with changed values. Just to know if I need to implement myself or if it already exists.

proven charm
modern plank
#

Hum... You have to compute the X and Y value outside