#arma3_scripting

1 messages Β· Page 79 of 1

stray flame
#

so its like _this setVehicleAmmo 0;

warm hedge
#

No

winter rose
#
params ["_newVehicle"];
_newVehicle setVehicleAmmo 0;
#

and be done with it

stray flame
#

alright

cyan dust
#

Aha, now I see, but the problem is - it returns the height of a terrain under player's feet, not what I need

winter rose
#

nooo wait

#

getPosATL πŸ˜‘

#

try getPosASL?

cyan dust
little raptor
#
obj worldToModel ASLtoAGL getPosASL obj
#

that gives you the diff between land contact and center in model coords

#

you can then convert it to world using vectorModelToWorld

cyan dust
little raptor
#

getPosWorld from some model point.
center, [0,0,0]

south swan
#

which can be pretty much anywhere inside what? 30 meter box? Unless there's autocentering in play, in which case it should by roughly in the geometry center blobdoggoshruggoogly

little raptor
#

that wasn't even the question

cyan dust
#

I just realized that difference in model points to measure is not a 'bug', but a feature explicitly described in 'getPosWorld' doku notlikemeow
And yeah, you can use 'getModelInfo' if you so want to know the difference in height between those points.

And for units it's 0, but for hellcat it's almost half its size

#

So my bad. Thanks for helping.

little raptor
#

And yeah, you can use 'getModelInfo' if you so want to know the difference in height between those points.
it's actually a dynamic point

#

it varies as the object rotates

#

I have no idea how the game measures it tho

south swan
#

"the vertex in geometry LOD that's furthest down in this orientation" is the first guess meowsweats

little raptor
#

maybe blobdoggoshruggoogly

true frigate
#

I have a script here that (I believe) needs to be called on every client with remoteExec '0', but it uses a while {true} loop and I'm worried it might impact performance quite heavily.
Could someone correct me if I'm wrong? It seems that calling it with '2' doesn't work on a dedicated server but I don't want to get there tonight and have 30 while loops spawn.
https://pastebin.com/UjdQRWGt

proven charm
true frigate
#

Ah, the problem is that it's on a truck - it's free to move and I want it to be able to check for new logs around the area that might be spawned in.

proven charm
#

oh ok

#

still one remoteExec per action would work

true frigate
#

Sorry I'm not sure if I'm misunderstanding something haha, I'm calling the entire script with remoteExec, and since it has the loop on it - I'm not sure if executing it technically more than once would result in poor performance.

proven charm
#

ah having a loop in remexec code doesnt make it lag because only the times sent and how big the code is counts

hallow mortar
#

Where are you remoteExecing it from?

true frigate
#

Inside of a trigger set to server only

#

Not sure if that makes a difference

hallow mortar
#

That means you will not accidentally generate 30 instances of the loop (provided the trigger is not repeatable)

#

The trigger only activates once, on the server -> the server broadcasts the remoteExec once -> each client starts one local copy of the loop -> no problems

true frigate
#

Alright, thanks for the explanation πŸ™‚

#

Didn't want a repeat of my last mistake haha

hallow mortar
#

I trust this script is contained in a function which you're remoteExecing? Broadcasting the entire script as plain code would be...unwise

true frigate
#

Yep, this is a function

hallow mortar
#

πŸ‘

true frigate
#

I'm stupid, I'm not that stupid πŸ˜„

#

Arguably

still forum
#

It can't.
It only scales attached and simple objects.
Other objects are allowed in Eden for screenshot making needs, but outside Eden the command just does nothing

winter rose
still forum
#

Good question.

The code is
if (isattached)
else if (is simple object)
else (false || EdenIsOpen)

#

If its a stinky banner, why is the stinky banner not a simple object?

#

its not reserved, _x isn't either

#

It does.
Setting a variable without private, Arma has to look all scopes above if the variable already exists, so it can replace its value.
With private, it just sets it in current scope, no need to chec kup

stark fjord
#

Can you set texture on simple stinky banner?

winter rose
still forum
#

The script failed to compile
so instead of

[a, b, c, d]
you ended up with
[a, , c, d]

Then it tried to create a 4 element array, but there are only 3 elements on the stack -> stack size violation

open hollow
still forum
#

Where does it say thats not recommended?

open hollow
still forum
#

The thing with loops is yeah you repeatedly re-create the variable which is less efficient than lookup in parent scope

#

I think you missunderstood yea

open hollow
#

probably was

While {true} do {private _myvar = 2};
open hollow
proven charm
#

is private ["_var"]; slower than private _var ?

sweet zodiac
#

It's more a question of why would you do that

proven charm
#

old code

still forum
proven charm
#

cool

still forum
#

more commands are slower yes

proven charm
#

nice πŸ‘

winter rose
winter rose
still forum
#

yes

#

indeed in eventhandlers it doesn't make sense to use it as there is no parent scope. But it also doesn't hurt adding it

winter rose
#

☝️ @little raptor πŸ˜‹

winter rose
little raptor
#

what did I do?! πŸ˜…

winter rose
proven charm
winter rose
#

well, Example 1 states that the string version is already less performant πŸ˜„

proven charm
#

ah didnt see it πŸ™‚

still forum
boreal parcel
#

how does one enable the select respawn on map screen?
I have respawn = 3; set, and I have multiple respawns created, one via respawn_west marker and the rest should be created on players via [player, getPosATL player] call BIS_fnc_addRespawnPosition;

But players just instantly respawn on respawn_west, no map screen or anything

stark fjord
#

you can add others, like Spectator, tickets etc too

boreal parcel
#

ah, hopefully thats it. Thank you ill give this a looky

boreal parcel
stark fjord
#

Lemm check. We use it with respawn position module.

frozen seal
#

Is there a way to assign a preferred look direction for an AI via script?
I know that as a squad leader you can order AI to look a certain way (like, "watch North-East"). Is there a way to do the same with scripting?

little raptor
#

doWatch

frozen seal
#

yep, that sounds about right, thx!
Is there any way to make this command work with azimuth rather than a specific position?

boreal parcel
sweet zodiac
#

They shouldn't, you just need to set the team that it works for

#

Markers are the only ones that need variable names to my knowledge

stark fjord
#

(set delay time as you wish), and ive used module (No markers)

boreal parcel
#

huh, for whatever reason changing the order those 3 lines were placed in fixed it. That or changing the respawn delay to 1

#

thank you

stark fjord
#

think its respawn delay, has to be > 0. otherwise i also respawn on death position

sweet zodiac
#

Yeah been like that for a good long while

boreal parcel
#

I do have another question, is there any obvious reason why this addAction will work fine in locally hosted multiplayer (via editor) but on a dedicated server there appears to be 2 of this addaction instead of one, and itll fade away not long after you start holding.

[ 
    this, 
    "Attempt Defusal", 
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_secure_ca.paa", 
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_secure_ca.paa", 
    "_this distance _target < 3", 
    "_caller distance _target < 3", 
    { 
        params ["_target", "_caller", "_actionId", "_arguments"]; 
        format["%1 has begun defusing, protect him!", _caller] remoteExec ["hint", -2];
        StartEnemyWaves = true;
        publicVariable 'StartEnemyWaves';
    }, 
    {}, 
    { 
        params ["_target", "_caller", "_actionId", "_arguments"]; 
        [getPosASL _caller, 100, false, [true, true, true, true, true, true, true, true, true, true], 1] spawn freestylesNuclearBlast_fnc_initBlast; 
    }, 
    { 
        params ["_target", "_caller", "_actionId", "_arguments"]; 
        format["%1 stopped defusing, get back on it!", _caller] remoteExec ["hint", -2]; 
    }, 
    [], 
    120, 
    0, 
    true, 
    false 
] remoteExec ["BIS_fnc_holdActionAdd", 0, this];
stark fjord
#

no. client is only local to itself

south swan
boreal parcel
south swan
#

Init field gets executed by every joining client. And you have remoteExec in Init field. So every joining client would add another copy of said action to everybody who've joined before them blobdoggoshruggoogly

boreal parcel
#

ah

#

hmm

#

okay ill throw it into the initServer.sqf and give the object I want it on a variable name

#

should fix it then right

sweet zodiac
#

If you want everyone to have the action just put the regular addAction/holdAction into the init field

south swan
#

just do [...] call BIS_fnc_holdActionAdd; in the Init blobdoggoshruggoogly

boreal parcel
#

hmm also true

sweet zodiac
#

Effectively the Init does the job of Remote Exec for you

boreal parcel
#

thats good to know as well, I didnt know this before

sweet zodiac
#

The same as initPlayerLocal.sqf

#

Beware scenarios where if you have something remove the action Later, e.g when the action gets used, People who Join after it's removed likely will still have the action Show

boreal parcel
#

alright, thankfully once this holdAction completes everyone dies and mission is pretty much over

sweet zodiac
#

Locality can be a nuisance but once you wrap your head around it stuff gets much easier

#

Do you mean an AI in their Squad?

#

I believe those become Local to the Squad Leader

#

No

#

The players Unit can only be local to that player iirc

#

That would be a nightmare otherwise

granite sky
#

Technically the player's unit is initially local to the server :P

#

I think it's already player-local by the time initPlayerLocal is executed though. Not sure because undocumented.

wary sandal
#

I'm pretty sure I found a bug?

#

third wiki example errors

still forum
#

Thats because your parent _this is passed along, and contains a number as first element

#

use [] call instead

boreal parcel
#

is there a built in way to allow players to respawn on one another? like in the apex campaign?

agile flower
#

howdy gang

#

is there ElseIf or do I need to nest an If?

#

or should I use a switch?

granite sky
#

I like this pattern:

call {
  if (condition) exitWith { // some code };
  if (condition2) exitWith { // some other code };
  // default case code
};
#

Switch works out slightly faster if the the conditions are suitable but not for general conditions.

boreal parcel
#

I attempted to throw this into the initPlayerLocal.sqf but no luck. Does anyone know how the apex campaign does it?
params ["_player", "_didJIP"];
[_player, _player, name _player] call BIS_fnc_addRespawnPosition;

opal zephyr
boreal parcel
sudden yacht
#

I am trying to remember.. I just cannot find it... There was an event handler for side and system chat ect? Help?

stark fjord
#

Dont think so? As in intercept chat or when message shows?

sudden yacht
#

Yeah. I remember specifically using something that at leasts checks whats in the chat box

sudden yacht
#

ty.

#

I might need a bit more help with this.

winter rose
#

denied

sudden yacht
#

lol ... if (_text == HELP WITH THIS) then { "It's true" } else { "It's false" };...

stark fjord
#

Yeah but that aint text, its just an error

sudden yacht
#
    params ["_channel", "_owner", "_from", "_text", "_person", "_name", "_strID", "_forcedDisplay", "_isPlayerMessage", "_sentenceType", "_chatMessageType"];  if (_text == THISISTEXT) then { "It's true" } else { "It's false" };

}];```
#

?

stark fjord
#

THISISTEXT isnt a string, its a global variable at best.
U wanna add quotes "

sudden yacht
#

got ya

#

ty

boreal parcel
#

how would one go about detecting vehicle wrecks? not any specific kind just wrecks in general

#

would I still look for objects of type Car, Tank, Helicopter etc?

hallow mortar
#

I believe yes, and you should be able to identify them by them being !alive

dreamy kestrel
dreamy kestrel
hallow mortar
#

Yes, I meant in combination with their other checks to determine what kind of object it is. I don't know how they'd end up with objNull on their list of objects to check, but presumably they're not looking for e.g. dead walls and fences.

dreamy kestrel
#

assuming an over zealous deleteVehicle, along these lines... becomes objNull.

dreamy kestrel
upbeat valve
#
[opforsquad_1, spawn_1] call TG_fnc_squadSpawn;
[opforsquad_2, spawn_2] call TG_fnc_squadSpawn;
[opforsquad_3, spawn_3] call TG_fnc_squadSpawn;
[opforsquad_4, spawn_4] call TG_fnc_squadSpawn;

opforsquad_1Move1 = opforsquad_1 addWaypoint [getMarkerPos "move1", 0];  
opforsquad_1Move1 setWaypointType "MOVE"; 
opforsquad_2Move1 = opforsquad_2 addWaypoint [getMarkerPos "move1", 0];  
opforsquad_2Move1 setWaypointType "MOVE"; 
 
opforsquad_1Move2 = opforsquad_1 addWaypoint [getMarkerPos "move2", 0];  
opforsquad_1Move2 setWaypointType "SAD"; 
opforsquad_2Move2 = opforsquad_2 addWaypoint [getMarkerPos "move2", 0];  
opforsquad_2Move2 setWaypointType "SAD"; 
 
opforsquad_3Move1 = opforsquad_3 addWaypoint [getMarkerPos "move3", 0];  
opforsquad_3Move1 setWaypointType "SAD"; 
opforsquad_4Move1 = opforsquad_4 addWaypoint [getMarkerPos "move3", 0];  
opforsquad_4Move1 setWaypointType "SAD"; 
 
opforsquad_3Move2 = opforsquad_3 addWaypoint [getMarkerPos "move4", 0];  
opforsquad_3Move2 setWaypointType "SAD"; 
opforsquad_4Move2 = opforsquad_4 addWaypoint [getMarkerPos "move4", 0];  
opforsquad_4Move2 setWaypointType "SAD"; 
}```
This code can spawn in squads fine, but waypoints do not work at all. Im totally stumped, especially since I've gotten addWaypoint to work before
granite sky
#

What is opforsquad_1 and what does that squadSpawn function do exactly?

upbeat valve
# granite sky What is `opforsquad_1` and what does that squadSpawn function do exactly?

An ID for an opfor squad im spawning in. here's the function


_squad = _this select 0;
_spawn = if (count _this > 1) then {_this select 1} else {spawn_1};
_position = getPosATL _spawn;

_squad = [_position, east, [
"1715_Eng_MR_Lieutenant", 
"1715_Eng_MR_Captain", 
"1715_Eng_MR_Corporal",
"1715_Eng_MR_Corporal",
"1715_Eng_MR_Sergeant",
"1715_Eng_MR_Sergeant",
"1715_Eng_MR_Private", 
"1715_Eng_MR_Private",
"1715_Eng_MR_Private",
"1715_Eng_MR_Private",
"1715_Eng_MR_Private",
"1715_Eng_MR_Private"
]] call BIS_fnc_spawnGroup; 
 
leader _squad setVariable ["lambs_danger_dangerRadio", true]; 

deleteVehicle _spawn;```
#

_spawn is just an object i'll place down where i want the squad to spawn, since markers dont work sometimes, like when i try to use tasks from lambs ai

granite sky
#

Yeah that's not going to work.

#

You're assuming that opforsquad_1 will end up holding the group but that's not what the code does.

upbeat valve
#

What do you mean by that?

#

I've used this function in other missions and it worked well

granite sky
#

Well, the function will create the group but it won't pass any data back.

#

_squad = _this select 0 sets the local variable _squad to the value of _this select 0. It doesn't create a reference to it or anything like that.

#

If you wanted to return the group, the conventional way would be something like opforsquad_1 = [spawn_1] call TG_fnc_squadSpawn, and then at the end of the squadSpawn function you'd return the group on the last line like this:
_squad;

#

You can modify the input array, but it's not a good idea and still wouldn't set opforsquad_X here anyway, because creating the input array is also making a copy of the variable not a reference.

upbeat valve
upbeat valve
granite sky
#

Well, you're only using one input argument here.

#

You want an output value, which you're not currently setting.

upbeat valve
#

But you said i shouldn't use _spawn = if (count _this > 1) then {_this select 1} else {spawn_1};

granite sky
#

I never said anything about that line but it's certainly going to need to change if you're removing the first parameter.

upbeat valve
granite sky
#

I'll rewrite it, sec.

#
if (!isServer) exitWith {};

params [["_spawn", spawn_1]];
private _position = getPosATL _spawn;

private _squad = [_position, east, [
"1715_Eng_MR_Lieutenant", 
"1715_Eng_MR_Captain", 
"1715_Eng_MR_Corporal",
"1715_Eng_MR_Corporal",
"1715_Eng_MR_Sergeant",
"1715_Eng_MR_Sergeant",
"1715_Eng_MR_Private", 
"1715_Eng_MR_Private",
"1715_Eng_MR_Private",
"1715_Eng_MR_Private",
"1715_Eng_MR_Private",
"1715_Eng_MR_Private"
]] call BIS_fnc_spawnGroup; 
 
leader _squad setVariable ["lambs_danger_dangerRadio", true]; 

deleteVehicle _spawn;

_squad;
#

And then the top of the calling function would change to:

opforsquad_1 = [spawn_1] call TG_fnc_squadSpawn;
opforsquad_2 = [spawn_2] call TG_fnc_squadSpawn;
opforsquad_3 = [spawn_3] call TG_fnc_squadSpawn;
opforsquad_4 = [spawn_4] call TG_fnc_squadSpawn;
upbeat valve
cosmic edge
#

yes

upbeat valve
granite sky
#

markerPos/getMarkerPos returns an ATL position.

#

or possibly AGL? probably fine :P

upbeat valve
#

What

granite sky
#

It's a troll, just ignore it.

upbeat valve
granite sky
#

shrugs

#

check it in the debug console.

#

oh, you know markers are strings, right

#

so it'd be "spawn_1" not spawn_1

upbeat valve
#

I didnt

#

Thanks

upbeat valve
cosmic edge
mighty halo
#

Barma

proven charm
#

why isnt this simple destroyer placing code not working, the ship is placed on bottom of the ocean? ```sqf
_as = getposASL player;
_as set [2,0];

_e = "Land_Destroyer_01_base_F" createVehicle (getposASL player);

_e setposASL _as;

warm hedge
#
[_e] call BIS_fnc_Destroyer01PosUpdate```try
proven charm
meager granite
#

https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HitPart

ammo: Array - ammo info: [hit value, indirect hit value, indirect hit range, explosive damage, ammo class name]; Or, in case of a vehicle collision: [impulse value, 0, 0, 0]; hit and damage values are derived from the projectile's CfgAmmo class, and do not match the actual damage inflicted, which is usually lower due to armor and other factors

Anybody knows when this [impulse value, 0, 0, 0] case for vehicle collision happens? Can't seem to get it no matter what.

#

It is for pre-A3 pre-PhysX stuff only?

meager granite
#

In my case it happened with RPG-32 shot, original grenade explosion and damage was null in HitPart, while penetrator was properly available in HitPart

#

Probably not fixable because I know that EHs are called after engine is done doing its stuff, so by the time EH scripts execute, original grenade shot is already deleted because it was submunition.

stray flame
#

if I wanted to make a thing where you need an item to get through something, what would I do?

#

like say, you have a toolkit on you and you can then remove a metal barricade

proven charm
#

but you need valid item name for "Toolkit"

stray flame
#

wouldnt it just be the item class name?

proven charm
#

yes

sweet zodiac
#

I believe it literally is "ToolKit" for the Toolkit

#

Taken from a function of my own

// Engineer Section
// If they have a toolkit make them Engineer
if ("ToolKit" in _items) then {
    player setUnitTrait ["Engineer", true];
} else {
    player setUnitTrait ["Engineer", false];
};
stark fjord
hallow mortar
#

It's part of the difficulty settings

stark fjord
#

Mainly in server difficulty preset. Or if you self host, your own

hallow mortar
stark fjord
#

I think that was intended.

#

It can also override stuff from mods like debug console.

#

Not that i have issue with it, but it would be nice to be able to choose, like you can with cba settings

frozen seal
#

This gives me an error "6 elements provided, 3 expected". But I'm pretty sure I am passing 5 arguments, not 6 o_0 Am I going crazy?

_type = typeOf _x;
_pos = position gameLogic_2 + _relativePosition;

_newProp = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
winter rose
#
[0,1,2] + [1,2,3] = [0,1,2,1,2,3]
#

use vectorAdd

frozen seal
#

ah damn right. My Unity habits did me bad. Thank you.

manic sigil
#
_incappedPlayers = _medicalTent nearEntities ["man",200] select {isPlayer _x && _x getvariable "vn_revive_incapacitated"};

_incappedNPCs = _medicalTent nearEntities ["man",200] select {lifeState _x == "INCAPACITATED"};

systemchat str _incappedNPCs;

if (count _incappedPlayers > 0)
    then
    {_corpList = [[_incappedPlayers],[],{_corpsman distance _x},"ASCEND"] call bis_fnc_sortBy;
    _corpTarget = _corpList select 0;}
    else
    {_corpList = [[_incappedNPCs],[],{_corpsman distance _x},"ASCEND"] call bis_fnc_sortBy;
    _corpTarget = _corpList select 0;};    

systemChat str _corpTarget;

Bluh. Why isn't my if-then generating _corpTarget? As far as I can tell, everything else functions, it finds the nearest _incapped unit, it's just not passing it forward.

meager granite
#

Its not defined outside of if-then-else scope

#
if(true) then {
    _someVar = 123;
};
// _someVar is undefined here
```vs
```sqf
private "_someVar";
if(true) then {
    _someVar = 123;
};
// _someVar is 123 here
#
private _corpTarget = if (count _incappedPlayers > 0)
    then
    {[[_incappedPlayers],[],{_corpsman distance _x},"ASCEND"] call bis_fnc_sortBy select 0;}
    else
    {[[_incappedNPCs],[],{_corpsman distance _x},"ASCEND"] call bis_fnc_sortBy select 0;};
```you can also do this
#

_corpTarget will be nil if both arrays are empty though

manic sigil
#

... ffffffff of course it's that basic.

#

The loop this is in doesnt kick off until one of those lists will have at least one unit in it.

meager granite
#

πŸ‘Œ

#
private _corpTarget = if (count _incappedPlayers > 0) then {
    [[_incappedPlayers],[],{_corpsman distance _x},"ASCEND"] call bis_fnc_sortBy select 0;
} else {
    [[_incappedNPCs],[],{_corpsman distance _x},"ASCEND"] call bis_fnc_sortBy select 0;
};
```also better formatting
manic sigil
#

I'll go with that, it's a lot smoother. Didn't know you could '= If'

frozen seal
#

Now it says I provide 0 elements to createVehicle T_T

_relativePosition = _pos vectorDiff _pos2;
_pos2 = position gameLogic_2;
_pos2 = _pos2 vectorAdd _relativePosition;
_type = typeOf _x;
    
_newProp = createVehicle [_type, _pos2, [], 0, "CAN_COLLIDE"];
#

nvm found the error

manic sigil
#

Did a little touchup and it's working now. Thanks, Sa-Matra!

frozen seal
#

I need rotation in all 3 axes

manic sigil
#

Wouldn't that be vectorUp?

stark fjord
#

And vectorDir. But then you have to covert it to angle.
In that case its easier to use setVectorDirAndUp

stark fjord
#

Thats direction πŸ˜› -> getDir

meager granite
#

yep

frozen seal
stark fjord
#

Afaik no. I guess mod can make its own messages with systemChat

#

deathMessages=0; in profile should rid of them all

manic sigil
#

Trying to wrap my head around my config files, I'm deep in the weeds on this one.

class CfgFunctions
{
  class SRD
  {
  tag="SRD";
    class 1
    {
      class 2
      {}
    }
    class 3
    {
      class 4
      {}
    }
  }
}

So, if have in my root mission directory two folders, '1' and '3', and inside those folders I have files labeled 'fn_2.sqf' and 'fn_4.sqf' respectively, that should be correct, yeah?

#

Or would this be more appropriate for the configmaker's channel? :x

stark fjord
#

first you dont need tag="SRD"; if function TAG class is already SRD

#

also im not sure using numbers to name functions is .... okay

#

compiler might complain

manic sigil
#

It's an example, they have proper names.

stark fjord
#

for example youd want

class CfgFunctions
{
  class MY_TAG
  {
    class MY_CATEGORY
    {
      class myFunc1 {};
      class myFunc2 {};
    };
  };
};

And put fn_myFunc1 and 2 into folder functions\MY_CATEGORY within your mission folder

#

OR you can

{
  class MY_TAG
  {
    class MY_CATEGORY
    {
      file="my_folder";
      class myFunc1 {};
      class myFunc2 {};
    };
  };
};```
Then your function files go into my_folder\ within your mission folder
manic sigil
#

This is going in a config.cpp for a mod, I was given to understand it uses a different format - category being the folder name.

#

And I was hoping to split my functions between different folders :x

stark fjord
#

then you need to use 2nd example, with file

#

and you can make multiples yes

#
class CfgFunctions
{
  class MY_TAG
  {
    class MY_CATEGORY1
    {
      file="my_folder";
      class myFunc1 {};
      class myFunc2 {};
    };
    class MY_CATEGORY2
    {
      file="my_folder2";
      class myFunc3 {};
      class myFunc4 {};
    };
  };
};```
#

also when using mod you need \addon_prefix\function_folder. in description.ext you dont need that (for file="";)

manic sigil
#

So, if I have the folder CoMn in the root '@MFAIO' folder, it'd be file="@MFAIO\CoMn"?

stark fjord
#

Umm no. More to do with pbo prefix

manic sigil
#

Hrn. See, I had a working version before, but it required me to bury my files deep in the folder soup for no reason, it used

file="@MFAIO\addons\Reinforce\functions"

stark fjord
#

If ur pboprefix is asdf
Then it would be file="\asdf\myFuncFolder"

manic sigil
#

Alright, time to sound like a pillock, but how do I find my pboprefix?

granite sky
#

It's an attribute on the PBO.

#

How it ends up there depends on how you're creating your PBOs.

manic sigil
#

I'm using Arma Tools' Addon Builder

granite sky
#

The UI or the command line?

manic sigil
#

UI

granite sky
#

The UI sucks :P

manic sigil
#

Well πŸ˜›

#

But I see an option to add a prefix. Huh.

granite sky
#

Yeah, the trouble is that the option is in the wrong place.

stable dune
#

You can add or it add automatic prefix. Have you check your pbo file does is include $PREFIX$

granite sky
#

I don't think addon builder cares about PBOPREFIX files.

manic sigil
#

It may be in the wrong place, but it worked πŸ˜„

granite sky
#

Yeah, trouble is that if you have multiple PBOs then you have to change that fucking thing for every one.

#

So at that point you really want to script it.

manic sigil
#

You mean, change it in the UI? Or does it have to be changed in each packed PBO?

hallow mortar
granite sky
#

@granite haven Haven't tried death messages, but Arma might not know if you're using medical mods.

hallow mortar
little raptor
sweet zodiac
#

I could never have all my things in One PBO that would drive me insane

winter rose
#

Hmm, camera rework…

systemChat "firstCamera";
  _camera camPrepareTarget _officer;
  _camera camCommitPrepared 0;
  _camera camPrepareRelPos [-0.03, 0.58, 1.43];
  _camera camPrepareFOV 0.700;
  _camera camCommitPrepared 0;
waitUntil { camCommitted _camera };
systemChat "secondCamera"; // this is reached

  _camera camPrepareTarget _officer;
  _camera camCommitPrepared 0;
  _camera camPrepareRelPos [-0.03, 0.58, 1.43];
  _camera camPrepareFOV 0.700;
  _camera camCommitPrepared 1;
waitUntil { camCommitted _camera };
systemChat "titleCut out"; // this is never reached
  titleCut ["", "BLACK OUT", 3];
```@still forum is there any chance that camera could get some love / bugfix / exploration or…?
I know it's dusty in a corner, so I wonder if investigation is possible
little raptor
#

I never even understood what prepared stuff do meowsweats

winter rose
#

I think it preloads the scene depending on planned camera angles

#

wtf, camCommitted seems to always return false now? meowsweats

winter rose
#

oooh wait, it might have to be if I am in map (or in vehicle?let's hope not) when the camera triggers πŸ˜‘

winter rose
#

ok no, it's something else e_e there are no waitUntil anymore and the script still halts here

"first camera" call _systemChat;
// === 19:15:47
_camera camPrepareTarget _officer; call _systemChat;
_camera camCommitPrepared 0; call _systemChat;
_camera camPrepareRelPos [-0.03, 0.58, 1.43]; call _systemChat;
_camera camPrepareFOV 0.700; call _systemChat;
_camera camCommitPrepared 0; call _systemChat; // this _systemChat is not called... camCommitPrepared shenanigans
#

…understood 😦

stark fjord
#

but what if you commit it unprepared, like take it by surprise?

winter rose
#

then it would be camSet* and not camPrepare*
it would work, but I would have to document camPrepare* failures

stark fjord
#

Here is a question, why does a one shot trigger keep evaluating condition, even after it has been triggered?

silent scaffold
#

Guys sorry for the question but I wanted to have some way for indenpent/civilian to talk to me on blufor , either by chat or something like that , because I wanted to do it as if it were a task , sorry for the bad English I am using a translator
Thanks a lot if anyone can help!

#

I need that when I get close to an npc , whether idependent or civilian , he sends me a message via chat , I know there is a trigger for this but it works only for blufor x blufor not blufor x idependent

manic sigil
# silent scaffold Guys sorry for the question but I wanted to have some way for indenpent/civilian...

You have quite a few options for this. Using the <x>Chat commands as suggested in general is one, though only globalChat would be available because the civilian and blufor are different factions.

At the most basic level: Give the civilian a name by double clicking on him and entering a Variable Name at the top. Place a trigger at the civilians position that detects Anyplayer Present. Leave the condition alone (so it doesn't have any other requirements to trigger), and in On Activation add

civiliansNameHere globalChat "Your Text Here"
silent scaffold
#

ok, any stupidity of mine I'll come back here, thank you very much @manic sigil

boreal parcel
#

so im running liberation on my server and I seem to be having FPS drops that to me, look like they atleast partially relate to a spawned script or multiple?

How could I go about finding out what scripts may be responsible?

pulsar bluff
#

do folder search for β€œcreateUnit” and put a unique β€œdiag_log” msg beside it

hallow mortar
#

How do you know it's createUnit that's doing it?

pulsar bluff
#

hastily read on an iphone and saw "spawn script" instead of "spawned script"

#

altho its probably the same thing

#

usually fps drop follows when a lot of entiteis are added to the game world in a short time

stark fjord
#

Why? Am i gonna get an answer with the ticket?

sullen sigil
#

because its a bug

little raptor
#

Yeah that

stark fjord
#

Meh

little raptor
#

Then don't complain blobdoggoshruggoogly

stark fjord
#

Wasnt complaining, just asking. Perhaps there was reason for it

silent scaffold
#

hello again guys , yesterday i got help from @manic sigil to activate the global chat but i am very noob , i would like to know if someone could help me with the step by step from the trigger to the finalization , i searched but i did not find anything , not even on Youtube

#

I'm a beginner but I try to get by with the game but there are hours that complicate things more

manic sigil
silent scaffold
#

thank you very much

stark fjord
#

In AddonBuilder in cli mode how do you define author?
Like you can via gui Options -> Author

granite sky
#

Does it actually do anything in the GUI?

stark fjord
#

lemme check

#

yuh class cfgMods { author="Marko"; timepacked="1684685039"; };

#

in cli mode author="";

frozen seal
#

Hi all, I think I've hit a bit of a dead end and I need some help πŸ™

What I want to do:

  1. There is a gamelogic_1 object somewhere on the map. Near this object there is a group of props that are arranged in a particular way.
  2. I want to take all these objects and precisely recreate the composition near gamelogic_2. Essentially, I want to achieve Eden's copy/paste, but with a script.

The problem is, it seems to be working with objects that are standing vertically, but if the object is laying on it's side it does not work. First screenshot is what the source composition looks like, second is what I get after running the code:

_nearbyProps = nearestObjects [gameLogic_1, ["All"], 10];

{
    _dir = vectorDir _x;
    _up = vectorUp _x;

    _posObjectInitial = getPosASL _x;
    _posPivotInitial = getPosASL gameLogic_1;
    
    _relativePosition = _posObjectInitial vectorDiff _posPivotInitial;
    
    _posPivotDestination = getPosASL gameLogic_2;
    _posObjectDestination = (_posPivotDestination vectorAdd _relativePosition);
    
    _type = typeOf _x;
    _newProp = createVehicle [_type, _posObjectDestination, [], 0, "CAN_COLLIDE"];
    
    _newProp setVectorDirAndUp [_dir, _up];
    _newProp setPosASL _posObjectDestination;
} forEach _nearbyProps;
#

I've got a sneaking suspicion that setVectorDirAndUp does not rotate the object around it's pivot but rather uses a different axis

manic kettle
granite sky
#

^^this

#

We do setPosWorld before setVectorDirAndUp but I'm not sure if it matters.

#

up/dir vectors are absolute. Issue is that some versions of setPos will realign the object.

frozen seal
manic kettle
#

Cheers

frozen seal
#

I will make a randomized backrooms generator out of this, somewhere to place misbehaving players as zeus πŸ™

last bramble
#

Can someone tell me why this isn't working?
I want to force autosave and forbid manual saving, but autosaving isn't working even if I allow saving before using "saveGame"

last bramble
winter rose
last bramble
#

yes, kinda, I just wanna know why saveGame isn't working when re-enabling it through a .sqf script, but does work if I do it in debug console

granite sky
#

Pretty sure entityKilled doesn't use a return value.

last bramble
winter rose
last bramble
#

what's the difference?

winter rose
#

I'd say "it works" πŸ˜„

last bramble
#

Isn't it the same as my first variant but with less text (sorry I'm not good at keeping text clean)?

#

Which didn't work for some reason

winter rose
#

no idea
I am just writing what I would do:

enableSaving [false, false]; // disables saving
// then, if needed
enableSaving [false, true];  // -should- save?

// if this above ↑ does not save, then use the following ↓ :
enableSaving [true, false];
enableSaving [false, true];
last bramble
#

enableSaving [false, false]; // disables saving
// then, if needed
enableSaving [false, true]; // -should- save?
It isn't saving if enableSaving is false though

#

Just doesn't do anything

#

anyway it does work now so thanks for pointing me in the right direction

sweet zodiac
winter rose
restive hinge
#

I have a weird script error.

// Basically I have an object, that gets created at certain position:
_lootCache = "VirtualReammoBox_camonet_F" createVehicle _cachePos;
// Then I create a trigget at object position:
_cacheTrigger = createTrigger ["EmptyDetector", _cachePos];
_cacheTrigger setTriggerArea [300, 300, 0, false];
// Then I make a statement to make sure the object is outside the trigger and is alive
waitUntil {(!alive _lootCache) or !(_lootCache inArea _cacheTrigger);};
// Code below gets executed if conditions met
// ...

This piece of code ran with no errors... But when I switched to a different map, the waitUntil started returning nil value...

#

If anyone could hint on this case I would greatly appreciate!

#

I guess it has something to do with object creation or its position.

granite sky
#

what's _cachePos?

#

Maybe paste the actual error too, because your description seems mangled.

restive hinge
#
// Config name of location type
_locationType = "NameVillage";
// Get array of all locations with met config location type
_locationsArray = nearestLocations [[worldSize / 2, worldsize / 2, 0], [_locationType], 25000];
// Gets random location from an array
_randomLocation = selectRandom _locationsArray;
// Gets location position
_locationPosition = getPos _randomLocation;
// Gets an array of all houses with met conditions below
_housesArray = nearestObjects [_locationPosition, ["house"], 300] select {
    [_x] call BIS_fnc_isBuildingEnterable;
    count (_x buildingPos -1) > 5;
};
// Picks a house found in the above nearestObjects array
_randomHouse = selectRandom _housesArray;
// Finds list of all available building positions in the selected building
_housePositions = _randomHouse buildingPos -1;
// Picks a building position from the list of building positions
_randomPosition = selectRandom _housePositions;
// Assign a value for cache position (its called to a function param)
_cachePos = _randomPosition;

// Cache stuff gets executed next
#

The error itself

#

The object gets created, but the code after creating isn't running

granite sky
#

The map you switched to. Are you sure it has anything in NameVillage?

#

You have a lack of sanity-checking in general here.

restive hinge
#

Oh, so it could be an empty value of NameVillage?

granite sky
#

There's an assumption on the houses too.

#

Like there could easily be nothing with 5+ building positions within 300m.

restive hinge
#

And gets spawned

#

The objects on map to the left got created correctly, but the other ones (without the task icon) are the bad ones

#

So they are alive

#

But even if I remove the inArea check from waitUntil it doesn't run

granite sky
#

I can only guess you're missing out some critical structural stuff.

restive hinge
#

The green crosses are all the locations from an array

#

That got picked from the config

granite sky
#

Where are you running this from?

restive hinge
#

LAN server

granite sky
#

No, I mean how do you execute the code? Why are there four boxes? etc.

#

Given that you're not using private variables I'm guessing that you have some accidental collisions but the failure point in that case is outside what you've pasted.

restive hinge
#
_locationType = "NameVillage"; 
_locationsArray = nearestLocations [[worldSize / 2, worldsize / 2, 0], [_locationType], 25000]; 
_randomLocation = selectRandom _locationsArray; 
_locationPosition = getPos _randomLocation; 
_housesArray = nearestObjects [_locationPosition, ["house"], 300] select { 
 [_x] call BIS_fnc_isBuildingEnterable; 
 count (_x buildingPos -1) > 5; 
}; 
_randomHouse = selectRandom _housesArray; 
_housePositions = _randomHouse buildingPos -1; 
_randomPosition = selectRandom _housePositions; 
_cachePos = _randomPosition; 
[_cachePos] execVM "scripts\fn_spawnCache.sqf";

This is what I run to test whether it breaks.
Occasionally it breaks

granite sky
#

ah ok

#

That's just run from the debug console?

restive hinge
#

Yep

#

So right now I got generated 2 objects with no error (my _locationsArray is resized to 2)

#

I guess it has something to do with a location

#

But if a location is broken I get the error.

granite sky
#

Is the first snippet you pasted the literal code in fn_spawnCache.sqf aside from a _cachePos = _this select 0?

restive hinge
#

I can pastebin, but yeah, it's main thing

granite sky
#

Pastebin it.

restive hinge
#

This is my init.sqf to call the function.

if (!isServer) exitWith {};
_locationType = "NameVillage";
_locationsArray = nearestLocations [[worldSize / 2, worldsize / 2, 0], [_locationType], 25000];
_locationsArray = [_locationsArray] call CBA_fnc_shuffle;
_locationsArray resize 2;
{
    _locationPosition = getPos _x;
    _housesArray = nearestObjects [_locationPosition, ["house"], 300] select {
        [_x] call BIS_fnc_isBuildingEnterable;
        count (_x buildingPos -1) > 5;
    };
    _randomHouse = selectRandom _housesArray;
    _housePositions = _randomHouse buildingPos -1;
    _randomPosition = selectRandom _housePositions;
    _cachePos = _randomPosition;
    [_cachePos] execVM "scripts\fn_spawnCache.sqf";
} forEach _locationsArray;
granite sky
#

Hmm. In the broken cases it's not creating the task, right?

restive hinge
#

Nope

#

The tasks are not being created

winter rose
#

so as usual, before a selectRandom, ```sqf
if (_myArray isEqualTo []) exitWith {};

restive hinge
#

Seems I get 0 _housesArray sometimes somehow

granite sky
#

Like there could easily be nothing with 5+ building positions within 300m.

#

If it's spawning a box there then I have no idea what's going on though.

#

There's a fun bug with your task creation where you'll get random task ID collisions.

#

but those should be random

restive hinge
#

I guess an index of 1000 is fine? blobdoggoshruggoogly

boreal parcel
restive hinge
#

This seems to fix my issue:

_locationsArray = nearestLocations [[worldSize / 2, worldsize / 2, 0], [_locationType], 25000] select {
        count (nearestObjects [getPos _x, ["house"], 300]) > 5;
};
boreal parcel
#

hmm

#

thinking about it

#

do you guys think adding this bit of code at the top and bottom of every single script/function in liberation would impact performance at all?

systemTime params ["_year", "_month", "_day", "_hour", "_minute", "_second", "_millisecond"];
diag_log ([str _month, str _day, str _year, str _hour, ":", str _minute, ":", str _second] joinString " ");
diag_log (["Current FPS:", (round (diag_fps * 100.0)) / 100.0, "Script: asymm_notifications.sqf"] joinString " ");
stark fjord
#

More code you add more impact on preformance. If they call often, they write to log often, you get the idea

boreal parcel
#

hmm well it is hopefully just a temporary measure to figure out which scripts are causing mass FPS drops.

ashen ridge
#

I have this as the first line of all my HandleDamage Eventhandlerssqf params ["_unit","_selection","_damage","_source","_projectile","_hitIndex","_instigator","_hitPoint"];but i noticed they added a new parameter _directHit after _hitPoint. I need to update all params with _directHit or they will work without it? I don't use _directHit.

hallow mortar
#

params doesn't have to interpret all available params. You could just have _unit if that was all you needed.

#

(still has to be in order though, so if you needed _directHit you'd have to have something for everything before that too)

ashen ridge
#

@hallow mortar πŸ‘ πŸ‘ πŸ‘

granite sky
boreal parcel
granite sky
#

Oh, there's probably a correlation, but the actual hit is likely from unit/vehicle spawning.

#

In Antistasi we don't actually have much of a script bump from spawning, because it's one spawn per location. It's still a visible perf hit though.

boreal parcel
#

hmm, I guess ill stop this nonsense with logging every script

#

yeah when units spawn in liberation there is a temporary performance drop as they spawn

#

but it goes away, this performance drop sticks around

granite sky
#

It's sometimes worth running diag_activeSQFscripts to see if there's anything eating script time when it shouldn't.

boreal parcel
#

until the server hits 0fps and needs to restart

granite sky
#

but even with the worst script-spamming it's still 3ms/frame

#

Worst case typically is that you kill latency of other scripts.

#

but otherwise things look normal.

boreal parcel
#

and I got like 4 scripts out of the 20+ that the performance panel said was running

#

hmm, would it be worth a shot to instead just have a CBA per frame handler check the FPS and run the diag_activeSQFscripts if server FPS gets below a certain point?

sweet zodiac
#

Unit spawning in Liberation is literally a Call so everything stops while it does that effectively

#

I been tweaking liberation over the past 2 weeks but I have determined that it is simpler to just start from scratch than to try and improve something already so full of problems

stark fjord
#

From his graph it seems like spawned, you can see spike down on fps, whenever there is a spike in spawned scripts

sweet zodiac
#

I would have to look into it but I believe each Sector's Manager is handled by spawned script

hallow mortar
#

It kind of looks like the spawn spike happens right after the FPS drop. It could be that whatever creates the units also creates a set of spawned scripts to do stuff with them - or that whatever condition triggers the unit creation also triggers a bunch of scripts.

sweet zodiac
#

I have been trying to implement a different method of handling unit spawning to stop the FPS Freeze experienced when Units spawn, because it's ridiculous

#

Each unit when created calls a KPLib script to manage the unit, but I doubt its that complicated, I'll have a look now

stark fjord
#

What we did was just restart server after 3 or so objectives. Yes its annoying but i simply didnt have the will to debug that sphagetti monster :/

sweet zodiac
#

I love Liberation but it just has so many problems, even before I broke half of it myself by simply making it more efficient

#

By doing nothing but changing slightly the unit spawn handling I broke Zone Capturing entirely

#

Since apparently the Bar that shows doesn't have any bearing on the capture progress

dreamy kestrel
#

Q: about object bounding boxes, especially as relates to world pos. finding the tricky part is gauging where that center Z dim should be, from object to object it seems 'different' than simply taking one of the BB Z dims, or even total Z, and dividing by two. is there a prevailing wisdom where this is concerned? convention, algorithm, is preferred to configuration in this instance, maybe I am reading the tea leaves incorrectly where the BB is concerned. thanks...

sweet zodiac
#

If you want the position of the bounding box in World Position you can use _object modelToWorld [0,0,0] for AGL and _object modelToWorldWorld [0,0,0] for ASL

stark fjord
#

and for ATL modelToWorldWorldWorld?

sweet zodiac
#

Bahahaha, I wish

little raptor
#

but in model coords

sweet zodiac
#

the MRAP Has a real funny looking box too

little raptor
#

well once v2.14 hits you can get the bb of individual LODs

#

they're more accurate

sweet zodiac
#

He is the above image with a Cross rendered on the Center of each.

#

I was doing bounding box shenanigans a while ago while making a funny little script to move Objects around

dreamy kestrel
#

at the moment I am taking the visual (0), and _bb#1 Z dim as my world pos offset. but this is yielding funny results. the error escapes in the logs me at the moment, something about objects under the map terrain, self-corrections etc. for ammo boxes is one thing, but for vehicles, causing havoc. but the root cause I think is interpreting the correct BB Z dim, if I am reading it correctly.

#

mainly for serialization purposes, which I am also employing to 'create' if you will objects, a serialization record, with prepopulated class names, world pos, etc.

little raptor
#

the bounding box has nothing to do with where an object "stands"

sweet zodiac
#

Was gonna say

little raptor
#

you should use the land contact

dreamy kestrel
#

wdym, when you are talking about world position, yes, you need to be concerned about the 'middle Z coordinate'

#

that has an effect 'where it stands'

sweet zodiac
#

I have no clue what you mean, just save it's ASL and restore it if you want it that precise

little raptor
#

well if you look at fluffy's pictures you can see that "middle Z" has nothing to do with the "land contact Z" of the vehicles

dreamy kestrel
#

also, I am creating objects from nothing, calculating the anticipated world pos. deserializing to create the object.

sweet zodiac
#

You've lost me here

little raptor
#

you have setPosASL and setPosATL

#

they automatically calculate the land contact of the object so you don't have to worry about Z

sweet zodiac
#

^ I was gonna say that earlier

dreamy kestrel
#

trying to find the primitives, there was a reason why world position was being used

sweet zodiac
#

I use setPosATL [_x, _y, 0] personally since it does the job

little raptor
#

you can do this to place objects on the next roadway LOD:

isNil {
  _obj setPosASL _aslPos;
  _diff = getPos _obj#2;
  _aslNew = +_aslPos;
  _aslNew set [2, _aslNew#2 - _diff];
  _obj setPosASL _aslNew;
}
#

they'll always touch the "ground" (even on objects)

dreamy kestrel
little raptor
#

well don't use world pos

#

use getPosASL and setPosASL

#

but if you instist on using setPosWorld you can still calculate the land contact using _obj modelToWorldWorld (getModelInfo _obj#3)

dreamy kestrel
#

but again, I start from nil there is no object in this instance, but rather the serialized representation.

little raptor
#

are you trying to create compositions?

dreamy kestrel
#

no

little raptor
#

are you serializing object positions to recreate them later in the exact spot?

dreamy kestrel
#

along these lines, yes. presenting the serialized, or meta data, and creating objects via this method

little raptor
#

yeah just store the getPosWorld + vectorDir + vectorUp + type
and restore via setPosWorld, setVectorDirAndUp

dreamy kestrel
#

couched in, of course I'd rather use the ATL or even ASL, but there was a reason, I'm sure, why world position was the choice

sweet zodiac
#

That is probably better, I just do thing crudely until it works :p

dreamy kestrel
little raptor
#

then you don't need to worry about Z or anything

dreamy kestrel
dreamy kestrel
sweet zodiac
#

You are already saving it's position I don't see the issue

dreamy kestrel
little raptor
dreamy kestrel
#

literally there was no object at first from which to save anything

sweet zodiac
#

This is a nonstarter

little raptor
sweet zodiac
#

How can you wish to pre emptively place something at a position you don't have

dreamy kestrel
#

there was nothing there ever, I am establishing meta data. from that creating the very first instance of the object.

#

positions, etc, well beyond the scope of the immediate conversation

#

assume they are known positions

sweet zodiac
#

Brother I don't even know what Scope you are aiming for

dreamy kestrel
#

starting from a meta data point of origin. creating the object from that.

#

okay, this is not productive for me. my take away's are, if possible, using the land contact, ASL.

stark fjord
#

Question if you create #dynamicsound with https://community.bistudio.com/wiki/createSoundSource
And then move too far away from it, it will stop playing sound forever, even if you return back into its vicinity.
Is there any workaround to restart it? or do i have to respawn the darn thing?
(i know its marked as broken, but the broken part doesn't relate to that, but its the only sound source that creates perfect sound loop)

sweet zodiac
#

without testing anything myself I would imagine you would need to recreate it

stark fjord
#

im trying to avoid that, as its global. And that means audible stop/restart of sound for everyone who hears it normally.

sweet zodiac
#

That slipped my mind when I read the page

sweet zodiac
stark fjord
#

i could work around it (with say3D) by having 2 objects and just obj1 finishes, obj2 starts playing and they alternate.
But that seems like even more dirty workaround than respawning sound source.

sweet zodiac
#

Nothing comes to mind honestly

winter rose
#

…did I break something with fog

boreal parcel
#

no I think someone spilled some milk

stark fjord
#

nope, just deep snow

drifting sky
#

I'm trying to figure out why an array containing groups sometimes contains Null group values. I'm setting their group deleteGroupWhenEmpty to false. Is there anything else that can cause a group to not exist, other than deletegroup?

winter rose
drifting sky
#

under what circumstances would a group not be created?

sweet zodiac
#

If the last member in the group also joins another group it changes it to GrpNull

drifting sky
#

ahhhh... that's probably what's going on.

#

does that happen instantly or after a delay?

sweet zodiac
#

Not sure seems instant but I am in VR with next to nothing happening

dreamy kestrel
#

okay, back on the BB question... forget about objects, meta data, etc, for now.
https://community.bistudio.com/wiki/boundingBox
https://community.bistudio.com/wiki/boundingBoxReal
I'd like for a precise BB, so maybe the real? but what is the difference then between the clipping choices?
if, for example, I am seeing objects below terrain surfaces, for example. maybe the BB is too precise?

clippingType: Number - can be one of:
0 - ClipVisual (can significantly reduce bounding box's size on buildings)
1 - ClipShadow
2 - ClipGeometry
3 - ClipGeneral (same type that is used in the main syntax)

thanks...

#

I have been using the ClipVisual option (0), but perhaps I need one of the others

sweet zodiac
#

They are effectively the different LODs so to speak

#

Try Geometry

dreamy kestrel
#

LODs? that is a different alternative syntax. not talking about LOD.

#

I will try that, thanks...

sweet zodiac
#

They are literally called LODs in Object Builder, I just double checked, Sample House for Example. I have no idea what Syntax 2 actually is referring to but if I had to make a generous Guess, it's probably just grabbing the relative "String" for that LOD, 2 - ClipGeometry meaning "Geometry" in the case of syntax 3.

drifting sky
#

Wait a minute. if a group with no units in it becomes group null.... does that mean it cannot be deleted????

sweet zodiac
#

I believe it just deletes the Group

drifting sky
#

So if I have the last guy in a group join a new group, it deletes the group he was in.

sweet zodiac
#

I would believe so yes, but I would need to test if a deleted Group just becomes GroupNull or Nil

dreamy kestrel
sweet zodiac
#

Deleted group becomes Null Group

dreamy kestrel
#

but generally when objects (or groups) are deleted, yes, they just become null, you can test for isNull

#

grpNull

granite sky
#

IIRC the all-join deletion is immediate.

sweet zodiac
#

The deleteGroupWhenEmpty merely stops the group from being Destroyed if all the Units in it vanish or get deleted

drifting sky
#

So a group that has become null has definitely been deleted?

sweet zodiac
#

It doesn't stop it being destroyed when they join another group

#

Yes

#

As per the Warning at the top This command does not prevent group deletion (through e.g deleteGroup or any engine group management).

#

the last Unit joining another group I imagine falls under engine Group Management

drifting sky
#

Yes I wish the doc for "join" said as much. Thanks for your help.

little raptor
little raptor
sweet zodiac
#

Well unless he is using the upper most part of the BB as the ground level of the object, but surely not right

#

There is no way to tell without seeing it but if it appears quite literally just under the surface that likely is it.

boreal parcel
#

wow 74 spawned scripts feels strange

boreal parcel
#

ai count + spawned scripts seem to begin jumping around the same time

#

what is considered an entity? this just seems to keep rising as well. Seems like perhaps our cleanup script simply isnt running

sweet zodiac
#

I'm not sure what doesn't pass as an Entity but as a shot in the dark probably everything that is created that isn't a map object is probably counted as an Entity

winter rose
#

hmmm we're getting away from scripting here no πŸ™ƒ sounds more like server management!
how can this issue be addressed/fixed script-wise?

sweet zodiac
#

It's likely related to poor scripting on behalf of Liberation

winter rose
#

is this your framework? (iirc, no) Liberation indeed

boreal parcel
#

ah apologies, this is referring to a previous conversation but I was trying to determine what scripts are causing this. and no it is not

winter rose
sweet zodiac
#

I did try fixing it for a while, not fun

boreal parcel
#

yeah looking at it myself makes me wanna cry

sweet zodiac
#

The only real solution is to restart the server every couple objectives, unless you want to rewrite half the gamemode to make it more sensible.
Side note if the entities command is to be believed, Groups, Modules, Units, Object all count towards the total entities

boreal parcel
#

could be fun and a good learning experience to try making liberation from scratch maybe ill give that a go soon. anyways ill temporarily set a server restart for every hour

#

seems to be around how long performance remains stable for

granite sky
#

Groups aren't entities.

#

Any unit, agent (eg snake) or physX object is an entity. Non-physx objects like flagpoles are not. I don't know what the rule actually is.

sweet zodiac
#

Yeah that's my bad I had a bunch of Logics made and because I am stupid I read it as Groups since they are named oh so similar

warm swallow
#

I can't get

["terminate"] call BIS_fnc_jukebox;

to work correctly. I get this error.

Type Any, Excpected Number

Here is the wiki for this command. Am I missing something?

little raptor
warm swallow
#

let me try with that

little raptor
#

this is all terminate does:

    /**
     * Terminate function
    **/
    case "terminate" : {
        //Remove event handlers
        removeMissionEventHandler ["Draw3D", missionNameSpace getVariable "BIS_jukeBox_onEachFrame"];
        removeMissionEventHandler ["Loaded", missionNameSpace getVariable "BIS_jukeBox_loaded"];
        removeMusicEventHandler ["MusicStart", missionNameSpace getVariable "BIS_jukeBox_musicStart"];
        removeMusicEventHandler ["MusicStop", missionNameSpace getVariable "BIS_jukeBox_musicStop"];
        
        //Reset variables
        {
            missionNameSpace setVariable [_x, nil];
        } forEach [
            "BIS_jukeBox_initialized",
            "BIS_jukeBox_onEachFrame",
            "BIS_jukeBox_loaded",
            "BIS_jukeBox_musicStart",
            "BIS_jukeBox_musicStop",
            "BIS_jukeBox_status",
            "BIS_jukeBox_musicStealth",
            "BIS_jukeBox_musicCombat",
            "BIS_jukeBox_musicSafe",
            "BIS_jukeBox_volume",
            "BIS_jukeBox_transition",
            "BIS_jukeBox_radius",
            "BIS_jukeBox_executionRate",
            "BIS_jukeBox_noRepeat",
            "BIS_jukeBox_forceBehaviour",
            "BIS_jukeBox_musicChanging",
            "BIS_jukeBox_music"
        ];
        
        //Log
        "JukeBox terminated" call BIS_fnc_log;
    };
#

a type any error here can only be linked to one of those vars BIS_jukeBox_onEachFrame, etc. being nil

warm swallow
#

Gotcha

#

even with

[] call BIS_fnc_jukebox;

["terminate"] call BIS_fnc_jukebox;
#

No longer getting error but the music doesn't stop

little raptor
#

well terminate doesn't have anything to stop the music as you can see for yourself

#

it just removes a bunch of event handlers

warm swallow
#

Ok

little raptor
#

I'd say stop using that function. it seems poorly made

warm swallow
#

rip

#

Thank you nonetheless @little raptor. Glad to talk to you again

winter rose
warm swallow
little raptor
#

well you can terminate it and do playMusic ""

stark fjord
#

so whatever loop is playing music is not terminated

warm swallow
#

I tried doing this but it didnt work:

[] call BIS_fnc_jukebox;

["randomMusic", [["jungle"]]] call BIS_fnc_jukebox;

["terminate"] call BIS_fnc_jukebox;

playMusic "";
winter rose
stark fjord
#

might help

warm swallow
#

it initializes by default

little raptor
#

it defaults to init

#

but try a sleep before terminate

stark fjord
#

ah, didnt read that far in.

warm swallow
#

Yes, ACE disables music control.

I think I got it back to default with:

ace_hearing_disableVolumeUpdate = true; 
little raptor
#

case default?!

stark fjord
#

perhaps, stupidly but DEFAULT could be a variable

#

instead of default as in default in switch

little raptor
#

well it's not a var or macro as far as I see

stark fjord
#

macro would already be expanded at this point

warm swallow
#
ace_hearing_disableVolumeUpdate = true;  

[] call BIS_fnc_jukebox;

["randomMusic", [["jungle"]]] call BIS_fnc_jukebox; // Completely ignores this function...?

sleep 5;

["terminate"] call BIS_fnc_jukebox;

playMusic ""; // doesn't work
little raptor
stark fjord
#

you also have case NOTHING

little raptor
#

it's raw text

stark fjord
#

OH

#

mb

warm swallow
stark fjord
#

whats the part that does playMusic?

little raptor
#

my mod would've picked it up otherwise

warm swallow
#

hm

stark fjord
#

does it play on EH or?

warm swallow
#
[["myMusic1", "myMusic2"], 1] call BIS_fnc_music;

this seems to do something similar

little raptor
#

wait it does work tho think_turtle

#

looks like undocumented stuff

warm swallow
#

*For what I'm trying to do

#

but i'm also having trouble stopping with BIS_fnc_music;

stark fjord
#

When it restarts, does song start from start? Or in the middle?

warm swallow
#

which function?

stark fjord
#

Jukebox

little raptor
#

works
blobdoggoshruggoogly
worth documenting?

stark fjord
#

When you terminate and playMusic ""

warm swallow
#

This works for me:

[["side", "wild"], 1] call BIS_fnc_music;

[[""], 0] call BIS_fnc_music;
stark fjord
#

Oh thunk you said it stops it for a while

winter rose
dreamy kestrel
#

is default a variable? ruh roh

stark fjord
#

no

dreamy kestrel
#

can I start a thread in the channel? got something I need help parsing through, do not want to lose it, or flood the channel, could get a bit lengthy.

little raptor
#

well yeah ofc it doesn't return NOTHING because you can return stuff from switch

stark fjord
#

you can also do switch (true) do { case true : default { 1 }} πŸ˜„

little raptor
#

I doubt you can

stark fjord
#

try it

little raptor
dreamy kestrel
#

so the engine is reporting ThingX:

17:52:54 ThingX 1d397864100# 1780671: cargonet_01_ammo_f.p3d was falling under terrain! Position corrected to ground [8345.56, 22.57, 11081.46]. Disable simulation to keep object under terrain.

but there is a some back story to that...
need to show more of the log.

winter rose
little raptor
stark fjord
winter rose
#

thread created; you may need to !verify in #offtopic_bot_cmds for you to be able to do so as well

winter rose
dreamy kestrel
winter rose
#
switch (true) do
{
    case default { 1 };
    case false: { 0 };
    case true: { 2 };
}
// 2
stark fjord
#

Whats wrong with that?

winter rose
#

nothing

granite sky
#

everything

winter rose
#

just trying out the case default horrendous thingy

stark fjord
#

Output 1

dreamy kestrel
#

I'm confused, I have DMs from server allowed but the bot is still complaining

stark fjord
winter rose
stark fjord
#

Yup. If it was true, would also be 1

#

but that means > The default block will be executed only if no case matches, no matter its position inside the code block. It is not a case, and will never be entered by fallthrough.

#

aint true

winter rose
#

something like that yeah
evaluated anyway

stark fjord
#
    case 1 : {3};
    case true : default {
        1
    }}
// 1
granite sky
#

Oh go on then:

switch (true) do {
    case call { default { 1 }; false }; 
    case 1 : {3};
};
// 1
switch (true) do {
    case call { default { 1 }; true }; 
    case 1 : {3};
};
// 3
stark fjord
#

switcheroo

sweet zodiac
#

I leave for like 10 minutes and I come back to Cursed Switch statements

manic kettle
#

Is it possible to remove environmental vehicle damage? So I can get these ai to stop breaking their tires

#

Maybe a handle damage EH? I'm wondering how to get it to recognize it didn't come from a player or ai though [just from crashing]

winter rose
#

"" damage source

manic kettle
#

Word? I'll give it a shot, thanks!

winter rose
#

well, rather go for "damage author" to be objNull

manic sigil
#

Alright, packed everything into a local mod, running on a dedicated server... is there some reason I can't see my functions in the function viewer?

stark fjord
#

Do funcs work?
If they must be in configFile

manic sigil
#

They are mostly functioning. Thats part of the problem, only some of my functions are operating :/

stark fjord
#

Did you accidentaly the functions?

manic sigil
#

Operates fine when run locally. For values of 'fine'.

stark fjord
#

Okay then your functions are defo in configFile

#

You just hid them too well

manic sigil
#

Can you just not look up functions if the mod is loaded on the server?

#

So the function to add an action works, but the function that action is supposed to call can't be found 🀑

stark fjord
#

IF they dont show up there, you whoopsed something in the mod

manic sigil
#

Yeah, tag ain't showing.

#

It does when locally running, but that doesn't do much good for usability :/

granite sky
#

You are running the mod locally as well, right...

stark fjord
#

incident.

manic sigil
#

Alright, back to 101 basics.

My intent was to create a mod that only needs to be run on the server, as a companion for a specific scenario. I know mods can be run client-only, and most require client+server, so I was assuming that server-only was also an option.

stark fjord
#

it is an option...

granite sky
#

It is, but any CfgFunctions entries won't be on the clients.

manic sigil
#

Which would make sense, because the action I'm activating is looking at the client's Cfg and saying 'woah nothing here boss' πŸ€•

stark fjord
#

you could send function to clients...

#

during runtime

granite sky
#

At that point I'd generally say "make it a client mod" :P

#

but it is possible.

manic sigil
#

Ah see, that would assume that I'm a good coder who doesn't absolutely fail to grasp the line between client and server.

#

A lot of exploding jeeps the last time we tried that, when I took this mod from 'everyone load it' to 'please only server load' and someone forgot.

#

... Ah, that also makes sense; I have a similar function to what I'm trying to achieve right now that works fine, because the action is an in-line function in the same file.

granite sky
#

If very little code needs to run on the client then it's acceptable to send it, I guess.

manic sigil
#

It's not an incredible amount, but it is a whole looped timed script, I don't think sending it would be best.

#

Testing just throwing it in an in-line in the same file.

granite sky
#

At least one version of that Advanced Towing mod transfers almost its entire codebase from server->clients :P

#

should really fix the version in Antistasi

manic sigil
#

Works so far. Alright, the problem is identified, at least.

#

And the follow up action has the same issue, trying to use a non-existing function... Alright.

#
srd_fnc_fhp_inlineActionAdd = 
{
params ["_helipad"];

_helipad  addAction ["<t color='#e2a750'>=Send Reinforcements</t>",
 {
  params ["_target", "_caller", "_actionId", "_arguments"];
  _target setVariable ["fhp_Tasked",true,true];
  [_target,srd_fnc_fhp_heliAction] remoteExec ["spawn",0];
 },nil,5.6,true,false,"","!(_target getvariable [""fhp_Tasked"", false])",10];
 
};
 
 [_helipad,srd_fnc_fhp_inlineActionAdd] remoteExec ["Call",0,true];

This is the (trimmed down) script I'm using to add the actions to the object.

srd_fnc_fhp_heliAction works in this context if I in-line it in the same file, and publicVariable it besides.

boreal parcel
#

I decided I am gonna spend some time attempting to remake Liberation cause I think it could be fun.

What do you guys think would be a good way to go about detecting when players are nearby a zone?

Im thinking grab all the markers on the map placed for liberation and creating repeatable triggers to detect if a player is within a radius and then calling a script most likely

drifting sky
#

Is there a way to tell if a unit has finished playing an action initiated by playActionNow?

sweet zodiac
sweet zodiac
#

I haven't thought of how to check it server side yet

#

Could have the client remoteExec a function Server side to add the Zone to an Array for a Serverside Loop to handle.

boreal parcel
#

I was planning to keep the marker portion to keep map creation similar to how its already done.

now you say you store details of the zone, this would basically be the same as having different types of markers right?

Im thinking triggers would be best to keep it simple and fast but would the way your talking about entail a speedier method of determining if players are within radius?

#

triggers I would just have activate on any player so long as the condition (most likely checking if ai cap is reached) hasnt been met

sweet zodiac
#

Well I have much more I want to handle about the Zones so for me it works best, but a trigger likely would do the job if you really wanted it to

#

I am handling quite a few properties for each Zone, Type, Side, Garrison, Buildings, Size, etc and likely a couple more down the line

#

Liberation handles only 2 of those, Side and Type

boreal parcel
#

im kind of thinking each type of marker/trigger will have its own script. One for Radio tower, city, factory, and big city right?

Each script would handle its own ai spawning, maybe push the ai into its own global array for counting and handling later?

I would also plan to have the scripts handle patrols + garrisons and whatnot

#

is that a bad idea?

#

I get the syntax and whatnot and how to do things I want (most of the time) I just dont know about performance much

sweet zodiac
#

The only problem is you need to make sure it would only fire once for the first player that enters the trigger and it would by nature need to be able to reactivate at a later stage if the Players fall back or Leave the zone long enough for it to deactivate

#

You don't want a Zone to spawn like 8 times because you had 8 players walk in

boreal parcel
#

right, well I could assign a variable to each zone that gets flipped true or false when the zone is active and check for this in the condition.

I guess its a question of how to look for deactivation. Maybe a countdown could be initiated in the triggers deactivation eventually deleting all the ai and setting the variable back to false right?

sweet zodiac
#

Give it a try

#

scripting is all about trial and error

boreal parcel
#

true

manic sigil
#

... Oh god I've been sending all of my functions to the clients already, that's why all my bullshit was working before T_T

#

But I wasn't doing it for my latest functions, hence why they don't work.

stark fjord
stark fjord
#

sure... i guess, but why obfuscate things like adding actions on objects...

manic sigil
#

This is a companion mod for Mike Force, and as divine punishment for my varied sins, I'm trying to do it as a separate beast and not just a fork of the base scenario.

#

It's a bunch of quality of life enhancements aimed at single/low player count servers, so you can slap it on top of any modload without causing too many conflicts.

stark fjord
#

ah so you are trying to change scenario without the need of repboing and reuploading it.

manic sigil
#

Yeh.

stark fjord
#

still doesnt make sense (to me) why you would avoid "shared" mod and stick with "server only", so you have to do shenanigans like sending functions to clients etc.
Cause obfuscation obviously isnt a goal here.

But i guess you have your own reasons.

manic sigil
#

Honestly, I don't, but I'm just really bad at separating server and client interactions; early versions required everyone to have the mod on, but it started cropping up issues with multiplication, resulting in a cascading explosion of jeeps I placed at the airfield for convenience.

#

It might be worth it to turn around and go back to client+server, and just resolve that issue.

stark fjord
#

i mean what you are doing doesnt solve multiplication, you are just adding extra layer of complexity. Makes whole thing harder to debug.

Overall just remember things with Global Effect (marked GE) on wiki, you most likely only want to run once (eg spawning vehicles), so always do that on server (to keep it simple). Things with local effect, you want to do on clients.

Your exploding jeeps is a prime example of running code everywhere and you spawned a jeep from each client+server

#

and most things are

{
//server stuff (things with global effect)
};

if (hasInterface) then
{
//client (player) - local effect stuff, sounds, hints, chats, UI, etc
};

if (!hasInterface && !isServer) then 
{
//Headless horseless client
};

//Shared stuff, that will run on all machines

#

and code written like this should be safe to execute with remoteExec on all clients

manic sigil
#

Yeah, I've dabbled a bit on those filters, and looking at it I didn't put one in on the vehicle spawner... but on the other hand, I (cringe incoming) remoteExec'd them to the server, 2.

stark fjord
#

If you remote exec code to spawn a vehicle at the same time, its still gonna spawn as many vics as there is clients

manic sigil
#

Yeah, because everyone had a copy of the code running; even if it was only telling the server to spawn it, it was being told player# times... x_x

stark fjord
#

Yes. And by sending that same code during runtime doesnt exactly remedy the issue.

manic sigil
#

Fair point :/

#

I mean, at least it's only being sent out once, it's not like I'm constantly updating and resending... but it's still a weird way to do it.

stark fjord
#

For example, stuff with global effect, like spawning vic, you dont have to do it on server. You can create vic on client and it will be created for everyone.

#

But spawning large amounts of troops you wanna do on server, or headless client, to not overburden the players pc.
If you spawn unit on client, that players pc will have to calculate ai stuff like pathfinding etc. But if players pc sucks, they will rubberband etc

manic sigil
#

Yeah, I did that for the F100 spawner - action added to an NPC by the hangar, call remotexec'd to _caller to spawn it in.

#

But the current bugbear, a helicopter delivering troops, is local to the server. At least, how I have it so far.

stark fjord
#

In this case, you dont remote exec, you just spawn the thing

manic sigil
#

TBF, I did want to functionalize it, since it's a selection of like 10 different types, and that was easier to handle by passing it through a [] call

#

... I'll be damned, it looks like that'd work at least.

stark fjord
#

Umm... you can just use call, not remoteExec then xD

manic sigil
#

After the jeeps, I was being very careful about controlling how things were created πŸ˜›

stark fjord
#

If player is expected to enter that vehicle as driver/pilot, then the locality will transfer to them anyways. So its preferable to create it on client straight away and skip the middleman, well middleserver

#

Anyhow, good luck with that.
In the end, if it works, there is no wrong paths, there is just more or less efficient ones.

manic sigil
#

I'll settle for 'works' at this point T_T

boreal parcel
#

can I not define a variable like so:

private ["_military", "_factory", "_bigtown", "_tower", "_village"];

Then use it as an array? _military pushBack etc

#

im getting undefined when I try to do so, do I need to do _military = []; first?

#

seems kinda annoying

sweet zodiac
#

Lemme try

granite sky
#

Yes, you do.

boreal parcel
#

ah, sadness

#

thank you

sweet zodiac
#

Yeah Arrays need to be declare properly

#

That works fine for normal Variables though from what I can see

granite sky
#

not sure what you call normal here.

#

For most variables you set the type when you assign data to them.

sweet zodiac
#

A single Value Variable

granite sky
#

A number, right

#

but then you couldn't do this and expect it to assume zero or anything:

private ["_myVal"];
_myVal = _myVal + 1;
sweet zodiac
#

Well of course It wouldn't do anything with that _myVal wasn't assigned in the first place

granite sky
#

Consider that this is also completely valid SQF:

private _myVal = [1,2,3];
_myVal = "wibble";
sweet zodiac
#

That's normally what happens when you assign Variables

#

They become the thing you assign it

granite sky
#

pushBack isn't assigning, it's appending. I guess they could make commands like pushBack and set do "if this variable is nil then turn it into an empty value of the appropriate type" but that's pretty dangerous.

#

wouldn't work with set anyway because array/hashmap overloads.

broken forge
#

What would be a cause for a server not being able to get allPlayers or playableUnits?

granite sky
#

too early?

drifting sky
#

Is it possible to get the muzzle position in the world of a unit?

granite sky
#

IIRC Leopard has a pretty epic script for that.

meager granite
broken forge
#

I created a client side mod that spawns an admin panel for the server I have, inside this admin panel there's a listbox that's supposed to get allPlayers, yet when I'm in the dedicated server and open the ui up the list doesn't populate. But if I host the mission myself in MP then the list populates with allPlayers on the server

dreamy kestrel
#

Q: when dealing with the getAllHitPointsDamage and conversely the setHitPointDamage, what do the selectionNamesArray have to do with anything? is that for groups of individual hitpointsNamesArray items? also what are the damages in damagesValueArray? scale of 0-1 like damage, setDamage? thanks...

meager granite
meager granite
#

All damages are 0 to 1, yes

#

hitpointsNamesArray -> setHitPointDamage/getHitPointDamage

#

selectionNamesArray -> setHit/getHit

#

Index of getAllHitPointsDamage return can be used in setHitIndex/getHitIndex

#

So you can operate same hit point by its config name, model selection name or just index

dreamy kestrel
#

sweet thanks for the shake down. so I could easily jam them into a HASHMAP and massage them out more meaningfully if I had to, thinking HP and damage pairs.

meager granite
#

Using hit point indexes is the most reliable way, its possible to have identical config names or empty selection names for hitpoints

#

This can happen if asset designer messed it up (A3 used to have plenty of such cases), might still be relevant for mods

#

So if you want to 100% cover all cases, operate hit points with indexes

dreamy kestrel
#

not sure what you mean, mess what up? as long as you are consistent with the HP name?

#

that is all setHitPointDamage takes, correct?

#

i.e. does not take an index

meager granite
#

setHitPointDamage takes config name, but its possible to configure vehicle and have it have two identical hit points

#

setHit takes model selection name but its possible to have hit point with empty selection name, so you won't be able to set/get it with setHit/getHit

#

Example of it, back in the day main tank turret had HitTurret hit point, but then there is commander turret on top of main turret which also was named HitTurret

#

So you had 2 hit points with HitTurret name and setHitPointDamage would only work on a first hit point with such name

dreamy kestrel
#

that so... so this code might be a possible kerfuffle, pending the object modeler...

{ _object setHitPointDamage _x; } forEach _hitpointsDamage;

as taken from our persistence model, deserialize object function

meager granite
#

Official assets fixed it by renaming commander turrets into HitComTurret but it might still happen somewhere and likely in some mods

#

Same with setHit, if hit point points to empty selection, setHit ["", 1] won't work (or will only work on first hit point with empty selection name)?

#

All in all, if you want exact 100% coverage, use hit indexes

#

If you only operate main hit points (which are also hardcoded in the engine) like HitFuel, HitEngine, then setHitPointDamage is sufficient

dreamy kestrel
#

filed under good to know, not sure we'll need hundred percent coverage, though

#

which the above, certain strategic parts, yes, that is the primary use case

#

thanks for the insight, plenty helpful

manic sigil
#

Fix one thing, break a dozen others T_T

meager granite
#

Is hashValue ["", objNull] always guaranteed to be "YAb76Oozh/g"? πŸ€”

#

Running another instance of the game returns same hash, wondering if somehow can be platform-dependent?

pallid anchor
#

hey guys, i could use some help. pretty sure its a coding/script thing. I’m trying to use a fire effect module that is trigger activated by the module that sets damage to the these vehicles with no damage animation to simulate the vics being destroyed once they’ve been given full damage. Problem is I can’t figure out how to activate the module via the trigger. I’m sure there’s a code I have to use but I can’t find anywhere that says what that code is

#

doing this in eden btw

dreamy kestrel
#

Q: about ``HASHMAP, given _keys createHashMapFromArray _values how are duplicate keys treated? last one wins? which I would half expect, or is an error generated? docs seem silent on the subject... I'll test, because I am curious... also somewhat in context with my above hitpoints questions...

meager granite
dreamy kestrel
#

i.e. assuming setHitPointDamage meaning first named HP wins

warm hedge
still forum
still forum
still forum
still forum
#

switch (false) would also return 1

still forum
stark fjord
#

So if case nil, or case ? : nil, case is ignored?

still forum
still forum
#

Every script command is ignored when you pass nil

#

nil call function
will not call function

stark fjord
#

This could cause some unwanted "it works but it shouldnt".
Maybe worth adding to wiki

stark fjord
still forum
#

default executes, but the function returns false, so then you do a case false
Its equivalent to

switch (true) do {
default { 1 };
case false;
case 1 : {3};
};

stark fjord
#

Ugh

pallid anchor
warm hedge
#

Yes

still forum
pallid anchor
#

the fire module for effect

#

the trigger the module is set to

#

the object the trigger is set to

stark fjord
pallid anchor
#

im honestly not used to the ones in eden or eden in general. im fairly new to mission making with eden and ive only really used the zeus module of which im pretty sure that one does fire the moment you put it on. in the fire module, i do see that theres a placement radius but even after altering that, it didnt show anything

stark fjord
#

So if you just play the mission there is no fire?

#

(Without triggering trigger)

#

Also, if that is true, then do trigger trigger (pickup that item), and check if fire perhaps appears on ground level. From what im guessing you have that ship floating in the sky

pallid anchor
#

correct, if i play the mission, there is no fire. in this video is the mission being played and me placing down the custom fire module from zeus. as you can see that works immediately.

this is all on ground level actually. maybe a couple feet above it but i think i get what youre asking me to check. although, what do you mean "do trigger trigger (pickup that item)"

stark fjord
#

Well complete trigger condition

pallid anchor
#

how do i translate that into code, if thats your meaning. if you just mean to play through it and se if the fire is on the ground, then ill do that now.

stark fjord
#

Yes. Just tp there and pickup the item thats supposed to make things burn

#

And then check on ground level

pallid anchor
#

sir

#

you are a genius

#

i was going through the steps to show you what was supposed to happen and when i checked under, the fire was all there lmao

stark fjord
#

Yes but. That means you cant easily move fire upwards. Fire or smoke module will always create particle source on ground

cold pagoda
#

hello!
Can someone explain what I'm doing wrong here? Everything works except for when it runs the remoteExecCall... It says that variable doens't exist. am I doing the str right?

{
    _group = _x;
    _group addAction ["<t color='#D61300'><br>---------------------------------------</t>", {}];
    _group addAction ["<t color='#1D8EDB'>Start All Targets</t>", { startAllTargets }];
    _group addAction ["<t color='#1D8EDB'>Stop All Targets</t>", { stopAllTargets }];

    {
        _group addAction ["<t color='#D61300'>---------------------------------------</t>", {}];
        _group addAction ["<t color='#12E900'>Start Target " + str _x + "</t>", {["snipergrp" + str _x, "MOVE"] remoteExecCall {enableAI, "snipergrp" + str _x;}}];
        _group addAction ["<t color='#12E900'>Stop Target " + str _x + "</t>", {["snipergrp" + str _x, "MOVE"] remoteExecCall {disableAI, "snipergrp" + str _x;}}];
        _group addAction ["<t color='#12E900'>Target " + str _x + " Walking Pace</t>", {}];
        _group addAction ["<t color='#12E900'>Target " + str _x + " Running Pace</t>", {}];
        
    } forEach [1, 2, 3, 4, 5];

} forEach [snppc1, snppc2];```
pallid anchor
#

well it seems it created it right under the thing i wanted it to be under. im currently messing with it to see if i can get it where i need

warm hedge
#

Ah sorry didn't see it

#

Well... this doesn't seem fine like at all

stark fjord
#

DisableAi has to be in quotes for starters

#

Also target isnt supposed to be a string

warm hedge
#

Do you know what exactly it is, and how exactly it works?

#

If not, the pinned Leopard's explanation would help

cold pagoda
#

to be honest, I've never used RemoteExecCall before. Just RemoteExec. the wiki says the syntax is the same. But I've never also done the nested foreach with a variable that needs to append the number.

I have it working except for the remoteExecCall.

warm hedge
#

Nothing is different than remoteExec, it is just spawn vs call but in MP

cold pagoda
#

I can fix the enableAI function but I'm more so looking, what would be the best way to do the snipergrp and append the 1?

#

this is running in the mission files init.sqf btw

stark fjord
#

missionNamespace getVariable "snipergrp"+x. But can disableai even take group as argument?

#

No it cant

cold pagoda
#

yea, that throws a wrench in it hmmm

#

i forgot it needs to be foreach units variable

stark fjord
#

Also _group is a number in your case. And you need to put action on an objects.

So i guess all of your script is basically wrong

cold pagoda
#

hmm, well it is working, just the remoteExecCall isn't.

stark fjord
#

But to answer your question, you are doing str right there πŸ™‚

cold pagoda
#

so it should be: snipergrp + str _x ?

#

I know it wont work, but just trying to learn lol

#

before, I had a init.sqf file of over 2000 lines, I've gotten a lot of it down to about 800 - 1000 lines by using foreach lol

stark fjord
#

Well, i guess.
It wont do what you want but yes it will make "snipergrp1/2/3/4/5"

#

Oh nvm _group is okay, i didnt notice you have nested loops

sweet zodiac
#

I fear for what ever mission you have made that requires over 2000 lines in the init.sqf

cold pagoda
#

its a training type map lol been working on it for about 10+ years now lol....

#

its traveled from A2 through A3

#

lol

pallid anchor
#

thats a really cool sounding personal project

sweet zodiac
#

I have even more questions than when I started

cold pagoda
#

wanna see it? lol

sweet zodiac
pallid anchor
#

if youre feeling inclined to share, of course

stark fjord
#

But question. When you added addAction to group, where does action appear?

sweet zodiac
#

does addaction even accept groups?

stark fjord
#

My question exactly πŸ˜›

#

It shouldnt

#

But then again, it may have some undocumented "features"

cold pagoda
stark fjord
#

This is arma after all

cold pagoda
#

if you want to see it lol
It controls a 60,000+ object training map and I've gotten 30+ people on at the same time with avg 40FPS lol... I know, but it has been a project!

cold pagoda
stark fjord
#

America explain...

cold pagoda
#

lol

#

just dont flame me tooo hard on the init file lol

#

but im always down for contributions/help

stark fjord
#

What is startAllTargets?

sweet zodiac
#

Dear God the eventhandlers

cold pagoda
#

so that one, when you hit Start All Targets all 5 groups that have popup targets attached to them will make the AI start moving.

stark fjord
#

Thats okay. But in the script context, what is it?

pallid anchor
stark fjord
#

Notepad of any kind

cold pagoda
pallid anchor
#

oh wait is that all the coding?

sweet zodiac
#

Yes

pallid anchor
#

ah i thought it was the mission file. i had a feeling it looked weird lol

cold pagoda
#

yea the mission file is 422 files large lol

pallid anchor
#

i dont knoe coding/script enough to understand what im looking at

sweet zodiac
#

Based OhMyPosh User

cold pagoda
#

lol

pallid anchor
stark fjord
#
{
    // addAction to group... i wont question it
    {
         _x addAction ["Disable move on " + name _x, {[_x, "MOVE"] remoteExec["disableAi", _x];}];
    } forEach units _x;

} forEach [group1, group2];```

Thats how id do it. Also untested and typed on phone, so mistakes are likely...
sweet zodiac
#

All the Hit event Handlers could probably each be turned into a one liner

#
// Adds "Hit" eventhandlers to the targets then moves the information from local into global.
L1_50L addeventhandler ["hit",{shooter1 = _this select 1; publicVariable "shooter1";}];
L1_50R addeventhandler ["hit",{shooter1 = _this select 1; publicVariable "shooter1";}];
L1_75L addeventhandler ["hit",{shooter1 = _this select 1; publicVariable "shooter1";}];
L1_150L addeventhandler ["hit",{shooter1 = _this select 1; publicVariable "shooter1";}];
L1_175L addeventhandler ["hit",{shooter1 = _this select 1; publicVariable "shooter1";}];
L1_250L addeventhandler ["hit",{shooter1 = _this select 1; publicVariable "shooter1";}];
L1_300L addeventhandler ["hit",{shooter1 = _this select 1; publicVariable "shooter1";}];

// Into
{_x addeventhandler ["hit",{shooter1 = _this select 1; publicVariable "shooter1"}]} forEach [L1_50L, L1_50R, L1_75L, L1_150L, L1_175L, L1_250L, L1_300L];
#

Doesn't change much, just looks nicer imo

cold pagoda
cold pagoda
stark fjord
#

But yeah, overall, no offence but sweet lawd jesus...

sweet zodiac
#

so many globals

cold pagoda
#

yea, I know lol I'm not a programmer. But I've tested things over the years and just found that setting it as a globalvariable makes things work in MP lol but over the last couple years, I've been learning about remoteExec.

sweet zodiac
#

The biggest problem you would run into is probably desync depending on how many things update and how often although it's mostly position updates that I find blast the network the hardest

cold pagoda
#

hmmmmmmmmmmmmmmm

#

I do see desync but only when people join the mission

#

could that cause it?

sweet zodiac
#

I Accidently set the Position of a Player several times a second for a short period of time, needless to say I Desynced to hell and back and I was the host

#

If you don't see any desync apart from that I wouldn't worry

#

It's probably just the sheer amount of Globals getting sent over the network if I had to guess

cold pagoda
#

yea, i want to figure it out tho lol it can be like a min usually a couple seconds.

#

ahh

sweet zodiac
#

It would only happen on Join mostly

cold pagoda
#

yea, only on join

sweet zodiac
#

Since init.sqf is run on the server and each player

cold pagoda
#

what would be a good alternative?

stark fjord
#

A minute is a wee too much in my personal opinion

cold pagoda
#

yea, I used to see a min, but normally its only been about 10-15 seconds.

sweet zodiac
#

That's insane, but I wouldn't worry about it

cold pagoda
#

do you think Global Variables in Triggers would also cause it? lol

sweet zodiac
#

It's likely just the sheer volume which you can't fix without just, well, doing less XD

cold pagoda
#

yea lol

stark fjord
#

But i guess i wanna test that addAction on group now

sweet zodiac
#

I closed my game a short while ago after like 10 hours of ramming my head against the wall making a gamemode

cold pagoda
sweet zodiac
#

Best case scenario it uses the Leader of the Group

stark fjord
#

But but but you said it does

cold pagoda
#

oh nooo, it works without the remoteExec. But this:

startTargetGroup = {
    {
        _snpgroup = _x;
        {
            [_x, "MOVE"] remoteExec ["enableAI", 2];
        } forEach units _snpgroup;
    } forEach _targetGroups;
};```
```sqf
_group addAction ["<t color='#1D8EDB'>Start All Targets</t>", { startAllTargets }];``` iirc works
#

but anyway, I wish I knew more lol but Ill keep stabbing at it! Thanks for the help! Need to get sleep for work... lol

inland iris
#

sorry to tag you mate
do you happen to know the script for sometihng
i want a heli to take off as soon as a scenario loads and go to a certain point in the map

stark fjord
#

Waypoint in editor would do just that

sweet zodiac
#

^

inland iris
#

I doesnt go up it starts up but doesnt go up

warm hedge
#

Please don't ping someone if the question is very generic.

inland iris
#

noted

little raptor
sharp parcel
#

hi there, is there anyway I can identify the cfggroup of an AI using objcursor code in the extended debug console? Or some other way to identify this for any AI unit group? cheers

warm hedge
#

Nope

sharp parcel
winter rose
#

@still forum - as long as your AI optimisations (don't calculate AI where it is not local) are not on trunk,
is disableAI "ALL" on clients an alternative to performance?

still forum
#

πŸ™ƒ
Don't know :x That would take too long to look up

winter rose
#

empiric testing it is then πŸ˜„ thanks πŸ™‚ (and hoping this fix reaches Stable!)

granite sky
#

disableAI "CHECKVISIBLE" should do it?

#

Although the other related command is dead IIRC so maybe that one is.

stark fjord
lethal cave
#

found out my error, cameraEffectEnableHUD true; should be executed after camCommit, and not on each frame, dunno why i missed that

winter rose
versed belfry
#

Hello :D

Quick question, I am trying to use the addItemToUniform command: https://community.bistudio.com/wiki/addItemToUniform

It is working as intended however I'd like to be able to overfill a uniform, by overfill I mean keep adding stuff even if it is full, this command will stop adding items if there is no space, is there any other command or way to do so?

stark fjord
#

I dont think you can overfill the uniform, like you can overfill a box

versed belfry
versed belfry
sweet zodiac
#

you could add to the max load the amount you need for the specific item I guess

inland iris
#

I want to spawn players on a Chinook on the air
as soon as the chinook is filled up with players I want to land the chinook in a certain position as a infil

sweet zodiac
#

define Filled

hallow mortar
inland iris
#

unarmed chinook full with players

lunar goblet
#

Is there a way to script something to play a video or some sort of cutscene when a trigger is activated? Trying to add something to a multiplayer operation and basically need the player camera to be sent to a different location for around 20 seconds, preferably without the player themselves moving.

hallow mortar
inland iris
# lunar goblet Is there a way to script something to play a video or some sort of cutscene when...

So I'm working on a mission, I have a Cut Scene already made and working with a trigger. The issue that I'm running into is that only I can see the Cut Scene and not the other players.Current scripting: Trigger On Act. this exec "camera3.sqs"; //camera3 because this is the 3rd video of 3, working backwards on this.// camera3.sqs: player setCapti...

sweet zodiac
#
waitUntil {
  sleep 1;
  (_heli emptyPositions "") == 0;
};
dreamy kestrel
#

following on from my hit points question... getting and setting them, looks great so far. however damage indicates 0. I gather does not translate to actual vehicle "damage" as it were. should I average the major components in terms of overall damage, i.e. fuel, engine, hull, body, etc?

sweet zodiac
#

If it can be fully damaged 1 and not blowup then I think it isn't considered major

winter rose
dreamy kestrel
#

not really my question... I want to approximate the damage based on hit points. or is that not the driving factor(s) for a vehicle?

winter rose
#

canMove

dreamy kestrel
#

in other words you can tell if vehicle is alive, correct? which is a function of damage? or maybe it isn't?

hallow mortar
# winter rose what about… "GetIn" EH?

That would also work. Personally I'd favour waitUntil as it's a bit more self-contained and I don't like to add whole EHs just for one event like this. Down to preference really, no significant performance overhead either way.

winter rose
stark fjord
#

Do you use ace?