#arma3_scripting

1 messages · Page 30 of 1

tender fossil
#

Yeah, that's what I was thinking as well. So I'll probably have to convert the backend code to async

south swan
#

yes, that's proposed in the same paragraph on wiki blobcloseenjoy

#

was about to copy that here as well, but got distracted

tender fossil
#

I somehow got the impression initially that it would apply in case of unscheduled code only, but it seems like I was wrong 😛

#

Thanks for the reply! 🙂

copper raven
#

scheduled vs unscheduled has 0 influence on how a command is executed, except things like while where an iter limit is introduced in unschd

#

commands dont control the allowed runtime per frame(they just execute their own thing without any time limit), scheduler does that, between each instruction

granite sky
#

with "between" being an important word there.

south swan
#

Except extension

#

The binary code that runs outside of sqf vm

granite sky
#

Aren't all commands effectively blocking though?

copper raven
granite sky
#

Like you'd have a similar issue with a really slow nearObjects call.

copper raven
#

otherwise, no

copper raven
copper raven
south swan
#

okay, i'll rephrase that

#

code called by callExtension isn't in the game and doesn't provide any run time (as in literal time spent) guarantees

#

which can move the nearest point where the scheduler (or VM time quota) can apply way outside the documented time limits 🤷‍♂️

copper raven
# south swan which can move the nearest point where the scheduler (or VM time quota) can appl...

it depends on what you do in the extension, if you put an infinite loop in there, you will just permanently hang the game. about the time limit, like i said, scheduler handles all of it.
do we have time left to run code this frame? if we do, run the next instruction, otherwise do nothing and let the game do what it needs to do. this instruction can be a command call for example, it can take 10 seconds, barely anything, it doesn't matter.

south swan
#

the "it can permamently hang the game" situation being exactly what Ezcoo suspected. With the solution he envisions (and doc independently proposes) being the async extension. To move time consuming stuff outside of game thread 🤷‍♂️

copper raven
#

well yeah, that's the best thing to do if you are able to

granite sky
#

Uh, there are certainly good and bad practices.

copper raven
#

well what is causing the lag, is it your own code? or just too many things in the mission?

south swan
#

ah, "what is causing the lag". The most difficult question of them all blobcloseenjoy

copper raven
#

paste it? need context in general, using less sleep won't change anything, rather have less scheduled code.

#

it could be better, but that's fine

#
if (typeOf _entity != ...) exitWith {};
MRTM_spawnedAPERSMine_Range_Ammo =  MRTM_spawnedAPERSMine_Range_Ammo - [objNull]; 
if (count   MRTM_spawnedAPERSMine_Range_Ammo < 50) exitWith { MRTM_spawnedAPERSMine_Range_Ammo pushBack _entity };
deleteVehicle _entity;

on phone, but something along those lines, edited, missread your code meowsweats

gaunt tendon
#

anyone knows how to hide/disable this?

copper raven
#

refer to mod's docs

proven charm
#

compared to what?

gaunt tendon
proven charm
#

well like your mission, which is lagging?

gaunt tendon
#

according to wiki
this works but it also disables left and right panels

proven charm
#

yea I know. i was just thinking if your mission has lot of AI that also lags, possibly a lot

gaunt tendon
proven charm
#

oh ok maybe it needs better garbage collection or something

copper raven
#

by default, no

#

unless you use something that does that, is what i meant

gaunt tendon
copper raven
#

ye ofc

#

but is the ui not contact only? THONK

gaunt tendon
#

it should be...

#

any idea how can i get a peek at the code of this BIN_fnc_showHorizontalCompass function?
I just need the IDD and IDC to disable them

copper raven
#

start your game with contact and use the functions viewer

proven charm
#

having lots of mines can lag too. maybe you should check how many entities your mission really has

gaunt tendon
#

oh right

gaunt tendon
#
"RscCompass" cuttext ["","plain"];

to remove contact DLC horizontal compass

stable dune
#

Hey,
It seems that when you drag an object (ace drag), that dragged object does not take effect on the speed command

if (speed _object > 0) then {};

So what happens to an object when it's attached to something, I'm trying to figure out how to check if my object is moved/ has velocity.
if carry object the if speed command works

proven charm
tender fossil
kindred zephyr
#

besides you cant really compare a mission like KOTH which is totally player based against literally anything that uses AI. KOTH besides optimization, uses the fact that it needs to compute very few things as everything is being done by the player and then comunicated to server, and not the other way around which is the usual case

brazen lagoon
#

Is it possible to disable night vision/thermal optics for vehicles?

#

for both players + AI

brazen lagoon
#

is there a way to always pick a day that it's a full moon?

jade acorn
#

"always pick" in what manner, that instead of normal day-night cycle, game cycles only between full-moon days?

gaunt tendon
brazen lagoon
#

yes

brazen lagoon
gaunt tendon
# brazen lagoon yes

u can just create a light point to illuminate the night, something like

SKYLIGHT = "#lightpoint" createVehicleLocal [0,0,0];
SKYLIGHT setLightBrightness 1;
SKYLIGHT setLightDayLight false;
SKYLIGHT setLightAttenuation [10e10, 26, 4.31918e-005, 4.31918e-005];
SKYLIGHT setLightAmbient [0.1, 0.2, 0.4]; 
jade acorn
#

woudln't it be easier to check for moonPhase and use setApertureNew when it's less than 1?

#

just throwing out ideas, never tried that

brazen lagoon
#

interesting idea

jade acorn
#

or on 23:59:59 set date back to 00:00:00 same day, but if you or anyone uses skipTime it won't work

gaunt tendon
#

anyone know how I can disable or hide these interaction icons, without editing config files

jade acorn
#

use a unit that has an empty loadout (not emptied by you) and it should work

#

otherwise use ACE, it disables that icon

gaunt tendon
mighty bronze
#

Is there anyway to retexture a vest from the mission? Not usesing a mod. I can retexture uniforms, but not vest or helmets

late parrot
#

Anyone know if

``` affects all players or just the ones in that specific group
granite sky
#

All units in the group of the local player.

late parrot
#

So if the player is in Alpha 1 it wouldn't affect alpha 2?

granite sky
#

Assuming that you're running the code local to the player in alpha 1.

late parrot
#

It'll be mp based

stable wedge
#

Hi there!

#

I am self hosting a server with some friends and wanted to know how I could use the executable box (when you press esc) to spawn a box and then have items get created in that box

#

I believe I can find the item names on my own, just wanted to know how I might go about that in a non dedicated server

late parrot
#

I believe the debug console is locked specifically to eden editor

#

The better option would be setting yourself as zues and spawning items that way

stable wedge
#

I have this for the eden editor;
private _testingCrateObject = this; if isServer then { private _itemsArray = [ ["ACE_1Rnd_82mm_Mo_HE_LaserGuided", 100], ["ACE_1Rnd_82mm_Mo_HE_Guided", 100], ["ACE_1Rnd_82mm_Mo_HE", 100], ["ACE_1Rnd_82mm_Mo_Smoke", 100], ["ACE_1Rnd_82mm_Mo_Illum", 100] ]; { _x params ["_stringItem", "_itemCount"]; _testingCrateObject addItemCargoGlobal [_stringItem, _itemCount]; } forEach _itemsArray; };

#

But i need to be able to do it while in game

stable wedge
#

I could edit the mission file but I would like to avoid that

stable wedge
grand stratus
#

Anyone know an efficient way of getting all "EmptyDetector"s? entities doesn't return anything, and allMissonObjects is laggy as hell

granite sky
#

I don't think there's an efficient way until 2.12 but some form of allObjects is probably best.

mighty bronze
#

Is anyway to make a trigger an invisible wall or anyway to make an invisible wall? The current was is extremly small

late parrot
#

Yeah just take a wall and in the properties uncheck visible but leave on simulation

mighty bronze
#

You can go through like that

#

Yea, it didnt work.

late parrot
#

does the invisible wall item not work for you as well?

mighty bronze
#

Is invidible and not a wall

#

I need a wall that you cant see.

granite sky
#

You'd probably have to find one in a mod.

stable dune
stable wedge
#

Thank you!

#

This will allow me to spawn items and run scripts in game ye?

stable dune
#

When you change 1st option from
Using Eden attribute Debug Console, available in Attributes > General > States > Debug Console
Then you choose
1 - Available in SP and for hosts / logged in admins in MP

So when you are host you can see debug console in MP hosted game when you press ESC.
And mod for debug console is just better than Eden editor own console.
Easier to use and alot of abilities

stable wedge
#

Sweet

stable wedge
stable dune
#

No, if you choose host/ logged admin. It only shown on you. Not another players

#

If you choose avaible for everyone, it will shown for all

stable dune
# stable wedge I have this for the eden editor; ` private _testingCrateObject = this; if isServ...
private _testingCrateObject = cursorObject;
if (isServer) then {
private _itemsArray = [
["ACE_1Rnd_82mm_Mo_HE_LaserGuided", 100],
["ACE_1Rnd_82mm_Mo_HE_Guided", 100],
["ACE_1Rnd_82mm_Mo_HE", 100],
["ACE_1Rnd_82mm_Mo_Smoke", 100],
["ACE_1Rnd_82mm_Mo_Illum", 100]
];
{
  _x params ["_stringItem", "_itemCount"];
  _testingCrateObject addItemCargoGlobal [_stringItem, _itemCount];
} forEach _itemsArray;
};

You could try this, just point your object and add to watch list cursorObject and pin 📌 that to screen when you get your cursorObject what you are looking, then you should be able to spawn item via debug console to object which is yours cursor object in game.

stable wedge
#

ah!

#

Thank you so much!

grand stratus
#

Is there a good way of testing features requiring 2 people on a dedicated server by yourself?

granite sky
#

There's the loopback server.cfg option, although I think you have to run the DS and both clients on the same machine, which needs a lot of RAM.

#

localhost + client also worked at some point but not the last time I tried.

real tartan
#
params ["_element1", ["_element2", str ( _this select 0 )]];
indigo wolf
hallow mortar
cyan dust
#

Good day, why can 'remoteExecutedOwner' return 0? 🤔
Context:

//Headless client request
remoteExec ['TAG_fnc_someFunc',2];
...
...
//Server check before response
TAG_fnc_someFunc =
{
    if (remoteExecutedOwner == 0 && isDedicated) exitWith {
        "TAG_fnc_someFunc: Caller is 0" call TAG_fnc_logError;
    };
...
}

And like, every time it's 'Caller is 0' blobdoggoshruggoogly Do I miss something?

cyan dust
jade tendon
#

how can i get the animationList/Components for vehicle to use in a config?

digital sphinx
#

I need something like player switchCamera "Internal"; but instead of specifying Internal/External, I just want the player to return previous view. (So basically just close Gunner view). Is it possible?

cyan dust
digital sphinx
#

Thank you! I will check that

#

Can I record the previous cameraView with that first EH you posted and use player switchCamera prevView;

#

What I am trying to do is to close binocular view after a particular trigger

#

Sorry I am not experienced with EHs

stable dune
#
this addEventHandler ["OpticsModeChanged", {
    params ["_unit", "_opticsClass", "_newMode", "_oldMode", "_isADS"];
systemChat _opticsClass;
systemChat  _newMode; systemChat _oldMode;
}];

So you get class to binocular and then you can use that in eh

this addEventHandler ["OpticsModeChanged", {
    params ["_unit", "_opticsClass", "_newMode", "_oldMode", "_isADS"];
if (_opticsClass == "classOfBinoculsrs") then {
    _unit switchCamera _oldMode
};
}];
digital sphinx
#

Thank you ❤️

velvet merlin
#

is doing unit positions on 2d map actually more efficient via markers compared to drawIcon ?

#

the latter you need per frame, while with markers you cache data, and update parts less frequently

#

plus only need to adjust the markers instead of remaking all the time with drawIcon

copper raven
#

marker will be "lagging" basically 😄

#

while with markers you cache data
you can also cache the drawicon params

#

and just adjust position per frame

velvet merlin
#

drawIcon is the most expensive part

#

you cant cache much either

#

you need position and direction

#

otherwise its non smooth either

#

for type and side (civ/captive) you dont want too much lag / you need to check that state

copper raven
#

i never had any performance issues with drawIcon, it's also map related only

velvet merlin
#

for drawIcon3d caching is useful

hallow mortar
#

It's not uncommon to use markers for force tracker icons, at least. Having a low update frequency doesn't matter too much because perfect intel is unrealistic/too OP. Depends what you want, I guess.

velvet merlin
#

200-300 entities with drawIcon is expensive (~5-10ms)

#

been using markers previously too (in A2 and till few years ago in A3)

#

however people suggested drawIcon to be "better"

#

benefit for non perframe drawing is also you can distribute the unit updates over multiple frame and thus have no spikes but instead some lower "permanent" load

open hollow
# mighty bronze I need a wall that you cant see.

far from perfect but works both with area markers or cover map module
add this at the end of initplayerlocal.sqf

//_ao = "marker_0";
_ao = "bis_fnc_moduleCoverMap_border";

while {true} do {
        if !(alive player) then {seleep 3; continue};
    _oldpos = getpos player;
    sleep 1;
    _newpos = getpos player;
    if !(_newpos inarea _ao) then {
        player setpos _oldpos;
        hint "You left the AO";
    };
};
open hollow
# velvet merlin however people suggested drawIcon to be "better"

markers are updated all the time on the server, so if there is a lot of them, probably is better using drawicon, it has 2 benefits:

  • its only executed when the map is opened, so you can give all the load the player, 3 less fps on the map, wont hurt
  • save ton of unnecessary network traffic

if you save all that data into an array and share it with publicvariable... probably is quite the same that using markers

copper raven
open hollow
#

hmmm i had bad experiences moving/deleting a large amount of markers, and with drawicon its made instantly, out of that, its quite the same

mighty bronze
digital sphinx
#

Very noob question here.
In the init field of an object I have this:
[this] call myFunction;
and the function looks like:

myFunction = {
    params ["_object"];
    [_object, "TITLE", "\A3\Ui_f_oldman\data\IGUI\Cfg\HoldActions\map_ca.paa", "\A3\Ui_f_oldman\data\IGUI\Cfg\HoldActions\map_ca.paa", "true", "true", {}, {}, { SOMECODEHERE }, {}, [], 1, 800, false, false, true] call BIS_fnc_holdActionAdd;
};

Why is this not working?

#

Note: I am new to A3 scripting so I don't completely get function params

copper raven
#

myFunction = { where is this part located?

digital sphinx
#

in init.sqf

copper raven
#

init.sqf is ran after the init fields

digital sphinx
#

Thank you, I will learn this now

#

What would be a better place for the function call? I was trying to do this because I wanted to reuse this function for a lot of objects in the editor

hallow mortar
#

The place for the function call is fine, you don't need to change that. It's defining the function that you need to do earlier, as sharp said.

upper geode
#

test

#

oh it works

#

aircraft flyInHeight 30;
this command for whatever reason is ignored by a large aircraft when it reaches a waypoint that has this command in it

#

it worked on a map with relatively flat terrain, but not on chernarus

hallow mortar
#

Aircraft of all types have a long history of.....inconsistent....compliance with flyInHeight commands. You can try setting it a bit lower or combining it with flyInHeightASL, but you may not be able to get exactly what you want.

upper geode
#

aw chucks

#

aircraft flyInHeightASL 30;?

hallow mortar
upper geode
#

some wiki entries are outdated so I had to clarify

hallow mortar
#

Commands don't usually change the format of their arguments, for backwards compatibility reasons. Sometimes they get new ones but the old one will still work.
If you find any outdated wiki entries, be sure to mention them in #community_wiki so they can be updated.

upper geode
#

yeah that command doesn't work either, the map is Chernarus (Summer)

#

the aircrafts do the commands in the waypoints such as drop bombs and so forth, the altitude commands feels like they are completely broken

#

I guess there's no choise but to resort to Unit Capture

velvet merlin
tepid vigil
#

Is BIS_fnc_buildingPositions deprecated with buildingPos -1?

copper raven
#

yes

long bloom
#

You tested this right - and it worked? Because I still can't get it to function at all.

#
this disableAI "PATH";  
 
this addMPEventHandler ["MPHit", {
 params ["_unit", "_causedBy", "_damage", "_instigator"];  
 hint "Hit!";
[_unit] joinSilent createGroup EAST;  

    _unit removeAllMPEventHandlers "MPHit"; 
   [_unit, "IMS_Die_Spec_1"] remoteExec ["switchMove"];
[_unit, "IMS_Die_Spec_1"] remoteExec ["playMoveNow"];     
    sleep 6; 
    _unit setDir (getDir player);  
[_unit, "IMS_Crawling_Away_Start"] remoteExec ["switchMove"];
[_unit, "IMS_Crawling_Away_Start"] remoteExec ["playMoveNow"];  
    sleep 1.4; 
[_unit, "IMS_Crawling_Away"] remoteExec ["switchMove"];
[_unit, "IMS_Crawling_Away"] remoteExec ["playMoveNow"];  
    sleep 10; 
    if (alive _unit) then { 
[_unit, "IMS_Crawling_Away_Stop"] remoteExec ["switchMove"];
[_unit, "IMS_Crawling_Away_Stop"] remoteExec ["playMoveNow"];   
    _unit setDamage 1; 
    }; 
    } 
];
#

Not even displaying the hit! hint.

copper raven
#

you don't need mphit for this

#

infact your entire code is wrong with those remoteExecs

long bloom
long bloom
#

Alright - tell you what
not even THIS is working

this disableAI "PATH";  
 
this addMPEventHandler ["MPHit", { 
 params ["_unit", "_causedBy", "_damage", "_instigator"]; 
hint "Hit!";
}];

Nor

this disableAI "PATH";  
 
this addMPEventHandler ["MPHit", { 
 params ["_unit", "_causedBy", "_damage", "_instigator"]; 
["Hit"] remoteExec ["hint"];

}];
#

Nothing on hit.

hallow mortar
#

Does the unit have "allow damage" turned off in its Editor attributes? That can cause hit-type EHs to ignore events

astral bone
#

how do I check again if something is ObjNull or not? 😅

astral bone
#

boolean value. If not included, sohuld just return the current value

long bloom
astral bone
#

Hm- Also what mods ya go

#

Well-

long bloom
#

A ton - none of which effect this though - considering this should be a vanilla function.

#

Damage enabled.

astral bone
#

I mean- a mod I got gives ya a shield of sorts. I dunno if it affects the hit events

#

Although, conveniently, I am just trying to mess with it now xD

#

Melee system?

hallow mortar
#

They might not affect the command itself but they could affect the way some things are interpreted. For example, CBA used to put a hidden call {} around anything you put in an init field, which was not terribly helpful

#

I'm not sure if it still does it but you should check.

long bloom
astral bone
#

Could check this in the debug console:
ims_laf_shotstotakeoutoneguy

#

Probably not that tho

long bloom
#

What - to see how many shots it would take to kill him if he had a melee weapon?

hallow mortar
#

I would recommend unloading all your mods and trying just this in a blank mission with nothing else. That will prove the basic point of whether it's mods or something else.

astral bone
#

Try in a new senario in vanilla. Only what you need for the guy

long bloom
#

Same effect

astral bone
#

oh-

long bloom
#

So not a mod issue.

long bloom
#

Does it work?

#

Is this only a my machine issue with that code - or is that code just not working

astral bone
#

is he dying or just getting injured?

long bloom
#

Yeah you can kill him

astral bone
#

What kind of damage is it.

long bloom
#

takes like 3 shots

astral bone
#

ah ok, so probably not this but-

long bloom
#

Tried vanilla guns, regular guns, etc etc.

astral bone
#

The hit EH will not necessarily fire if only minor damage occurred (e.g. firing a bullet at a tank), even though the damage increased.

long bloom
#

I wouldn't say 3 shots is considered minor damage.

astral bone
#

yea

#

so probably not that :P

hallow mortar
#

Okay, I did a blank VR mission with me and one guy. That guy had your code in his init. I shot him and got a "Hit!" hint.

long bloom
#

Right - so it's a "My machine" error.

astral bone
#

wait

long bloom
#

Which one - top or bottom?

astral bone
#

multiplayer or single

long bloom
hallow mortar
#

Editor SP. Wouldn't matter if it's top or bottom, there's no locality problem.

#

MPHit is supposed to trigger on every machine anyway so you shouldn't need remoteExec.

astral bone
#

i feel that's really weird-

long bloom
#

Interesting.
So without removing ANY mods

#

and just loading up VR

#

suddenly it works.

#

Begging the question
Why the fuck doesn't that work on that map?

astral bone
#

huh-

long bloom
#

Or, possibly, with that specific unit type

astral bone
#

Try in VR with the unit type.

long bloom
#

Nope - working fine there.

astral bone
#

Ok, modded map?

long bloom
#

Yeah but it wasn't when I unloaded all my mods to test this.

#

Plus why would a map conflict with an MPHit Event Handler

astral bone
#

Try on altis

astral bone
long bloom
#
    _unit removeAllMPEventHandlers "MPHit";
    _unit removeAllMPEventHandlers "MPKilled";```
#

Found it

astral bone
#

wha

long bloom
#

Mission side script that has been bugging me for a few weeks now - that I had ported over for testing with the other ones to check they worked in vanilla at the same time.

#

Early version of fuckin' Project Injury Reaction.

hallow mortar
#

So when you said you'd tried it in a blank mission with nothing else... 🤔

long bloom
#

Yeah I didn't think the mission scripts would've been conflicting - Arma takes forever to boot on my laptop so I was trying to kill two birds with one stone.

#

Regadless - let me see if removing that'd fix it

#

Because theoretically that shouldn't be firing either.

#

Nope - that wasn't the issue.

#

right

#

Pulled that entire module out.

#

Something in it was doing it apparently - works now.

astral bone
#

Is it && or and for if statements? 😅

#

oh seems it's either

#

ok, lets see if my force invincible script works :P

#

i have just realized the reason my clipboard is cleared whenever I ender zeus :I
PrintScreen is my zeus button xD

copper raven
astral bone
#

I notice the zeus gamemaster module doesn't give all playable units zeus access- How would I make it so I always have zeus access? :P

#

oh wait

#

Somethings have tool tips. Some do not. I was thinking I'd need to write something to manually make all playable units be zeus xD

astral bone
# copper raven isNull

Better way is to use isEqualTo it seems, to me?
isNull expects game types, I believe. Atleast, it doesn't expect bool values.
Way I got around this is isEqualTo.

#

Also, ["_newValue",objNull,[objNull,true]], means it will NEVER be undefined right? As in, I should need to do a isNil check on it?

#

wait, do if statements try everything? Or is this a mod?
if (not (isNil "_s")) and (hint "F") hints F even if _s is not defined?

#

interesting-

copper raven
#

yes, because its not lazy eval

astral bone
#

bruh

copper raven
copper raven
dreamy kestrel
#

Q: I have an EH responding to a user action, and I want to prompt the player using a call to BIS_fnc_guiMessage. but this apparently only works in the context of a spawn not a call... i.e. when I do something like:

// in a debug console
[] spawn{['test'] call BIS_fnc_guiMessage} // prompt okay
// versus:
['test'] call BIS_fnc_guiMessage; // nothing prompted

My base EH is something like:

// _okay defined aligned with _response(s)
private _prompt = {
// ...
  private _response = [...] call BIS_fnc_guiMessage;
  _response == _okay;
};
// ...
if (_baseCond && { [] call _prompt; }) then {
  // ...
};

So should I be spawning the EH callback, not calling it? i.e. [...] spawn _callback versus [...] call _callback?

copper raven
#

you can't spawn here either because you need the result, so just execute everything scheduled

dreamy kestrel
copper raven
#

call from scheduled, that's what you need to do

#
0 spawn {
  private _result = ... call BIS_fnc_guiMessage;
  // or like yours, same thing
  private _prompt = { ... call BIS_fnc_guiMessage == "whatever" };
  private _isTrue = call _prompt;
}
dreamy kestrel
copper raven
#

latter might still work, if you're in scheduled env

#

call doesn't change the environment

dreamy kestrel
meager spear
#

removeAllActions doesn't remove vehicle actions like "get out" or "turn off engine". How can I do it?

copper raven
copper raven
meager spear
#

🥺

hallow mortar
#

If you want to stop someone getting out you can lock the vehicle

dreamy kestrel
hallow mortar
#

spawn creates a new independent scheduled thread.
call is like running the called code in-place in the existing context.

granite sky
#

You could probably remove "turn off engine" by destroying the engine :P

dreamy kestrel
copper raven
#

just throw a guard and call back the function in scheduled if called from unscheduled

#
if !canSuspend exitWith { _this spawn tag_fnc_thisFunctionBlabla; }
dreamy kestrel
sharp grotto
#

So i just learned that you shouldn't use deleteAt while iterating with foreach. 😅
Can you do it like that or is there a better way ?

while {ExileServerVehicleSaveQueue isNotEqualTo []} do 
{
    sleep 0.001;
    {
        private _vehicleObject = _x;
        if (!isNull _vehicleObject) then
        {
            if (_vehicleObject getVariable ["ExileIsContainer", false]) then
            {
                _vehicleObject call ExileServer_object_container_database_update;
            }
            else
            {
                if (isNumber(configFile >> "CfgVehicles" >> typeOf _vehicleObject >> "exileIsDoor")) then
                {
                    _vehicleObject call ExileServer_object_construction_database_lockUpdate;
                }
                else
                {
                    _vehicleObject call ExileServer_object_vehicle_database_update;
                };
            };
        };
        ExileServerVehicleSaveQueue deleteAt _forEachIndex;
    }
    forEach ExileServerVehicleSaveQueue;
};
granite sky
#

Err, I assume some other scheduled code is adding entries to this queue, possibly while that update loop is running?

#

And a single object could potentially be added multiple times?

sharp grotto
#

It's to clear the Save buffers at mission end. An object can be only added once to ExileServerVehicleSaveQueue
I guess i can just do

if !(ExileServerVehicleSaveQueue isEqualTo []) then
{
    {
        _vehicleObject = _x;
        if (!isNull _vehicleObject) then
        {
            if (_vehicleObject getVariable ["ExileIsContainer", false]) then
            {
                _vehicleObject call ExileServer_object_container_database_update;
            }
            else
            {
                if (isNumber(configFile >> "CfgVehicles" >> typeOf _vehicleObject >> "exileIsDoor")) then
                {
                    _vehicleObject call ExileServer_object_construction_database_lockUpdate;
                }
                else
                {
                    _vehicleObject call ExileServer_object_vehicle_database_update;
                };
            };
        };
    }
    forEach ExileServerVehicleSaveQueue;
    ExileServerVehicleSaveQueue = [];
};
granite sky
#

Yes.

#

If you even need to delete it at all.

sharp grotto
sharp grotto
#

So next question, how would one handle this to avoid the problems mentioned above for other cases where i can't just empty the array but i still want to delete an element from an array 🤔

tough abyss
#

If it's a problem with concurrent access then you probably just want to go with a simple mutex system w/ a lock

#

if it's just not being able to delete stuff in an array while iterating over it.... just don't do that

#

there's alternative solutions to the latter, if that's the case

sharp grotto
#

So just pushback the elements i don't want to delete into a new array and override the original array then ?

tough abyss
#

That's one way

#

could also just do a select {} on the original array and have a filter expression to filter out the ones you don't want

#

ideally a function for the filter if the code's complex

sharp grotto
tough abyss
#

No problem

long bloom
#
if (({ alive _x } count [Graf1T,Graf2T,Graf3T,Graf4T]) == 0) then  
{ 
 ["TUTGRAF2","SUCCEEDED"] call BIS_fnc_taskSetState;  
 [(group _caller), ["TUTGRAF3","TUTGRAF"], ["Collect your payment at the terminal","Collect Bounty Payment.","download"], TutorialTerminal, "AUTOASSIGNED", -1, True, "download", False] call BIS_fnc_taskCreate; 
TutorialTerminal addAction     
[    
    "<t color='#0f4719'>Collect Bounty: Graffiti Maestro</t> - <t color='#b9bf00'>500 Credits</t>",    
    {    
        params ["_target", "_caller", "_actionId", "_arguments"];    
 
{   
         [_x, 50] call HALs_money_fnc_addFunds;   
} forEach units group _caller;   
[_this select 0,_this select 2] remoteExec ["removeAction", 0, true]; 
    }    
]; 
}; 

Am I being stupid again?

 ["TUTGRAF2","SUCCEEDED"] call BIS_fnc_taskSetState;  
``` his fires - nothing below it does.
#

When executed seperately -

 [(group _caller), ["TUTGRAF3","TUTGRAF"], ["Collect your payment at the terminal","Collect Bounty Payment.","download"], TutorialTerminal, "AUTOASSIGNED", -1, True, "download", False] call BIS_fnc_taskCreate; 
TutorialTerminal addAction     
[    
    "<t color='#0f4719'>Collect Bounty: Graffiti Maestro</t> - <t color='#b9bf00'>500 Credits</t>",    
    {    
        params ["_target", "_caller", "_actionId", "_arguments"];    
 
{   
         [_x, 50] call HALs_money_fnc_addFunds;   
} forEach units group _caller;   
[_this select 0,_this select 2] remoteExec ["removeAction", 0, true]; 
    }    
]; 
``` this creates the task and adds the action.
tough abyss
#

Nvm, mixed up my target numbers

#

firstly, cleaning the formatting

#
if (({ alive _x } count [Graf1T, Graf2T, Graf3T, Graf4T]) == 0) then 
{ 
    ["TUTGRAF2","SUCCEEDED"] call BIS_fnc_taskSetState;  
    
    [
        group _caller, 
        ["TUTGRAF3","TUTGRAF"], 
        ["Collect your payment at the terminal", "Collect Bounty Payment.", "download"], 
        TutorialTerminal,
        "AUTOASSIGNED",
        -1,
        True,
        "download",
        False
    ] call BIS_fnc_taskCreate;
    
    TutorialTerminal addAction     
    [    
        "<t color='#0f4719'>Collect Bounty: Graffiti Maestro</t> - <t color='#b9bf00'>500 Credits</t>",    
        {    
            params ["_target", "_caller", "_actionId", "_arguments"];    
 
            {   
                [_x, 50] call HALs_money_fnc_addFunds;   
            } forEach units group _caller;   
            [_target, _actionId] remoteExec ["removeAction", 0, true]; 
        }    
    ]; 
};
#

Not sure why you're using [_target, _actionId] remoteExec ["removeAction", 0, true]; in the action code; the addAction only happens locally , so remoteExec'ing removeAction makes no sense

#

I suspect this confusion over locality is the overall issue

granite sky
#

JIP removeAction makes even less sense :P

jade tendon
#

What am i doing wrong here. No errors, just doesn't show in editor

    class C_Heli_Light_01_civil_F;    // External class reference
        
        class DSF_COP_MD500E: C_Heli_Light_01_civil_F
        {
            faction="DSF_COP";
            scope = 2;
            scopeCurator = 2;
            side=1;
            displayName="Police MD-500E";
            vehicleClass = "DSF_COP_Helicopters";
            author = "Pakeha";
            hiddenSelections[] = {"camo1"};
            hiddenSelectionsTextures[]=
            {
                "\DrongosSimpleFactions\Cops\Data\police_heli.paa",
                ""
            };
            crew="DSF_COP_pilot";
            typicalCargo[]={"DSF_COP_pilot"};
        };
tough abyss
#

More of a #arma3_config question, but if I had to guess, having more entries in hiddenSelectionsTextures than hiddenSelections could be upsetting things.

jade tendon
tough abyss
#

👍

open hollow
#

hello, i have a little problem.
i want to make some downtime at start of the mission

init is executed, when role selection has pased, but i want to wait until briefing phase has ended ( i mean all players in map) but i dont know how to make an codition to handle that, any ideas?

hallow mortar
#

Any suspension during init will be held until the end of briefing phase, i.e. sleep 5; will completely pause the code and only start its count to 5 when the mission begins

#

This doesn't account for clients still being in post-briefing loading screens - it starts when the map closes, not when the loading screen ends - but as long as your downtime is more than 10-15 seconds you should catch most cases of delayed loading without having to worry about it

sturdy delta
#

https://i.imgur.com/XW8VCw6.png
so i have this trigger wich went really bad when multiple people where on the server
i wonder what went wrong, it got fired on every single machine, i think

#

should i tick "server only" maybe?

copper raven
#

that, and don't remoteExec

sturdy delta
#

i sadly cant just test this, as iam always alone, when tinkering in the editor 😄

warm hedge
#

You can launch multiple instances of Arma and local MP

hallow mortar
copper raven
sturdy delta
copper raven
sturdy delta
#

like that?

copper raven
copper raven
sturdy delta
#

thanks!

open hollow
sturdy delta
#

[RadioHQ,["Send a RifleSquad to Hell", "scripts\sendRifle.sqf"]] remoteExec ["addAction", p1];
this is the init of a player unit (player 1 in this case), i wonder if i should remove the remoteExec too

copper raven
#

yes

#

init boxes run on every machine

open hollow
copper raven
#

there actually you want to exit the script if p1 isn't local

#

or just don't use initboxes for this

sturdy delta
#

well is there even a reason to have triggers, that are not server only? like what about triggers that skip waypoint for AI, should those be on the server only?

hallow mortar
hallow mortar
sturdy delta
#

thanks alot @hallow mortar

digital sphinx
#

I have defined ogg files in a bikb document for a simple conversation, however the game doesn't play the sounds even though it appears to wait for the length of the sounds before moving to the next line. Any ideas where to look for ?

digital sphinx
#

Yes, ["Briefing", "ConversationsAtBase"] call bis_fnc_kbtell;

#

The conversation text flows as I expected

copper raven
#

do you have the speakers defined or whatever?

#

the units

digital sphinx
#

Yes, the units are on the map, their id's are in my bikb file

#

Even their lips are movin

copper raven
#

i never had issues with the conversations thing, you did something wrong somewhere, maybe your audio files are wrong format?

digital sphinx
#

They are just .ogg files I downloaded from a tutorial and I can listen to them out of game with no problem

#

May be they are corrupted or something, idk

#

But the fact that engine is waiting equal to the time of ogg files makes me think I encountered a bug. May be not a common one

hallow mortar
#

Maybe too obvious but have you checked your in-game volume settings?

granite sky
#

@open hollow Check out allUsers + getUserInfo

real tartan
#

how can I log large numbers 2.05217e+009 in decimal format ?

distant egret
#

String them?

willow hound
#

Use toFixed.

drowsy geyser
#

Is there a way to list all players that have activated the same trigger (triggerInterval is set to 0) and then sort from first to last?

hallow mortar
#

Have activation be local player-specific (e.g. player in thisList rather than using this with Any player present) and have them pushBack themselves into a global array when they activate it

drowsy geyser
#

thank you i will try that

copper raven
hallow mortar
#

You'd want the trigger attributes set to Any player but you wouldn't want to use that with this as the condition (the trigger activates when any player enters it); if it's non-repeatable that will mean it only gets the first one unless they all enter at once, and if it's repeatable that means a lot of unnecessary activations from players who have already been got (and duplicate executions of the trigger code, depending on what it is)

digital sphinx
#

This is in the descriptions.ext of my mission:

{
    class ConversationsAtBase
    {
        class Briefing
        {
            file = "\brief.bikb";
            #include "\brief.bikb"
        };
    };
};```

This is brief.bikb:

```class Sentences
{
    class Brief_SQL_Line_1
    {
        text = "Merhaba hoşgeldin";
        speech[] = { "\talk\test1.ogg" };
        class Arguments {};
        actor = "SQL";
    };
    
    class Brief_TL_Line_2
    {
        text = "Seni görmek ne güzel. Gördüğüme sevindim."
        speech[] = { "\talk\test2.ogg" };
        class Arguments {};
        actor = "TL";
    };
    
    class Brief_PL_Line_3
    {
        text = "Hoşbulduk teşekkür ederim."
        speech[] = { "\talk\test3.ogg" };
        class Arguments {};
        actor = "journalist";
    };
};

class Arguments {};
class Special {};
startWithVocal[] = {hour};
startWithConsonant[] = {europe, university};```
I activate it from a trigger with:
`0 = execVM "StartTalk.sqf";`
This is the content of StartTalk.sqf: `["Briefing", "ConversationsAtBase"] call bis_fnc_kbTell;`
And finally, all my sounds are in `talk` folder inside the mission root.
#

Can anyone help me before I go completely crazy tryng to figure this out

drowsy geyser
hallow mortar
#

Sort of, but as long as the trigger is using Any player and this rather than a more specific condition, the trigger will activate on every client when any player enters it, not specifically when the local player enters it.
That's why I made the original suggestion I did; it neatly avoids all these problems.

drowsy geyser
#

condition is set to player in thislist and any player

hallow mortar
#

That's fine. Do make sure it's set to non-repeatable unless you want players to be able to activate it more than once.
If you're using my suggestion of having each client add itself to an array when it activates, and you want it to be repeatable, you might want to use pushBackUnique if you want to record order of first activation rather than order of every activation.

fair drum
#
private _step = 360 / _count;
private _offset = random _step;
for "_i" from 1 to _count do {
    // Gaussian distribution avoids all waypoints ending up in the center
    private _rad = _radius * random [0.1, 0.75, 1];

    // Alternate sides of circle & modulate offset
    private _theta = (_i % 2) * 180 + sin (deg (_step * _i)) * _offset + _step * _i;

    // etc ommitted, not needed
};

so I understand the reasoning by using the gaussian distributions, I usually just do _radius * sqrt random 1 myself though... I understand alternating the sides of the circle on every other iteration by 180 degrees... what I don't understand is the math behind the modulated offset of theta and why it is needed?

south swan
#

Given the what looks like "let's convert degrees step from radians to degrees again and plop the result into sin" the most likely explanation is "because it looks kinda cool"

fair drum
#

this was within CBA_fnc_taskPatrol

south swan
#

Replace with "less uniform" then 🤷‍♂️

#

Effectively "pseudorandomly rotate up to 1 step in any direction"

#

Correction, "up to some preselected part of one step"

twilit crown
#

um Hello! I suck at scripting this is my first time scripting anything good um I am trying to set up respawn with my current loadout but for some reason it spawns me on the position of death and my inventory is empty.
Here is some of my code:

#

and here is my error messages:

#

honestly idk what im doing and how to fix it some help would be greatly appreciated :/

granite sky
#

seems fairly straightforward. P1_1 isn't defined.

#

Is that the variable name of a player unit, set in the editor?

frank mango
#

This seems an awfully complicated way to respawn with your loadout that you had on when you died.

#

OnPlayedKilled.sqf

player setVariable["Saved_Loadout",getUnitLoadout player];```

OnPlayerRespawn.sqf
```sqf
_unit setUnitLoadout (configFile >> "EmptyLoadout");
player setUnitLoadout(player getVariable["Saved_Loadout",[]]);```
fair drum
#

if you are using setUnitLoadout you don't have to clear anything. its going to set it to that loadout array you provide

frank mango
fair drum
#

you can fully clear faster with _unit setUnitLoadout (configFile >> "EmptyLoadout");

frank mango
#

Thank you for the enlightenment ❤️

#

Can I just replace the removeAllX
with that, then having the get loadout still as it is?

fair drum
#

All you need is two lines. The empty loadout and then the new loadout

dreamy kestrel
#

Q: given a custom camera, I want to show the marching ants circle (ellipse, etc) about a radius of the camera... somehow I 'lost' this, not sure was it a camera command, or something else custom drawn like PFH... thanks...

broken forge
#

Infinite Repeating Loop Mission Success End Issue

copper raven
dreamy kestrel
dreamy kestrel
dreamy kestrel
dreamy kestrel
broken forge
#

How do I correctly exit out of the while loop:

// Check if Time Limit and type CBRN
if (_timeLimit && _cbrn) then {
    while { _time > 0 } do {
      _time = _time - 1;
      uiSleep 1;

      private _captives = [];
        
      {
        if (captive _x) then {
        _captives pushBack _x;
        hint str _captives;
      }
    } forEach _hostages;
    
    if (_time <= 0) exitWith {            
      "SmokeShellYellow" createVehicle getMarkerPos _cbrnZone;

      uiSleep 5;

      {
        _x setDamage 0.9;
        _x playMove "acts_executionvictim_kill_end";

        uiSleep 2.75;

        _x setDamage 1;
      } forEach _captives;
    };
  };
};
copper raven
broken forge
#

The while loop continues and doesn't exit for some reason

copper raven
#

_time > 0

#

it should break once it's less than that, have you tried printing the value?

broken forge
#

I've done a few test and I can hear that the smoke shell keeps being created and noticeably lagging the game. As well as the hint str _captives keeps being printed out every second even after the time has expired

copper raven
#

print _time

broken forge
#

just tried it and the time is all over the place as well as continues to count even after it hits 0. Looking further into it it seems as though it starts acting up once hostages start joining my group when I free them.

copper raven
broken forge
#

No negative value

copper raven
#

are you sure that you aren't running this script multiple times accidently?

broken forge
#

It might be running multiple times, I'll have to figure out how to test for that

copper raven
#

test? where are you executing it from?

#

no need to test anything, just run it once

broken forge
#

It's being executed from a script that registers the task and it re-runs the script checking the task conditions every 3 seconds.

tough abyss
#

If it's looping the above script every 3 seconds then that's your problem

#

Either only run the script once, or adjust the script to just work on the 3 second interval without a loop

wanton swallow
#

Does Geiger counter sound presents in arma? Please ping me with className.

ripe sapphire
#

hello, any ideas why setObjectTexture on object's init in MP, on some clients it works and some clients dont?

#

none of the players are JIP

winter rose
ripe sapphire
#

why

winter rose
#

"idk lol"

ripe sapphire
winter rose
#

iirc it has to do with some initialisation

ripe sapphire
ripe sapphire
#

or maybe i make it loop 10 times each second to be sure good_think

winter rose
#

only?

ripe sapphire
#

😈

ripe sapphire
winter rose
#

not unless you do tests and I am sure I didn't say some bs

ripe sapphire
#

I feel that i have been wrongly handled by a Moderator (Rule #9)

winter rose
#

new rule #69: deal with it 😎 you're banned

ripe sapphire
#

absolutely toxic moderatormad

#

i am leaving this game for good

winter rose
#

noooooo we need you

ripe sapphire
#

its too late 😒

winter rose
#

ok I was lying anyway

#

all jokes aside ❤️ I would wager it eventually has to do with initialisation order or randomisation, hence why it would be a good idea to have it externalised
I can't confirm it as of now

ripe sapphire
#

ight i'll do some testing with the global variant of the command

winter rose
#

please no

#

the doc already says not to do that (in the init field at least)

tough abyss
#

simply do a

waitUntil {obj setObjectTextureGlobal [0, "DESIRED_TEXTURE"]; "DESIRED_TEXTURE" in getObjectTextures obj};

in the init 😈

ripe sapphire
ripe sapphire
winter rose
tough abyss
#

the docs still don't auto-redirect the setPos page to a page explaining why setPos is bad so they're not to be trusted

#

the disclaimers aren't enough

winter rose
#

!quote 5

lyric schoonerBOT
winter rose
#

it's… the modding fee

tough abyss
#

does the premium version give access to

if !(call BIS_fnc_modWorks) then {
  call BIS_fnc_makeModWork;
}

?

winter rose
#

hey where did you get internal code, u leaker

tough abyss
#

I would never

winter rose
#

!burgerpan @ripe sapphire telling me what to do notlikemeowcry

tough abyss
#

I slipped lou $5 to never ban me

ripe sapphire
#

he leaked my code

olive forge
#

hey

#

im trying to make a leaderboard using a gui

#

i have a text widget on my gui

#

how to i set the text of the widget?

south swan
olive forge
#

any way to add an event listener for on unconscious?

#

or check if each enemy is unconscious?

real tartan
olive forge
#

thanks 👍

jade acorn
#

I am looking for a way to override the invulnerability of units with hideObject true to enhance the future-soldier-like TTS Cloak script - basically I'd like to be able to deal damage to certain hidden units

grand stratus
#

im curious about the 'size' of data sent with public variables. is there any difference between
PUBLIC_VAR = player
PUBLIC_VAR = uid of player
PUBLIC_VAR = parseNumber uid of player
or does the scripting engine handle it all internally to keep things minimized

lusty hollow
#

Is there a way to tell missile to stop tracking it's target? Similar in effect to successful flare.

tough abyss
#

Would probably want to ask Dedmen if you need actual specifics.

digital sphinx
#

Is there a to define a vanilla sound as a music. I want to use the sound \A3\Sounds_F\environment\structures\church\worship with playMusic

#

I know how to add custom music with CfgMusic but I think just putting this file path doesn't work

jade acorn
#

it's not a file path if there's no file type in it

digital sphinx
#

What confuses me is, when I provide a path, root is mission folder, but this file is vanilla. Is there a way to do it other than moving it to my mission folder?

jade acorn
#

you just put @A3\Sounds_F\environment\structures\church\worship.ogg as the file path, not sure if with @ or \ at start but no need to copy it

digital sphinx
#

Thank you! Will try

lusty hollow
willow hound
#

nil will definitely not work, all commands fail upon nil input.

#

If the target is dead, it is ignored. The target has to be inside the missile's configured targeting cone for the command to work.
I don't think objNull will work, as alive objNull is always false and as it resides at [0, 0, 0] (if I remember correctly).

winter rose
still forum
#

if object is null setMissileTarget does nothing and returns false

#

ah no

#

if arg1 is null.
If arg2 is null it "unlocks" the missile and returns true

winter rose
#

\o/

#

@willow hound in yo face!

#

thanks - I will update the doc 😉

#

added, thanks y'all 🙂

olive forge
#

hm

#

how come

#

when i do (side _unit)

#

on an opfor russian

#

it returns civ?

#
addMissionEventHandler ["EntityKilled", {
    params ["_unit", "_killer", "_instigator", "_useEffects"];
    
    if (_killer isEqualTo player) then
    {
        hint str (side _unit);
    };
}];
#

do they turn to civ once they die?

warm hedge
#

Yes somehow

olive forge
#

is there a way to push the units id to an array, and then check if that id is in the array

#

/ identify the opfor by an array of ids

warm hedge
#

Yes but I wouldn't do it. I'll just store the original side using setVariable

olive forge
#

ah thats smart

#

i only learnt sqf yesterday, does setVariable just give the unit an attribute?

#

and you can get it using _unit origionalSide?

warm hedge
#

Time to check BIKI - our beloved document

#

It could be a gibberish if you have a little clue to read the doc, but basically setVariable command does set a variable into some storage, getVariabledoes get

olive forge
#

yea the docs are a bit confusing at times

#

i think i got it tho

#
_x setVariable ["originalSide", side _x];

_unit getVariable["originalSide", side _unit]) != east```
#

i didnt copy paste whole funcs

#

but they are in different bits of code

#

func too big to paste whole thing

warm hedge
#

Yup yup. You have an unwanted )but the basic idea is it

olive forge
#

if ((_unit getVariable["originalSide", side _unit]) != east) then

#

mb

#

didnt paste whole line

#

thanks for the help 👍

south swan
#

side (group _unit) seems to be a frequently used workaround as well

olive forge
#

alr ty

#

is there a way to determine where the killing shot is?

#

like a headshot

digital sphinx
#

I am trying to run this in the activation field of a trigger: baofficer doMove (getPosATL player); but it doesn't work at all. What could be the problem?

chrome hinge
#

Greetings, anyone got insight on how to modify a variable? Im moving a marker on target every 10 minutes and i have side objectives that are supposed to shave a portion of that cooldown off. (im trying to make amount of sleep into a variable) What would be easiest way to do this or could i make every side objective reduce trigger timer by x amount and just repeat the trigger?

winter rose
chrome hinge
#

Making sleep into a variable and having triggers reduce amount of sleep when triggered

#

and more broadly, player gets marked by a map marker every 10 minutes. Other players complete missions to make the marker update more often

winter rose
#
HALI_SleepDuration = 600;
// ...
sleep HALI_SleepDuration;
// ...
HALI_SleepDuration = 60;
chrome hinge
#

Okay thanks, ill try to get forward

hallow mortar
south swan
#

why not just getNumber (configFile >> "CfgFactionClasses" >> (faction _unit) >> "side") then?

hallow mortar
hallow mortar
winter rose
#

I would still go with side group _unit
one could spawn an OPFOR group on blufor side for scenario purpose 🙂

chrome hinge
#

Can i use count to count activated triggers from a list of triggers? Can i do something like this to process the sleep variable? _alltriggers = List[trigger1, trigger2, trigger3, trigger4,]; //list of triggers that complete tasks when triggered

_triggeredcount = count triggerActivated _alltriggers; // out of alltriggers, count the triggers that have been activated

MARKER_SleepDuration = 600*(1/(_triggeredcount2))-(_triggercount2); // uses amount of triggered triggers to reduce sleep amount

winter rose
#

List[trigger1, trigger2]
list takes a trigger

#
private _list = [trg1, trg2, trg3];
private _activatedTriggers = _list select { triggerActivated _x };
private _activatedTriggersCount = count _activatedTriggers;
#

you cannot make up commands on the fly @chrome hinge

chrome hinge
#

Oh that is very likely the case haha

spare vector
#

can someone help me figure out how to do something...
want to have an addaction only appear on a unit if they are unconscious

drowsy geyser
heavy lily
#

Hey, I'm relatively new to this but have had some success. This one has me stumped I'm trying to get a trigger to replay a sound for a duration of time. Essentially "Playsound "soundx"; on repeat for about 2 minutes. What am I missing? This seems like it should be simple.

winter rose
winter rose
heavy lily
#

everything has revolved around PlaySound within 200 meters of the trigger. I've set it to repeatable and set the trigger to be any player present

#

Also tried a "While True" scenario with a second or two sleep

#

Tried removing all scripts and using the build in sound trigger too on a timeout

winter rose
#

what is the use case?

heavy lily
#

Don't understand the question, are you asking what I'm trying to do?

#

I've been scripting for like 2 weeks so I'm learning jargon still lol

winter rose
#

what is the situation, your context, etc

#

in human words: don't tell me that you are trying to loop a sound every x seconds, tell me e.g "I want the alarm to sound as long as there is an enemy in the area"

heavy lily
#

Ah, okay I want players to get within a certain range of the trigger and then play a sound on repeat for 2 minutes

#

when they enter within 200 meters of the trigger, play sound

winter rose
#

and if they leave, or leave & come back after these two minutes, it doesn't ring again, right?

heavy lily
#

Right, they won't based on mission goals so that's not important but technically yes

winter rose
#

so have a trigger triggering on any player
and in its OnAct:

120 spawn { // 120 is the duration here
  params ["_duration"];
  private _timeLimit = time + _duration;
  while { time < _timeLimit } do
  {
    playSound "mySuperSound";
    sleep 2; // the sound duration
  };
};
heavy lily
#

what'd i miss lol

winter rose
#

remove the comments ^^

heavy lily
#

got it

winter rose
heavy lily
#

yeah I caught that lol

#

testing now

#

I mean...that's what it always was...right?

winter rose
#

totally

#

I never make any mistakes obviously

heavy lily
#

working perfectly thank you

kindred zephyr
real tartan
#

I put showWatch false; in initPlayerLocal.sqf, but I still can see watch when I press [O]. Then I tried run command via debug console, at after execution I no longer can see watch when pressing [O]. Is this command local or do I need to run it on server ( initServer.sqf ) ?

#

nope, it does not work with initServer.sqf either

#

same deal with showCompass false; it does not work until I run it via debug console

drowsy geyser
#

you need waitUntil {time > 1};

winter rose
digital sphinx
tough abyss
#

If it still doesn't work, it could be that either baofficer doesn't exist at the time the trigger is activated, or using baofficer with doMove isn't working because baofficer isn't local where the trigger code runs.

#

The latter could potentially be the issue if the trigger is set up to run client-side (if you're testing on dedi).

digital sphinx
#

Thanks for the advice! It is a singleplayer mission I am working on.

#

Is there any way to check (before running doMove) if baofficer is available?

#

to move etc.

granite sky
#

Available in what sense?

digital sphinx
#

I mean, may be it is because baofficer is running an animation or something at the time of doMove?

granite sky
#

If they're not unconscious or dead then they're typically going to try to follow a doMove.

digital sphinx
#

Hmm. Then I will first check what Sysroot said

digital sphinx
#

He definitely exists, the trigger is definitely activated and baofficer is reachable for other commands. Besides, I set up another soldier with the same commands, he moves. This is very confusing

#

Is there a way to stop the animation I set up in Eden editor? I suspect it is the reason

granite sky
#

_unit switchMove "" should reset animations when run locally to _unit

#

may or may not need _unit playMoveNow "" afterwards.

digital sphinx
#

I tried move, I reset animatios as John Jordan suggested and even replaced the soldier. Still, it doesn't work in this particular situation

granite sky
#

So what's the situation exactly?

tough abyss
#

any clue on how to loop an animation?

round scroll
dreamy kestrel
#

Q: createVehicleLocal is creating "Sign_Sphere100cm_F" objects more or less like I expect, marking off a zone for 'FOB building' purposes. However, it appears to be changing the position "around" existing objects. Is there a way to avoid this without going to the createVehicle primitive? Note, these objects are for local machine area indication only, does not need to be a network object, in fact MUST NOT be. Or should I simply (re-)set its position after creation.

dreamy kestrel
lone vapor
#

Does anyone have experience with VisionModes from night vision goggles?

winter rose
dreamy kestrel
winter rose
#

not exactly, but you can ceil the legs damage with the HandleDamage event handler

naive needle
night sundial
naive needle
#

I'm not talking about the limping

#

I'm talking about the animation speed of the running animation for example

#

You are slower when damaged over 0.1 damage and it gets slower with the damage value

night sundial
#

did you try removing all damage from the legs and testing again?

naive needle
#

yes

grand rock
#

I have a question, where would be a good place to start looking into coding a script that uses persistence on a limited "virtual" arsenal, such as Jeroens Arsenal?
Ideally I'm trying to make it to where I can use a script I make to save all the items in said arsenal so I can just load it later in another mission.
Thank you for any answers 🙂

granite sky
#

JNA stores all its persistent data in the jna_datalist variable.

lone vapor
shut gate
#

Hi again. I think I got unitPlay working after some fiddling, but now I'm trying for a different effect.

I am attempting to make a repeatable trigger that teleports a player using setPosATL but nothing I've done has worked at all in the editor.

First I tried this...
Type: None
Activation: None
Repeatable: Yes
Server Only: No

Condition
player inArea thisTrigger && !(playerside == west);

On Activation
vehicle player setPosATL [10134.3,5202.73,5.31129];

And I've since tried various combinations of type/activation (anybody, any player, server only etc) along with vehicle player in thisList but no luck. Should I be trying this on my dedicated server or am I doing something wrong here beyond that? TY in advance btw.

digital sphinx
# winter rose setup _how_ indeed

baofficer is set to play animation "briefing point table" or something from Eden editor. In the trigger, I reset animations and use doMove. It doesn't work. I tested it without animation, it works everytime.

tough abyss
shut gate
#

I'm not sure; it was taken from the bohemia forums. Thank you, I will try that now 🙂

tough abyss
#

caveat being that you'll want the activation type to be Present

shut gate
#

I really appreciate the help. For some reason, I still can't get it to teleport in the first place. Here's what I'm working with:

#

I also tried Activation: None,

#

and here's the actual trigger in the editor if that's any help.

stable dune
tough abyss
#

Should be working fine with just player seeing as it's a local trigger.

shut gate
shut gate
stable dune
tough abyss
shut gate
tough abyss
#

You are testing with a player on the east/opfor side, yes?

shut gate
#

oh no lol. I have been using blufor. != west means NOT blufor doesn't it?

tough abyss
#

Correct

shut gate
#

🤦‍♂️ I am so sorry lmao

tough abyss
#

No worries 😛

shut gate
#

if i get rid of ## side player != west will that fix the issue?

tough abyss
#

That will make it apply to any player regardless of side

shut gate
#

yeah that's fine :)

tough abyss
#

👍

shut gate
#

now I am well and truly confused. I removed ## side player != west from the Condition and tried it with activation None, Anybody and Any Player to no avail 😭

It's now Condition: player in thisList

and On Activation: vehicle player setPosATL [10134.3,5202.73,5.31129];

Do I have to test it on the running dedicated server or should it work in the editor?

tough abyss
#

Should work fine in the editor

#

^ My test trigger

shut gate
#

ok so I finally got it to work and this is what fixed it:

#

the actual placed point of the trigger (the flag icon) was floating above the floor

tough abyss
#

Ah yeah that'll do it

shut gate
#

and for it to work I think it has to literally be snapped to whatever surface it's on. I moved it outside on the grass and it worked

#

I thought it took the actual 3d shape (the cube or ellipse) to be the area it recognized

tough abyss
#

Some background for that -- the center of players' models from the game perspective is on the ground between their feet, not at their actual center of mass

#

and it's the center that triggers look for

shut gate
#

ohhh my god

#

and i had it just barely above the floor yeah

#

again I seriously appreciate it @tough abyss you are a life saver

tough abyss
#

No worries :)

#

happy to answer any further scripting questions

shut gate
#

I will have many to come I'm sure, I just started integrating scripting into my zeus missions a couple weeks ago and the capabilities are astounding 😃

tough abyss
#

what namespace are global variables stored in?

#

missionNamespace by default

#

hmmm

#

welp time to check all my code and pull some hairs out

#

Can help you, if you want. What's the issue?

winter rose
#

can help pulling hair

cyan dust
# tough abyss Why `playerside`? Should be `side player`.

JFYI playerSide is more preferred in some cases over side player
Most common example is the renegade state. When BLUFOR player killed enough friendly bots or destroyed friendly vehicles their 'player side' will be 'enemy' (renegade) while 'playerSide' still be 'west'

tough abyss
#

thanks :)

torpid mica
#

Hello guys, I need help really quick pls.
i´m currently scripting on a mission containg a trigger with long (i mean really long) TrigggerStatements. So at first i made everything with: setTriggerStatements ["","",""] and the code in between then quotes. The Problem is in Npp++ all the code becomes green because it being text. I know that it is possible to do it with code: setTriggerStatements [{},{},{}] and I have a trigger that works with code. But erverytime i´ll try to do it the second way i get an error that says: Type Code, expected String. does someone know why and can help me?

south swan
stable dune
#

toString ?

#

Oh, artemoz was faster

torpid mica
#
trg_maxfuel setTriggerStatements ["dynamic_fuel > max_fuel_storage", {dynamic_fuel = max_fuel_storage; hintSilent "maximaler Treibstoff erreicht";},""]; // -> this works

_nametrg setTriggerStatements ["this",{
                                            _activated = thisTrigger getVariable "alreadySpawned";
                                            _subarray = thisTrigger getVariable "_subarray";
                                            _subArrayIndex = thistrigger getVariable "_subArrayIndex";
                                            _countactivated = true;
                                        
                                            
                                            
                                            thisTrigger setVariable ["alreadySpawned", "true"];                                          
                                          },"_countactivated = false;"];
// ->but this doesn´t
#

how to post in sqf again?

south swan
#

```sqf in one line

stable dune
#

Does he need add in code block double " or single ' to strings

south swan
#

and another set of ``` to close it off afterwards

torpid mica
#

the second one always gives me the error Type Code, expected String, the first one doesn´t .Second one works fine in quotes but i cant keep overview when everything is green

#

and i just dont get why 😭

south swan
#

i also don't get why. The first version errors out on me just as well

torpid mica
#

i wrote the first one some versions ago but i know it worked. maybe different version?

#

and how can i make it work? any hints for that? because i definitely need that syntax highlighting

south swan
#

or maybe trg_maxfuel doesn't exist and the string gets skipped altogether 🤷‍♂️

south swan
#

toString is the answer. ```sqf
_nametrg setTriggerStatements ["this",toString {
_activated = thisTrigger getVariable "alreadySpawned";
_subarray = thisTrigger getVariable "_subarray";
_subArrayIndex = thistrigger getVariable "_subArrayIndex";
_countactivated = true;

                                        thisTrigger setVariable ["alreadySpawned", "true"];                                          
                                      },"_countactivated = false;"];``` doesn't error out 🤷‍♂️
torpid mica
#

thanks mate. hopefully that´ll do it. Since the tigger does contain about 200 lines of code when it´s ready 🥺

proven charm
#

you can also call function from the trigger: ```sqf
_trg setTriggerStatements ["this", "call myTriggerCode", ""];

torpid mica
#

yeah, good idea as well thanks 🤔 🙂

#

thanks to all contributors. Now it works flawlessly and i´m able to keep track of my code since i have syntax highlighting

torpid mica
#

I have another Problem which is now occurring inside the trigger mentioned above: I have 4 While lops which do something according to 2 variable statuses. They work fine most times but triggering a certain problem with changing the variables in a special order the while loops get triggered even if their condition is not meet and the one which condition is meet does not trigger. I can post the code , but it´s to long for discord chat. So maybe someone could help me in a voice channel.

tame axle
#

Hi All, using this script to create a task. But can't get the task hidden. Tried true and false in the last parameter but still same result, once the task is created it shows up on the map aand in 3d
[grp1,"task2",["Task 2 Briefing Description", "Briefing Title"],(getMarkerpos "mkr1"),"ASSIGNED",1,true,"SCOUT",false]Call BIS_fnc_taskCreate;"mkr1" setMarkerAlpha 1;

winter rose
torpid mica
tame axle
#

@winter rose Thanks for heads up re code. Let me try the objnull approach. I do need to create it since i need to be able to update its state.

winter rose
pastel crater
#

any scripts for a full-heal zone? Tried making my own and failed miserably

torpid mica
pastel crater
#

I could swear I tried the first one and it didn't work

#

Let me check

torpid mica
#

But the first one only works if u use ACE

stable dune
tough abyss
#

That should work better. Just need to pass it the _thisTrigger and _subarray vars

torpid mica
tough abyss
#

👍

torpid mica
#

is someone really good at programming with ai to make them do what they are supposed to? Because I always hat a low of trouble since they weren´t really listening to orders via script. Nee dit for my current project which is going to involve a hell lot of ai programming

dreamy kestrel
granite sky
#

Looks like it, yes.

tough abyss
#

If you provide details as to what you want them to do, people may be able to help you, but the AI have some unavoidable limitations at times.

granite sky
#

And in some cases limitations that can only be bypassed in unreasonably painful ways.

tough abyss
#

As is the arma way

violet remnant
#

with Dynamic Groups is there a way to control what patches are assigned to the groups ?

shut gate
#

I have a question 🙂 is there a way to prevent a trigger from activating/fulfilling its condition— like "locking" it. And then mid-mission (via Zeus) being able to "unlock" it and make it activatable again?

E.g. I have a trigger that is activated by someone being present inside it. But I don't want this trigger to be active right at the start of the mission. I would prefer to, at the right time, make it able to be activated and perhaps lure players to its activation region.

#

maybe giving the trigger a variable or something and using that? I am very new ofc

dreamy kestrel
# granite sky Looks like it, yes.

that's just brilliant 💡 function of...

private _defaultAlgorithm = { _x; };

params [
    ["_from",objNull, [objNull]]
    , ["_to",objNull, [objNull, []]]
    , ["_algorithm", _defaultAlgorithm, [{}]]
];

private _relativeDir = [_from, _to] call BIS_fnc_relativeDirTo;
private _x = _relativeDir;

[_from, _to, _relativeDir] call _algorithm;

which default passes the result back. or can be used to filter whether _aft...

private _aft = [_source, _target, { _x >= 90 && _x < 270; }] call MY_fnc_relativeDirTo;
hallow mortar
# shut gate I have a question 🙂 is there a way to prevent a trigger from activating/fulfill...

Have its condition also include a variable being true/trigger being activated, then set that variable/activate that trigger.

(yourVariableName) && {this}```
^ requires that `yourVariableName` is `true` and that the trigger's configured condition be fulfilled
```sqf
(triggerActivated yourOtherTrigger) && {player in thisList}```
^ requires that `yourOtherTrigger` be activated and that the local player is in the trigger area
hallow mortar
shut gate
hallow mortar
#

Yes, that's the general principle. Obviously replace player in thisList with whatever you want the actual condition for activating the trigger to be, or this to use its configured condition

shut gate
#

funny enough that's exactly what I'm using 😃 thank you very much

hallow mortar
#

Note: pay attention to the ( ... ) && { ... } structure. This is used for lazy evaluation with the &&/and command. It means that the code on the right won't even be checked until the code on the left returns true. If you don't use it (e.g. condition1 && condition2) both pieces of code will be run every time it checks, which can be very frequently with triggers.
Using lazy evaluation is a great way to optimise for performance, since the right side doesn't have any perf drain when it's not being run at all, but you have to make sure you put things in the right order otherwise it may be pointless (or get blocked completely at the first stage, depending on what the code is).

shut gate
#

that's incredibly good to know, I appreciate it, I'll write that down

#

while I'm at it, if I want to hide/show like 10+ objects at once, is there an easy way to put that in an array? instead of say, this:

b1 hideObject false; b2 hideObject false;

and so on and so forth

hallow mortar
#
{
  _x hideObject false;
} forEach [b1,b2,...];```
Be aware of the locality of the `hideObject` command; it has local effect, meaning that in a multiplayer game it will only cause a change on the the machine where the code is being run. In order to make global changes, you need to either have the code run on all machines, `remoteExec` the command, or use `hideObjectGlobal` (_only on the server_).
dreamy kestrel
#

Q: if I have a camera object viewing in a particular vector (direction) to a target object, I want to get that direction, so I can do some translations involving the target object direction.

dreamy kestrel
shut gate
#

Thanks again btw

hallow mortar
#

If it's a trigger, and it's safe for the condition to be evaluated only on the server, use the Server Only checkbox in its attributes. For other scripts, you can use initServer.sqf, or an if isServer then { ... safety check, or remoteExec with target 2.

dreamy kestrel
shut gate
hallow mortar
hallow mortar
dreamy kestrel
empty flame
#

can you help me ?

hallow mortar
shut gate
# hallow mortar Note: `player in thisList` is _not_ an example of a condition that's safe to eva...

I was a little confused, my player in thisList trigger was actually a different one I had for teleporting (which does not have Server Only checked). The one I was working on with you actually just had a this condition with BLUFOR present.

Is there any documentation you could direct me towards on the concept of a 'safe' condition? just to make sure I can avoid those mistakes in the future, regardless :)

empty flame
#

Hello, can you help me?
My problem is that I put mods on my server, when I log in I have access to the modder weapons, but the players do not have access to them

hallow mortar
# shut gate I was a little confused, my ``player in thisList`` trigger was actually a differ...

It's not really a specific defined concept, it's just a way in which you can describe things in this context. It depends on locality of the commands you want to use, and how you want the trigger to work.
It's not safe to evaluate only on the server if:

  • you need the trigger to activate locally on one or all clients, because of locality requirements or because you want player-specific effects
  • the trigger condition can only be true on one machine which may not be the server
  • the trigger condition relies on a command that doesn't work on a dedicated server
hallow mortar
dreamy kestrel
hallow mortar
empty flame
hallow mortar
dreamy kestrel
hallow mortar
#

So.........distance between the mouse world pos and the object world pos?
I guess I'm not understanding why this is a difficulty. You can just...do that.

dreamy kestrel
#

no worries, it is a couple of moving parts, just sorting it out now on paper

fossil smelt
#

What's the possibility of making a drone that follows you around in game without the use of another player controlling it? Similar to an AI drone but it simply follows you based on commands given by a "control pad".

granite sky
#

I was going to say "easy" and then you added "control pad" at the end.

fossil smelt
#

The idea I'm thinking is having it being able to follow specific directives given by the control pad, "Stay Right" it'll keep drone on the right side of you. "Hold fire" pretty obvious. "Keep Front", drone will attempt to stay in front you.

granite sky
#

Based on current facing or something fancier based on direction of recent travel or relative enemy position?

fossil smelt
#

Imagine being in a street right, you got a big drone that can act as a wall as you advance up the street, or in an open field where you can put the drone between you and the zeus controlled AI who are hell bent on making you holier than swiss cheese.

granite sky
#

Oh, like a UGV? That's much harder because ground vehicles are really bad at precise movement.

fossil smelt
#

Doesn't have to be precise, just has to work. And yes, a UGV.

#

I'm currently working out the logistics on what a proper drone swarm or independent and or semi autonomous drone system would look like.

hallow mortar
#

All drone stuff other than direct player control still relies on the usual Arma vehicle AI. So...don't expect too much.

fossil smelt
#

What's the feasibility or if at all possibility to make it better?

pulsar bluff
#

zero, unless you are controlling the vectors/velocities yourself -- and then using it only in Singleplayer because controlling movement manually is not smooth in MP

neat monolith
#

Is there anyway to force the view distance on a MP mission? setViewDistance doesnt seem to work, it allwais takes the player vd

granite sky
#

For who?

neat monolith
#

for all the player

granite sky
#

Run setViewDistance on the server. Wait. Run setViewDistance on the clients. Don't run any mods :P

neat monolith
#

So, it can only be contrones on by the server config?

granite sky
#

Server view distance caps client view distance.

#

But live setViewDistance does work, IIRC.

#

Just not sure on the propagation/negotiation mechanisms.

neat monolith
#

I just want to put the vd on 500m, and I cant change the server config

#

Nothing else

granite sky
#

hmm. Reducing should work.

neat monolith
#

how?

granite sky
#

You can always set clients lower than the server.

#

setViewDistance 500 on the clients.

neat monolith
#

but where I place it? on the mission init does not work

granite sky
#

Well, check if it works in the debug console?

#

Some things don't work on mission init because it's too early.

neat monolith
#

it does work on console

stable dune
pulsar bluff
#

Improving AI suppressive fire

#

let me know what you think

distant egret
pulsar bluff
#

yes, roughly as effective as the other. i did have to adjust elevation for distance. basically bumping the intermediate target up 0.1 for every 100m of range over 300m, roughly ...

hoary saddle
#

how do you turn a c17 into a static object like the static c130 in CUP?

hallow mortar
#

One way is at the config level, making it an "object" rather than a "vehicle". That requires a mod.
Another way is to make it a Simple Object. The easiest way is to use the Simple Object checkbox in the Editor, but scripted solutions like createSimpleObject exist. Simple Objects are static but not destructible or physics interactive. For a similar effect you can also disable simulation.
If you want it destructible and physics-y, but not accessible, just lock it.

hoary saddle
#

Ok thank you!

chrome hinge
#

greetings

#

private _music = list [Music_Battle_Human,LeadTrack03_F_EXP,LeadTrack02_F_EPA,LeadTrack03_F_EPA];

private _randommusic = _list select { _music };

thisTrigger setVariable ["TAG_cooldownmusic", true]; thisTrigger spawn {
[_randommusic, 0, 1] call BIS_fnc_playMusic;
sleep 300;
_this setVariable ["TAG_cooldownmusic", false];};

#

Im trying to pick a random music piece from a list, any insight on what im doing wrong?

south swan
#

list [array] isn't a thing in SQF afaik

#

_list variable isn't defined anywhere

#

_list select {_music} doesn't make much sense in general. This version of select takes array on the left and code that returns boolean on the right 🤷‍♂️

#

_randommusic wouldn't be defined inside the spawned code even if it actually contained anything

hallow mortar
#

Music classnames have to be strings

#
private _musicList = ["classname1","classname2"];
private _randomMusic = selectRandom _musicList;```
There's a start on the basics. I don't have time to talk about the rest, but I'm sure artemoz has got you covered.
abstract shuttle
#

Hey there! Does anybody got an idea how to use "a3\characters_f\civil\data\c_cloth2_v3_co.paa"? I already found out, that the matching clothing is "U_C_HunterBody_grn". But unfortunately I am not able to get a texture on it. Any ideas? blobcloseenjoy

dreamy kestrel
south swan
#

And then come the drones

velvet merlin
#

no drones in WW2 😛

south swan
#

Until somebody configurates a horse as one 🤣

torpid mica
#

does someone know a fast and easy way to spawn Compositions? everything i found online doesn´t really work or doesn´t save dependencies (position, attached objects and their rotation) or init code.

boreal parcel
#

can sqf do if-else-if-else? such as

    if ( buildtype == 99 ) then {
        _classname = FOB_typename;
    } else if (buildtype == 98) then {
        _classname = CAMP_typename;
    } else {
      //...
    }
hallow mortar
#

It cannot, but for what you're doing, you could use a switch case

boreal parcel
#

ahh ok that explains the error

hallow mortar
#

You can put another if inside the else case of the first if, but there is no actual if-else-if

boreal parcel
#

and yeah your right a switch should work fine as well

torpid mica
#
//i mean you could use this as well:

if (condition) then
  {

  }
  else
  {
      if (condition) then 
        {

        }
        else
        {

        };    
  };
boreal parcel
#

true, would a switch or nested if-else be better/faster though?
This is what I would be doing

switch (buildtype) do {
        case 99: { _classname = FOB_typename; };
        case 98: { _classname = CAMP_typename; }
        default {
            _classname = ((KPLIB_buildList select buildtype) select buildindex) select 0;
            _price_s = ((KPLIB_buildList select buildtype) select buildindex) select 1;
            _price_a = ((KPLIB_buildList select buildtype) select buildindex) select 2;
            _price_f = ((KPLIB_buildList select buildtype) select buildindex) select 3;

            _nearfob = [] call KPLIB_fnc_getNearestFob;
            _storage_areas = (_nearfob nearobjects (KP_liberation_FobRange * 2)) select {(_x getVariable ["KP_liberation_storage_type",-1]) == 0};

            [_price_s, _price_a, _price_f, _classname, buildtype, _storage_areas] remoteExec ["build_remote_call",2];
        };
    };
#

I also wanted to check, in sqf switch doesnt need breaks?

torpid mica
#

i think switch is the cleaner version.

boreal parcel
#

alright

hallow mortar
#

It does need a ; after case 98

boreal parcel
#

ah woops, thanks lmao you caught it as I started building the pbo

dreamy kestrel
modest fern
#

is there anyway i can change the timeout threshold on ACE and its dll files?

dreamy kestrel
modest fern
dreamy kestrel
boreal parcel
#

can anyone help me understand why a variable I have certainly defined is nil?
I have 2 variables, im basically try to duplicate variable 1.
in save_manager.sqf on line 74-77 I have

// All FOBs
GRLIB_all_fobs = [];
// All CAMPs
KPLIB_all_camps = [];

in the same file on line 189-190 I assign those variables to the following array data

        GRLIB_all_fobs                              = _saveData select  9;
        KPLIB_all_camps                             = _saveData select  22;

finally on line 517 of that file I define both variables as public variables.

publicVariable "GRLIB_all_fobs";
publicVariable "KPLIB_all_camps";

why is KPLIB_all_camps nil in any other file I try to use it in?
it should at the very least be an empty array right?

dreamy kestrel
boreal parcel
# dreamy kestrel Are there 10 items in the array? much less 23? unless you did something like: ``...

yes, its an array of arrays

[
    kp_liberation_version,
    date,
    _objectsToSave,
    _resourceStorages,
    _stats,
    _weights,
    _aiGroups,
    blufor_sectors,
    combat_readiness,
    GRLIB_all_fobs,
    GRLIB_permissions,
    GRLIB_vehicle_to_military_base_links,
    KP_liberation_civ_rep,
    KP_liberation_clearances,
    KP_liberation_guerilla_strength,
    KP_liberation_logistics,
    KP_liberation_production,
    KP_liberation_production_markers,
    resources_intel,
    _allMines,
    _allCrates,
    KPLIB_sectorTowers,
    KPLIB_all_camps
]
#

the KPLIB_all_camps array will be empty in the beginning but that shouldnt matter right?

dreamy kestrel
boreal parcel
#

or am I misunderstanding something here? I am not crazy familiar with sqf or game programming

#

I have been slowly learning it

dreamy kestrel
knotty crow
#

been trying to get setWeaponReloadingTime to run on a fired event handler, but the first item in event handler array is returning the player that's and not the AT launcher turret i'm trying to apply the command to

#
this addEventHandler ["Fired",{ 
 _vic = _this # 0;
 hint str _vic; 
}];```
#

like this debug code just returns the player instead of the object i'm running this from in the init

#

kinda confused

#

adding vehicle before the _vic variable just returns the exact same thing

hallow mortar
#

It should return the vehicle if applied to a vehicle. Are you absolutely 100% certain you've put it in the init of the turret and not the unit in the turret?

knotty crow
#

when i run this it returns my player twice??

this addEventHandler ["Fired", {  
 private _vic = getShotParents (_this # 6);  
  (_vic # 1) setWeaponReloadingTime [_this # 0, _this # 2, 0]; 
 hint str _vic; 
}];

and then if i change the var name of the at launcher in the editor it returns [var name, player name]

hallow mortar
#

I have a funny feeling this is a behaviour of str when used on objects with no variable name, and not a problem with the EH. I think it's actually returning a reference to the correct object, but when a vehicle has no variable name, str uses the identifier of the effective commander.
Place an ordinary car with the player in it (no variable name for the car), play the mission, remain in the vehicle, and do str vehicle player in the debug console. See what it says.

knotty crow
#

yeah it's doing the same thing

dreamy kestrel
hallow mortar
knotty crow
#

ugh

#

ok, so i guess that's not the issue then

#

EH still not working though

hallow mortar
#

I bet this AT launcher has 1rd magazines and you load a new magazine with each shot

copper raven
knotty crow
#

that's what i've been using

#
this addEventHandler ["Fired", {  
  _this # 0 setWeaponReloadingTime [_this # 7, _this # 2, 0];
}];
#

no error messages but no change in reload time

hallow mortar
#

It won't if the AT launcher has 1rd magazines and you load a new magazine with each shot, because setWeaponReloadingTime affects the intra-magazine reload, not the inter-magazine reload

copper raven
hallow mortar
#

i.e. time to load next shot in mag, not next mag

knotty crow
#

wait oh oh fuck

#

you're right

copper raven
#

what Nikko said

knotty crow
#

goddammit

#

any way to reload the magazine faster?

copper raven
#

remove and readd

knotty crow
#

I mean I guess the end goal is to add it slower

#

cause vanilla reload time is way too fast

copper raven
#

there is no command to change reloading time between magazines - only between shots (what you are using)

knotty crow
#

on the bright side i've learned how to make the marshal have a minigun autocannon

hallow mortar
#

The best you can do without changing the weapon's config is take away all the spare mags, and add a long sleep (in spawned code, no suspending in EH code) before giving them back. This will obviously not be reflected properly in the weapon HUD, so it may be confusing for players.

copper raven
#

add some custom ui on top of that 😄

knotty crow
#

not worried about that, probably only going to use these with AI

hallow mortar
#

It may also be confusing for the AI. Best to lock the turret so they can't abandon it because they think it's out of ammo.

dreamy kestrel
# dreamy kestrel Trying to chain together a couple of submenus, but not getting the `-5` (`cmd_ex...

Anyone have any idea? 'expression' and -5 (cmd_exec) do not seem to be working with a menu directing to a submenu.
Code snippet, not in CPP obviously: https://online-ide.com/I6Zs0rYlEd
The menus do show up correctly, that much I know is working. Also the player action kicking the whole process off, also works.
But I am finding the expressions are not being invoked.

dreamy kestrel
dreamy kestrel
tough abyss
#

@dreamy kestrel From my brief overview of the command menu system (as I've never personally worked with it before), I get the impression that menus with submenus don't have their expressions executed

#

which would match up with the fact that only your menu without a linked submenu seems to be executing

#

if I interpreted the situation correctly, that is

#

now, assuming the execution in that case is handed off to the submenu, you could check the id param passed to the expression to handle behavior switching

#

but once again, guessing based on various things

fossil peak
#

Just a general question but is there a sample of the AR-2 darter? I don't see any way of finding a drone sample if there isn't

fossil peak
#

Arma 3 tools provides samples of animals, characters, cars, houses, helis, planes, tanks and more but there are no drone samples

#

so people can learn from how they're made

dreamy kestrel
fair drum
fossil peak
#

both lol

tough abyss
dreamy kestrel
tough abyss
#

so, assuming the parent triggers the expressions of the sub-menus, you could detect it by checking if the id matches that of the parent

#

but that assumption is not proven

#

either that or the parents of sub-menus just can't have expressions or something

#

in which case

#

¯_(ツ)_/¯

dreamy kestrel
#

also I am not using any of the BIS functions... so SMH dunno... it would not be the worst thing to handle the forward and backward navigation manually and just drop the submenu linkage. I may just do that.

dreamy kestrel
tough abyss
#

👍 glad you found a solution

pulsar bluff
#

need a way to get the exact position of the muzzle of a units weapon

warm hedge
#

Do you mean you want one?

kindred zephyr
#

Im a bit confused, and maybe the scripting channel is not the ideal place for this question itself but:

What would cause a group reported as "flag" entities (I assume virtual or logic?) to be created in the exact same place as another units?

Is

object1 attachTo [object2...];

creating some sort of AI logic in place to represent the attachment tot he object?
Or are helper objects considered AI logic?

Asking as that kind of groups return in the allGroups array and need this bit of info in order to accomodate code loop

hallow mortar
#

Some helper objects may be logics, it really depends on their purpose and who made them.
Modules are logics but I don't know if they appear as groups/units. BIS_fnc_ambientAnim creates logics on unit positions if you're using that.
Some mods may use logics to do invisible stuff.

kindred zephyr
hallow mortar
#

I'm pretty sure those are just normal objects

naive needle
#

How do I check if a position point hits the geometry of an object

#

I want to measure the width of an object

#

of an fence

#

I guess with boundingBox ?

proven charm
naive needle
#
private _p1 = _bbr select 0;
private _p2 = _bbr select 1;
private _maxWidth = abs ((_p2 select 0) - (_p1 select 0));
private _maxLength = abs ((_p2 select 1) - (_p1 select 1));
[_maxLength,_maxWidth]```
#

yea works

south swan
naive needle
#

boundingbox does the job

#

is there also a way to check if the object has workable surface ?

torpid mica
#

I have a question about the attachtTo command. Is it possible to attach a respawn (call BIS_fnc_addRespawnPosition;) to an object?

proven charm
#

no but you can move/attach the object you give to BIS_fnc_addRespawnPosition as position

#

@torpid mica

torpid mica
#

but moving it every ... seconds does cost more performance that attaching it right?

proven charm
#

dunno about that

#

different objects update differently....

unborn bronze
#

Any way to smooth out door animations when using attachToRelative? doors open in steps. I tried setting the visual argument to both true and false to no avail

south swan
#

attaching to non-static objects, apparently 🤔

hallow mortar
#

When an object is attached to something, it inherits the simulation type, and therefore simulation tickrate, of the object it's attached to. This affects animations.

unborn bronze
#

Woah alright, i've always been using invisible helipads for this. thank you!

night sundial
#

is it possible to get the submunition of ammo when it detonates?

wary sandal
#

Hello! is there any (easy?) way to make missiles such as HARMs visible on radars to give the ability to the SAM sites to intercept them?

night sundial
#

nvm i found it

copper raven
#

you'd have to make your own radar ui for that

drowsy geyser
#
//player1FinishTime etc. are the variable for the time when a player activates the finish trigger
_allFinishTimes = [[player1FinishTime, player2FinishTime, player3FinishTime, player4FinishTime, player5FinishTime], [], {_x}, "ASCEND"] call BIS_fnc_sortBy; 

result: [any,any,any,12.352,13.363]
how would i exclude "any"?

wary sandal
#

isn't there a property to make a weapon visible to radars or is it like hardcoded to not show any arms ?

torpid mica
#

how can i change my respawn hight? I tried to playce the marker high up in the sky but even then i respawn on the ground.

#

I just need to set my respawn position (from only one respawn point which is moving) to a very precice location to activate a trigger when that respawn point is selected

#

hopefully someone can help me 🥺

#

theoretically I just need a trigger that is activated when I use a specific spawn Position

proven charm
#

700 is the height (ATL)

night sundial
#

whats the difference between GroundWeaponHolder, WeaponHolder, WeaponHolder_Single_F etc?

torpid mica
south swan
#

WeaponHolder has scope=0 (private?)
GroundWeaponHolder is the same, but with scope=1 (hidden?)
WeaponHolder_Single_F has different p3d model that should (iirc) only show the first weapon in container and no ammo

proven charm
proven charm
night sundial
#

yea that one too

#

hence the etc

torpid mica
proven charm
torpid mica
south swan
#

WeaponHolderSimulated has PhysX simulation, so your dropped RPG can roll down the cliff

proven charm
torpid mica
# proven charm it should follow the vehicle , maybe its different for static objects

if i set the position to a object directly i spawn besides the object.
For illustration: placed a vehicle, created a trigger on top of it, attached the trigger to the vehicle (including offset) then
used getPos and you code -> spawn at the perfect spot but when i move the trigger (aka the vehicle) the spawnpoint stays.
if i set a object as referenc (in my example the trigger) i spawn besides the car (under the trigger).

torpid mica
proven charm
wary sandal
#

I might have an idea here, can i make this radar(or any object) act like an actual radar and show up on planes' rwr?

wary sandal
real tartan
copper raven
#

i don't think it will work on static objects like that

sturdy delta
#

so i have rhs mod, i know that you can _anyWaypoint setWaypointType "SAD" for example
but how you set RHS infantryparadrop on a waypoint via script?
https://i.imgur.com/gtVPMSQ.png

#

that would be so cool to just spawn in Paradrop Planes via script 🙂

#

i tried to google this, but couldnt find anything about it

sturdy delta
#

ok the type is "SCRIPTED" but now i wonder how to insert a script into a scripted waypoint 🤔

copper raven
#

scripted waypoint takes a script path

sturdy delta
#

thanks! ❤️

sturdy delta
#
_wp1 setWaypointType "SCRIPTED";
_wp1 setWaypointScript "\rhsafrf\addons\rhs_c_air\scripts\WP_ParaInf.sqf";
_wp1 setWaypointCompletionRadius 100;```
if you care