#arma3_scripting

1 messages ยท Page 207 of 1

pallid palm
#

that must be diff

#

you can even point at a medic and hit enter then point at another soldier and order the medic to heal that soldier

granite sky
#

Yeah the issue is that the player stop command doesn't seem to have script equivalent or a direct way to undo it through script.

pallid palm
#

oh so that is diff hmmm

hallow mortar
#

IIRC there are a few other command menu orders that aren't available through scripts. It's unfortunate, but I think the last word was that it's deep magic and we probably won't get them.

pallid palm
#

hmmm

#

im not even sure what the player stop command is ?

hallow mortar
#

When you are the leader of the group, open the command menu (e.g. pressing F2 to select the second unit in your group) and select Stop.

pallid palm
#

oh thats the same as the normal stop command right

#

for Ai and players right ?

#

after chose stop command i just chose regroup and all regroups to me

shut carbon
#

after he stops the unit he wants to use a script move on him and it doesn't work, that's the issue,

pallid palm
#

oh ok i see now ok

#

thx for the explantion m8 @shut carbon

#

i guess you would have to make your own command structure for that

#

i remember there was 1 in Arma 2

shut carbon
#

like a rank structure?

#

or commands as in script commands.

pallid palm
#

ummm no it was a umm support structure i think

shut carbon
#

you thinking of High Command?

pallid palm
#

oh yeah thats it

shut carbon
#

yes, but we're talking about the user group units. It's a different use case. Thing is the user commands menu have another "layer" where they function, disabling some script commands over them.

pallid palm
#

oh shit yeah wow oh man ๐Ÿ™‚

#

now i see why you call it player stop command

#

๐Ÿ™‚

shut carbon
#

yup ๐Ÿ™‚

pallid palm
#

i guess i'm a little thick in the head ๐Ÿ™‚ but thx for taking the time to make me understand

shut carbon
#

you're not. I'ts Arma's fault ๐Ÿ˜„

pallid palm
#

lol no no there's nothing wrong with Arma ๐Ÿ™‚

#

lol

#

its always me that mess's up its never the game ๐Ÿ™‚

#

lol

#

just like in Golf its never the club ๐Ÿ™‚

#

๐Ÿ™‚ i just added a cool intro to my demo mission of my chopper command

#

that no one seems to want lol

#

but thats ok i love it

glossy matrix
#

Turns out if you call camSetTarget, then setVectorUp and setVectorDirAndUp no longer work on camera...

glossy matrix
#

Solved by replacing camSetTarget with setVectorDirAndUp, the direction vector is the same passed into camSetTarget and the up vector is used to control banking.

honest lichen
#

i can't kill a script with "terminate" even if it returns true using "canSuspend"

glossy matrix
#

Another problem, now that I don't use camSetTarget, calling camSetFov doesn't work anymore since according to wiki this function requires camera to have a target, how do I workaround this?

viscid belfry
#

Hello guys I'm running into some issues with my global kill counter. I was thinking I'd ask here if you guys have any experience with addMissionEventHandlers. For some reason _killer and _instigator is ALWAYS null or in my code at least, not a player. Which isn't true, we clear through hundreds in our missions. This code is executed from XEH_PostInit of my own addon, and is run globally, on each client, but the first rows exclude client players. I have also tried using !HasInterface only to enforce server & headless are only allowed to track these kills, but without success. Could it be a locality issue? Could the internal isServer check be breaking things as perhaps the unit is not local to the server therefor the reference to it falls apart? Any ideas? Thanks for checking. If anyone wants to use this bit of code, feel free, IF I manage to fix it of course ๐Ÿ˜„

    Global Killed Event Handler for all units.
    Registers a missionEventHandler ["EntityKilled", ...] on all non-interface clients (server & HC).
    Ensures only one global score addition per kill using a variable on the killed unit.
*/

// Only run on server and headless clients (not player clients),
// but allow if this is a local server (hasInterface && isServer) for debugging
if (hasInterface && !isServer) exitWith {};

private _Debug = missionNamespace getVariable ["GOL_Enemy_Debug", false];
if(_Debug) then {
    format["[KILLS] Registering Global Killed Event Handler"] spawn OKS_fnc_LogDebug;
};

if (isNil "GOL_GlobalKilledEventHandler_Registered") then {
    GOL_GlobalKilledEventHandler_Registered = true;
    
    addMissionEventHandler ["EntityKilled", {
        params ["_unit", "_killer", "_instigator"];
        private _Debug = missionNamespace getVariable ["GOL_Enemy_Debug", false];

        // Only process if not already handled
        if (_unit getVariable ["GOL_ScoreAdded", false]) exitWith {};
        _unit setVariable ["GOL_ScoreAdded", true, true]; // sync to all
        
        // Only update global score on server
        if (isServer) then {
        if(isPlayer _killer || isPlayer _instigator) then {
                //// Lots of logic to figure out if captive, is enemy, is civilian, etc. Can be ignored as we never reach this point.
            } else {
                // Killed by environment or unknown
        private _name = name _unit;
        if (isNil "_name" || {_name isEqualTo ""}) then { _name = typeOf _unit; };
        if (_Debug) then {
             format["[KILLS] NotPlayer: %1 killed by %2 (%3) - Instigator %4 (%5)", _name, name _killer, _killer, name _instigator, _instigator] spawn OKS_fnc_LogDebug;
        }; 
            }
     }]

The logs I receive are mostly the following types

18:35:56 "[D][KILLS] NotPlayer: Error: No unit killed by Error: No vehicle (<NULL-object>) - Instigator Error: No vehicle (<NULL-object>)"
18:35:56 "[D][KILLS] NotPlayer: Bilal Al-Hassan killed by Error: No vehicle (<NULL-object>) - Instigator Error: No vehicle (<NULL-object>)"
18:35:56 "[D][KILLS] NotPlayer: Sami Al-Hashim killed by Error: No vehicle (<NULL-object>) - Instigator Error: No vehicle (<NULL-object>)"
18:35:56 "[D][KILLS] NotPlayer: Mohammed Al-Nasser killed by Error: No vehicle (<NULL-object>) - Instigator Error: No vehicle (<NULL-object>)"

Edit:

I fixed this making sure that I check (local _unit), the logs were of course on the headless client. so I removed the isServer and freed that up and then used that condition to make sure I only run it on the client that the unit is local to.

It works, but perfection, probably not ๐Ÿ˜„

tender fossil
# viscid belfry Hello guys I'm running into some issues with my global kill counter. I was think...

Didn't check the code thoroughly, but there seems to be some misplaced and missing semicolons. You can try this code snippet, but can't guarantee that it would work ๐Ÿ˜… (I highly suggest using a syntax plugin/extension) ```sqf
if (isNil "GOL_GlobalKilledEventHandler_Registered") then {
GOL_GlobalKilledEventHandler_Registered = true;

addMissionEventHandler ["EntityKilled", {
    params ["_unit", "_killer", "_instigator"];
    private _Debug = missionNamespace getVariable ["GOL_Enemy_Debug", false];

    // Only process if not already handled
    if (_unit getVariable ["GOL_ScoreAdded", false]) exitWith {};
    _unit setVariable ["GOL_ScoreAdded", true, true]; // sync to all
    
    // Only update global score on server
    if (isServer) then {
        if(isPlayer _killer || isPlayer _instigator) then {
                //// Lots of logic to figure out if captive, is enemy, is civilian, etc. Can be ignored as we never reach this point.
            } else {
                // Killed by environment or unknown
            };
    };

    private _name = name _unit;
    
    if (isNil "_name" || {_name isEqualTo ""}) then { _name = typeOf _unit; };
    
    if (_Debug) then {
         format["[KILLS] NotPlayer: %1 killed by %2 (%3) - Instigator %4 (%5)", _name, name _killer, _killer, name _instigator, _instigator] spawn OKS_fnc_LogDebug;
    };
    
}];

};

viscid belfry
#

But thanks for the advice! I do run VS Code with Syntax prettyness ๐Ÿ˜„

astral bone
#

Little bit of a Niche thing, but any way to make Advanced Developer Tools, the syntax, ignore something?

#
["Randomize rotation and scale"] collect3DENHistory {
    private _scaleRange = "85,115";
    // Rotate:    True - Random 0 - 360
    //            False - No Rotate
    //            Array - 
    private _doRotate = [0,90,180,270];
    
    private _rotated = 0;
    private _objs = get3DENSelected "object";
    private _scaleRangeSafe = _scaleRange splitString ",";
    _scaleRangeSafe resize 2;
    if(isNil {_scaleRangeSafe # 0} || {(_scaleRangeSafe # 0)call BIS_fnc_parseNumber <= 0})then{
        _scaleRangeSafe set [0,"100"];
    };
    if(isNil {_scaleRangeSafe # 1} || {(_scaleRangeSafe # 1)call BIS_fnc_parseNumber <= 0})then{
        _scaleRangeSafe set [1,"100"];
    };
    private _hScale = parseNumber (_scaleRangeSafe # 1);
    private _lScale = parseNumber (_scaleRangeSafe # 0);
    private _scaleRandomRange = _hScale - _lScale;
    private _scaleOffset = _lScale; // Needed?    
    

    {
        private _nScale = (random (_scaleRandomRange * 1));
        _nScale = (floor (_nScale + _scaleOffset))/100;
        
        _x set3DENAttribute ["ENH_objectScaling",_nScale];
        _x setObjectScale _nScale;
        
        if(typeName _doRotate == "BOOL" && {_doRotate == true})then{
            private _oRot = (_x get3DENAttribute "rotation") # 0;
            _oRot set [2,random 360];
            _x set3DENAttribute ["rotation",_oRot];
        }else{
            if(typeName _doRotate == "ARRAY")then{
                private _nRot = selectRandom _doRotate;
                if((_nRot % 360) > 0)then{
                    private _rotation = (_x get3DENAttribute "rotation") # 0;
                      _rotation set [2, ((_rotation # 2) + _nRot) % 360];
                  
                    _x set3DENAttribute ["rotation", _rotation];
                    _rotated = _rotated + 1;
                };    
            };
        };
    }forEach _objs;
};
#

That or, if you have a better idea how to accomplish this- Script is meant to make an eden undo history point, then you enter a range for random scale, then it was just a bool for rotation. True, randomize rotation between 0 and 360. False, doesn't touch the rotation. New part however is the typeName check. If bool, do what it was doing. But now, if an Array, then pick a random entry from the array, and set the rotation to that.

Advanced Developer Tools, syntax checker doesn't like _doRotate in the bool when it's an array, and vice versa. Runs fine, but the editor part complains b/c doesn't realize I'm doing a check, so it can ignore mismatched types x3

cosmic lichen
#

You should use params command with default value, accepted data type and array size

#

Also why is the range a string and not an array.

astral bone
winter rose
astral bone
#

Ah- I forgot the scale doesn't have a way to tell it to ignore it so it will always change scale ๐Ÿซ  This has already taken longer then I'd like, so I'll just live with it for now xD

split ruin
#

is there any way to remove the external turret from CRV -6e Bobcat and turn it to pure armored transport ? I know I can remove the ammo but there is resupply point players can use to still shoot that gun ...

hallow mortar
#

I'm not sure if it has animation sources to visually hide the turret. But you can use removeWeaponTurret to...remove...the weapon...and then they won't be able to rearm it

rocky totem
#

my workflow now consists of codex-cli being able to modify my arma3 scenario, pack the pbo, run an arma3 server with it, check the logs, fix stuff, all automated. fully worth the effort lol

split ruin
#

@hallow mortar I tried this and it completely removes turret

_veh animate ["HideTurret",1];
silent prairie
#

How can I destroy/delete a backpack placed in the editor? Surprisingly hard. I've tried deleteVehicle/setDammage/enableSimulation false, doesn't work so far

tulip ridge
#

deleteVehicle works, but enableSimulation wouldn't do either of things you're asking

silent prairie
viscid belfry
silent prairie
granite sky
#

Yeah, it's because they're placed in ground weapon holders IIRC.

#

kinda weird because the backpack itself is an object?

#

never figured that out fully.

rocky totem
drifting copper
#

I redid the KP Lib arsenal to just the ACE3 arsenal for files init_arsenal.sqf and open_arsenal.sqf. Somehow it works but spits errors and would like to know how to clean it a bit better

[] spawn {
    // Wait for the player to be alive
    waitUntil { alive player };

    // Declare private variables at the top
    private _backpack;
    private _posBase;

    // Backup the player's backpack
    _backpack = backpack player;

    // Optional: limit arsenal to base
    _posBase = getMarkerPos "base_marker";
    if ((getPos player distance _posBase) > 50) then {
        hint "You can only access the arsenal at base!";
        exitWith {};
    };

    // Open a standard ACE Arsenal
    [player, player, false] call ace_arsenal_fnc_openBox;

    // Wait until arsenal is closed, then restore backpack
    waitUntil { isNull (findDisplay 245) };
    [_backpack] call KPLIB_fnc_checkGear;
};
// --- Whitelisted ACE Arsenal ---
[] spawn {
    waitUntil { alive player };

    private _backpack;
    private _arsenalWhitelist;

    // Backup player's backpack
    _backpack = backpack player;

    // Define whitelist of classnames
    _arsenalWhitelist = [
// add whitelist string here
    ];

    // Add whitelist to ACE Arsenal
    [player, _arsenalWhitelist, false] call ace_arsenal_fnc_addVirtualItems;

    // Open ACE Arsenal
    [player, player, false] call ace_arsenal_fnc_openBox;

    // Wait until closed, then restore backpack
    waitUntil { isNull (findDisplay 245) };
    [_backpack] call KPLIB_fnc_checkGear;
};
tulip ridge
drifting copper
tulip ridge
#

I mean for whether to use BI or ACE arsenal

drifting copper
tulip ridge
#

I've never had issues

#

ยฏ_(ใƒ„)_/ยฏ

drifting copper
#

Same, till recently. Been setting up lib annd converting maps for myself for years now. I have converted maps for myself basically to all 5star maps onn the workshop

#

But the question was not how to setup the arsenal presets - it was for help inn cleaning the above posted ^

drifting copper
thin fox
#

you should asked in the kp lib discord before wasting your time on that script lol

thin fox
#

updated

#

the arsenal is handled differently

drifting copper
#

I see the functionn call has been changed

thin fox
#

but even in 7a, i've never had any issues with the arsenal,

#

the only issue occurs when you have an error in the preset

#

and it won't load the arsenal right

drifting copper
#

Ye in the last few weeks I have noticed the preset breaks, especially on modded stuff, and you get half loaded arsenal. Hence why I just made it for a standard preset less ACE3 arsenal that can be restricted

drifting copper
#

What I made now works as intended - I just don;t know enough about sqf to make it 100% error free

drifting copper
thin fox
#

but I'm not the dev

#

xD

jade acorn
#

I'm trying to get a helicopter hover next to the edge of a building, however any varian of flyInHeight will either make it drop to the ground or go way up the sky. Can I actually do this without unitCapture'ing myself flying it?

jade acorn
#

if I place an object or helipad and use land/landAt it will choose any other spot.

jade acorn
thin fox
jade acorn
#

since some version of A3 any height below 10m makes them land, anything above will default to the baked-in lowest number

manic sigil
#

Is it possible to rotate a vehicle without resetting its velocity?

hallow mortar
#

I don't think so, but you can save its velocity, rotate it, and then immediately re-apply its velocity

manic sigil
#

Yeah, thats what I was thinking, just hoping someone has some cooked up way around it xD

hallow mortar
#

I mean it's not super hard to do. Any hacky workaround would likely be more complex than just re-applying velocity.

private _vel = velocity _object;
_object setVectorDirAndUp [ ... ];
_object setVelocity _vel;
// or
private _vel = velocityModelSpace _object;
_object setVectorDirAndUp [ ... ];
_object setVelocityModelSpace _vel;```
manic sigil
#

Ehh, true...

Im working on a mod to make beach assaults easier and smoother for Zeus, and thinking of different ways to manage pathing the boats to the target area when theyre being forced forward.

tulip ridge
#

Really struggling to try and rotate some created objects along with a module.
It's accurate ~1/4 of the time (rotation wise), but once it crosses a certain threshold it gets a larger and larger offset from the module.

I've always struggled with vector math, and not sure what the correct way to go about this is. Also this is mostly testing code, I will clean it up more later.

// Takes a center position, length, width, height, and direction and generates a random position within the area.
params ["_centerASL", "_a", "_b", "_c", "_direction"];
TRACE_5("fnc_distribution_gaussian",_centerASL,_a,_b,_c,_direction);

private _return = [];
{
    _return pushBack (random [-_x, 0, _x]);
} forEach [_a, _b, _c];
_return = _centerASL vectorAdd _return;
_return = [_return, _direction, 2] call BIS_fnc_rotateVector3D;
_return;

"large" (not sure what it was at) rotation vs 0 degrees

#

It seems my issue was just because I was adding the center position before the rotation, it seemingly should be after. This seems to be correctly rotating with the module

private _return = [_a, _b, _c] apply { random [-_x, 0, _x] };
_return = [_return, _direction, 2] call BIS_fnc_rotateVector3D;
_return = _centerASL vectorAdd _return;
_return;
split ruin
#

Does anyone know/have good vehicles paradrop script? Or I have to make my own ...

fair drum
pallid palm
#

i also have a paraDrop script that i made, well really like 3 of them: for diff things

#

thay are realy nice and simple and works great

#

but if you realy want a Awsome paraDrop script look into (LV scripts) hes Awsome

#

imho

#

in my paraDrop script it only Drops the Amount of soldiers that can fit in the caro

#

in (LV scripts) he has it so you can drop as many as you want

#

and also in the (LV scripts) there's full Documentation on how and why to exec the script

#

as a matter of fact i have a "Para folder" that has
(ParaEject script)
and a regular Paradrop Script like from a flag pole
and 2 Halo Scripts 1 with EX cam
and 1 with out

all my Para scripts work over water or land

#

over water my para scripts ajust the stuck Aim the happends when you drop in the water sometimes as a scuba drive

#

hight of chut open can be ajusted in the script as you want

#

all with sounds of chut open PoP: and wind ripple affect: untill land

pallid palm
#

i have it set that you can not be shot while in para drop but that can be changed as you wish

split ruin
#

I want to drop tanks

pallid palm
#

oh ummm ok lol ๐Ÿ™

#

there is sling rope for that right

#

or do you mean drop fuel tanks ?

split ruin
#

base is on a carrier, paradrop vehicles is easy way to get tanks and apcs to land if there is no pilot among players

pallid palm
#

oh so you would just ajust my para drop script for the tank insted of _player

#

cuz my para drop script has map click location

#

@split ruin w8 a sec can't you use support drop for that m8

#

IIRC i think there is a Module for that

#

maybe that was Arma 2 i forget

#

hello all: what's the name of the cargo parachute in Arma 3 ?

#

ahhh ok "B_Parachute_02_F"

#

Woohoo ๐Ÿ™‚

split ruin
#

paradrop module is for crates only but maybe it can be scripted to drop vehs

pallid palm
#

im making one now for tanks and stuff ๐Ÿ™‚

pallid palm
#

but it may take me like 4 weeks to get it right ๐Ÿ™‚

#

lol just kidding ๐Ÿ™‚

#

ok now to see if it works ๐Ÿ™‚

split ruin
#

@thin fox unfortunetely I don't plan to have Zeus in the scenario

split ruin
#

I solved the problem partially by making land vehs to be produced as cargo container, then after sling loading them to land they can be "unpacked" to vehicle needed

depot addAction
[    
  "<t color='#FF80FF'>Build Container</t>",
  {
  params ["_target", "_caller", "_actionId", "_arguments"];
_container = createVehicle ["B_Slingload_01_Cargo_F",[5845.74,2941.8,23.8007],[], 0,"NONE"];
_container setPosASL [5845.74,2941.8,23.8007];
_container setDir 300;
_container addAction
    [
      "<t color='#80FF80'>Build Quadbike 2P</t>",
      {
    params ["_target", "_caller", "_actionId", "_arguments"];

    private _pScore = (getPlayerScores _caller) select 5;
        if (_pScore < 2) exitWith { hint "Earn more score!"};
    _caller addScore -2;
        _vehpos = getPosATL _target;
    deleteVehicle _target;
    _veh = "B_Quadbike_01_F" createVehicle _vehpos;

        ["build"] remoteExec ["BIS_fnc_showNotification",0];
        },nil,5,true,true,"","true",3,false,"",""
      ];
    },nil,6,true,true,"","true",3,false,"",""
];
tough abyss
#

I need to workshop how to make an XP system for various tasks in our game. It would be simple: a player does a certain task and that adds to the points total. Those points allow other skills and features to unlock.

So after the system is running it would be simple to use it. "if so many points, then, else, etc." I would like to know ways to go about collecting the points (keystrokes, time, trigger area, a combo?), and how to store them in our DB. I can set up new categories in the database to store the stats neatly. How would they be stored, and would that all fall under scripted database?

Sorry I can't be more specific, I really don't know where to start on this one. Not looking for the script, just help with an outline of the work flow.

split ruin
#

@tough abyss maybe use score as exp points? you can simply add custom amount of score points for tasks and additionally player gets points automatically when killin enemy units and assets

tough abyss
split ruin
#

score is personal for every players so it can work as experience

#

it is saved during mission

#

and probably can be saved to player name varspace between server sessions

tough abyss
#

Is there any way for me to split that into a several classes of scores per player? For different types of tasks. The goal is a very simple skill tree.

split ruin
#

no problem,here is the example win trigger on a task where players have to destroy enemy weapons cache

wintrg = createTrigger ["EmptyDetector", _uberPos, true];
wintrg setTriggerArea [50, 50, 0, false, 30];
wintrg setTriggerActivation ["NONE", "NONE", false];
wintrg setTriggerStatements ["{!alive _x} forEach tsk_objects",
"
    private _allPlayers = call BIS_fnc_listPlayers;
    {_x addScore 20} forEach _allPlayers;
    deleteVehicle failtrg;
    ['tsk','SUCCEEDED', true] call BIS_fnc_taskSetState;
    ['succ'] remoteExec ['BIS_fnc_showNotification',0];
    _list = (position thisTrigger) nearObjects ['All', 30];
    {deleteVehicle _x} forEach _list;
    ['tsk'] call BIS_fnc_deleteTask;
    deleteVehicle wintrg;
", ""];
#

with this

 private _allPlayers = call BIS_fnc_listPlayers;
{_x addScore 20} forEach _allPlayers;

you give all players 20 score points ("experience") to everyone when they destroy the enemy cache but you can make it only the player who actually destroyed the cache receives the score points

tough abyss
#

Yea that first block gives me a good idea of how to put this to use! With a little planning, we could make our tree a bit more complex and it wouldn't drain our brains too much, lol. Many thanks for the help.

split ruin
#

About your previous question, you can make player buy improvements for his skills with experience (score points), this way he will decide how to improve his character
making his traits better and buying custom traits https://community.bistudio.com/wiki/setUnitTrait

#

Good luck on the battlefield! ๐Ÿ™‚

thin fox
tough abyss
thin fox
#

it doesn't require "zeus" to use that, it's a function

split ruin
#

it needs zeus module placed in eden ...
I definitely test it with the Supply Drop module
if it works it will solve the issue completely

thin fox
errant iron
#

it's not particularly complicated, just some sound effects and a teleport with automatic parachutes

split ruin
#

@errant iron that's really cool especially if you are inside the tank ๐Ÿคฉ

sage dawn
#

is there a way to detect if a unit has a valid lock on a target? cursorTarget returns the selected target but it still returns that target even if the lock isn't valid and cursorTarget only works on a player

fringe marsh
#

hey guys!

I'm trying to place a weapon on the ground in the editor. I want it to have a specific ammo inside.
Is there a way to do this? Maybe with a script?

tulip ridge
fringe marsh
#

a ground holder? you mean like a box?

tulip ridge
#

Like createVehicle ["GroundWeaponHolder" , ...]

#

They are boxes though technically

#

Though if you want to mess with it Eden you'll want create3DENEntity instead

hallow mortar
zinc loom
#

hi mate,s me with my basic trouble again, i kinda cant create a ListNBox 3 in arma 3, i just does not appear, any ideas what could be wrong ?

thin fox
#

then you need to addcolumns to it

#

and add something using lnbadd

zinc loom
#

does it not appear black like a listbox if nothing is in ?

thin fox
#

listnbox doesn't have a background/frame like the normal listbox

#

it's just invisible

zinc loom
#

u kidding me so colorBackground is what ?

thin fox
#

from my experience it doesn't work lol

#

generally I add a background to it

#

but that's it

#

but to get it working, to show up, you need to add something in the list

hallow mortar
#

Make sure you use ListNBox-specific commands on it. If you try to use ordinary ListBox commands, weird stuff can happen.

thin fox
#

start with adding columns with lnbAddColumn, then use it to add things with lnbAddRow

hallow mortar
#

If you're creating it in config, you won't need to add columns by scripting as they can be defined in the config

thin fox
#

that too

#

but I found that, at least for me, it's easier this way to get the right column pos

zinc loom
#

funny its not in the den editor in gui editor

dawn thunder
#

Not sure where to ask; is it possible to hot-reload a mod to make testing and editing the packaged mod in different scenarios easier?

fair drum
tulip ridge
#

Scripts are pretty easy, config is doable but jank AFAIK (never tried it)

granite sky
#

Is the system documented?

manic sigil
#

I feel like I'm missing something with BIS_fnc_randomPos; I tried passing [{player distance _this == 5}] as a code argument and it throws an error about it being code but expecting array, etc.

hallow mortar
#

Parameters are interpreted strictly based on their sequential position; you can't just skip parameters and expect the game to figure out what to do with what you've given it. It's not that clever.

manic sigil
hallow mortar
#

If you don't want to blocklist any areas, then you need to pass an empty array [] for that parameter so you can reach param 2: code condition.

manic sigil
#

Ah, got it, didn't see the missing element there - borrowed it from the wiki as-was and threw my own code in to try and figure out how it works.

#

Had to rewrite from the ground up to get it t_t

#

I'm trying to pass it a specific set of instructions, that the positions picked must have an ASL height and AGL height of 0, trying to find the exact border between land and sea.

#

But it's not coming together :/

hallow mortar
#

I think aiming for exactly 0 might be too ambitious. You might have better luck looking for a position that's between, say, 0.1 and -0.1

#

You can blocklist "water" to avoid getting positions that are actually in the water

#

Also, this is a function not a script command, so it is itself just made of SQF commands. You can inspect it in the Functions Viewer to see what it's doing.

manic sigil
#

Ech. Had a feeling that was the case when my marker stopped popping around to the eachFrame'd picked positions.

hallow mortar
#

You can verify this yourself in the functions viewer, but I strongly suspect that this function simply generates a random position and then checks if it meets the condition. If the condition is very specific, it could take a looooooooong time for it to randomly generate a position that matches. Theoretically, forever. It has the ability to bail out and return [0,0] if a position can't be found, and that might include "this is taking too long", not just "there is literally no position there to be found".

manic sigil
#

Yeah. Damn, well, that's not cutting it. At least the function I'm dreaming of doesn't have any actual utility yet so I don't really need it ๐Ÿ™ƒ

hollow lantern
#

can you command an Darter drone to paint a target? For simplicity I tried: sqf (gunner this) doWatch Bardelas; (gunner this) doTarget Bardelas; this fireAtTarget [Bardelas, (this weaponsTurret [0]) select 0]; in the init of the drone
which did not work. Ort would you need to create a laserTarget via createVehicle instead?

modest temple
#

hey, I'm trying to detect when certain popup targets are down and then having it play a sound.

_target_0 = target_0; 
_target_1 = target_1;

_soundPlayed = false;

while {!_soundPlayed} do {
    sleep 1;

    _anim1 = animationState _target_0;
    _anim2 = animationState _target_1;

    if (_anim1 == "terc_1" && _anim2 == "terc_1") then {
        playSound "beep"; 
        _soundPlayed = true;
    };
};

I tried this but it doesn't seem to be working

modest temple
modest temple
modest temple
thin fox
warm ore
#

Is there a script command to prevent a vehicle turret from moving?

warm ore
warm ore
modest temple
thin fox
#

๐Ÿ‘

cursive pebble
#

can someone help me by telling me if a script I have for dynamic loot is functional?

cosmic lichen
#

From what I can see it's functional ๐Ÿคทโ€โ™€๏ธ

cursive pebble
tulip ridge
#

Pastebin, github gists, etc.

#

Just uploading the file too

cursive pebble
cursive pebble
#

where i got it from said it was the most basic for dynamic loot, but when i put it in my project nothing appeared

cosmic lichen
#

How do you excecute it?

#

Have you checked if there are actually items in _lootArray?

cursive pebble
cosmic lichen
#

You need to execute it from within initPlayerLocal.sqf

cursive pebble
#

i have it in the mission folder

winter rose
#

ok
execute it from within initPlayerLocal.sqf

cursive pebble
#

how do I execute it? it is not supposed to put it in the mission folder is executed when i open it in multi

winter rose
#

say again?

cursive pebble
#

?

winter rose
#

it is not supposed to put it in the mission folder is executed when i open it in multi
I did not understand that

tulip ridge
cursive pebble
dawn thunder
hallow mortar
# cursive pebble the scripts check them by starting the mission in multi

Most scripts don't (can't) automatically run themselves. A file on its own will do nothing. Something needs to tell the game to run that file.
You can use execVM to run the file directly, or turn it into a function (https://community.bistudio.com/wiki/Arma_3:_Functions_Library) and use call or spawn. You'll need to use one of the scripts that is automatically run when the mission starts, like init.sqf, initServer.sqf, or initPlayerLocal.sqf.

limber panther
#

Greetings folks! I would like to ask you for a little tip. In a multiplayer scenario, when player does some action, i want to play him some music. The music should be played in a loop until i make it to stop and only that one player should hear it, noone else. So i was wondering which script should i use, which one is the best? create sound source, or play sound or say or some other? Thank you

#

I was reading through the wiki and all of them seem way too similar to me, i was thinking about create sound source as it loops the sound, so i wouldn't need any while-do loop. But it has global effect so i guess others would hear that too

cursive pebble
cursive pebble
#

IT WORKED

#

THANKS

#

but i need a hand to fix something

cursive pebble
#

how can i make the loot vary?

#

because only weapons appear

#

no backpacks, no vests, no accessories, no food

#

just weapons

cosmic lichen
#
_cfgArray = "( 
(getNumber (_x >> 'scope') >= 2) && 
{getText (_x >> 'vehicleClass') in ['WeaponsPrimary','weaponsSecondary','weaponsHandGuns'] &&
{_lootArray pushBack ( configName _x );
  true}
}
)" configClasses (configFile >> "CfgVehicles");
#

WeaponsPrimary, weaponsSecondary....

#

that's what you need to adjust

limber panther
cursive pebble
cosmic lichen
cursive pebble
cosmic lichen
#

They should have the same item type

cursive pebble
#

ok, thanks for the aid

fair drum
zinc loom
#

@thin fox ty sir, i didnt what u tried to explain to me, but now i get it and u have been completle right

#

about listnbox i made it

cursive pebble
#

i dont know what to touch but only dlc appears to me and in quantity

#

all buildings look like christmas trees

zinc loom
#

i forgot to write understand

#

but i get the point, yea but its har to figure it out if u dont see anything ..

thin fox
warm fern
#

Hello, I have questions about RscDisplayMultiplayerSetup. Is it normal for this display to remain active after a mission loads?

gray cairn
#

Trying to create script/function that has any vehicle driven by a CIV either turn around and drive away or have the occupants dismount and flee if they are hit by a specific projectile.

Couldnt find any examples on the workshop. Anyone go something similar kicking around?

broken pivot
warm hedge
#

Yes

broken pivot
#

Is there any extension of that area or a reason why the last bracket isnt inside the #define area?
(thats an image from the example files - both sides of the picture show the same document in diffrent lines)

stable dune
#

\ does mark continue on next line.
So that is last "new" line

broken pivot
#

So the area logic goes like Ive tried to mark it. That also explain my confusion

cosmic lichen
#

Yes

broken pivot
#

I gues Ive done something wrong in the defining or including part because hes missing its values.
Ive compared with others and cant find a diffrence. Isnt it possible to tabstop them like Ive did?
Or is it possible that my deactivated area creates some issues because the \ isnt the very last character in line like
its called in https://community.bistudio.com/wiki/PreProcessor_Commands#Multi-line

cosmic lichen
#

It says on the page you linked.

#

Last character, no spaces allowed.

cursive pebble
#

now only dlc weapon appear, the backpacks that appeared cannot be grabbed, the rest of the objects that i put on the list do not appear, and the buildings look like christmas trees

grim yoke
#

I'm not sure if this is the right channel,
but I'll ask here ๐Ÿ™‚

Does anyone know how to reuse the map menu from the old man scenario?
It's not a standard map menu, but we like it and would like to use it in Altis Life.

dire star
#

How do i play music to specific group of players?

winter rose
dire star
#

Do i just use group name?

winter rose
#

you can use an array of players

#

what if i have a group of 5 players and in that group there is only 3 players how do i remotExec group?
just to make it clear, you have a group of 5, and you only want to send playMusic to 3 of them

dire star
#

I have 2 groups which contain player slots and i want to play for music only for 1 group, mb i didnt explain it that well i meant if in my group there is 5 slots and only 3 players connect to server

winter rose
#

oh, then use units _groupVar as remoteExec targets

#

(do not use _groupVar directly, it would only go to the group's owner)

dire star
#

Like this?
["coh_calm1"] remoteExec ["playMusic", units ft_grp];
ft_grp is my groups variable name

errant iron
winter rose
dire star
#

["coh_calm1"] remoteExec ["playMusic", ft_grp];

#

Like this then?

winter rose
#

seems so ๐Ÿ™‚

hushed turtle
#

Look at mission files, you may code, which does this

broken pivot
broken pivot
#

Can someone translate what hes saying?
From wich "caller" is he talking about?

tulip ridge
broken pivot
#

Thanks brother ๐Ÿ˜„ Trailing is translated into german with something similar to "hunt" or "chasing"

#

So the problem is that Ive closed the brackets in the end of my defining part?
Because Ive no ";" at the end oy my macro

tulip ridge
#

You do, you literally circled it

broken pivot
#

Hm? I dont understand full

tulip ridge
#

The last character is a ;

broken pivot
#

Thats what Ive tried to say haha sorry for language barrier

#

Now Ive received an error and I could bet that its because the missing simicolon in the area Im using my macro

broken pivot
stable dune
#
material = -1   \ 
broken pivot
stable dune
#

You're welcome

broken pivot
stable dune
#

Do you mean after the fix? The error doesn't always redirect to the correct line in the config.

broken pivot
#

Yeah after the fix
Ive learned that painfully haha. Im using the macro in line 200 so I gues its the ongoing process that resulted from line 200 cause the error.

I removed my semikolon at the end of my #define and havent placed it down so far again. Im comparing with the sample file but havent found an diffrence so far

broken pivot
tulip ridge
#

It's not an arma limitation, it's something mikero's enforces

stable dune
#

well you dont have ; after this ->

tulip ridge
#

Yes because that's what the error was, how it is now is the "correct' way to do macros

granite sky
#

Slightly curious whether armor = arm works as intended there.

broken pivot
#

So I have to place the semikolon after usage of the macro if Ive understand everything well.
But where is that?

broken pivot
granite sky
#

If you're asking about glass hitpoints specifically then I guess find where & how the vanilla code uses NORMAL_GLASS_HITPOINT

broken pivot
broken pivot
granite sky
#

What's the issue at the moment?

broken pivot
#

Ou yeah your right. Im working on both and oversee when crossing this boarder

tulip ridge
broken pivot
#

Ouuuuu OF CORSE!!!! YOU EVEN EXPLAINED THAT BI DID IT DIFFRENT... I was so blind hahahaha. Dont take a look about what Ive did with your intel hahahaha

#

He still is missing a semikolon. Ive removed it in the macro file and added it in the place after Ive used my macro
But in both ways Ive tried it Im receiving errors
|| Ill go buy some stuff before store closes Ill read and anwser EVERYTHING on my return. Thanks previously ||

granite sky
#

The first one is closer but shouldn't have the class in front of the line.

#

You already have class in the macro so it's coming out as class class

#

compare with BI's version.

blissful current
#

This code works in SP but not MP. Is there anything that stands out to you all before I start dissecting it? The helicopter is on the ground with the engine on. After that this code is executed in a holdAction.

[] spawn {
  ExtractHeli landAt [ExtractHelipad, "None"]; // lets the heli take off
  ExtractHeli flyInHeight 80; // goes to height then moves to base. Doesnt look smooth.
  _group = ExtractHeliGroup;  
  _markerName = "returnToBase";   
  _waypointPosition = getMarkerPos _markerName;  
  _wp1 = _group addWaypoint [_waypointPosition, 0]; 
  _wp1 setWaypointType "MOVE";  
  _group setCurrentWaypoint _wp1; // forces heli to move
  sleep 60; // lets heli take off before giving another landing
  ExtractHeli landAt [baseHelipad, "Land"]; // if there was no sleep the engine will turn off and heli wont take off.
        };
#

I'll try and remoteExec the landat first even though the wiki says it's a global effect.

split ruin
#

Is there a way to forbid player changing the loadout? I want to make dedicated pilot to remain pilot only.

granite sky
#

@blissful current What does "MP" mean here?

#

If it's solo localhost then that's a big difference from DS+client.

blissful current
#

This code, as far as I can tell, only works in SP and MP if the action is performed by the local host (correct term? I mean the player that all the other players connect to.). The code will not work on a dedicated server when executed from a client.

#

The way I found this out was when using two arma games open at once. The code did not work from the client so I alt+tabbed back to the main game and opened the ADT mod, put the code block in there and pressed the green play button. And it worked then.

granite sky
#

landAt says it's local argument. So it should be executed where the heli & pilot group are local (should be the same place).

#

For this sort of code I would strongly recommend running the whole routine locally to the group. Waypoint commands are supposed to be global but they're also a buggy heap of shit.

#

"global effect" here just means that the helicopter is going to land globally. Which is pretty obvious :P

blissful current
#

What is strange is that I have a similar hold action with landAt that does work on dedicated server. The only major difference is that the one that works is attached to player and the one that doesn't is attached to the heli.

blissful current
granite sky
#

You turn it into a function and remoteExec that instead.

blissful current
#

Oh nice, I know how to do that. Why does that make this work again? I don't grasp that.

granite sky
#

I'm not sure what you're not grasping.

granite sky
#

"local argument" means that the command should be executed where the argument (in this case the helicopter) is local.

blissful current
#

The helicopter is owned by the server because an AI is flying it right? So that means the code must be executed on the server?

granite sky
#

No :P

#

AIs can have any locality. Depends how you create them and what you do with then. Same with vehicles.

#

If the heli and the group are mission objects and you haven't messed with them since then they'll be server-local.

blissful current
#

Yeah pretty much. I just plop them down and then a hold action tells it to fly to a LZ. then another holdAction tells it to land. And then another holdaction tells it to fly off (this is the one that doesnt work on dedicated server.)

#

But the fact that the first two actions work but the third hits a locality issue is whats throwing me now.

#

Why is that?

granite sky
#

It's not necessarily a locality issue.

blissful current
#

Then why should I remoteExec the code again?

granite sky
#

well, or not an absolute one. Sometimes it's timing.

#

You should remoteExec the code because the wiki says that it's local argument :P

#

That does not mean that it actually is local argument.

blissful current
#

I'm so confused, lol. It is or it isn't, why is there an in between?

winter rose
#

he dares say the wiki might be wrong sometimes

#

heresy!

hallow mortar
#

if you remoteExec it and now it works, then it was a locality issue and the wiki is correct.
If you remoteExec the code and it still doesn't work, then there may be another problem.
But my money would be on the wiki being correct and it's a locality issue.

granite sky
#

Arma itself has grey areas. For example setMass does have short term effect even with a non-local argument.

blissful current
#

Ok I just swapped it over to a function. Time to test.

granite sky
#

And yes, sometimes wiki is wrong :P

blissful current
#

Oh wait there is a lot of commands in that block. So what is faster just remoteExec the whole block, though I wonder if that will break some of the commands or slowly just remoteExec one command at a time until it works?

granite sky
#

I said make a function out of your entire paste and the remoteExec that.

blissful current
#

Okay that's what I've done. Ill try now.

sturdy prairie
#

Messing around with moveInTurret, moveOut and lockTurret and I'm running into two issues with my script. Basically, I have two commander seats, because I want the commander to have a camera they can use while turned in, then a pintle MG while turned out, both independently. My script first unlocks the other seat, moves the commander to it, then locks his original seat, and vice versa. Now, I have to bugs that pop up.

  1. After running the script once, the driver can no longer use their vanilla turnout feature. Does having any locked seat stop all seats from turning out or is there something else?

  2. In singleplayer my script works fine, but on multiplayer with latency, I often have the problem that it kicks the player out of the vehicle, and ends up locking both seats so the commander cannot get back in. Any ideas how to solve this?

#

My script for reference

params ["_vehicle", "_caller"];

if (_caller == (_vehicle turretUnit [0, 0])) then { // Commander going from CITV to MG
    _vehicle lockTurret [[0, 1], false];
    moveOut _caller;
    _caller moveInTurret [_vehicle, [0, 1]];
    _vehicle lockTurret [[0, 0], true];
    _vehicle animateSource ["commander_hatch", 1];
} else { // Commander going from MG to CITV
    _vehicle animateSource ["commander_hatch", 0];
    _vehicle lockTurret [[0, 0], false];
    moveOut _caller;
    _caller moveInTurret [_vehicle, [0, 0]];
    _vehicle lockTurret [[0, 1], true];
};
blissful current
finite bone
#

if I have an array say _testarray with 11 elements inside it, can I call it later down a loop as
_x params ["_elemen1", "_element2" ...]?

crimson lion
#

on profiling, Malden 2035. Lemme try this on another vanilla map just in case

finite bone
# finite bone if I have an array say ``_testarray`` with 11 elements inside it, can I call it ...

_allGpsTrackers pushBack [_deviceId, _netId, _trackerName, _trackingTime, _updateFrequency, _customMarker, _linkedComputers, _availableToFutureLaptops, ["Untracked", 0, ""], _allowRetracking, _lastPingTimer, _powerCost, _trackerUID];

and later down the code, Ill be using a forEach _allGpsTrackers - How do I assign these values to another variable (using params) instead of _x select 0 through 12 for the above array?

granite sky
#

_x params ["_deviceId", "_netId", ...]; is correct.

finite bone
granite sky
#

You'd need a second params line for that one.

finite bone
#

Assing it to a variable and run another params to it?

granite sky
#

yes

finite bone
#

ah great thanks

finite bone
#

Another question: What is the best way to find out a specific object (lets say has a variable assigned to it as "PEPE_tracker") in the inventories of allUnits, vehicles, and even ground?

Like I have an object that has been assigned a variable with _object setVariable ["PEPE_tracker", "TRACKER_ACTIVE", true]; - I want to essentially get the position of the object regardless of where it is (in the inventory of a player / ai unit / vehicle / in the ground)

granite sky
#

Most inventory items aren't objects anyway.

#

What is it exactly?

finite bone
#

Like I have ACE_Banana that can be picked up by players from the ground and this "banana" then produces a marker on the map wherever it is.

Usually you can just place the banna from the empty tab of 3DEN Editor / Zeus and assign variables / values to it.

granite sky
#

I think the way that works is that it creates a ground weapon holder to put the item in.

#

So you'd be setting the variable on the weapon holder object, and as soon as the banana is moved it'll no longer be relevant.

finite bone
#

So whats the best way to pursue this?

granite sky
#

You want to follow a banana around, specifically?

finite bone
#

Yea - not all bananas, just a select specific one

granite sky
#

Is this a mod or a mission?

finite bone
#

A mod, but does it make a difference?

granite sky
#

Because the "normal" way is to create a different banana item, but that's only possible in a mod.

#

Hence ACE adds like 10000 different dogtag items.

#

TFAR adds 1000 of each radio and so on.

finite bone
#

Well, what I'm essentially trying to do is add a 'gps tracker' to an object that can be picked up and moved to different inventories will still broadcasting its position in the map.

granite sky
#

Even with a unique item there's no easy way, but at least you can grind through inventories and find the thing if you really need to.

#

If you actually wanted to track the thing then there's an awful lot of event handlers involved, and I'm not sure that covers everything.

finite bone
#

My initial idea was to give it a variable and then go through allUnits, vehicles and ``allMissionObjects` to check if any of the objects within the inventories have the variable that was tagged earlier and broadcast its host position - Don't know if this is feasible in sense.

granite sky
#

No, because items aren't objects.

finite bone
#

Yea figures based on the info you gave earlier - what do you recommend I read through then

granite sky
#

So you could try to track the movement of the item with the Take event handler.

#

I'm not 100% sure whether that's possible though.

#

unique item is a pre-requisite anyway.

#

So you should clone the banana class.

finite bone
#

While I understand the logic behind unique item, can't we just use the Take EH and process the stuff there on existing class? Like, when the item is taken compare its variables with that of the tag earlier and if so broadcast the position of the _unit?

granite sky
#

As long as you know there are absolutely no other bananas in circulation.

#

There is no way to distinguish between two items with the same classname in the same container.

finite bone
#

Ah

errant iron
#

i imagine that'd give you greater control over how that tracker is transferred around, but it wouldn't exist as an in-engine item anymore

finite bone
blissful current
#

I have this code:

player addEventHandler ["FiredMan" ...

It breaks under a specific circumstance. In SP when you press U to switch to another unit. In that situation the EH is not monitoring the unit you switched to. I guess player doesn't get swapped on the fly to the unit the player is controlling.

What would be a solution to this? Maybe units playerGroup addEventHandler though I'm not sure if that syntax works.

tulip ridge
#

Easiest way would probably be a class event handler if you're using CBA

blissful current
#

What is a class event handler?

tulip ridge
blissful current
#

So it adds the EH to all units in the group, even AI, so when your press U it will have it?

tulip ridge
#

But if it only matters for units in the player's group (and no unit leaves/joins it) you could just add the eh to all of them specifically

blissful current
#

Oh interesting, you know how when you are testing your misssion in the editor you can press U and switch to another unit?

#

I assumed this works in SP too but now I'm wondering if it's just editor behavior.

tulip ridge
#

Oh that, you said it like it was something with the event handler itself

blissful current
#

Yeah just tested it. It is indeed normal function in SP as well.

blissful current
tulip ridge
blissful current
#

Oh interesting. Maybe that's what I should use for the other issue too.

tulip ridge
still forum
# finite bone While I understand the logic behind unique item, can't we just use the ``Take`` ...

The flaw here is "compare its variables"
Items have no variables. There are no variables to compare.

I have done GPS trackers as item. But I didn't have any data to store on them.
I made the tracker item a ACE-Attachable item, like a explosive or chemlight.
You can walk to vehicle and attach it on, and you can detach it again. You can attach it to your own body, and detach it again.
This makes it easy because attach/detach is just two eventhandlers, that I also know will work reliably.

But while its detached and in inventory, it doesn't do any GPS tracking. And every time its attached its essentially a new tracker created, it has no history of its past like having an own name or deviceID.

finite bone
#

I figured as much, so there is no definitive way in the current implementation we can pull this off unless as John suggested earlier, create unique class names purpose built for this functionality and use it to broadcast network. What I initially assumed is the EH able to distinguish between different items of the same classname in the container.

tough abyss
#

i have this on a object attaching to another object but when i start the scenario it spawns it a diffrent rotation how do i rotate it so it spawns the right way when its spawned {usa_flag attachTo [usa_hunter, [1.6, -2, 0]]; usa_flag setVectorDirAndUp [vectorDir usa_hunter, vectorUp usa_hunter]; this setObjectScale 0.4;}

hallow mortar
#

This applies to vectors too, but it's easier to understand with bearings: you're getting the parent object's true compass direction (e.g. heading 250) and then using it in a context where "north" is the direction the parent object is facing. So the parent is facing world 250 -> world 250 is relative 0 -> orient the attached object to relative 250 -> the attached object is facing world 140

pallid palm
#

umm did he just post that in arma3_editer

tough abyss
pallid palm
#

copy that

#

i repyed to you did you see it ?

tough abyss
pallid palm
#

roger

#

i think Nikko and me was saying the same thing: but of course he's way better then me: and i mean way way better ๐Ÿ™‚ he showed me alot about Arma 3 scripting he's Awsome

#

i like it when he gives me hell: for messing up scripts and stuff: cuz he makes me understand what i'm trying to do: which is really cool of him

blissful current
#

Oh thanks Scotty, I have my helicopter working now but send me a link and I'll add it to my "To play" list.

pallid palm
#

i would like to PM it to you m8

blissful current
#

You may do that, thanks.

pallid palm
#

how do i do that if we are not friends

blissful current
#

Click my name on discord, it will open a box, place the message in the field at the bottom.

pallid palm
#

oh i see cool

#

ok im pbo-ing it now ok m8

#

@blissful current thx you for giving me the opportunity to show case my INSEX Chopper Command Demo mission

#

there may be many things you can learn from that mission ok m8

#

full briefing is in there and also added some tasks to help you learn how to use the chopper

#

i just love it: and i have a feeling you will also

#

btw INS= Insertion and EX= Extration ๐Ÿ™‚

#

i can't w8 till you play it and tell if you liked it ๐Ÿ™‚

#

i played the mission like 50 times in a row lol ๐Ÿ™‚

#

oh btw the Chopper Command includes all water Insertion and water Extration also ๐Ÿ™‚ just make sure you have Diver gear on lol ๐Ÿ™‚ if you go to water

blissful current
#

No worries. I'll let you know when I get around to it.

pallid palm
#

ok cool m8 thx so much: oh hay @blissful current you may want to disable all mods to play the mission at 1st cuz if you have CBA's on you may have to alter the EH's in the scripts im not sure about that

blissful current
#

Is it okay to use the deleteVehicle command on an object that has already been removed by that method?

pallid palm
#

yeah it just wont do anything

#

if it gone its gone the deleteVehicle command just wont do anything after that

#

iirc

winter rose
pallid palm
#

i knew it WooHoo

#

thx Lou

blissful current
winter rose
#

if you just "don't know and try", straight use deleteVehicle

blissful current
#

Okay, thanks!

stable dune
#

Hello,
Is there a way to detect when a scripted eventhandler is used?

winter rose
pallid palm
#

isn't that the only way to use a EH is by script ?

#

๐Ÿ™‚

winter rose
pallid palm
#

oh i see

#

then i think there must be away to detect if a scripted eventhandler is used

granite sky
#

Just read one of those functions and find out. There will be a storage variable in there somewhere.

#

General rule when talking about BIS_fnc stuff. Some of them are a hard read though.

pallid palm
#

thats a roger

stable dune
#

Trying figure out vn (SOG) events, that is called and you can define "own" setups for those, but didnt find any wiki/ examples how to use those.

#

And i do not know how to debug/ follow/ see, is those defined, called, used.

winter rose
#

no luck with search

stable dune
stable dune
# winter rose he means Scripted Event Handlers, as opposed to (Engine) Event Handlers https://...

Mm,
Local ? Right, if I add

[true, "vn_photoCamera_pictureTaken", {
    params ["_cursorTarget"];
    private _target = cursorTarget;
    if(player distance _target < 50 && _target == target1) then {
        if(!(getText (configOf cursorObject >> "displayName") isEqualTo "")) then { hint format ["Photographed Object: %1", getText (configOf cursorObject >> "displayName")];};
        TAG_your_task_condition = true;
        publicVariable "TAG_your_task_condition";
    };
}] call BIS_fnc_addScriptedEventHandler;

So I need to define where the event is called,
Like in initLocalPlayer.sqf

pallid palm
#

man i wish i could help you @stable dune

#

cuz you helped me so many times

#

oh i see what your trying to do there hmmm

#

well kinda anyway ๐Ÿ™‚

stable dune
#

Well, I get my task completed when I take a picture from the correct "target",
But I don't know where I need to define eventhandler.

#

I have a trigger with the condition "TAG_your_task_condition",
Which is synced with the task completed,
It gets completed, but just for knowing, I want to know, do I need to publish a variable global or not.

pallid palm
#

wouldnt you define the eventhandler by missionNameSpace, or em i being nutty ?

stable dune
#

Boolean will default to missionNamespace

pallid palm
#

oh ok

hushed turtle
#

Never worked with trigger and task sync, but provided trigger is not server only then task framework should complete task inluding other players over network

cursive pebble
#

i tried adding more loot variety (mod) and seeing how to reduce the spawn rate, but i managed to get only dlc weapons to spawn and what did appear couldnt be picked up. can anyone help me?

blissful current
#

If I used the command deleteVehicle on an object that was hidden with the hide module, will it still delete it?

blissful current
stable dune
#

Hidemodule hides the object and disabled simulation of objects,
So yes.

pallid palm
#

lol i just made a Depth Charge Ship it drops Depth Charges to any Depth on a submerged sub ๐Ÿ™‚ 4 of them to be correct ๐Ÿ™‚ just make sure you don't back up the boat when you drop the charges lol

blissful current
#

I have some tasks that are created at the same time. So as to not overload the player at once, the triggers that create them are separated by 3 seconds. In testing, sometimes it works flawlessly and other times the messages overlap on the UI.

I assume this happens because there are other processes running at the same time so they get queued up differently. Is there a way to make this more consistent?

pallid palm
#

you need to put a delay trigger in betwene them look at my Chopper comand mission for examples

errant iron
pallid palm
#

i have a 10 sec delay trigger at each task

blissful current
pallid palm
hallow mortar
errant iron
# blissful current Exactly so.

essentially the reason that happens is because periods with different lengths will eventually overlap with each other: py Time Interval 3 6 9 12 15 18 3 | | | | | | 6 | | | 9 | | if the game time is at 18s, all triggers would (in theory) evaluate their conditions at the same time, causing them to run their bodies simultaneously if they happen to be true - ignoring slight offsets that happen over time as per nikko's explanation

pallid palm
#

in that video he shows how to have a delay trigger at each task

#

its very simple

#

@blissful current or you can open up my mission and see how i did this very thing

hallow mortar
blissful current
#

I don't get the overlap though.

pallid palm
#

yeah the tasks do pile up on eachother if you dont have a dely trigger on them

hallow mortar
pallid palm
#

like it will show next task and then show task completed if you dont have a dely trigger on them

blissful current
#

I was worried that 5 might be too long for some attention spans, haha.

pallid palm
#

i did read that sir but iv found it to work bady even tho you have delys in the task them selfs, iv found delay triggers work way better

blissful current
#

And perhaps this is way too much attention to detail anyway. I find that most players don't care for little things like this that I do.

hallow mortar
pallid palm
#

true that

pallid palm
#

and you are right @blissful current most people dont care about tasks iv found

#

but some like tasks

thin fox
#

@blissful current
From a scenario of mine

sleep 7;

task00_completed = true;

sleep 5;

task01_create = true;

blissful current
pallid palm
#

but you only have 3 tasks it should be ok

hallow mortar
blissful current
thin fox
#

or just make variables and use triggers to check it, like in my example above

pallid palm
#

@blissful current so you are using delay triggers cool just make them like 6 or 7 or 10 sec like this 10 10 10

blissful current
errant iron
# blissful current I don't get the overlap though.

Hmm, let's say I tell you to clap your hands every 3 seconds, I'll clap every 6 seconds, and we start our stopwatches at the same time. When your stopwatch says 0:03, you clap hands once, and when it says 0:06, you clap your hands again. But because my stopwatch also says 0:06, I clap as well, so we both end up clapping our hands at the same time.

It's the same phenomenon here, all your triggers start counting their intervals at game start, so they naturally overlap with each other at multiples of 6 or 9.

(this explanation is just to understand the theory of why it happens with trigger intervals)

thin fox
pallid palm
#

ever since i started using delay triggers at 10 10 10 sec dely everything worked perfectly

blissful current
errant iron
#

ah i see, in that case it's not periodic like i described, but simply the order in which the triggers are satisfied

blissful current
pallid palm
#

10 sec is way short m8

blissful current
#

Thanks everyone, I now have multiple avenues to tackle this.

thin fox
pallid palm
#

again if you open up my mission i gave you you will see all of this done

blissful current
hallow mortar
pallid palm
#

copy that m8

thin fox
#

or you can make your own notification: 3 tasks available and the short description below ๐Ÿ˜„

pallid palm
#

i like 10 sec cuz theres just a little pase like befor next task

blissful current
pallid palm
#

roger that

#

i reason i like the 10 sec delay is cuz its like the task is kinda like coming from HQ ๐Ÿ™‚

pallid palm
#

lol

blissful current
#

I'm kinda on the fence about task notifications anyways. I'm not sure how I feel about them. Half of me says just create all tasks at mission start and be done with it. That way no bothersome pop ups. But I'm afraid that might be info overload for players.

thin fox
pallid palm
#

yeah i get that: i realy dont use any task in any of my missions i just put them in that mission i gave you for any one to get help on how to play the mission

#

i really just use map links and markers

hallow mortar
# blissful current I'm kinda on the fence about task notifications anyways. I'm not sure how I feel...

Well, it depends on the task.
If they have to be done in a certain order, then you should probably gate them appropriately. If they rely on information that isn't revealed until later, also.
If you want players to see them all and make their own choice about what to do, then showing them at the start is fine; if it's right at the start without triggers then they'll also appear in the briefing phase if you have one, which can be useful for player planning.

pallid palm
#

and in most of my missions you can attack any obj in any order you want

#

but like Nikko said it may depend on intel and stuff

blissful current
pallid palm
#

yeah thats true

thin fox
errant iron
pallid palm
#

its good that it still there tho for people that want to know

blissful current
hallow mortar
blissful current
#

vet like military veteran or veteran discord or?

#

I've always wondered what that tag meant.

pallid palm
#

discord vet

#

and Arma vet

blissful current
#

Cool either way! What are the requirements?

hallow mortar
blissful current
#

Haha well it's well deserved anyways.

pallid palm
#

valan said you can become a vet in like 3 years if

hallow mortar
#

I didn't do anything specific to get it, it just happened, so ๐Ÿคท

pallid palm
#

its if you go out of your way to help all the people for Arma and all that kinda stuff ๐Ÿ™‚

#

valan said i'm doing ok with that and i should keep up the good work

#

so i em

#

i just like helping people if i can thats all

#

well @hallow mortar i think your a Awsome person: and i like you: so good going m8

pallid palm
#

you helped me like 10,000 times thx so much NikkoJT

fair drum
pallid palm
#

hay i play the blues on guitar does tha count ๐Ÿ™‚

hallow mortar
pallid palm
#

green is my fav collor

#

green is the same as the 2ed note in music or the dorian mode ๐Ÿ™‚

#

quick fun fact: the collors of the notes of the muical scale is the same collors of the rainbow: but not the same order

fair drum
finite bone
ornate warren
#

is there a code that I could use so that when I use a hold action on the table, the holo on the table disappears? Ive never done much scripting so I have almost no knowledge of the formatting or what all the codes do

fair drum
#

depends if that table has some sort of hidable texture or something to that nature

cursive pebble
#

how could i make mod weapons appear instead of dlc weapons and make them appear in smaller quantities?

fair drum
#

if you want modded weapons only, you'll have to add an additional filter after grabbing all the weapons to filter out ones that don't have that mod's tag in the classname. Like filtering for "CUP_"

cursive pebble
#

type "CUP_AK-109","CUP_HK-471", etc...?

fair drum
#
private _filteredForCUPClasses = _weaponClassArray select { _x regexMatch "/^CUP/i" };

or whatever string comparison you want to do.

you can also do this at the config level when you are grabbing them in the first place

cursive pebble
finite bone
#
if (!hasInterface) exitWith {};


[{!isNull player}, {
    private _action = [
        "ROOT_AttachGPSTracker_Object",
        "Attach GPS Tracker",
        "",
        {
            params ["_target", "_player", "_params"];  
            if (isNull _target || {_target == _player}) exitWith {
                ["Cannot attach GPS Tracker!", 2] call ace_common_fnc_displayTextStructured;
            };        
            [
                5,
                [_target, _player], 
                {
                    params ["_args"];
                    _args params ["_target", "_player"];
                    [_target, _player] call ROOT_fnc_aceAttachGPSTrackerObject;
                },
                {},
                format ["Attaching GPS Tracker to %1 --", getText (configOf _target >> "displayName")],
                {
                    params ["_args"];
                    _args params ["_target", "_player"];
                    !isNull _target && {alive _player}
                },
                ["isNotInside"]
            ] call ace_common_fnc_progressBar;
        },
        {true}
    ] call ace_interact_menu_fnc_createAction;
    ["All", 0, ["ACE_MainActions"], _action, true] call ace_interact_menu_fnc_addActionToClass;
}, []] call CBA_fnc_waitUntilAndExecute;

Why is that even with postInt = 1 this is not properly executed? I had to re-execute it in game via debug console to get the ACE Interaction Menu

hallow mortar
#

Did you set it to postInt = 1 or postInit = 1?

finite bone
#

postInit = 1;

fair drum
#

try it with the cba preInit.sqf or postInit.sqf

tulip ridge
#

Also need ace_interact_menu in your requiredAddons, otherwise the function isn't guarenteed to be defined by the time your script executes

finite bone
#

Works when I use XEH_postInit.sqf

#

I'll add in the ace_interact_menu too just in case thanks ๐Ÿ‘๐Ÿป

#

Off topic to the above, is there a way to attach a sound to a moving object so it keeps broadcasting at its current location?

mellow wasp
#

What's the command to despawn a whole group of units and any vehicles they're in? I have a bunch of APCs I'm using for a set piece as you fly by, and once the helicopter lands on a trigger, I want to despawn them. Using deleteGroup doesn't work at all, and using deleteunit only deleted the squad leader, not the whole group or the vehicle

finite bone
#
{
  deleteVehicle _x;
} forEach crew _vehicle;```?
hallow mortar
#

You can use forEach, but deleteVehicle now accepts arrays directly

#

e.g. deleteVehicle (crew _vehicle pushback _vehicle);

hallow mortar
tulip ridge
#

Or even attach a return from say3D if you don't want / need a looping sound

finite bone
#

I looked at playSound3D but its position is constant - Is say3D as effective/loud as ps3D?

mellow wasp
tulip ridge
hallow mortar
tulip ridge
hallow mortar
#

The important thing is that you give deleteVehicle an array of objects to delete. How you build that array depends mostly on what reference point you're starting from, and what you want to delete.

finite bone
tulip ridge
#

The objects will still be different on each machine

hallow mortar
#

One thing to watch out for with say3D is that any object can only be say3Ding one sound at a time. If you start a new one before the previous sound is done, it'll be queued to play once it's finished. So if you could have overlapping sounds, you might want to create a proxy object for each one.

mellow wasp
finite bone
#

Or do you think this approach is terrible ๐Ÿ˜…

hallow mortar
mellow wasp
#

Because I'm getting a pop-up saying On Activation: deletevehicle: Type Number, expected Array,Object when I gave it deleteVehicle (units bobcat1 pushback vehicle leader bobcat1);

tulip ridge
hallow mortar
tulip ridge
#

Like Niko said, I also used a dummy object to play the sound from so that it didn't conflict with anything else that play a sound from the player

finite bone
#

Invisible helipad attached to the source which is then being used as a source itself?

hallow mortar
# hallow mortar You've done nothing wrong, I'm stupid

pushback doesn't return the resulting array, it returns the index at which the new entry was added to the array.
Try (units bobcat1 + [vehicle leader bobcat1]) - get the list of units in the group, create a new array containing the leader's vehicle, merge the arrays and return the result

tulip ridge
hallow mortar
#

If you did want to use pushback (handy tool to familiarise yourself with but not essential for this), it could look like this:

private _units = units bobcat1;
_units pushback vehicle leader bobcat1;
deleteVehicle _units;```
This is because `pushback` modifies the original array and does not return a reference to it, so you have to have already stored a reference to the array so you can then use it.
hallow mortar
raw vapor
#

I want to know how to do a couple of checks in a clump of script I'm working on.

How can I check if certain inventory slot are occupied? Like, "Does this guy have a hat? Does he have a vest? Does he have a backpack?" I don't care what classname, I just need to know if he's wearing anything in that slot.

if (hat) {do thing}
if (backpack) {do thing}
etc

#

For context, this script will skip certain inventory randomization if that part of their outfit was already assigned to the unit before the script fires.

tulip ridge
raw vapor
#

So that checks if the slot is blank?

tulip ridge
#

Yeah e.g. headgear _unit == "" will be true if the unit does not have a helmet equipped

raw vapor
#

Not quite where I expected to find it but, this list is accurate?

#

Minus the numbers.

tulip ridge
#

Seems to be

raw vapor
#

๐Ÿ‘

#

Okay, so it really is just as simple as going "is headgear blank? Yes." No funny getBlahBlahBlahHeadgear commands.

tulip ridge
#

Well headgear is just a command that returns a unit's worn helmet

raw vapor
#

What I mean to say is somehow I was expecting something more complicated. smilethonk But I also don't know what I should have been expecting.

#

Thank you for the help.

ionic merlin
#

unsure if this is the right spot to ask this, but is there a easier way of creating a ace arsenal? I've been trying to create my units arsenal and going through all the items and slowly picking what we would have is a pain ๐Ÿซ  (more so a pain now that we are using Grom Restricted Arsenals to make it so that only certain roles can access certain arsenals)

raw vapor
#

I do not know it off the top of my head but I know you can run a debug command to get the inventory of every unit in your group and dump it all into a big fat array that can then get exported into an ACE Arsenal.

That's how I started.

#

Found it!

AllPlayableUnitsItens = [];
{AllPlayableUnitsItens = AllPlayableUnitsItens + [(headgear _x)] + [(goggles _x)] + (assignedItems _x) + (backpackitems _x)+ [(backpack _x)] + (uniformItems _x) + [(uniform _x)] + (vestItems _x) + [(vest _x)] + (magazines _x) + (weapons _x) + (primaryWeaponItems _x)+ (primaryWeaponMagazine _x) + (handgunMagazine _x) + (handgunItems _x) + (secondaryWeaponItems _x) + (secondaryWeaponMagazine _x)} forEach (playableUnits + switchableUnits);
AllPlayableUnitsItens = AllPlayableUnitsItens select {count _x > 0};
AllPlayableUnitsItens = AllPlayableUnitsItens arrayIntersect AllPlayableUnitsItens;
copyToClipboard str AllPlayableUnitsItens;```
#

Itens
Don't worry about it smilethonk

raw vapor
# ionic merlin unsure if this is the right spot to ask this, but is there a easier way of creat...

What I suggest you do:

  • Create your squad of guys like you would have them at mission start, but don't make them playable except the leader.
  • Make sure they have at least one of every single item you want players to be able to access in the arsenal later.
  • Put them all in a group with yourself as the group leader if you haven't already.
  • Run this debug command
  • Export the paste output to an arsenal.
#

Now if you're trying to do something like I'm doing where you have a horrible disorganized gagglefuck of mercenaries with wildly varying levels of competency, the best way to give them a diverse amount of equipment is the hard way. eminent_pain

light musk
#

is this syntac right for checking if 1 or another trigger have been activated?
triggerActivated task7a_completed || triggerActivated task7b_completed;

ionic merlin
# raw vapor Now if you're trying to do something like I'm doing where you have a horrible di...

many thanks! and based on what you said, I somewhat have a similar thing going on- the goal is create a arsenal for our main 3/4 roles and use Groms Restricted Arsenals to make it so that Junior Operators can only grab the basic shit, while Senior Operators can grab the basic/mid/advanced gear, then Elite Operators and Team Leads can grab the fancy shit + the same shit the JOs and SOs can grab. Fun times XD

pallid palm
#

@light musk altho i use dely triggers on my tasks: and i just use triggerActivated name of prev trigger;

pallid palm
#

oh yeah ForeWard Or -BackWard -Left Or Right Up Or -Down [ 3, -4, 1.5 ] ๐Ÿ™‚

tough abyss
#

anyone know the code to set a soilder insignia to a texture in the init feild i did it before but forgot the code

pallid palm
#

yeah i forget that as well hmmm

winter rose
pallid palm
#

@winter rose hi Lou: is that the same as changing the patch on the shoulder ?

#

no i guess not

pallid palm
#

it looks diff tho

tough abyss
#

im pretty sure u can change it to a texture

pallid palm
#

yeah but it looks like the insignia is at a lower spot the the shoulder patch

tough abyss
#

i know but i mean that you can replace the insignia as a texture

pallid palm
#

or is it all the same thing

#

oh i see ok

#

can we change the shoulder patch or is that stuck on thier in the uniform

tough abyss
#

i think its stuck thats why i wanna use the insignia as a replacment so i can put a flag on it

pallid palm
#

roger that

tough abyss
#

im pretty sure last time i done it i used the insignia not 100% sure tho

pallid palm
#

copy that

#

i wish we could change the shoulder patch

#

without making a hole new uniform

#

i guess thats what mods are for

tough abyss
#

ye

#

i play on vanilla zeus so mods arent a opiton for me ๐Ÿ™

pallid palm
#

same here i use no mods

tough abyss
#

i got it

pallid palm
#

oh w8 i see some other stuff down at the bottom

tough abyss
#

this setObjectTextureGlobal [1, "\A3\Data_F\Flags\flag_NATO_CO.paa"];

pallid palm
#

i see some left shoulder and roght shoulder stuff woohoo

tough abyss
#

ye

#

looks like this in game

winter rose
#

but please, do not use setObjectTextureGlobal in init field, only setObjectTexture

pallid palm
#

yeah i want to change the shoulder patch: but its way out of my skill level

pallid palm
#

like i would like to use the "U_I_CombatUniform_shortsleeve" and put a USA flag on the shoulder patch

tough abyss
#

i think you can make a custom texture and apply it as i did

pallid palm
#

yeah see thats on the sleve i want it on the shoulder patch

#

i guess i don't really need to do it i was just wanting to

tough abyss
#

i think there embeded into the uniform textures

pallid palm
#

im not so sure about that

#

in the link Lou gave at the bottom i see some cool stuff

grim yoke
#

My functions defined in CfgFunctions are detected by the game (they appear in BIS_fnc_functionMeta and BIS_fnc_exportFunctionsToWiki), but the actual function variables (CHX31TAB_fnc_*) never exist at runtime.
isNil "CHX31TAB_fnc_postInit" always returns true even though the config data looks perfectly fine.

Addon Structure

@CHX31_AC_Tablet
โ””โ”€โ”€ addons
    โ””โ”€โ”€ chx31_ac_tablet.pbo
        โ”œโ”€โ”€ config.cpp
        โ”œโ”€โ”€ $PBOPREFIX$      โ†’ chx31_ac_tablet
        โ”œโ”€โ”€ functions
        โ”‚   โ”œโ”€โ”€ fn_postInit.sqf
        โ”‚   โ”œโ”€โ”€ fn_hasTablet.sqf
        โ”‚   โ”œโ”€โ”€ fn_openOverview.sqf
        โ”‚   โ””โ”€โ”€ ...
        โ””โ”€โ”€ ui
            โ””โ”€โ”€ RscOverview.hpp

config.cpp (relevant part)

class CfgPatches {
  class chx31_ac_tablet {
    name = "AC Tablet Mod";
    author = "Dennis | CHX31";
    requiredVersion = 2.10;
    requiredAddons[] = {"A3_Data_F", "A3_Functions_F", "cba_main"};
    units[] = {};
    weapons[] = {"chx31_tablet_item"};
  };
};

class CfgFunctions {
  class CHX31TAB {
    tag = "CHX31TAB";
    class Core {
      file = "functions";                 // also tried "\chx31_ac_tablet\functions" (even with /)
      class postInit { postInit = 1; };
      class registerInArmory {};
      class hasTablet {};
      class collectThreeLists {};
      class openOverview {};
    };
  };
};

Debug results

  • isClass (configFile >> "CfgFunctions" >> "CHX31TAB" >> "Core") โ†’ true
  • getText (configFile >> "CfgFunctions" >> "CHX31TAB" >> "Core" >> "file") โ†’ "functions"
  • getNumber (configFile >> "CfgFunctions" >> "CHX31TAB" >> "Core" >> "postInit" >> "postInit") โ†’ 1
  • fileExists "\chx31_ac_tablet\functions\fn_postInit.sqf" โ†’ true
  • "CHX31TAB_fnc_postInit" call BIS_fnc_functionMeta โ†’
    ["functions\fn_postInit.sqf",".sqf",0,false,true,false,"CHX31TAB","Core","postInit"]
  • Still: isNil "CHX31TAB_fnc_postInit" โ†’ true
  • No related errors or warnings in the RPT log.

Has anyone any idea?

pallid palm
#

so like what happening what's go wrong as you see it ?

#

can you tell what the problum is or whats not working for you ?

grim yoke
#

Nothing happens, that's the problem.

postInit is not called, and when I try to call another function via [] call CHX31TAB_fnc_*, nothing happens (no function call, no error message in rpt).

But all debug attempts, as you can see above, look as if everything is where it should be and how it should look, except for the isNil query.

pallid palm
#

hmmm yeah i see

#

maybe you need to use spawn

#

if there is sleeps in the function you would need to use spawn:

fair drum
#

Have you looked in the function viewer in the editor (should use ADT)?

Just search postInit and it will tell you if you have a name issue. I personally don't use the tag flag. Could be a naming issue.

grim yoke
#

Oh, I just noticed something while testing.

It works in the editor, but not in the mission.
It's supposed to be a tab for AirControl (Reaction Forces DLC) where you can see the supply statistics for all cities at a glance.
When I load the mission (in SP), the functions don't work, but when I load it in the editor, everything works.

That just makes it even more confusing for me.

fair drum
#

And are these new functions, or are you trying to patch an existing mod with the same names?

pallid palm
#

SP and the editor is the same thing

#

kinda like i guess

grim yoke
#

Yes, I think so too,
but how can it be that the functions are compiled and the postinit is executed when I load it in the editor, but not when I load the AirControl mission?

fair drum
#

What's in the post init file?

grim yoke
#

just keybind definition via CBA

#
#include "\a3\ui_f\hpp\definedikcodes.inc"
diag_log "[CHX31TAB] fn_postInit.sqf gestartet.";

// --- SERVER: Armory-Inject ---
if (isServer) then {
  [] spawn CHX31TAB_fnc_registerInArmory;
};

// --- CLIENT: CBA-Keybind registrieren ---
if (hasInterface) then {
  [] spawn {
    waitUntil { !isNull player && { alive player } };
    private _t0 = diag_tickTime;
    waitUntil { !isNil "CBA_fnc_addKeybind" || { diag_tickTime - _t0 > 15 } };

    if (isNil "CBA_fnc_addKeybind") exitWith {
      diag_log "[CHX31TAB] ERROR: CBA_fnc_addKeybind nicht vorhanden. Ist CBA_A3 geladen?";
      hintSilent "CHX31TAB: CBA nicht geladen โ€“ Hotkey nicht registriert.";
    };

    // F9 = 67
    ["CHX31 AC Tablet", "OPEN_OVERVIEW",
      "AC Lagebericht รถffnen",
      {
        if (isNil "CHX31TAB_fnc_hasTablet") exitWith {
          diag_log "[CHX31TAB] ERROR: CHX31TAB_fnc_hasTablet fehlt.";
        };
        if (!([player] call CHX31TAB_fnc_hasTablet)) exitWith {
          hint "Du benรถtigst das CHX31 AC-Tablet.";
        };
        if (isNil "CHX31TAB_fnc_openOverview") exitWith {
          diag_log "[CHX31TAB] ERROR: CHX31TAB_fnc_openOverview fehlt.";
        };
        [] call CHX31TAB_fnc_openOverview;
      },
      {},
      [67, [false,false,false]]
    ] call CBA_fnc_addKeybind;

    diag_log "[CHX31TAB] Keybind registriert (F9).";
    systemChat "[CHX31TAB] Keybind registriert (F9).";
  };
};
diag_log "[CHX31TAB] fn_postInit.sqf beendet.";
fair drum
#

I'm at work now so debugging on phone is a pain. Can you upload your whole mod to GitHub so we can see everything and look for an issue? I won't be able to really look at it for a while so maybe someone else can deep dive.

pallid palm
#

To fix the errors, you should remove all usage of CBA commands and replace the keybind registration with native Arma 3 event handling

fair drum
#

The cba keybind system is well tested and works fine.

pallid palm
#

well maybe try with no cba 1st

grim yoke
hallow mortar
#

Using vanilla keybind modding is better if you're making a mod (missions can't use it), but CBA keybinds do work and there should be a way to fix this without removing CBA.

pallid palm
#

copy that

grim yoke
# hallow mortar Using vanilla keybind modding is _better_ if you're making a mod (missions can't...

The advantage of CBA is that it allows you to customize the key bindings with the control settings.

In addition, the largest, most stable, and best-known mods also use CBA for their keybinds (TFAR, ACRE, ACE3).

The interesting thing is:
If the CBA mod is loaded but I am NOT using it in the mod (I removed the content of postInit), then it works.

Only if I leave the postInit as I showed you, then nothing works, i.e., not only does the postInit not work, but no function works at all.

grim yoke
#

are you in eden editor or in the air control mission?

pallid palm
#

no wounder i dont use mods ๐Ÿ™‚

hallow mortar
grim yoke
# stable dune

Okay, that makes it really confusing.
Why does it work for you but not for me?
I uploaded exactly what I loaded in ArmA, no differences, no changes.

stable dune
#

Which program do you use packing your mod?

grim yoke
pallid palm
#

oh shit

grim yoke
#

that is the one, which once was on armaholic, but since they are down the pbomanager is aviable on other sites (or even was before reuploaded)

stable dune
#

Well, you could test pack with some other better program.
hemtt, Mikero Tools, A3 Tools Addon Builder,

many options, every of those are better than pbomanager.
That might cause your issues.

pallid palm
#

as soon as i saw the Dayz tag i was like oh shit

pallid palm
#

holy hana

#

im just going to thx myself that i don't use mods ๐Ÿ™‚

grim yoke
#

i use it since about 3 years or 4 years
it is also not my first small mod, even not the first using cba elements
but it is the first that makse that problems

pallid palm
#

dont get me wrong i used to be a mod head but no more Woohoo ๐Ÿ™‚

#

and this is the 1st problum you had wow that's good

#

there must be a simple fix

#

i bet when you find out whats happening yull say oh shit ๐Ÿ™‚

grim yoke
stable dune
#

And you have correct options (include files *.sqf,*.paa etc).
And be sure that your prefix is defined correctly.
And have you tried only with your mod and CBA loaded?

fair drum
#

@grim yoke I suggest using hemtt

#

Irregardless of your current issue

still forum
granite haven
#

what are the remoteexec restrictions on public zeus servers?

blissful current
#

I have an issue with floating objects when huts burn down in a village. My first idea is to use addMissionEventHandler ["BuildingChanged" and somehow grab the nearby object and deleteVehicle them. Maybe use a marker and delete objects with it. Or grab a center point and return all object x distance away from it. Any thoughts on this?

fair drum
fair drum
blissful current
#

Currently looking into allObjects .

fair drum
#

It could also be a part of the building lod, which you would then have to delete the building. I'm assuming this is a sog building?

blissful current
blissful current
#

Ok, I got this to return the huts in the village:

nearestTerrainObjects [[7809,9098], ["HOUSE"], 80];

Now to try to apply the EH to the big huts where most of the floating objects happen.

blissful current
thin fox
#

or I misunderstood what you said

granite sky
#

Where are the floating objects in the houses coming from?

blissful current
blissful current
thin fox
blissful current
# thin fox generally, just by putting in initServer.sqf works

Made some progress. I can get the EH to work, but for some reason, if I add this script to delete nearby objects, then it won't play the hut being destroyed animation or the ruin model. Effectively, it makes the huts look like a static/invincible object. It is deleting all the objects within, however.

addMissionEventHandler ["BuildingChanged", {
    params ["_from", "_to", "_isRuin"];
    
    if (_isRuin) then {
        private _nearObjs = _from nearObjects 10;     
        {
            deleteVehicle _x;  // Delete each nearby object
        } forEach _nearObjs;
    };
}];
thin fox
#

I was going to say that maybe it's getting the hut as well

#

and trying to deleting it, resulting an odd behaviour

blissful current
#

I just tested a simple one by naming an object in the edior chair and doing deleteVehicle on it. Everything works like that. But I cannot do it this way. There are too many objects and some get moved around.

So that means it's getting broken by something that is getting deleted. I logged it here, it must be one of these:

[BuildingChanged] Land_vn_hut_01 destroyed. Nearby objects processed: HouseFly, FxWindLeaf1, FxWindLeaf1, FxWindGrass1, FxWindGrass1, Land_vn_hut_01, Land_vn_stallwater_f, Land_vn_woodenbed_01_f, Land_vn_chest_ep1, Land_vn_helipadempty_f, Land_vn_helipadempty_f, Land_vn_helipadempty_f, Land_vn_helipadempty_f, vn_c_men_05, vn_c_men_10, vn_o_men_vc_13, HouseFly, #mark, #particlesource, #soundonvehicle, WeaponHolderSimulated, #destructioneffects, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #crateronvehicle, #destructioneffects, vn_m10_ammo, Land_vn_hut_01_ruin
`

blissful current
#

I already tried a script to exclude Land_vn_hut_01_ruin to see if that was it but no.

blissful current
#

I systematically excluded items from the previous list and found the culprit to be "#destructioneffects".

muted fulcrum
#

hello was wondering how i can undo scripts in multiplayer?

#

there was a bit of trouble in our server i messed up a script but we're hardstuck on a save and I suspect that its the script that I ran

#

we use a dedicated server

#

We tried finding the script executions in the server files though we cant seem to find it

#

any help?

dusk gust
#

What script did you run? You cant "undo" a script that ran.

#

You can run a script to potentially fix it though

muted fulcrum
#

how so?

#

let me paste it

#

setDate [1987, 2, 25, 0800, 0];

thin fox
#

dude

#

what are you trying to do?

#

what is the problem?

#

did you check rpt files from the server?

muted fulcrum
#

guess alot

#

not the brightest person

#

wanted to change the date for a bit of immersion so I changed it to 1987 the problem is its stuck on its date and the time isnt moving forward

#

everytime we progress and restart the server it looses its progress because the date and time is stuck

thin fox
#

did you wape your save?

muted fulcrum
#

no not yet

#

trying to figure it out without wiping the save

thin fox
#

what? why not? you beign told to do so on kp lib discord

#

just wipe your save, change the date on your editor first

#

then pbo the mission

#

and that's it

muted fulcrum
#

because of the progress

#

its kind of a waste imo

#

though if thats gonna be the case

#

we cant even find the save

thin fox
#

where did the date shows up? introduction?

muted fulcrum
#

yes

#

intro

thin fox
muted fulcrum
#

omg

#

how can you remove the intro

thin fox
#

as admin

#

#login as admin

#

then, #reassign

muted fulcrum
#

theres actually no way to save our save huh

thin fox
#

let me see the last rpt file

muted fulcrum
#

hold up

thin fox
#

that your server generated

muted fulcrum
thin fox
#

check mods

muted fulcrum
#

was it the ofp thing

thin fox
#

but as I can see, the game is loading right

#

no error in the mission to be worried

muted fulcrum
#

yeah i dont know why but kp lib is trying to find the opfor thing

#

yeah it works fine

#

besides duplicate body bags

thin fox
#

Idk what you did, but save your presets

#

and wipe the mission file

#

and put the files again

#

and repack into a new pbo

muted fulcrum
#

do i download a new kp lib?

thin fox
#

will not hurt your save because your save is on the server profile

thin fox
muted fulcrum
#

yeah the thing is tho i cant find the mission save

muted fulcrum
#

we use a game server

#

correction to my previous message

#

not dedicated

#

its game server

thin fox
#

why are you trying to find the mission save?

#

the save is in your profile then

muted fulcrum
#

wait what were you talking about?

muted fulcrum
#

the mission or the profile save

thin fox
#

wipe the mission folder, and get the kp lib files again (0.96.8, if you're playing in this version), just save your presets if you have custom ones

#

let's see if this solves your issue with saving your game

muted fulcrum
#

alright

#

will do

finite bone
#

So an option question would be, whats the best way to achieve a moving sound source thats loud enough? (no need to be strictly syncing across the network as I can create one local for each client required)

fair drum
#

playsound3D

finite bone
#

but playsound3D does not move with the source though

#

Doesnt work as I tried it earlier by attaching

hallow mortar
#

There is a volume parameter in CfgSounds, which is where say3D gets some of its information from. You can increase that, to an extent

#

Apparent volume is quite strongly affected by distance falloff too, so make sure your max distance is high enough

fair drum
#

like >=2 times more than the distance you want to hear it at

finite bone
#

Ah the volume property is in cfgSounds - I was looking for it in say3D ๐Ÿ˜…

tulip ridge
#

You can modify it in say3D

hallow mortar
#

Are you sure about that?

finite bone
#

Nope

tulip ridge
#

Oh nevermind it was just pitch, I mis-remembered

pallid palm
#

or like Kikko said ```cpp
class CfgSounds
{
sounds[] = {};
class LetsRock
{
name = "LetsRock";
sound[] = {sound\LetsRock.ogg, db+8, 1};//db+8 is the volume level
titles[] = {0, ""};
};
};

jovial sinew
#

hey cuties

i have stink brain, it's probably a simple thing but I figured I'd ask here and see if anyone else knows already

looking to use the leaflet stuff for a horror op, and wondering how I could put linebreaks in the text (just to make a note easier to read)

[myLeaflet, "#(argb,8,8,3)color(1,0,1,1)", "Line1"] call BIS_fnc_initInspectable;

is what I stole from the wiki and barely changed, any help is much appreciated

warm hedge
#

Usually either \n or <br/> work

pallid palm
#

best way to play3D sound is to make an addMissionEventHandler```sqf
if (!isServer) exitWith {};

addMissionEventHandler ["EntityKilled", {
params ["_killed", "_killer"];

if ((isPlayer _killer or side group _killer isEqualTo west) &&
(side group _killed) isNotEqualTo west && typeOf _killed == "O_Officer_F") then 
{
    _randomSound = selectRandom ["LetsRock","ComeGetSome"];
    _killer say3D _randomSound;
};

}];

jovial sinew
pallid palm
#

oh w8 now see what you mean

ivory lake
#

but it's in a string so it's &lt;br/&gt;

pallid palm
#

yeah what POLPOX said should work then

jovial sinew
#

I'm an absolute fool

I wasn't putting the slash in <br/> lmao

aaaa apologies, thanks though

pallid palm
#

lol ok m8

jovial sinew
#

thanks misc_chma_pepe_heart

blissful current
# thin fox Did you test this EH without your script?

So I've made an interesting but ultimately disappointing discovery regarding the addMissionEventHandler ["BuildingChanged" EH. It turns out there are certain conditions where the game will not recognize that a building has changed.

For example, if I use fire to destroy the building the EH will fire. But if I use a rocket launcher to destroy it, then the EH will not fire.

So I'm not sure how I can detect the building being destroyed anymore, which I need to in order to delete floating objects that occur when the building is destroyed.

tulip ridge
#

It might not fire if the building is fully destroyed, similar to Hit not firing when the unit dies

#

Just a guess, haven't used it personally

granite sky
#

What's fire? :P

#

I tested BuildingChanged recently with a MAAWS and it worked fine.

#

Also worked with setDamage

#

You're not assuming that _isRuin is gonna be true for intermediate states or something?

jade acorn
#

I'd like to make a rather simple "teleport to marker" system. I thought of comparing the MapSingleClick's _pos value to a specific marker's position but how can I round it to make the detection less pin-pointing? Alternatively how can I check if player is hovering mouse over a marker?

winter rose
#

distance 2D?

#

I believe you cannot have the map cursor position easily

jade acorn
blissful current
# granite sky What's fire? :P

I mean activated when I said fire. I tested without _isRuin to be certain. I can reproduce by using a rocket launcher to shoot the underside of the huts.

There is also a pattern of when the EH does not fire and when it does. If the EH activates then there will result in a ruined model replacing it. If the EH doesn't activate then nothing will be remaining, making the ground look quite absent.

winter rose
blissful current
#

All this is to say since the EH is very inconsistent, I need to find a new solution since I can't use it.

I can reduce the number of objects so there won't be as many floating ones. Or I thought about using the hide module to hide the editor-placed huts, then place my own huts and make them indestructible. I lose some exciting dynamics, but that's better than ruined immersion from floating objects.

thin fox
blissful current
thin fox
thin fox
blissful current
#

Or I thought about using the hide module to hide the editor-placed huts, then place my own huts and make them indestructible.

#

As mentioned above. Yeah might have to do that.

thin fox
#

I think it's the best option

#

you can do that way, or you can put a trigger with a code to find nearby terrain objects and set them as indestructible

blissful current
thin fox
carmine sand
pallid palm
#

btw what's latest ver of vanilla Arma 3 ? any one ?

blissful current
granite sky
#

Well, if the building just disappears rather than changing then I guess the EH won't fire?

#

I haven't seen that effect with any vanilla gear though.

#

Might be busted config for that particular building.

blissful current
granite sky
#

It turns into nothing though.

#

Typical CDLCs fucking everything up :P

#

Probably intentional.

pallid palm
#

@blissful current oh thx m8 nice so im up to date cool

pallid palm
#
{deleteVehicle _x;} forEach (allMissionObjects "Ruins");
tender sable
tender sable
granite sky
#

If you setDamage 0 on the building then it'll both bring the original back to the surface and delete the ruin.

#

Which feels like a lot of features for something that supposedly isn't intended :P

carmine sand
granite sky
#

I forget whether it hides the original building after sliding it underground.

#

It certainly should

carmine sand
#

better would be deleted by replacing it with a ruin

granite sky
#

map objects can't normally be deleted, only hidden. Not sure if mission object buildings have the same behaviour though.

carmine sand
pallid palm
#

@tender sable what do you mean the terrain object ?;

#

do you mean like the base of the house ?

hallow mortar
#

Objects that are part of the terrain, as opposed to objects that are placed in the Editor or created by scripts

#

For various reasons they work slightly differently

pallid palm
#

yeah on Strites it seems to delete the terrain object "ruins" with this ```sqf
{deleteVehicle _x;} forEach (allMissionObjects "Ruins");

#

of course after the house is destroyed 100%

#

or maybe i just cant see that the house; is under the Z, 0;

#

like if i destroy all the houses in the city by the bay: on Stratis: with a chopper and i have on a loop ```sqf
{deleteVehicle _x;} forEach (allMissionObjects "Ruins");

#

or are the houses just under ground like crashdome said

#

I hope some day someone makes a terrain: that has no houses or buildings on it: So we have to place all the terrain objects: not the veg: but just the house's and buildings: that would be cool

#

cuz its kind-a funny even if we hide a house or building its really still there: i can see Ai get stuck there sometimes

tender sable
split ruin
#

is there a command that gives center of the map position?

faint burrow
#

[worldSize / 2, worldSize / 2]

austere granite
#

That's just what it's called. Everything in order

#

It's because it's an object with no model

split ruin
#

I found a bug in vanilla, AAF jet pilots spawn without a helmet

dawn thunder
split ruin
#

did u try the command in the debug console to see what returns ? thonk

dawn thunder
cyan dust
#

Does Arma have simple 'Yes/No' popup with callbacks to reuse? ๐Ÿค”
I really don't feel like creating another GUI just for that

cosmic lichen
#

3denMessage works too and is a bit more flexible

winter rose
cosmic lichen
#

Yes

bleak valley
#

Hi
Quick question : I'm setting up a countdown in my scenario with that code, with a trigger I manually activate
in the trigger :
execVM "countdown.sqf";
in the script :
0 spawn { [1080] call BIS_fnc_countdown; While {[true] call BIS_fnc_countdown} do { hintSilent format ["temps restant : %1 secondes", [0] call BIS_fnc_countdown]; Sleep 1; }; };

Once the player have done their job, I want the countdown to stop (once again, I'll manually trigger it when conditions are satisfied)
I'm using the terminate command but it doesn't work

In a trigger, on activation :

_script = [] execVM "countdown.sqf"; terminate _script;

It doesn't stop. I tried numerous options, like defining a private variable or using _handle but I can't get it to work, can anyone help me please ?

fair drum
#

For the way you are doing it, I would ditch the BI countdown function and make your own. It's not difficult.

bleak valley
#

I don't think I've reached that stage honestly, for now I'm only good at googling sqf scripts and more or less understand what's going on so I can edit it

I'll find another way to reach my goal, maybe ditch the countdown part entirely then

fair drum
#

Gonna have to make that jump at some point. You have most of the idea already. You'll need some while do loops and some hints.

winged thistle
#

Hey guys, is there a way to cease the passage of time in my mission?

#

Previously, to accomplish this, I've just set the date every 300 seconds or so, but it looks wonky and I'm looking for a better way to do it