#arma3_scripting

1 messages ยท Page 81 of 1

stark fjord
#

IF you have zeus enhanced.

#

yep

lavish stream
#

Should be.

crisp sonnet
#

Remind me never to ask Marko for a simple solution again XD

stark fjord
#

butbutbut, i linked you exactly that

lavish stream
#

I was going to offer a better one for triggers but I got here late it seems

crisp sonnet
#

YOU LINKED ME TO THE MF PARACHUTE BIBLE ๐Ÿคฃ

stark fjord
#

its written right there in first 10 comments ``` * Example:

  • [_vehicle] call zen_common_fnc_ejectPassengers
  • Public: No
    */``` ๐Ÿ˜
crisp sonnet
#

Only I don't have ZEN loaded while I make the mission because using any aspect of it makes a dependency in the mission file and the unit I'm in don't use ZEN

stark fjord
#

then... one thing you may try. it will look silly, and im not sure if they will deploy chutes, but what happens if you press G on flying xian?

crisp sonnet
#

When I don't have zeus because it's a zeusless scenario?

lavish stream
#

Pretty sure he's not Zeusing his mission, it's entirely editor made.

stark fjord
#

Ah

#

well

crisp sonnet
#

Yeahhhh

lavish stream
#

hold on.

stark fjord
#

that script in a nutshell is very simple... just looks complicated

crisp sonnet
#

Anything over like, a paragraph, is a huge mental nope

#

I trigger scum 90% of my "scripting"

stark fjord
#

nothing wrong with triggers

crisp sonnet
#

Hell even the starting parachute drop in the first mission was made almost entirely by people who weren't me

lavish stream
#
private _passengers = crew _vehicle select {assignedVehicleRole _x param [0, ""] == "cargo"};

{
    unassignVehicle _x;
    moveOut _x;
} forEach _passengers;
crisp sonnet
#

Should I use that instead of the other one?

lavish stream
#

replace _vehicle with your vehicle name.

stark fjord
#

You may wanna add parachute and slight delay to that. Or its gonna look like mass suicide pact

lavish stream
#

You mean to say you don't enjoy shotgun-shitting out paratroopers?

stark fjord
#

Without parachutes *

crisp sonnet
stark fjord
#

Add sleep <seconds>; after move out

#

And that is more or less what that "parachute bible" does, excluding some checks, optimizations, and attaching parachute even if unot doesnt have one.

#

You will probs also wanna put the whole shebang in spawn.

#
[My_helo] spawn {
  params[["_vehicle", objNull]];
  if (isNull _vehicle || !alive _vehicle) exitWith {};
  private _passengers = crew _vehicle select {assignedVehicleRole _x param [0, ""] == "cargo"};
  {
    unassignVehicle _x;
    moveOut _x;
    sleep 2;
  } forEach _passengers;
};
crisp sonnet
stark fjord
#

it will most likely work, they will just shotgun eject

winter rose
#

this will also eject dead people ๐Ÿ˜›

crisp sonnet
#

That's fine

#

They're all AI, won't be in visual range of the players when they do parachute and I added a slight sleep timer anyway

fresh wing
#

guys is not possible spawn npcs with weapons in altislife mod?

mighty halo
#

Can anyone recommend good videos or forums to get into Arma scenario scripting?

manic sigil
# mighty halo Can anyone recommend good videos or forums to get into Arma scenario scripting?

This would be the forum; as for videos, there's plenty to choose from but a good number are dated.

There's this one, fairly recently, though I feel it jumps pretty quickly from 'how scripting works' to 'this is how I personally design encounters', so grain of salt: https://www.youtube.com/watch?v=JSqU7EvSv04&t=6841s

Join in future operations: https://discord.gg/UselessFodder
Support the channel and community: https://patreon.com/UselessFodder
Buy awesome tactical games: https://nexus.gg/UselessFodder

In this tutorial, we will make a complete mission in the Arma 3 Eden Editor and show how to set up Arma 3 missions, create waypoints, set enemy patrols and...

โ–ถ Play video
north leaf
#

Good evening!

Trying to use ACE3's Event Handlers to detect when a player picks up / places an item with the "Carry" function ACE3 adds...has anyone done similar or familiar with how to use the EH?

#

I found this, but how do I point it to the item in question?

granite sky
#

As far as I can tell, that event is only triggered for attaching items like chemlights to the player. Not for carrying, or attaching objects explosives to a vehicle.

north leaf
#

was afraid you would say that haha, been doing testing and it hasn't been working out

#

all good though, i'm sure i'll find another route

granite sky
#

As far as I know, the only ACE event generated for carrying is the setMass, and I think that's only triggered for physX objects like the crates.

#

Might be (ab)usable though, depending on your requirements.

#

[QEGVAR(common,setMass), [_target, _mass]] call CBA_fnc_globalEvent;

north leaf
#

i'm currently wondering if i can just edit the 'drop' function that ACE has

#

would create a different dependency / version of ACE, but would fix the issue i think

#

I'm hoping to save items to my inidbi db whenever a player drops them, instead of using loops to check

#

it looks lke ACE uses the attachTo command for it's carry mechanic, but I don't see a BI Event handle for that either

granite sky
#

There's a feedback tracker thing for it.

drifting sky
#

Can anybody remind me real quickly what getHideFrom returns when the believed position isn't known?

#

never mind!

tough abyss
#

anyone know how one may be able to stop animals from spawning in a mission? cant find a module for it and the biki page relating to animals doesnt show much

little raptor
meager granite
tough abyss
#

should work thanks

versed belfry
#

Hello :D

I have a question once again, the command allMissionObjects linked https://community.bistudio.com/wiki/allMissionObjects

The biwiki highlights that This command is quite performance heavy. Use with caution!, does anyone know how performance heavy it is? any data or examples of this?

I am attempting to use this in initServer or initPlayerLocal:

allMissionObjects "EmptyDetector";

to detect all triggers in the mission and place a marker on them before the players load onto the mission.

little raptor
#

well it depends on the terrain tho

#

e.g. in VR it's not that bad, but on Altis it could lead to FPS drop

#

iirc it takes >15ms on Altis

#

all triggers in the mission and place a marker on them before the players load onto the mission.
in that case it's fine

#

there's also allObjects which is much faster but it's not available till v2.14

#

does anyone know how performance heavy it is? any data or examples of this?
you can just run your own performance test using the debug console

#

just click on the speedometer button

versed belfry
versed belfry
little raptor
#

yeah

#

but I think it goes thru the terrain objs as well

#

which is why it's slow
in that case mission objects shouldn't matter much because terrains have hundreds of thousands of objs (e.g. 1.8M on Altis)

versed belfry
#

Hmmmmm, I might be better off making it check through a layer called "Triggers" instead of using this command then.

#

It's less automation but I'd rather not risk it with performance if it ends up causing issues.

little raptor
little raptor
versed belfry
#

๐Ÿ‘

#

Thanks a lot for the help

versed belfry
little raptor
#

well you can use getUnitloadout

versed belfry
#

It's perfect, thank you again

meager granite
#

Wonder if there is even faster way to know if entity is a unit or not than _unit isKindOf "CAManBase"?

#

Some unary command perhaps?

#

Thinking about it, config branch checks are not fully reliable, who knows if some mod decides to have a tank under CAManBase branch, it is possible.

#

getText(configOf _unit >> "simulation") == "soldier" is even slower but 100% reliable

warm hedge
#

I would say if CAManBase don't work, blame the unit's Mod

ivory lake
#

yeah someone doing a non-unit under camanbase is psychotic

#

like I wouldn't be surprised if someoen has done it but still

meager granite
#

Having something like BOOL = isSoldier ENTITY would be perfect

#

But then you might need similar commands for other simulation types

versed belfry
#

I've got a general question in regards to writing scripts, which of the following would be a better practice when writing scripts? taking into consideration that this needs to be done not just on the map but also other items in the loadout. One is more understandable but has variables that are unnecessary, the other is more "efficient" but less readable:

Sample 1:

private _currentPlayerLoadout = getUnitLoadout player;

if (((_currentPlayerLoadout select 9) select 0) == "") then {
    player linkItem "ItemMap;
};

Sample 2:

private _currentPlayerLoadout = getUnitLoadout player;
private _currentPlayerMap = (_currentPlayerLoadout select 9) select 0;

if (_currentPlayerMap == "") then {
    player linkItem "ItemMap";
};
meager granite
#

If you'll be checking _currentPlayerMap 10 times later in the code of course its better to assign it into variable, if you need to squeeze as much per frame performance as possible, then you might skip some variable assignment and do selects inline in the condition.

versed belfry
meager granite
#

Readable and properly structured code leads to having less bugs

#

Premature optimization is evil yada-yada

little raptor
fallow pawn
#

Dont we have "BIS_fnc_hasItem"?

little raptor
#

unless something gives you dozens of microsecond diff don't worry about it

fallow pawn
#

It returns boolean and all

#

if ([_currentPlayer, "ItemMap"] call BIS_fnc_hasItem) then {
blahblahblah
};

little raptor
#

he wants to check if unit has no linked map item

fallow pawn
meager granite
#

Wish hashmaps accepted entities for keys. Yes, its not reliable because entity can go null and not serialisable but I still use it all the time, would save me additional hashValue command call.

versed belfry
#

I am not checking if the player has "ItemMap" I am checking if the player has ANY map from different mods.

If he doesn't then he gets one.

fallow pawn
#

If so, there should be bo need to get the whole loadout.
Something like:

If ((items _currentPlayer) findIf {"ItemMap"} < 0) then {
link your map here
};

fallow pawn
versed belfry
# fallow pawn Oh... accounting for mod assets and whatnot are a real pain ๐Ÿ˜Ÿ

It is...

The script is part of our quality assurance system, in the case a mission maker forgets to give the players a map, a radio, a compass or some other necessary item the script kicks in and does it at the start of the OP.

Here is an older version of the script that I am updating with the getUnitLoadout command to improve further:
https://github.com/SkippieDippie/A3A-Event-Standard-Files/blob/Nomas_dev/A3AEventMissionBase/initScripts/initEquipment.sqf

tough abyss
#

what command would one use to move an object and/or bool into an array?

little raptor
#

pushBack

#

append
insert
set

tough abyss
#

familiar with all but insert and set

warm hedge
#

What exactly is your need?

tough abyss
#

looking in to it insert is what im after thank you

tough abyss
little raptor
#

so does pushBack and every other command in that list blobdoggoshruggoogly

warm hedge
#

Yeah...?

#

If you put X, will return Y... can you explain X and Y?

stray flame
#

Anyone familiar with Webknight's two primary weapons mod? I wanna look into if I can save the additional weapon on respawn along with the rest of the loadout

sullen sigil
#

just overwrite whatever bit of the function handles it clearing upon death; but as a warning the mod is written incredibly poorly and i dont think its even registered in cfgfunctions

#

alternatively you can make a variable that saves every couple seconds with the second primary then overwrite whatever variable he uses in a respawn eh

stray flame
#

I would just want it to save that weapon the same time it saves the rest of the loadout

#

something I currently have a functional script for

sullen sigil
#

then save to a different variable and overwrite the one he uses in a respawn function

stray flame
#

hmm

sullen sigil
#

but that wouldnt spawn the second weapon

#

and afaik theres no way to do that

#

like i said, incredibly poorly written mod

stray flame
#

sad

sullen sigil
#

you can always use mine ๐Ÿ—ฟ

#

(i actually register my functions to cfgfunctions)

stray flame
#

I'll check it out but I just hate how some second primary weapon mods just gives the interaction prompt on screen at all times to swap or put it in a 2nd slot

sullen sigil
#

mine does not

stray flame
#

Any names or links I can go by to find it?

sullen sigil
#

"kjws two primary weapons"

#

press 4, swap weapon. can blacklist classes from being swapped too if you dont want an lmg to be stuck on someones back

#

im going to be rewriting the code behind it at some point but end-user pov it's fine

stray flame
#

I do like it

#

I think that webknight's is a lil flashier due to the nicer animation/placement but

#

If this actually works with what im trying to do

#

I dont see a reason not to use it

sullen sigil
#

yeah i dont know how to do animations

#

probably requires a p drive which i refuse to set up

stray flame
#

2 different types of modders I suppose

sullen sigil
#

reworking its code is on the list of things to do but that list is very extensive and i am burning myself out on useless projects right now

stray flame
#

understandable

sullen sigil
#

i also want to make it integrate with vanilla inventory but you know how gui stuff is

stray flame
#

honestly it not doing that is mostly fine

#

the only ones I see actually integrate with vanilla inventory are the ones that place it in the launcher slot

sullen sigil
#

yeah i hated those

stray flame
#

now, to figuring out how to save this 2nd primary weapon on respawn

sullen sigil
#

one sec let me get the things

stray flame
#

my current system is weird and its all becouse PIR is weird

winter rose
#

now step on it ๐Ÿ˜„

sullen sigil
#

writing a thing for you hamsch i'll sqfbin it shortly

stray flame
#

ho my

winter rose
#

WAIT IT IS BACK!

sullen sigil
#

its working for me

#

but this was my first """good""" mod so its pretty piss poor

stark fjord
sullen sigil
#

and as per usual sqfbin just does not want to highlight my code

#

i might rework the code as a weekend project as i can just do it all in debug console

#

but meh

#

it works, even if barely

stray flame
#

if it works, im happy

sullen sigil
#

if it works ๐Ÿ˜‚

stray flame
#

my only comment would be that the workshop page could make do with a fancier look

sullen sigil
#

my problem with it is i want to rework it but it'd be a purely backend rework for a mod that seemingly completely works fine for end users

#

meaning peoples second primaries on persistent modes would be lost and nothing else would happen really

stray flame
#

hm, I can get that

sullen sigil
#

oh and i hate the fact the prefix is just kjw

finite dirge
sullen sigil
#

oh forgot to delete that

finite dirge
#

It should work otherwise, but honestly it's a janky site that I'm basically just leaving up because it's handy ABlobHaha

finite dirge
winter rose
sullen sigil
#

i really need to rewrite the whole thing i hate the variable spam

winter rose
#

I like that you feel my presence above your shoulder

finite dirge
sullen sigil
#

my radiation mod has like 20 functions purely because of you

#

all it is is just a variable increasing when you have a bloody lineintersect be good

stray flame
#

okay, testing the respawn thing now

stray flame
sullen sigil
#

no it should be fine

stray flame
#

hm

sullen sigil
#

wait hang on

stray flame
#

well first attempt no luck

sullen sigil
#

ive just realised thats saving the primary weapon as the secondary

#

whoops

stray flame
#

haha

sullen sigil
#

hang on a moment

stray flame
#

I will post my current method in the meanwhile to be on the safe side that im getting it right too

#

onPlayerKilled.sqf

 
params ["_oldUnit", "_killer", "_respawn", "_respawnDelay"];
_primaryWeapon = [primaryWeapon player, primaryWeaponItems player, primaryWeaponMagazine player];
_secondaryWeapon = [secondaryWeapon player, secondaryWeaponMagazine player];
player setVariable ["Hmch_Saved_primWeapon",_primaryWeapon];
player setVariable ["Hmch_Saved_secWeapon",_secondaryWeapon];

onPlayerRespawn.sqf

params ["_unit", "_corpse"];
if (isNull _corpse) exitWith {};
player setUnitLoadout (getUnitLoadout _corpse);
_primaryWeapon = _corpse getVariable ["Hmch_Saved_primWeapon",["",[""],[""]]];
_secondaryWeapon = _corpse getVariable ["Hmch_Saved_secWeapon",["",[""]]];
player addWeapon (_primaryWeapon select 0);
player addWeapon (_secondaryWeapon select 0);
{
player addPrimaryWeaponItem _x;
} forEach (_primaryWeapon select 1);
{
player addPrimaryWeaponItem _x;
} forEach (_primaryWeapon select 2);
player addSecondaryWeaponItem ((_secondaryWeapon select 1) select 0);






//this part was for a respawn TP thing dont mind it
if !(_corpse isEqualTo objNull) then {
    _nearPlayers = nearestObjects [_corpse, ["OPTRE_UNSC_Marine_Soldier_Unarmed"], 500, true];
    _teammates = _nearPlayers select {alive _x && _x != player};
    player setPosASL (getPosASL (_teammates select 0));
};

deleteVehicle _corpse;```
#

PIR is to blame why this is somewhat convoluted

sullen sigil
#

think that should work

#

its just making temp variables

#

you can get rid of the second load of private (but not the variable redefines themselves)

stray flame
#

First part would go into onPlayerKilled.sqf right?

#

since thats what saves the loadout

sullen sigil
#

ya

#

then second part onplayerrespawn, just copy paste it all

stray flame
#

alright

#

running a test

winter rose
stray flame
sullen sigil
#

oh pea brain kjw again

stray flame
#

I can send my current file configuration

sullen sigil
#
//in playerkilled bit
private _oldGunItems = weaponsItems player;
player setVariable ["Hamsch_nuts", _oldGunItems];

//in the loadout restore
private _oldGunItems = player getVariable ["Hamsch_nuts",[]];```
#

i hate this mod

#

am also trying to debug my own right now too after 4 hours of sleep

stray flame
#

onPlayerKilled.sqf

 
params ["_oldUnit", "_killer", "_respawn", "_respawnDelay"];
_primaryWeapon = [primaryWeapon player, primaryWeaponItems player, primaryWeaponMagazine player];
_secondaryWeapon = [secondaryWeapon player, secondaryWeaponMagazine player];
player setVariable ["Hmch_Saved_primWeapon",_primaryWeapon];
player setVariable ["Hmch_Saved_secWeapon",_secondaryWeapon];



private _oldGun = player getVariable ["KJW_ShotgunClassname", ""];
private _oldammoClassnames = player getVariable ["KJW_ShotgunAmmoClass", ""];
private _oldAmmoCount = player getVariable ["KJW_ShotgunAmmoCount", 0];
private _oldGunAttachments = player getVariable ["KJW_ShotgunAttachments", []];
private _oldSecondaryAmmoClass = player getVariable ["KJW_ShotgunSecondaryAmmoClass", ""];
private _oldSecondaryAmmoCount = player getVariable ["KJW_ShotgunSecondaryAmmoCount", 0];

player setVariable ["Hamsch_ShotgunClassname", _oldGun];
player setVariable ["Hamsch_ShotgunAmmoClass", _oldAmmoClassnames];
player setVariable ["Hamsch_ShotgunAmmoCount", _oldAmmoCount];
player setVariable ["Hamsch_ShotgunAttachments", _oldGunAttachments];
player setVariable ["Hamsch_ShotgunSecondaryAmmoClass", _oldSecondaryAmmoClass];
player setVariable ["Hamsch_ShotgunSecondaryAmmoCount", _oldSecondaryAmmoCount];
#

onPlayerRespawn.sqf

params ["_unit", "_corpse"];
if (isNull _corpse) exitWith {};
player setUnitLoadout (getUnitLoadout _corpse);
_primaryWeapon = _corpse getVariable ["Hmch_Saved_primWeapon",["",[""],[""]]];
_secondaryWeapon = _corpse getVariable ["Hmch_Saved_secWeapon",["",[""]]];
player addWeapon (_primaryWeapon select 0);
player addWeapon (_secondaryWeapon select 0);
{
player addPrimaryWeaponItem _x;
} forEach (_primaryWeapon select 1);
{
player addPrimaryWeaponItem _x;
} forEach (_primaryWeapon select 2);
player addSecondaryWeaponItem ((_secondaryWeapon select 1) select 0);




// in a respawn eh or wherever you restore the loadout
private _oldGun = player getVariable ["Hamsch_ShotgunClassname", ""];
private _oldammoClassnames = player getVariable ["Hamsch_ShotgunAmmoClass", ""];
private _oldAmmoCount = player getVariable ["Hamsch_ShotgunAmmoCount", 0];
private _oldGunAttachments = player getVariable ["Hamsch_ShotgunAttachments", []];
private _oldSecondaryAmmoClass = player getVariable ["Hamsch_ShotgunSecondaryAmmoClass", ""];
private _oldSecondaryAmmoCount = player getVariable ["Hamsch_ShotgunSecondaryAmmoCount", 0];

player setVariable ["KJW_ShotgunClassname", _oldGun];
player setVariable ["KJW_ShotgunAmmoClass", _oldAmmoClassnames];
player setVariable ["KJW_ShotgunAmmoCount", _oldAmmoCount];
player setVariable ["KJW_ShotgunAttachments", _oldGunAttachments];
player setVariable ["KJW_ShotgunSecondaryAmmoClass", _oldSecondaryAmmoClass];
player setVariable ["KJW_ShotgunSecondaryAmmoCount", _oldSecondaryAmmoCount];

// below handles spawning the shotgun object.
private _shottyObj = createVehicle ["GroundWeaponHolder", [0,0,0]];
private _oldGunWeaponItems = {
  if (_oldGun isNotEqualTo "" && { (getNumber (configFile >> "CfgWeapons" >> (_x select 0) >> "type") == 1) }) exitWith { _x };
  continueWith [];
} forEach _oldGunItems;

_shottyObj addWeaponWithAttachmentsCargoGlobal [_oldGunWeaponItems,1];

private _relPos = [-0.521984,-0.69026,-0.099307];
private _vectorDirAndUp = [[-0.775624,0.621418,0.110659], [-0.630396,-0.771462,-0.086297]];
[_shottyObj, "spine3", _relPos, _vectorDirAndUp] call KJW_fnc_attachToBoneRelative;








//params ["_unit", "_corpse"];
//player setUnitLoadout (getUnitLoadout _corpse);
//params ["_unit", "_corpse"];
//player setUnitLoadout (_corpse getVariable ["Saved_Loadout",[]]);
//player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);
player setUnitFreefallHeight 200;






if !(_corpse isEqualTo objNull) then {
    _nearPlayers = nearestObjects [_corpse, ["OPTRE_UNSC_Marine_Soldier_Unarmed"], 500, true];
    _teammates = _nearPlayers select {alive _x && _x != player};
    player setPosASL (getPosASL (_teammates select 0));
};




deleteVehicle _corpse;```
sullen sigil
#

with the restore bit withthe rest of the getvariables

stray flame
#

roger

#

I added those bits at the end of the parts I pasted from you

sullen sigil
#

the playerkilled bit doesnt matter where it goes but make sure private _oldGunItems = player getVariable ["Hamsch_nuts",[]]; is line after private _oldSecondaryAmmoCount = player getVariable ["KJW_ShotgunSecondaryAmmoCount", 0];

stray flame
#

before

thin heron
#

where is it that i can change the arma logo at the top of the load screen with a different graphic?

stray flame
#


// in a respawn eh or wherever you restore the loadout
private _oldGun = player getVariable ["Hamsch_ShotgunClassname", ""];
private _oldammoClassnames = player getVariable ["Hamsch_ShotgunAmmoClass", ""];
private _oldAmmoCount = player getVariable ["Hamsch_ShotgunAmmoCount", 0];
private _oldGunAttachments = player getVariable ["Hamsch_ShotgunAttachments", []];
private _oldSecondaryAmmoClass = player getVariable ["Hamsch_ShotgunSecondaryAmmoClass", ""];
private _oldSecondaryAmmoCount = player getVariable ["Hamsch_ShotgunSecondaryAmmoCount", 0];

private _oldGunItems = player getVariable ["Hamsch_nuts",[]];

player setVariable ["KJW_ShotgunClassname", _oldGun];
player setVariable ["KJW_ShotgunAmmoClass", _oldAmmoClassnames];
player setVariable ["KJW_ShotgunAmmoCount", _oldAmmoCount];
player setVariable ["KJW_ShotgunAttachments", _oldGunAttachments];
player setVariable ["KJW_ShotgunSecondaryAmmoClass", _oldSecondaryAmmoClass];
player setVariable ["KJW_ShotgunSecondaryAmmoCount", _oldSecondaryAmmoCount];

// below handles spawning the shotgun object.
private _shottyObj = createVehicle ["GroundWeaponHolder", [0,0,0]];
private _oldGunWeaponItems = {
  if (_oldGun isNotEqualTo "" && { (getNumber (configFile >> "CfgWeapons" >> (_x select 0) >> "type") == 1) }) exitWith { _x };
  continueWith [];
} forEach _oldGunItems;

_shottyObj addWeaponWithAttachmentsCargoGlobal [_oldGunWeaponItems,1];


sullen sigil
#

change player getVariable ["Hamsch_nuts",[]]; to player getVariable ["Hamsch_nuts","butt"]; and see if it returns a different error plz

stray flame
#

will do

sullen sigil
#

where is the

private _oldGunItems = weaponsItems player;
player setVariable ["Hamsch_nuts", _oldGunItems];``` bit in your `onPlayerKilled.sqf`
stray flame
#

Sorry I got lazy

sullen sigil
stray flame
#

curius

sullen sigil
#

as private _oldGunItems = player getVariable ["Hamsch_nuts",[]]; is returning the default value

stray flame
#

it spawned that AAF gun next to my respawn location it seems

sullen sigil
#

wonder if weaponItems actually works on dead players ๐Ÿค”

stray flame
#

good question

#

weird. It spawned that gun where I died

sullen sigil
#

yeah thats part of the mod

stray flame
#

eventhough I didnt have it

sullen sigil
#

your second primary is dropped on your corpse; i dont think i actually set that as a variable to delete either, one mo

stray flame
#

well I can confidently say its a new thing

#

at least new as in before this mod

sullen sigil
#

uh, shouldn't be

#

oh its spawning f2000

#

wtf

stray flame
#

What I mean is that it didnt spawn a random gun on my body after I die before

#

having had an operation with this respawn save loadout thing just this weekend it didnt happen then

sullen sigil
#

thats erm
odd

stray flame
#

yeah

sullen sigil
#

it shouldnt be using an f2000 at all the command should be failing thonk

stray flame
#

Its weird

sullen sigil
#

give me 10 and i'll add a cba setting for gun not being removed on death

#

probably the simplest approach tbh

stray flame
#

I see

sullen sigil
#

you also should be able to use call KJW_fnc_shotgunHandler instead of everything below // below handles spawning the shotgun object.

#

try that actually

stray flame
#

okay so

sullen sigil
#

i'll add a cba setting and update the mod that'll stop it clearing the variables upon death right now

#

all you should need is call KJW_fnc_shotgunHandler to spawn the shotgun again on player respawn

stray flame
#

okay so

replace this:

// below handles spawning the shotgun object.
private _shottyObj = createVehicle ["GroundWeaponHolder", [0,0,0]];
private _oldGunWeaponItems = {
  if (_oldGun isNotEqualTo "" && { (getNumber (configFile >> "CfgWeapons" >> (_x select 0) >> "type") == 1) }) exitWith { _x };
  continueWith [];
} forEach _oldGunItems;

_shottyObj addWeaponWithAttachmentsCargoGlobal [_oldGunWeaponItems,1];

private _relPos = [-0.521984,-0.69026,-0.099307];
private _vectorDirAndUp = [[-0.775624,0.621418,0.110659], [-0.630396,-0.771462,-0.086297]];
[_shottyObj, "spine3", _relPos, _vectorDirAndUp] call KJW_fnc_attachToBoneRelative;``` 


With:

call KJW_fnc_shotgunHandler

sullen sigil
#

in fact i'll do it for you

#

give me 10 minutes and i'll get an update out for all this

stray flame
#

Sure thing

#

Honestly im surprised this respawn save configuration thing isnt its own mod tbh

#

Besides having to adjust it for these mods it seems like it would make for a good mod given its worked reliably so far

#

Not that I know much about how stuff works its magic to me

sullen sigil
#

repair the mod and disable the setting then retry; comment out anything related to my mod from those scripts

#

i've got to go now though, dm/tag me here/comment on the ws page with any issues you encounter

boreal parcel
#

How do the save game commands work? (saveGame, loadGame, etc)
What do they save? where? How does it determine what to save?

winter rose
boreal parcel
#

what is a normal videogame save game? mainly asking to see if the commands would be any use for me wanting to dynamically save mid-game placed objects without have to write a script for it.

#

for multiplayer as well

winter rose
#

it would yes
but that only works on player-hosted server iirc

#

unsure about Zeus-editable things and all that

boreal parcel
#

alright gotcha, ill stay away from that then and probably work on saving to something like the profile namespace.

Another question, what would be more performance friendly and effecient?

Global array that has items appended to it whenever they are built, then being saved to the profile namespace every minute
or
Doing a nearEntities scan with a radius of likely 2-300 meters in multiple locations on a map (up to five at a time), then sorting through, modifying and merging the arrays to be saved in the profileNamespace every minute

#

I imagine the former option would be best

#

missionProfileNamespace*

sweet zodiac
#

I have Global Arrays with Multiple Sub Arrays for different sets of Things that store the Object, Position and Rotation and various other details server side

stray flame
#

Am I misunderstanding what CBA settings are?

boreal parcel
stray flame
#

(as in addon settings)

sweet zodiac
#

hashmaps are the way to go I think with my method I just haven't refactored it yet

#

as for Captured vehicles I would make it when they get taken to a blufor FOB or equivalent that it gets added

#

Just a small loop every 30 seconds to check for the vehicle and add it to the list if it isn't already there, but an EH should work fine

#

FSM's function similar to Switch Statements, it looks for the lowest? priority condition that returns true in order

#

I can't remember if the priority starts with the highest or lowest first

boreal parcel
sweet zodiac
#

The goal of an FSM is to only have one condition be met and continue down that path

#

and of course if there are multiple it will pick the highest priority, if you are right about that

stray flame
sweet zodiac
#

Not to my knowledge

stark fjord
#

Only one branch should exec

sweet zodiac
#

Unless someone else can shed light on it but in my minimal experience so far It only does the one unless you make it loop around back to the statement

#

But then it would just execute the same condition again in that case

stark fjord
#

But multiple compares can run at once

#

Ye

sweet zodiac
#

Yeah I used a random Number as part of an AI I did with an FSM so it looked for the Number and another Condition along with it to decide things, I also gave it a short delay after each thing to simulate it thinking, I have posted it before #arma3_scripting message

stark fjord
#

Does it say "Hmmm" and show buffering icon above it?

sweet zodiac
#

Hahahah, I should have done that, it would have been funny

sullen sigil
#

Cba settings

sweet zodiac
#

Are a thing

#

I had an idea to make an FSM for Agents to make them play a similar role to AI, It wouldn't be great but I wonder if it would let me have dumber but more Numerous AI

granite sky
#

Only if Arma AI are horribly suboptimal :P

graceful stag
#

Squawk Codes for Arma 3

sweet zodiac
#

I am just curious of the performance differences, either way it's a good learning experience for making AI

#

Since I will need a couple for Commander Level Stuff

boreal parcel
#

is it faster to (crew _veh) apply { _x disableAI "ALL"; etc; }; or should I just forEach it?

granite sky
#

fractionally faster.

granite sky
#

hmm, I prefer apply for readability.

winter rose
#

array <command> code, I can get that

#

we could ask Dedmen or KK for an array forEach code version ๐Ÿ‘€

granite sky
#

oh, maybe apply doesn't work out faster if you're not using the output array.

#

They're both kinda suboptimal like that. apply makes an array, forEach generates forEachIndex.

boreal parcel
#

lol, ill use apply. I want to squeeze any ounce of performance I can. oh btw the apply is inside a for loop if that makes it worse

#

hmm actually another question, im using BIS_fnc_spawnVehicle to create my vehicles/crew, is this optimal or is createVehicle/createUnit a faster way to go?

#

I would imagine the spawnVehicle function does things faster and more efficiently than I could, creating and assigning the crew etc

granite sky
#

You can read the code.

#

(you should read the code)

#

Generally it's not a performance question, because the cost of the SQF is tiny compared to the cost of creating vehicles and units.

#

The other potentially-slow part is finding a suitable place to spawn them.

#

A misused BIS_fnc_findSafePos can be brutally slow, for example.

sweet zodiac
#

Isn't there a command to fill a vehicles crew?

granite sky
#

createVehicleCrew, yeah

boreal parcel
#

there is, and from reading the code BIS_fnc_spawnVehicle makes use of it

#

looks like the function honestly does anything I would know to do

sweet zodiac
#

a lot of functions are like that, the marker ones for example

boreal parcel
#

I guess the best improvement I can probably do for spawning vehicles is make the function spawn on exact cords. Just need to try and determine if the position is safe beforehand

#

if its worth it

sweet zodiac
#

CreateVehicle has that no? the last param string

granite sky
#

"CAN_COLLIDE", yes.

sweet zodiac
#

You would NONE i believe iirc

granite sky
#

NONE does a nearest position search.

#

It's quite dangerous :P

sweet zodiac
#

It just checks of the model could fit there from the wiki

#

Would that be slower than a manual check though?

granite sky
#

Not sure about slower, but it's not super-reliable.

boreal parcel
#

oh you know what, I was assuming BIS_fnc_spawnVehicle had a param for exact position. Looks like it doesnt?

#

the wiki doesnt mention anything about it, but it does make use of a _precidePosition variable, but it gets the value for this from the sideOrGroup param?

_precisePosition = _this param [4,true,[true]];
#

if im reading correctly

sweet zodiac
#

Well its a bool by the looks not a position

boreal parcel
#

oh wait, its actually a fifth param that the wiki doesnt mention

#

hmm

#

yeah, the code says:

    Parameter(s):
    _this select 0: desired position (Array).
    _this select 1: desired azimuth (Number).
    _this select 2: type of the vehicle (String).
    _this select 3: side or existing group (Side or Group).
    _this select 4: (optional) force precise position (Bool, default: true).

#

wiki doesnt mention it though, interesting

winter rose
#

indeed

sweet zodiac
#

Does createVehicle have a radius it can use? if so its likely a bool that controls if it uses 0 for the radius or not maybe?

#

Not at the pc so I cant look myself

boreal parcel
#

only use of the bool I can see so far is after vehicle creation:

if (_precisePosition) then
{
    _veh setPos _pos;
};
sweet zodiac
#

That is always true since the param defaults to true

boreal parcel
#

looks like it has a placement radius

boreal parcel
#

why use setPos after

sweet zodiac
#

Maybe the createVehicle is unreliable in positioning like John suggested about the Last Param on it

boreal parcel
#

hmm I guess so, it does use "none" when creating vehicles

sweet zodiac
#

So its a sort of backup that always makes sure that it actually gets placed there in the event that createVehicle places it in a wonky position

boreal parcel
#

im gonna change it to false and see what happens

sweet zodiac
#

If you are confident that its spawn position is clear then you could use CAN_COLLIDE and skip the position check all together

#

just like John said earlier

boreal parcel
#

im gonna do some tests for speed and see if I can do the position checks and placement any better than the function then, yeah

granite sky
#

Bear in mind that completely safe placement is hard

#

Arma just lacks good functionality for it.

sweet zodiac
#

I cant even think of a good way to test it

#

maybe a trigger and check if anything is in its area, but that's not great either

#

or maybe it would be?

#

oh well that's for tomorrow me to find out

granite sky
#

trigger is just a point area check. Like doing _a distance2d _b < _radius

boreal parcel
#

tried using the watch lines in the debug console, did not do it correctly I guess.

#

I remember seeing someone do it, how do you run the script in the debug console where it tells you how long it took to finish running?

granite sky
#

diag_codePerformance usually, but that's not appropriate for anything that creates objects.

#

So diag_tickTime before/after comparison.

boreal parcel
#

yeah im seeing that lol. I seen the speedometer button in the debug console and got this
Result:
0.0078 ms

Cycles:
1/10000

Code:
[trigger_military_1, "military_1"] spawn TRA_fnc_spawnMilitary

#

I assume thats not accurate since im spawning the creation of vehicles/infantry though right

granite sky
#

Yeah, that's only checking how long it takes to run a spawn.

#

And then hopefully throwing the spawn away :P

#
private _startTime = diag_tickTime;
// your code here
diag_log format ["Time elapsed: %1", diag_tickTime - _startTime];
#

Might not be very consistent. Like first run might be far slower than subsequent runs for the same object types.

#

probably wanna multiply by 1000 for milliseconds.

boreal parcel
#

got about 2.7 seconds
"Time elapsed: 2.77393"

#

would you consider that good or bad lol

granite sky
#

how much stuff are you spawning here...

boreal parcel
#

well im spawning what I expect to be the minimum, about 19 infantry + 2-3 vehicles

granite sky
#

Any sleeps/waitUntil in there?

boreal parcel
#

going for a max of about 30 or more infantry in the future

#

yes, 3, each in a for loop similar to this

for "_i" from 1 to _patrollingInf do {
    _group = createGroup TRA_enemySide;
    _squadPos = (getMarkerPos _marker) getPos [random _captureRadius / 2, random 360];

    [_unitObjs, _group, _unitArr, _squadPos, _captureRadius] spawn {
        params ["_unitObjs", "_group", "_unitArr", "_squadPos", "_captureRadius"];
        for "_j" from 1 to 5 do {
            _unit = _group createUnit [selectRandom _unitArr, _squadPos, [], 0, "FORM"];
            _unit enableSimulationGlobal false;
            _unit allowDamage false;
            _unit hideObjectGlobal true;
            _unit disableAI"ALL";
            _unit setBehaviour"CARELESS";
            _unit setSpeaker"NoVoice";
            _unit disableConversation true;
            _unit enableMimics false;
            _unit enableStamina false;
            _unitObjs pushback (_unit);
            sleep (((abs(50 - diag_fps) / (50 - 20))^2) * 2);
        };
        [_group, _squadPos, _captureRadius / 2] call lambs_wp_fnc_taskPatrol;
    };
};
granite sky
#

If you're testing perf then comment out the sleeps...

boreal parcel
#

I didnt think about that

#

yeah will do now

granite sky
#

wait, it's spawning these 5-man groups in parallel though?

#

It's sleeping per unit but only within the inner spawn?

#

(why is there an inner spawn?)

boreal parcel
#

without the sleep's its about 0.7 seconds
"Time elapsed: 0.737793"

boreal parcel
granite sky
#

Again it won't measure the performance cost of the inner spawn.

#

I'm not entirely sure what it's doing for 0.7 seconds there though :P

boreal parcel
boreal parcel
#

it was only curiosity

jade acorn
#

can I somehow get rid of certain road types from a map with a script? Wanted to replace or completely hide some asphalt road types. nearRoads returns segments of all roads near the center and that's about it

boreal parcel
# granite sky Again it won't measure the performance cost of the inner spawn.

measured the spawns now as well, looks like my original 2.7 seconds was coincidentally close, unsurprisingly loop one does finish well after the other loops.

13:22:26 "Time elapsed: 0.595215"
13:22:27 "Time elapsed Loop two: 2.21826"
13:22:27 "Time elapsed Loop two: 2.22119"
13:22:27 "Time elapsed loop three: 2.45703"
13:22:27 "Time elapsed Loop two: 2.479"
13:22:28 "Time elapsed loop three: 2.68408"
13:22:28 "Time elapsed Loop one: 2.72412"
13:22:28 "Time elapsed Loop one: 2.7251"
#

I know im reiterating my question here, but spawning 19 + 2 vehicles with like 2-3 crew each, is this bad? good? or about average? idk

granite sky
#

Never actually tested it. Marked down as "expensive but unavoidable".

#

If you're creating vehicles unnecessarily then definitely don't do that :P

#

IIRC even something like addWeapon is painfully slow.

boreal parcel
#

gotcha, yeah may end up settling with the fps dip is unavoidable as well. I do think I have minimized how noticeable it is though.

granite sky
#

Your parallel spawns are probably not ideal there :P

boreal parcel
#

very true, ill see what I can come up with there as well

sullen sigil
mighty halo
#

Anyone know a script to prevent AI from moving without disabling pathing?

#

Like once in battle then they will move

mighty halo
#

Iโ€™m not sure how well it works with it being combined with other orders though.

fair drum
#

doStop but that will make your units stupid and not communicate with each other

#

so you'll have to doFollow after which then you might as well just do pathing

mighty halo
#

Thatโ€™s probably the best thing I can do right now

#

I canโ€™t have the ai stupid in urban combat

granite sky
#

If they don't have a waypoint then they won't move if out of combat.

#

At least that's the vanilla behaviour. They just stand there.

fair drum
#

that's if he doesn't care about them always going back to formation

mighty halo
fair drum
#

well between all of us you have 3 ways now you can experiment with to figure out what you like the best

mighty halo
boreal parcel
#

is my second condition on the trigger wrong?
the first time the trigger is activated it has the marker_name_active variable created and assigned to the trigger as false if it doesnt already exist, then in the script called on activation the trigger is passed in and setVariable is used to assign the variable as true.

Even though the variable is true after the first activation, when a player re-enters the trigger it still activates once again.

format["this && (thisTrigger getVariable ['%1%2', false] isEqualTo false) && (TRA_zonesActive < TRA_maxZonesActive) && (TRA_activeAi < TRA_maxAiActive)", str _x, '_active'],

-- figured it out, I was doing str _x when _x is already a string

stray flame
#

if its on, the F2000 will spawn like before

#

if its off, a floating gun will be left where my body was that I cant touch

versed belfry
#

Question once again :D

Is there a command or script I can use to get the ID of a layer in the editor?

versed belfry
manic sigil
#

Huh... yeah, not seeing a Getter.

sullen sigil
versed belfry
stray flame
sullen sigil
fresh wing
#

guys is normal praetorian kill in shipยดs too?

warm hedge
#

Excuse me?

fresh wing
#

i add praetorian c1 "b_aaa_system_01_f"

#

for destrou hellis in one zone

#

but is destroy boatยดs or ships too

warm hedge
#

Normal

fresh wing
#

it's possibel make for destroy air vehicles?

#

like isKindOf "Air";

#

i dont know because praetorian not have condition in editor

#

only have box txt init

warm hedge
#

I don't think there is a good and straightforward way to make it shoot only air targets

fresh wing
#

๐Ÿ˜ฅ

manic sigil
#

Could you do a repeating check, if !(_target iskindof "air"), dotarget ""?

drifting sky
#

Is it possible to script deleting of vehicle tire marks on the ground? They seem to sometimes get stuck and not ever garbage collected. Also, is there a way to delete destroyed vegetation?

sudden yacht
#

How can i open arsenal... FOR NOT ME... BUT... For a different NPC from a specific box? Is that possible?

warm hedge
#
["Open",[true,box,unit]] call BIS_fnc_arsenal```
sudden yacht
#

ty

sudden yacht
#

Can i force a sector to become uncaptured?

#

If so how?

unique pewter
#

Does anybody knows if there is any script that makes ai throw flares on trigger?

boreal parcel
#

I want to get when the up, down, left, and right arrows are pressed on the keyboard but this is kind of confusing me. What code should I be looking for?
200, 203, 205, 208 I assume but what are the lower in the list up/down/left/right arrows?

boreal parcel
#

mmm, I have played myself it seems. tried setting an event handler/switch case for 203/205 and now no key other than the left and right key does anything. Neato, its way too late for this, im going to bed

little raptor
little raptor
#

Look closely. The lower ones use the same macro. They're just aliases

little raptor
#

If you always return true you can't do anything anymore

proven charm
#

wiki says disableCollisionWith has global effect

unique pewter
little raptor
#

it does

#

what does that mean?

warm swallow
#

Is there any way to get the relative position of a listbox element? I'm trying to tie listbox entries to another control that cannot be represented as a string.

#

is that possible?

little raptor
#

so you mean the local player still collides with whatever _asset is?

little raptor
warm swallow
#

how would I calculate a ctrlPosition from index though?

little raptor
#

?

warm swallow
#

Would I just have to do the listbox's step * index?

little raptor
#

ctrlPosition?

warm swallow
#

yes

#

im trying to do ctrlPosition but with index. But the individual lb elements are not a control so it doesnt work for that.

little raptor
#

well it's not simple. as you said the relative Y is index * height but there's also the scrollbar to take into account

#

where do you run this?

warm swallow
#

that is true. The first you stated could work if there was no scrollbar, but yea it wouldn't be dynamic.

#

So is there no way to retrieve its position?

little raptor
#

there is

proven charm
#

what are you trying to do Happy?

warm swallow
#

Tie a control's position to an element of a listbox

little raptor
#

what kind of ctrl tho?

proven charm
#

ic

warm swallow
#

a combo box.

warm hedge
#

You've said a listbox then is a combo box, which exactly it is?

little raptor
#

he wants to show a combo box next to a listbox item

warm swallow
#

no sorry, both.

A listbox is the main element right. The combo box is tied to the position of a listbox's index

warm hedge
#

Hmm

#

Since I don't exactly know what it is, but you'll need

  • the row height
  • ctrlScrollValues
  • lbSize
warm swallow
little raptor
#

well you can do this:

  1. abs Y (but relative to listbox) is index * itemheight
  2. check scroll bar via its command (don't remember its name) => ctrlScrollValues as polpox said
  3. if scroll bar percent is > 0:
    3.1 total height is count * itemheight
    3.2 Y of center of view is (h_total - h/2) * scroll + h/2 (h is listbox height)
    3.3. if you subtract it from the abs Y you get its current rel Y, (relative to the center of listbox ofc)

then you just add it to listbox pos

warm swallow
#

thank you! I'll see what I can come up with an report back.

This would need to run in a loop right?

warm hedge
#

Depends how you want to run

warm swallow
#

if there is a scrollbar then yea

#

might as well

little raptor
warm swallow
#

ctrlAttachTo lol

warm swallow
little raptor
#

you need 2 EHs. one for scroll bar one for index changing

warm hedge
#

Yeah I do no think there is a scroll related thing

#

Only mouse Z

little raptor
#

pretty sure we did think_turtle

warm swallow
#

would the default spacing of elements just be the size?

little raptor
#

size?

#

there's an itemHeight entry in config

#

or something like that

#

don't remember

warm swallow
#

yea

little raptor
#

CT_LISTBOX#rowHeight

#

I think you also need to add it to itemspacing

#

well it's obviously how it's supposed to work. just run it on all players individually

#

collision is checked locally

warm swallow
#

@little raptor @warm hedge I love you it worked.

But I only have it working for static LB right now.
That's fine though, I will update if I need more space for stuff.

THANK YOU SO MUCH

little raptor
# unique pewter Real ai already placed

well just find which weapon and flare round it can use. then use the forceWeaponFire command.
you can also add a FiredMan event handler to adjust the projectile's velocity to go exactly where you want

warm swallow
#
_lbIndex = _statMenu lbAdd "COMBO BOX HERE:";
_ctrlHeightNew = (_lbIndex * 0.04 * safezoneH);
_ctrlHeight = ((ctrlPosition _lb) # 1) + _ctrlHeightNew;

_combo ctrlSetPositionY _ctrlHeight;

This is the code that worked for me

little raptor
#

didn't test but it should work meowsweats

warm swallow
#

so I'd just spawn a loop with that?

warm swallow
little raptor
#

well you should also check if the item is in view:
abs(_relY) < _h / 2

warm swallow
#

grr

fresh wing
restive hinge
#
_cfgPath = configFile >> "CfgWorlds" >> worldName >> "Names";
_cfgClasses = [];
{
    _class = configName (_x);
    if (_cfgPath >> _class >> "type" == "CityCenter") then {
        _cfgClasses pushBack _class;
    };
} forEach ("true" configClasses _cfgPath);

How would I correctly compare the entry of type? This throws me an error at == operator...

hallow mortar
#

What error specifically?

restive hinge
hallow mortar
#

I'm pretty sure you need getText to retrieve the content of a config property, you can't just plug in the config itself in this context

restive hinge
#

Roger that

#

Worked, thank you!

little raptor
frozen seal
#

I've got a big problem with respawns in multiplayer (this is my first MP mission so maybe I'm missing something)

What I have:

  • Two respawn position modules called respawn_guerrila and respawn_west
  • Two empty markers called respawn_guerrila and respawn_west
  • Multiplayer respawn settings set to "Custom position"

What I expect to happen: INDFOR and BLUFOR players respawn on corresponding spawn points

What actually happens:

  • INDFOR and BLUFOR players respawn on corresponding spawn points in local multiplayer (in other words it works good)
  • INDFOR and BLUFOR players respawn on their dead bodies on dedicated server (in other words it's broken)

The only workaround we found is for the Zeus to place "Blufor respawn" and "Indfor respawn" modules after the game has started. The freshly spawned modules do not work either, however this somehow fixes the initial "respawn position" modules.

I'm really lost here and the fact it only happens on dedicated server makes it nightmarish to debug.

stark fjord
#

if you have modules, you dont need markers, afaik they serve the same thing

frozen seal
stark fjord
#

also whats your respawn delay?

frozen seal
#

10 seconds

stark fjord
#

actually, module dont seem to work, use marker instead

#

they work with respawn menu tho

frozen seal
#

When running the local multiplayer, I can see the respawn marker on the map. But on dedicated server it is absent

stark fjord
#

Oh?

#

howd you manage that one?

frozen seal
frozen seal
frozen seal
stark fjord
#

amm you ever played APEX protocol?

#

or public zeus?

frozen seal
#

ah it's when you get to choose the spawn point I guess

stark fjord
#

ye

frozen seal
#

I don't see this menu in my mission

twin oar
frozen seal
stark fjord
#

for me its the other way around xD

#

works with map markers but doesnt with modules

twin oar
#

Couldnโ€™t you just Sync the marker to the module?

#

So when you move it

#

It moves

stark fjord
#

Anyways, we use MenuPosition and works well with zeus, if you decide to use it, create file description.ext in your mission, plop this in: and use respawn modules

respawnDelay = 10;
respawnTemplates[] = {"MenuPosition"};```
#

10 here is respawn delay

frozen seal
frozen seal
stark fjord
#

i did run a mission without menu position and i remember having no issues, but tbf i never moved it, or had to move respawn point

#

could be an issue if you want to move it later, as you cant simply move markers with zeus

frozen seal
#

well for us the respawn point was not working even without moving, we all just spawned on our dead bodies

#

I'll see if respawn menu works

stark fjord
#

just a warning respawn delay must not be 0, or it wont work

frozen seal
#

Yeah I'm planning to keep it at 10 to let the playerbase reflect on their choices ๐Ÿ˜„

frozen seal
# stark fjord Anyways, we use MenuPosition and works well with zeus, if you decide to use it, ...

I ran some tests in local multiplayer and it seems like there is a problem.

I've made custom loadouts for my players and I have this code in onPlayerRespawn.sqf. This makes sure that the players always respawn with the same loadout that they had at the beginning of the mission.

_loadout = player getVariable "Saved_Loadout";

if (isNil "_loadout") then { 
    player setVariable["Saved_Loadout", getUnitLoadout player] 
};

player setUnitLoadout(player getVariable["Saved_Loadout",[]]);

The problem is, after adding MenuPosition the players now respawn with the default loadout of the units they're playing as.

stark fjord
#

You need to set respawn on start

frozen seal
#

nevermind, it actually does not even give them the loadout at the start

#

the first time they spawn they have the default loadout o_0

stark fjord
#

respawnOnStart=1; add that to des.ext see if it helps

frozen seal
stark fjord
#

Hmm i thunk that was default... oh well. As long as it works!

frozen seal
#

Now the scariest part, uploading to the dedicated server and testing ๐Ÿ’€ brb

stark fjord
#

Dont be afraid of ds, its only a machine, it cant hurt you

frozen seal
#

Ok so this thing worked for dedicated, thanks!

stark fjord
#

Awesome

frozen seal
#

A new problem emerged after introducing the new respawn system.
Here is a respawn point.
Before the new system the players respawned in the hallways, but now they spawn on top.

I suspect the game is confused thinking that the respawn position is obstructed

south swan
#

of just shoots itself in the foot with using PositionAGLS

frozen seal
#

fixed by putting this into onPlayerRespawn

_pos = getPosATL player;
_pos = [_pos select 0, _pos select 1, 0];
player setPosATL _pos;
low zodiac
#

Hey,
Is there way to play sound/music inside of the strategic map while calling BIS_fnc_strategicMapOpen to open the strategic Map Module?
I've tried to just start the music when BIS_fnc_strategicMapOpen happens, but BIS_fnc_strategicMapOpen mutes everything.

stark fjord
#

hmm perhaps set simulation parameter to true, it might work. but ive never dealt with strategic map

low zodiac
#

I am not using it like that though - I use the module and then call it via script with [openStrategicMap] call BIS_fnc_moduleStrategicMapOpen;
So I would need to re-activate it otherwise to test that (which I will do try in a couple of minutes) and if that doesn't work I think I will switch to not the module version.

#

Should not be a problem of simulation as far as I can tell - will test more. nvm it is the problem.
Have changed it, thanks for helping!

low zodiac
#

Now I just need to figure out how to stop the music when it closes and how to play a map close sound. (trying to do it with playMusic and playSound) Any ideas?

stark fjord
#

playMusic "" will stop it

low zodiac
#

I know, though I will need to stop after a player closes the strat map, which I haven't figured out. Edit: Found something in the functions viewer, now gonna try with isnull _display

restive hinge
#

I'm trying to call ace functions from my function but it seems I pass the variables the wrong way?

// Object Init
[this, player] execVM "fn_arsenalWEST.sqf";
// fn_arsenalWEST.sqf
params ["_arsenal", "_unit"];
_arsenal = _this select 0;
_unit = _this select 1;
 
_openStorage = [
  //  Action name
  "OpenStorage",
  // Name of the action shown in the menu
  "Storage",
  // Icon
  "\a3\ui_f\data\igui\cfg\simpletasks\types\box_ca.paa",
  // Statement 
  { 
    // hint won't execute...
    hint "Hello World!";
  },
  // Condition 
  { 
    side _unit == west 
  },
  // Children code
  {},
  // Action parameters
  [_unit],
  // Position 
  [0,0,0],
  // Distance 
  100
] call ace_interact_menu_fnc_createAction; 

// This gets executed!
[
  // Object the action should be assigned to
  _arsenal,
  // Type of action, 0 for actions, 1 for self-actions
  0,
  // Parent path of the new action
  ["ACE_MainActions"],
  // Action
  _openStorage
] call ace_interact_menu_fnc_addActionToObject;

How would I call the variables correctly if it's the case?

#

I tried to describe the case as simple as I could...

#

The addActionToObject function executes.

little raptor
#

or _this#0 or whatever

restive hinge
little raptor
#

params ["_arsenal", "_unit"];
_arsenal = _this select 0;
_unit = _this select 1;
and this is not needed

#

params automatically does that for you

restive hinge
#

How do I address the arsenal object then?

little raptor
#

well idk what ACE passes to its codes

#

show me the docs

restive hinge
little raptor
#

looks like it passes these:
params ["_target", "_player", "_params"];

#

so unit is _params params ["_unit"]

little raptor
# restive hinge Where? At the top of my function?
// Statement 
  {
    params ["_arsenal", "_player", "_params"];
    _params params ["_unit"];
    // hint won't execute...
    hint "Hello World!";
  },
  // Condition 
  {
    params ["_arsenal", "_player", "_params"];
    _params params ["_unit"];
    side _unit == west 
  },
#

or just chain it : private _unit = _this#2#0

low zodiac
little raptor
#

Both work if its true
what is true?

#

make it check that the strat map has closed instead of it checking if it is open
reverse the condition using !...

low zodiac
#

I had something with waitUntil, which checked everytime when it was open and that worked - but also wasn't able to destroy the loop after one completion.

little raptor
#

what was your code?

low zodiac
#

waitUntil { sleep 1; if (isnull _display) exitWith { true }; playSound "MapOFF"; false};
should be this one, though I already have removed it - this is just out of my memory (which I put in a diffrent .sqf)

little raptor
#

well it's not correct

#

if display is null then it's closed

#
waitUntil {!isNull findDisplay 506};
playSound "MapOn";
waitUntil {isNull findDisplay 506};
playSound "MapOff";
#

you can also use an event handler to check if it's closed

low zodiac
#

works! Thank you!

analog inlet
sharp grotto
analog inlet
#

it triggers it properly but my health isnt going down and after about 10 seconds i just die

warm swallow
#

How can I get procedural textures to align more closely with their true RGB values?

In most cases, the value I set becomes lighter (sun maybe?). If I try to decrease RGB through texture, it becomes black inadvertently.

_BG setObjectTexture [0, "#(rgb,8,8,3)color(0.1,0.1,0.1,1)"]; 
little raptor
#

use a different material

warm swallow
#

Like a different class, or use the material propert

#

y

little raptor
#

? I mean setObjectMaterial

warm swallow
#

Do you know what would be a good material? I don't see a predefined list

little raptor
#

dunno. try removing the material first

#

if it's not good enough you can just make your own material

warm swallow
#

the material i'm trying to apply the texture to is the blank screen asset

little raptor
analog inlet
whole monolith
#

hey, how do i give "splendid camera" perms to other players in my server?

#

i am noob at at scripting

manic sigil
winter rose
#

what is this capitalisation

#

and indentation

#

kill me now

#

does alive take a group now?

#

AMMA INVOICE YOU MY CODE REVIEW AT THIS (I)RATE

manic sigil
#

Hey, if the only issue besides 'alive group doesnt make sense and you could have looked into that to double check first' is that I typed this up on a cellphone keyboard during a very boring 12 hour shift where indents are a nightmare and capitalization at the whims of the predictive text, ill take it. Thank you!

winter rose
#

I haven't checked it all, but the alive thing was the most in my face one

#

and the lack of private, of course

#

I would not recommend the "spawn one per group" thing, too

manic sigil
#

Thats true, the scenario its going in could have a significant number of groups appearing, and I did plan ahead by assigning the markers as variables to the groups themselves. Workable problems, I think.

winter rose
manic sigil
#

Yeah; this bit will have to be on its own timer, which should free up some of the Spawn stacking. At the moment its configured for a on-call use to test when I actually can sit down and test.

analog inlet
south swan
#

because you only set _damage in the start and never update it in the loop?

winter rose
#

โ†‘

analog inlet
#

ahhh, thank you so much

south swan
#

also, are you sure player having any one piece of CBRN gear should be enough for them to not take damage?

analog inlet
#

they require all 3

#

ah i sent the old code

#

in my current one its if !((_uniform isEqualTo "U_C_CBRN_Suit_01_White_F") && (_backpack isEqualTo "B_SCBA_01_F") && (_goggles isEqualTo "G_RegulatorMask_F")) then {

south swan
#

new exploit: dress up, enter hotzone, drop CBRN gear, still get no damage ๐Ÿ™ƒ

manic sigil
winter rose
#

private _group = _x; is missing from my code, too
but anyway
good luck with your code ๐Ÿ‘

#

oh wow and SHININGRAID_fnc_ReconGroups append SHININGRAID_fnc_ReconGroups; โ†’ SHININGRAID_fnc_ReconGroups append _groupsToAdd;

manic sigil
# winter rose _tbh I felt you might have taken my fake rudeness as potentially a bit real so g...

You did come on a little strong, not gonna lie, but we're all good ๐Ÿ™‚ ive been around long enough to know you dont respond that harshly unless its a bit... but also long enough to know that 'heres my untested code' is just a shade better than '... that I got from an AI'.

And hey, if it gives me a chance to see how The Prosยฉ๏ธ would handle the same thing Im working on, its worth a little sass.

winter rose
frozen seal
#

Either way, making sure the players first spawn happens into a unit and not into a spawnpoint fixed the problem, still appreciate the help though

winter rose
#

if the same condition is used for more states, the condition and action code will be compiled to more different places in the compilation result. But only one of them can be used during decompilation! So, one cannot freely change the compilation result in text editor (decompilation can indeterministically copy such changes to all places or ignore it at all).

twin oar
#

What do I used to let people make groups in a server?

twin oar
#

Thank you!

#

Lou do you know of anyway to make WL Aircraft Arrival work with dynamic airports, like the USS freedom

hallow mortar
#

(or if you use in to check against an array of possible classnames, use toLower to force everything to be the same case regardless of input case)

drifting sky
twin oar
#

Much appreciated!

winter rose
#

you're welcome!
I don't say it is impossible, but I don't know WL - and my guess would be that WL arrived after dynamic aircrafts iirc, so it might be tricky to override that behaviour

spice vapor
#
[_x, _ctrlTV, _itemHashMap, _selectHashMap, _AttachTypes] spawn {
    params["_x", "_ctrlTV", "_itemHashMap", "_selectHashMap", "_AttachTypes"];
    private _typeIndex = _AttachTypes find "secondaryMags";
    (_itemHashMap get toLower(_x)) params ["_displayName", "_picture", "_addonClass", "_addonIcon", "_category", "_specificType", "_descriptionShort", "_class"];

    if (isNil "_displayName" || isNil "_class") then {
      (false)
    };

    format["name: %1 class: %2", _displayName, _class] call BIS_fnc_3DENNotification;
    [_ctrlTV, _typeIndex, _displayName, _class, _descriptionShort, _addonIcon, _selectHashMap] call _fnc_initTVItem;
    (true)
  };

I've got this spawned function that I'm trying to run asynchronously and _displayName keeps giving me undefined variable even though I'm testing it

I'm pretty sure it's the way I'm trying to kill the spawned, do I just return a value? or is there a break function to kill a spawn?

twin oar
#

setMarkerShape โ€œECLIPSEโ€;

#

Having an issue with this

#

keeps saying missing ;

warm hedge
#

Context of the script?

twin oar
#

trying to change the WL sector module from being square to round

warm hedge
#

Well, one thing I notice alongside you don't have the marker name, you're using wrong quotation

twin oar
#

How do I find the marker name?

warm hedge
#

I don't know, I'm not familiar with WL scripts

twin oar
#

I looked at the SQF and couldn't really figure it out

low zodiac
#

Hey,
wanted to ask something again regarding BIS_fnc_strategicMapOpen. Is there a way to remove a mission from the Strat Map after it has been selected and also to reappear if a mission was finished. Currently looking on having more than 3 missions in the Strat Map.
This is my BIS_fnc_strategicMapOpen thingy:

    findDisplay 46,
    [11685.615,15898.968,0],
    [
        [
            [12816.17,16668.49,0],
            {trgconOBJ01 = true},                                         
            "Scavange a battlefield.",
            "A heavy clash between the FIA and AAF happend in this area. According to rumors some weaponory has been left behind. Somebody should look into it...",
            "Kosta",                                                    
            "",
            1.5,
            [ player ]
    ],
        [
            [10959.119,17249.828,0],
            {},
            "Scout area around...",
            "We have reports of AAF partrols in this area.",
            "Kosta",
            "",                                                            
            1.5,
            [ player ]
        ]
    ],
        [
            [0,0,0],
            {},
            "Mission 3",
            "Mission 3",
            "Kosta",
            "",                                                            
            1.5,
            [ player ]
        ]
    ],
    [
        [
            [14864.262,16588.461,0],
            configFile >> "CfgORBAT" >> "BIS" >> "B_1_A_1_2",
            configFile >> "CfgORBAT" >> "BIS" >> "B_1",
            [],
            10
        ]
    ],
    [
        "marker_1",
        "marker_2"
    ],
    [
        [
            "\A3\Ui_f\data\Logos\arma3_white_ca.paa",
            [0,0,0,1],
            [12462.769,17745.64,0],
            8,
            8,
            0,
            "Mission Logo",
            true
        ]
    ],
    0,
    false,
    1,
    true,
    "Current missions",
    false,
    "\A3\Ui_f\data\Map\GroupIcons\badge_rotate_%1_gs.paa"
] call BIS_fnc_strategicMapOpen;```
Thanks in advance
twin oar
#

How do I know if the groups feature worked

boreal parcel
#

can anyone tell me what these messages mean? They have been getting spammed in my servers RPT the last few weeks, started around the same time we began noticing drastic performance drops/server freezing.

23:20:22 Server: Object 2:1381 not found (message Type_117)
23:20:23 Server: Object 2:3094 not found (message Type_124)
23:20:23 Server: Object 2:3093 not found (message Type_124)
23:20:25 Server: Object 2:1374 not found (message Type_118)
23:20:29 Server: Object 2:1381 not found (message Type_118)
23:20:29 Server: Object 2:1780 not found (message Type_96)
23:20:30 Server: Object 2:1374 not found (message Type_117)

Many more where this came from

stark fjord
#

Hmm, i think it means that object wasnt found...

little raptor
#

probably a client is asking the server to update it or something?

#

you should probably show the logs to Dedmen

pulsar bluff
#

just put this in your server.cfg

#
{
    LogObjectNotFound = true;            // logging enabled
    SkipDescriptionParsing = false;        // parse description.ext
    ignoreMissionLoadErrors = false;    // do not ingore errors
    queueSizeLogG = 1000000;            // if a specific players message queue
                                        // is larger than 1MB and #monitor is running,
                                        // dump his messages to a logfile for analysis
};```
#

change to LogObjectNotFound = false;

stark fjord
#

If error isnt logged, its not an error xD

hexed forge
#

If there a (mostly) painless way to search and replace a specific piece of gear on all units on the map?
Specifically looking to replace GL rigs with special rigs due to some nonsense with ace medical going on

#

I imagine it can be done, but would this tank performance if it's constantly running and searching?

manic kettle
#

I assume this is on ai
I think best practice if you know the classnames of the units would be to use a CBA init event handler.
A vanilla option that applies this to all ai would be an entity created event handler. This will run code on every spawned entity. Then you check if they have the rig on, remove it, and add the new one.

manic kettle
hexed forge
#

Ideally the script would be used in multiple different missons/scenarios not made by me, just hosted on my server for buddies

#

so I don't have access to the unit classnames in this case

#

and the units might not be spawned when I initially run the script

manic kettle
#

Then just a entitycreated handler will do the trick

hexed forge
#

Roger that, thanks for the help! I'll read up on it.

pulsar bluff
#

the entitycreated event is not necessarily appropriate .. have you seen how often it executes?

#

each time a footprint or butterfly or bit of dust/pollen is created, etc..

restive hinge
#

I asked yesterday about adding an ace action and passing variables to a function, and Leopard20 told me to use this construction:
#arma3_scripting message
But since then I had no success in understanding this and making it work.
I tried a different approach and make separate actions, thinking it might be an issue...
But the actions aren't event inited.
If anyone could check the code, I'd appreciate it: https://sqfbin.com/aqotoxeqokiletowesig

ashen ridge
#

I created some smoke and want to change the draw distance of it.

#

Some player use high view distance and the smoke just draw when they zoom on it.

#

I want ot make it more consistent. Can i do that via particles setParam?

lavish stream
restive hinge
lavish stream
tough abyss
#

to find a log of zeus entities performed/ entities placed would one check the server rpt?

lavish stream
hallow mortar
restive hinge
lavish stream
# restive hinge God, that worked... I mean the actions inited, but they don't do nothing. But pr...

One final thing, what you're doing to combine your arrays is a terrible idea. Use pushBack.

replace this:
_arsenalArray = _uniformsArray + _backpackArray + _headgearArray + _faceGearArray + _vestsArray + _weaponsArray + _launchersArray + _attachmentsArray + _weaponmagazines + _aceitems + _grenadesitems + _radioItem;

with this:

private _arsenalArray = [];
{
    _arsenalArray pushBack _x; 
} forEach [_uniformsArray, _backpackArray, _headgearArray, _faceGearArray, _vestsArray, _weaponsArray, _launchersArray, _attachmentsArray, _weaponmagazines, _aceitems, _grenadesitems, _radioItem];
#

oh and lines 13-24, private your variables like in the example I gave you.

#

One last question, why addVirtualItems instead of initBox?

restive hinge
#

But I want it to be a limited one

lavish stream
#

[_box, ["MyItem1", "MyItem2", "MyItemN"]] call ace_arsenal_fnc_initBox

restive hinge
#

Although as I look now, I guess I'm wrong

lavish stream
#

Same thing, less commands.

restive hinge
#

Yep, ty!

ashen ridge
#

Can i use script to change the parameter smokeGenMaxDist of a partile?

little raptor
#

no

meager granite
#

Not sure how impactful it is on a real server though

distant cobalt
#

Hey, I'm trying to make a currency system to hold objectives and you periodically get paid out for minutes of the objective captured, is there and scripts already made that do this? I need a shop script to go a long with it as well where you can buy weapons. Any help is much appreciated.

manic sigil
#

If he hasnt completely obfuscate it/agrees to your request, you may have some luck pulling apart the Dynamic Bulwarks script.

little raptor
little raptor
#

_arsenalArray append _thatGiantArray

little raptor
boreal parcel
boreal parcel
granite sky
#

A lot of object not found errors are absolutely normal for multiplayer though. I'm guessing they're just part of the networking design at this point.

agile pumice
#

Can we throw this example

_gunPos = _unit selectionPosition ['proxy:\a3\characters_f\proxies\pistol.001', "Memory"];
``` onto the https://community.bistudio.com/wiki/selectionPosition page?
manic sigil
#

Im drawing a blank.

Ive a helipad, a helicopter, and a script running things with a while-do loop. There is an exit clause throughout, to exit the loop if the helicopter is forced down/script is no longer needed... but im trying to sort out how to tell if the helipad is deleted. I suppose also if the helicopter is erased, since its currently relying on '!alive _heli'.

granite sky
#

isNull _helipad

#

!alive _heli covers isNull as well.

manic sigil
#

I kept doing circle on 'isnil? No. Is... nil? NO.' T_T thanks!

hexed forge
#

would I be better off calling the script on a loop, with a set timeperiod?

#

I don't think we'd be dealing with a lot of units at once

high tendon
#

Can someone refer me to a good tutorial video on how to allow players to keep ingame items after logging off of my dedicated server?

#

im probably over thinking this

pulsar bluff
pulsar bluff
twin oar
pulsar bluff
#

i think not, no

#

what you migt be able to do is rename them to avoid confusion

#

i try to just rename all AI from like "Bob Smith" to just "AI"

granite sky
#

@high tendon Usual approach is to write data (uniquely tagged, of course) to profileNamespace.

#

missionProfileNamespace is an arguably better option now, but it's bugged on Linux.

simple trout
#

Word of caution is to not save huge amounts of data on profileNamespaces

high tendon
#

@granite sky thxs. I found a video and it said to make a database to store players info, etc. Really cool vid

granite sky
#

extDB stuff?

high tendon
#

Yea

granite sky
#

yeah that's another way but you need a database for it :P

high tendon
#

I don't mind the work but I am having trouble finding people to play the rough draft so I don't go through all the effort of making a data base for a broken mission lmao

pulsar bluff
#
addMissionEventHandler [
    'EntityCreated',
    {
        params ['_entity'];
        systemchat str [_entity,getObjectType _entity,typeOf _entity];
    }
];```
#

basically still fires for each bullet impact/deflection

#

so one unit firing a gun will cause it to spam pretty bad

#

in my opinion it should only fire for "type 8" objects

#

not temp objects

#

one bullet can cause it to fire 8+ times if there is penetration and deflection

manic kettle
#

bullets trigger entitycreated? wow

boreal parcel
#

could errors such as these be causing server FPS to fall? like down to 10-2 fps?

21:09:54 Error during evaluation of expression _interval in rpgdirt
21:09:54 Error during evaluation of expression _moveVelocity in rpgdirt
21:09:54 Error during evaluation of expression _position in rpgdirt
21:09:54 Error during evaluation of expression _colorCoef in rpgdirt


21:14:44 Error during evaluation of expression _source->AccessSourceType()->_colorCoef
21:14:44 Error during evaluation of expression _source->AccessSourceType()->_colorCoef

We got quite a few of them. I think its from out blastcore mod

#

also a bit of these as well

21:15:09 Ref to nonnetwork object 1865777: pg9_shell.p3d
21:04:10 Ref to nonnetwork object 1860680: empty.p3d
wary needle
#

IDC_CANCEL, IDD_MISSION, IDD_DEBRIEFING, IDD_MP_SETUP, IDD_MULTIPLAYER,
IDC_MULTI_TAB_DIRECT_CONNECT, IDD_IP_ADDRESS, IDC_IP_ADDRESS, IDC_IP_PORT, IDC_MULTI_SESSIONS,
IDC_OK, IDC_MULTI_JOIN, IDD_PASSWORD, IDC_PASSWORD, diag_tickTime + _TIMEOUT];

#

does anyone know where i can find the ids for all these display names, i cant find some of them

random cape
#

I need on why my server password is not working.

#

help

acoustic abyss
#

I've got a question...
Is there a way to check whether a specific weapon has been picked up by the player?
Am trying to create an oldschool FPS Doom moment where a player picks up a weapon on a table and enemies spawn.
The event handler "Take" would be exactly what I need, except it only works on items.
I'm avoiding checking the weapon slots, because the player may have already picked up the weapon from other enemies before the event.

#

...
I suppose I could make a trigger where I wrap the code in a condition check hasWeapon forEach in thisList. Then, if that's negative, keep checking until it's positive.
Must be an easier way.

sharp grotto
#

Could make it a unique weapon that is nowhere else.

acoustic abyss
sharp grotto
#

With next update you could use this EH then

acoustic abyss
sharp grotto
#

You can still use a weapon that the player has no access anywhere else and Take EH

#
player addEventHandler ["Take", {
    
    params ["_unit", "_container", "_itemClassName"];
    private _itemType = [_itemClassName] call BIS_fnc_itemType;
    private _itemTypeMainCategory = _itemType select 0;
    if ((_itemTypeMainCategory isEqualTo "Weapon") && {_itemClassName isEqualTo "Your_Unique_Weapon"}) then
    {
        // Trigger your stuff
    };

}];

boreal parcel
#

any idea why I cant seem to get the vectorDir of an attached object? is there another command or way I would need to get and change/set the attached objects position?

params["_player"];

private _building = "Land_Cargo_HQ_V1_F";
private _fobObj = createVehicle[_building, [1, 1, 1000], [], 0, "NONE"];

private _playerDist = 20;

_fobObj attachTo[_player, [0, _playerDist, 0]];

/* Allow user to Rotate */
(findDisplay 46) displaySetEventHandler ["KeyDown","[_this select 0, _this select 1, _this select 2, _this select 3, _this select 4, _fobObj, _vectorDirAndUp] call TRA_rotateFOB"];

TRA_rotateFOB = {
    params["_display", "_key", "_shift", "_ctrl", "_alt", "_fobObj", "_vectorDirAndUp"];
    _vectorDir = vectorDir _fobObj;
    systemChat format["Fob VectorDir: %1", str _vectorDir];

    false
};

the _vectorDir variable appears to be an empty array, if I format the variable without the str bit, it says Fob VectorDir: array, with str nothing is output.

-Edit: I dont think im properly passing in the _fobObj

acoustic abyss
sweet zodiac
#

I have learnt something cursed today

boreal parcel
#

neat

crude stream
#

Can I use setTerrainGrid to force all players to a specific setting in a mission file?

sharp grotto
crude stream
#

Wicked thank you!

little raptor
#

but it does trigger for bullet craters

little raptor
#

are you sure it actually works in vanilla tho?! ๐Ÿ˜…

#

my mod's preprocessor might be different

boreal parcel
#

how do you get the id to remove the keydown event handler? displaySetEventHandler has no return value

display displaySetEventHandler [handlerName, function]
little raptor
#

it does

#

oh set...

#

well don't use set

boreal parcel
#

ah woops didnt realize I was looking at set

#

ignore me

sweet zodiac
#

just execVMing a file test.sqf

little raptor
#

nice ๐Ÿ‘

sweet zodiac
meager granite
#

I wonder how BE treats that and if such code will match say true expression

little raptor
#

does BE even care about scripts?

meager granite
#

It does, there is scripts.txt

sharp grotto
#

Which also "runs" on the client side.

boreal parcel
#

I have 2 questions here
How can I exit when any key is pressed other than keys I want? I tried if (_key isNotEqualTo 203) exitWith { false } for the left n right arrows keys but no luck, it seems to exit at all times, even when the left arrow key is press.

Second question, how can I temporarily overwrite a keys function? the arrow keys are also movement, but while this script/function is active I want the movement disabled.

params["_player"];

private _building = "Land_Cargo_HQ_V1_F";
private _fobObj = createVehicle[_building, [1, 1, 1000], [], 0, "NONE"];

private _playerDist = 20;
_fobObj attachTo[_player, [0, _playerDist, 0]];

/* Make the FOB object a mission variable in order to grab it later. */
missionNamespace setVariable ['fob_object', _fobObj];

/* Allow user to Rotate */
private _id = (findDisplay 46) displayAddEventHandler ["KeyDown","_this call TRA_rotateFOB"];

/* ID needed to escape the FOB orienting */
missionNamespace setVariable ['fob_displayID', _id];

TRA_rotateFOB = {
    params["_display", "_key", "_shift", "_ctrl", "_alt"];
    private _fobObj = (missionNamespace getVariable ['fob_object', nil]);
    if (isNil '_fobObj') exitWith {
        systemChat "Fob object was not set as a missionNamespace variable";
    };
        // Does Not Work
    if (_key isNotEqualTo 203 || _key isNotEqualTo 205) exitWith {
        false
    };

    private _rotation = (missionNamespace getVariable ['fob_rotation', 0]);

    switch (_key) do {
        case 203: {
            _rotation = _rotation + 1;
        };
        case 205: {
            _rotation = _rotation - 1;
        };
    };
    _fobObj setDir _rotation;
    missionNamespace setVariable ['fob_rotation', _rotation];

    false
};
little raptor
little raptor
#

missionNamespace getVariable ['fob_object', nil]
what's the point of putting nil there?!

#

just check isNil "fob_object"

#

and you might want to return false there

#

to summarize:

TRA_rotateFOB = {
    params["_display", "_key", "_shift", "_ctrl", "_alt"];
    if (isNil 'fob_object') exitWith {
        systemChat "Fob object was not set as a missionNamespace variable";
        false;
    };
    
    if (_key isNotEqualTo 203 && _key isNotEqualTo 205) exitWith {
        false
    };

    private _rotation = (missionNamespace getVariable ['fob_rotation', 0]);

    switch (_key) do {
        case 203: {
            _rotation = _rotation + 1;
        };
        case 205: {
            _rotation = _rotation - 1;
        };
    };
    fob_object setDir _rotation;
    fob_rotation = _rotation;

    true
};
#

instead of _key isNotEqualTo 203 && _key isNotEqualTo 205 you can write !(_key in [203, 205])

winter rose
#

@boreal parcel I think that event handler doesnt give the integer but the d-i-k code, check here for reference for that https://community.bistudio.com/wiki/DIK_KeyCodes

You can always display _key with a hint or something to see what it reads back
Cc @opal zephyr

opal zephyr
#

Thankyou, I was just asking about that in the discord section of this server @winter rose I kept getting blocked ๐Ÿ˜…

#

I feel like the the di# bit in the link, no idea whats set to be blocked tho

little raptor
#

well in any case,

that event handler doesnt give the integer but the d-i-k code
DIK codes are integers

opal zephyr
#

Wouldnt it give something like DIK_RIGHTARROW?

south swan
#

those are preprocessor defines for actual number values

open hollow
little raptor
#

unless you create several thousand variables no
but if that's the case you might want to rethink your design... meowsweats

vagrant skiff
#

so I'm trying to use the SOG:PF radio support config but when I use it I get an error that says "line 481: '/vn_artillery_settings/resupply/ammo/hostage_1.US_FORCES': 'c' encountered instead of '=' here is the section of code where the error comes from:

{
      displayname = $STR_VN_ARTILLERY_GHOSTRIDERS_NAME;
      //icon = "vn\ui_f_vietnam\data\decals\";
      description = $STR_VN_ARTILLERY_RESUPPLY_AMMO_SF_DESCRIPTION;
      vehicleclass = "vn_i_air_uh1d_02_01";
      containerclass = "vn_b_ammobox_06";
      SF_FORCES
      cooldown = (60*5);
      cost = 0;
};

line 481 is "SF_FORCES"

#

anyone have any idea what the problem is?

south swan
#

and what is "SR_FORCES" supposed to be?

vagrant skiff
#

not entirely sure, this is just the default CDLC config for SOG

opal zephyr
#

The 'c' its encountering is the first letter in "cooldown"

#

Something has to equal sf_forces or sf_forces has to equal something

high tendon
#

how do i make the addAction command relevant to certain players? For example I am making a mission with fast travel points that I would only like to be used by blufor and different fast travel points that should only be used by opfor. I would like them to use the same object to fast travel but i need them to go to different places

#

ive tried outsourcing on youtube and i have fast travel points that are working but they work for anyone

opal zephyr
#

You can use the "condition" portion of addaction

#

Do a check for the players side

open hollow
high tendon
#

okay do you guys recommend any good tutorial videos on how I can use the condition command accordingly?

open hollow
#

the condition is just "side _this == opfor" and "side _this == blufor" ( need to be in "")

unique pewter
#

Does anybody know how can I make AA units shoot down one specific helicopter? I am trying to do a cinematic where a helicopter is flying by and get shots down, sow the other need to go down and secure the LZ for medevac to arrive but I donโ€™t know how yo make that helo go down

high tendon
#

thx @open hollow

opal zephyr
#

If you want it to be precise though you can probably keyframe it

unique pewter
#

The thing is the AA doesnโ€™t shoot until the helo is right on top of it

#

I want it to shoot the helo on sight

opal zephyr
#

Does changing its ai skill level affect that?

unique pewter
#

Havenโ€™t tried that out yet

opal zephyr
#

Try that

unique pewter
#

Trying it

#

Already put the other helo as civ

boreal parcel
#

also ๐Ÿ˜ฆ

unique pewter
#

Nop AI still didnโ€™t shoot until the helo shot first

#

What should I do now?

stark fjord
boreal parcel
hallow mortar
#

The filter regex making bad decisions has happened a few times before. Mention this in #discord_server , it will help the admins improve it.

opal zephyr
#

You can say dik, but it has a problem with the use of in that url I guess, Lou helped me out earlier with the same thing

stark fjord
#

I think its combo, between the two. I think you can post url alone safely

winter rose
boreal parcel
#

lol.
Any reason why object height doesnt seem to want to increase?
I am logging both getPosATL of the object earlier, and _height, im seeing _height increase but the change isnt applied to the object

fob_object setPosATL [_posATL select 0, _posATL select 1, _height];
unique pewter
stark fjord
stark fjord
unique pewter
#

Let me try that

warm swallow
warm swallow
#

thank you!

high tendon
#

so i have an addAction command once a trigger is activiated and once the trigger is deactivated i have

removeAllActions player;

and it doesnt remove the action. Sorry for the noob question. I have searched on the wiki, forums, and youtube and cant find a clear answer on what i am doing wrong

cold pagoda
#

question, can someone tell me what I'm doing wrong? When the trigger activates, the targets just go down, but do not come back up?

I have similar scripts that I've built using this exact same concept but this particular one does not pop back up... I did make these but Im confused as to why they are not poping back up..

sqdlivefirepopup = true; 
publicVariable "sqdlivefirepopup";  
  
_players = allPlayers select {alive _x};  
  
[_players] spawn {  
    params ["_players"];  
   
    _sqdlivefirestargets = nearestObjects [sqdfirecen, ["TargetBase"], 400];  
   
    { _x animate ["Terc", 1]; } forEach _sqdlivefirestargets;  
   
    waitUntil {  
        {  
            if (count (_players inAreaArray [ASLToAGL getPosASL _x, 70, 70, 70, false, 70]) > 0) then {  
                _sqdlivefirestargets = _sqdlivefirestargets - [_x];  
            };  
        } forEach _sqdlivefirestargets;  
        { 
            if (_players inAreaArray [ASLToAGL getPosASL _x, 70, 70, 70, false, 70] isEqualTo []) then { 
                _x animate ["Terc", 1]; 
            } else { 
                _x animate ["Terc", 0]; 
            }; 
        } forEach _sqdlivefirestargets; 
  
        uiSleep (20 + random 15);  
        !sqdlivefirepopup;  
    };  
};```

Here is one that works flawlessly...
```sqf
sqdtrainpopup = true; 
publicVariable "sqdtrainpopup"; 
 
_players = allPlayers select {alive _x}; 
 
[_players] spawn { 
    params ["_players"]; 
 
    _sqdtraintargets = nearestObjects [sqdtrainercenter, ["TargetBase"], 700]; 
 
    { 
        _x animate ["Terc", 1]; 
    } forEach _sqdtraintargets; 
 
    waitUntil { 
        { 
            if (count (_players inAreaArray [ASLToAGL getPosASL _x, 85, 85, 85, false, 85]) > 0) then { 
                _sqdtraintargets = _sqdtraintargets - [_x]; 
            }; 
        } forEach _sqdtraintargets; 
 
        { 
            if (_players inAreaArray [ASLToAGL getPosASL _x, 500, 500, 0, false, 500] isEqualTo []) then { 
                _x animate ["Terc", 1]; 
            } else { 
                _x animate ["Terc", 0]; 
            }; 
        } forEach _sqdtraintargets; 
 
        uiSleep (20 + random 15); 
 
        !sqdtrainpopup 
    }; 
};```
little raptor
warm swallow
#

createVehicleLocal?

little raptor
#

it has no AI tho?

#

and it's not an actual unit

warm swallow
#

I don't need AI

little raptor
#

well it's still not a unit blobdoggoshruggoogly

warm swallow
#

do you just mean unit by not having AI?

cold pagoda
opal zephyr
drifting sky
#

Is there any way to poll the current state of a native fsm running on a unit?

acoustic abyss
#

I have forgotten something basic about triggers. I'm making a kind of Escape mission. I'm trying to code a victory check to make sure all BLUFOR players are inside a trigger area. All the players are in 1 group.

Type: None
Activation: BLUFOR
Activation type: Present
(Server only)
Condition: count thisList == blufor countSide allPlayers;

Seems to work, but this will also trigger eg if all the players become incapacitated (I am Zeusing this mission), or if I happen to play OPFOR during a mission preview.
How can I get the trigger to evaluate its expression only when BLUFOR players are present?

agile pumice
#

So I'm sort of new to sounds, how do I set them up to not play automatically?

#

currently have frequency and volume set to 1

fleet geyser
#

In 3den, when editing Attributes>Environment, the Date parameter shows that for example 1. January 1968 is a Tuesday - is there any way I can pull the same information (Tuesday) with a command or function?

#

Trying to simplify a script I have, instead of elaborating on it to account for leap years & differing month lengths.

sweet zodiac
#

What exactly are you looking for the current Day?

stark fjord
little raptor
fleet geyser
little raptor
#

but not via event handlers

stark fjord
little raptor
sweet zodiac
acoustic abyss
leaden ibex
#

Hey there, I was wondering if there's a way to "add a slot" into a MP mission using sqf.
The best bet I had was setPlayable, but the Does not work as intended - does currently nothing in Arma 3. warning kinda... Well, is right.
Has anyone tackled this before? monkaHmm

stark fjord
#

Uhh, im not 100% sure, but dont think you can add player slots after mission starts.

leaden ibex
#

That's unfortunate sadge

winter rose
leaden ibex
#

Yeah. A bummer for me.
I am adding stuff for an event that has "Move to spectator" as a "respawn", but they also delete all unoccupied slots after warmup, so there are none left. Wanted to always add one empty that would server as a "spectator slot" for people, that connect late.
Well, I guess if you die and get disconnected, tough luck and you got to wait till the next mission.

stark fjord
#

You could setup onPlayerRespawn event in such a manner, that if they have no respawns left, put them in spectator.

#

That way you keep the slots, but if someone joins late, or dies, gets put in spectator

leaden ibex
#

Yeah, I got it like this on my event and it's just pain painsChamp

These guys have been running almost problem free for years now. Just this small... Unfortunate fact.

hallow mortar
#

You could just add a whoooooole bunch of virtual spectator slots and not delete those?

leaden ibex
#

I could, but they use custom spectator interface. No idea what weirdness would happen if I tried that

hallow mortar
#

Their custom spectator must have some kind of initialiser that activates it when someone dies. Find it and call it on anyone who takes a spectator slot

leaden ibex
#

Also a large number of missions, that would need to get updated manually.
I was only looking for a rather simple solution, that would require some changes in addons and didn't touch the missions.
I got stable internet, I can live without it rtzW

leaden ibex
stable dune
#

Hello,
Any good advice to check if an object has a player nearby and he's not running (speed < 8)
and the object is not moving.
I know how to do with while loop. I know how to do via server.
But i would have event what is running on clients.
Checking if near (one object or more list of my objects).
But how do I do check that objects is not moving . Static objects, so if some hit those by car etc it will explose.
And, I have multiple of these, thats reason why I do not want current event running on server on object (like some while loop while {alive _object} do ..).

winter rose
#

huuuh please state your original goal

stable dune
#

Yeh

#

I want get an event on the client, which check if the player is nearer than 20m distance from my objects, any of them. Current code is running on the server by checking nearestEntities and if it's player and speed is over 8 , my object explodes.
Because when I have multiple objects and every object has its own event that is not good for server performance.

winter rose
#

one spawn, one array, one forEach

#

boom performance

crude stream
#

Anyone know what I can put in the init of an object to make it local?

manic kettle
little raptor
#

it may not be exactly the same

crude stream
#

As in when it creates the copy it might not spawn in the same location?

little raptor
#

no. I mean like customizations and stuff (tho you can add those back too if you keep track of them)

stable dune
little raptor
# crude stream As in when it creates the copy it might not spawn in the same location?

but if you don't care about those you can do this:

if (!isServer) exitWith {};
_type = typeOf this;
_pos = getPosWorld this;
_dir = vectorDir this;
_up = vectorUp this;
deleteVehicle this;
[[_type, _pos, _dir, _up], {
  params ["_t", "_p", "_d", "_u"];
  _v = _t createVehicleLocal _p;
  _v setVectorDirAndUp [_d, _u];
  _v setPosWorld _p;
}] remoteExec ["call", 0, true];
#

remoteExecing call must not be blocked on the server

winter rose
stable dune
#

If player near (+ player speed over 8) OR object move

manic kettle
#

If you want to check if an obj moved then you need to do a time based approach using a while loop or a perFrame EH.
Unless you store the initial position of the object from its creation and reference that...
If (getPos obj distance getVariable ["objPos",[]] > 1) then {setDamage 1}

winter rose
#

don't
use
getPos

winter rose
# stable dune If player near (+ player speed over 8) OR object move

something like that

[_allObjects, 1] spawn {
    params ["_objects", "_checkPeriod"];
    while { _objects isNotEqualTo [] } do
    {
        private _players = call BIS_fnc_listPlayers;
        private _objectsToRemove = [];

        {
            private _object = _x;
            if (speed _object > 8 || { _players findIf { _x distance _object < 10 } }) then
            {
                _object setDamage 1;
                _objectsToRemove pushBack _object;
            }
        } forEach _objects;

        _objects = _objects - _objectsToRemove;
        sleep _checkPeriod;
    };
};
```@stable dune
#

or whatever speed check I did not get (is the object moving? the player running? anyway I believe you see where to write your code in there)

stable dune
# winter rose something like that ```sqf [_allObjects, 1] spawn { params ["_objects", "_ch...

Yeh, i had on bomb object checking nearest player and speed from it, and check if bomb speed (moves) is over 0

params ["_bombObj"];
while {!isNil {_bombObj getVariable "IEDD_BOMB"}} do {
    private _plrNear = _bombObj nearEntities ["CAManBase", 10];
    private _index = _plrNear findIf {isPlayer _x};
    if (_index > -1) then { 
        _targetPlayer = _plrNear select _index;
        if  (speed _targetPlayer  > 8) exitWith {
            [_bombObj] call iedd_fnc_bomb;
        };
    };    
    if (speed _bombObj > 0 ) exitWith {
        [_bombObj] call iedd_fnc_bomb;
    };
    sleep 1;
};
winter rose
#

okok
so "if it moves, boom"
"if there is a player and he moves faster than 8, boom too"

stable dune
#

Yes

winter rose
#

I believe the faster way is still to check all players, might be faster than nearEntities (especially if there are not a lot of player slots)

stable dune
winter rose
#

please provide example? what is "my player icons"?

#

not our fault :p

winter rose
#

there is no way to tell what the issue is here
nothing is vanilla so the "fix" cannot even be considered

please reduce to the point where vanilla stuff is faultyโ€ฆ or not ๐Ÿ™‚

#

is the report that drawIcon [(...), "ะะ‘ะ’ะ“ะ”ะ„", (...)] is not working, or is the function potentially not returning the good value?

sweet zodiac
#

Cyrillic doesn't work properly in the strings?

granite sky
#

Are you using unicode or what?

#

oh, whatever name player returns. Fair enough.

sweet zodiac
#

so does that mean name player fails to return it then?

winter rose
#

so unrelated to [_x] call MRTM_fnc_iconText ok

#

I don't want a logical guess, I want facts :p

#

try systemChat name player for example hehe ^^

sweet zodiac
#

that would be the fastest way to tell yeah

granite sky
#

well, that's also untrustworthy :P

winter rose
#

the best thing would be that + drawIcon
but tbh for it not to have been reported before, I smell shenanigans involvement here

sweet zodiac
#

trying to remove as many middlemen as you can is wise

granite sky
#

toArray name player might be best.

opal zephyr
#

It probably just fails to convert cryllic letters correctly

#

or recognize them in general

#

Lots of games put symbols in the place of unrecognized characters in peoples usernames because they dont recognize them, wouldnt be surprised if arma does the same, or in this case, just puts a space

winter rose
high tendon
#

hint "In Safe Zone";
player allowDamage false;
while [true] do
{
player action ["SwitchWeapon", player, player, 100];
sleep 1;
};

#

sorry i am a noob but what am i doing wrong?

little raptor
#

while [true]

high tendon
#

its still giving me an error