#arma3_scripting

1 messages · Page 36 of 1

peak pond
#

Hi I'm using respawn on custom position with select respawn loadout and position options, to get the UI where you select loadout and position like the Apex campaign. I noticed it actually appears to spawn the players somewhere before they make a selection, teleport or hide them off-map, then when they make a selection it just sets their loadout and teleports them to the selected location. Does anyone know an easy way to activate this UI without players having to respawn (as that would count against their score). I would like to have a role-changing feature where a player can RTB, interact with a laptop or something, and access this UI to select a new role/location.

hallow mortar
#

also very fun: it doesn't remove the weapon that was originally on the pylon, so you're left with an unusable empty weapon unless you manually remove it with another command :|

hallow mortar
#

More good news: the wiki says that in order to remove pylon weapons, you can do this:

{ _vehicle removeWeaponGlobal getText (configFile >> "CfgMagazines" >> _x >> "pylonWeapon") } forEach getPylonMagazines _vehicle;

However, in my testing, removeWeaponGlobal simply ✨doesn't work ✨ on pylon weapons.

granite sky
#

Oh, I was going to switch our stuff to that. Thanks for the warning.

hallow mortar
#

I'm looking for an actual solution and people regularly recommend this one, so it must have worked at some point, but...not now that I need it, apparently

granite sky
#

Our slightly crazy code which does work for removing only pylon weapons:

private _turrets = [[-1]] + allTurrets _veh;
private _toRemove = [];
{
    private _turret = _x;
    private _baseWeapons = getArray (([_veh, _turret] call BIS_fnc_turretConfig) / "Weapons");
    private _weapons = (_veh weaponsTurret _turret) apply { toLower _x };
    // Avoiding array subtract in case there's a pylon and non-pylon copy of the same weapon
    // RHS has case bugs (zu-23 notably) so we force everything lower
    { _weapons deleteAt (_weapons find toLower _x) } forEach _baseWeapons;
    { _toRemove pushBack [_x, _turret] } forEach _weapons;

} forEach _turrets;

{ _veh removeWeaponTurret _x } forEach _toRemove;
hallow mortar
#

How does that determine whether something's a pylon vs an actual turret (e.g. attack helo gun turret)?

granite sky
#

IIRC _baseWeapons there contains all the non-pylon weapons.

hallow mortar
#

Oh, okay

granite sky
#

(in that particular turret)

#

Note that it can't do a simple array subtraction because of the mod casing bugs :P

#

I think the removal is only outside the loop due to logging requirements, so it could be simplified a bit.

hallow mortar
#

That seems to do the trick. Doesn't remove the visual proxies from the model, oddly, but that's not an issue since I just replace them anyway. Thanks!

hallow mortar
warm vapor
#

These are spawned once in very specific placements, since it's a large custom interior environment. Basically, I need them to be able to aim, but not move, otherwise they're going to walk through walls and it'll be ugly

#

We do have 3 headless clients in place. They aren't really all being fought at once, but given the proximity of the segments of the interior environment, it's not impossible that the units could detect the combat and attempt to engage

fair drum
#

There is an event handler for transferring ownership

#

Fires when locality changes

warm vapor
#

... Interesting. I didn't realize that. What would the server impact of 400 event handlers be, in theory?

#

And do those event handlers survive transfer?

#

Looks like it does, since the eventhandler is at the server/headless client level, it's not recreating the object every time

granite sky
#

A locality change EH probably has no performance cost unless the locality of the attached unit changes.

#

So attaching one to each created unit isn't unreasonable.

warm vapor
#

Which SHOULD only happen once. We use Zulu Headless Client, so once the initial balancing happens, there would be one locality change, then not another.

#

I'd love to use Dynamic Simulation with a low distance, but the problem there is at the same time this is going on, I'm spawning in air to air contact for our forces, and those of course need to come in from a longer range.

kindred zephyr
warm vapor
#

Problem is, I think Zulu applies it globally to every unit

#

Although perhaps if I include it in the EventHandler it might work, since all ZHC is doing is applying it to units it think should have it (based on it's own visibility checks)

warm vapor
#

So if I disable Zulu's dynamic support, and just do it manually + some event handlers, that may work

pulsar bluff
#

when locality transfers FROM server TO hc ... then add another locality event handler on server to handle the transfer back to server when (not if) the HC disconnects

#

add all the stationary units to a globally sync'ed array

#

then on locality change, check if the unit is in the array

#
    unit1,
    unit2,
    unit3
];
missionNamespace setVariable ['TAG_myStationaryUnits',_units,TRUE];```
#
    unit1,
    unit2,
    unit3
];
missionNamespace setVariable ['TAG_myStationaryUnits',_units,TRUE];

{
    _x addEventHandler [
        'Local',
        {
            params ['_unit','_isLocal'];
            if (_isLocal) then {
                if (_unit in TAG_myStationaryUnits) then {
                    _x enableAIFeature ['PATH',FALSE];
                };
            };
        }
    ];

} forEach _units;```
#

and on HC something like this

#

// init.sqf
0 spawn {
    if (isDedicated || hasInterface) exitWith {};
    while {true} do {
        sleep 10;
        TAG_myStationaryUnits = TAG_myStationaryUnits select {alive _x};
        {
            if (((_x getEventHandlerInfo ['Local',0]) # 2) isEqualTo 0) then {
                _x addEventHandler [
                    'Local',
                    {
                        params ['_unit','_isLocal'];
                        if (_isLocal) then {
                            if (_unit in TAG_myStationaryUnits) then {
                                _x enableAIFeature ['PATH',FALSE];
                            };
                        };
                    }
                ];
            };
            sleep 0.1;
        } forEach TAG_myStationaryUnits;
    };
};```
warm vapor
#

.. Interesting. And that actually gives me an idea.

I could probably use a similar idea to enable/disable simulation using triggers when players reach certain areas in the interior environment, so that not all 400 are technically alive at once

pulsar bluff
#

i mean you shouldnt have all 400 alive at once... design your mission area so it wont be necessary

#

depending on player count, the players will never be able to address all 400 enemy at once, so theres really no need to have them spawned/placed

warm vapor
#

Well, basically, my goal is to have them all preplaced during mission creation. The placement is very particular (IE: On catwalks where Zeus may not necessarily be able to spawn AI, etc). I know in theory I could do scripts that spawn and despawn the AI as needed, but I haven't found an obvious way to point at say, a floor of the interior environment and go

"Okay. Give me a .sqf file for all 80 of these guys"

warm vapor
#

That would give me the list of AI, but not necessarily the sqf for spawning each one, wouldn't it?

#

Unless there's a subsequent command that would return the spawn script for an entity, then I could just iterate through that

pulsar bluff
#
// Getting the positions
// In editor debug console, after selecting your units
TAG_list = [];
{
    TAG_list pushBack [typeOf _x,getPosWorld _x];
} forEach (get3DENSelected 'object');
copyToClipboard str TAG_list;


// Create a file (or just use init.sqf) (paste the result)
TAG_list = <paste here>


// In game
private _unit = objnull;
{
    _unit = (createGroup [EAST,TRUE]) createUnit [_x # 0,[0,0,0],[],0,'NONE'];
    _unit enableAIFeature ['PATH',FALSE];
    _unit setPosWorld (_x # 1);
    TAG_myStationaryUnits pushBack _unit;
} forEach TAG_list;```
#

create a list for each zone/trigger area

warm vapor
#

Ahhhh, I see how that would work. That's a really clever solution, thank you.

To explain: Basically, I've got a massive map composition constructed of combined interiors. The interior winds up being a multi level structure, but in actuality is essentially free floating platforms placed on the map perimeter. Progressing through the interior is done via teleporting between sections at junction points, as well as some clever use of hallways rotated vertical to simulate elevator shafts to rappel down.

So I have clearly marked zones that I could spawn AI into, and I can create enough of an air gap between sections that Zulu Headless Client would have time to re-balance the AI in each section so that all of the locality is dealt with before players getting there.

#

I knew there were ways to export the -mission- as an SQF, but because the placement is so specific and somewhat dependent on the interior structure being placed, I knew that was just going to be a vomit of the entire mission file. This is a much more elegant solution

pulsar bluff
#

IMO the headless client should be kept in mind for mission architecture, but get it all working on the server first

#

you may find you dont need headless client if, say, your not spawning >100 AI at a time

warm vapor
#

Fair, and I've wondered whether it'd be overkill for this particular section. There is likely going to be a lot of contact in this mission though given it's the last in an ongoing campaign. Still, as you said, it's not like they are encountering them all at once.

pulsar bluff
#

for mission design ya, you want to consider how many AI you want players to encounter at a time , and then try different methods to get rid of the extras (without compromising the experience)

#

i hate CAS/jets/aircraft for this reason

#

with infantry you can create a 'front line' and spawn units "just in time" behind the front

#

but if players have jets/helicopters, they can overfly the area and there is no front line, so you need higher baseload count of AI

warm vapor
#

Admittedly, the nice part about this is the air mission is relatively straight forward. The area where the interior is, is marked as no-fly for the mission duration and well out of the way of their objective.

#

So I don't have to worry about the air presence spotting things ahead of time

#

Anyways, thank you for your help. I think this gives me a good baseline to work off of, and a good way to handle the AI

pulsar bluff
#

@still forum Does it make sense to have a few big hashmaps for storing configfile queries, with complex keys, or having lots of smaller hashmaps with simple keys

#

for instance, storing weapon muzzles in same hashmap with vehicle display names

#

getText (configFile >> 'CfgVehicles' >> (typeOf _vehicle) >> 'displayName')

#

getArray (configFile >> 'CfgWeapons' >> _currentWeapon >> _muzzle >> 'modes')

#

seems cleaner to have a hashmap for each value data type, but not necessarily better

tough abyss
#

If it's a true HashMap it would be accessed in O(n) or O(1)

tough abyss
#

Then spawn them in places that are 'sensible'

dusky lichen
#

probably the wrong channel but is this the right scripting if i wanna add virtual garage to an object and make it spawn 30m away from the player?

}];```
warm hedge
#

No this channel is fine

dusky lichen
#

i kinda mashed 2 codes i found so..idk if it works

#

still learning

warm hedge
#

Also

dusky lichen
#

thats where i got it from

warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
warm hedge
#

Your code doesn't create any vehicle you can use

#

Try example 2 or 3

dusky lichen
#

im guessing i remove the // parts?

warm hedge
#

Depends where you put the code

dusky lichen
#

init of a prop

warm hedge
#

Then yes

#

IIRC that block doesn't detect a comment line

dusky lichen
#

like this?

#

ignore the s

warm hedge
#

As I said it doesn't create the vehicle

#

Do not forget this line: _vehicle = createVehicle [ "Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE"];

dusky lichen
#

so this will sound stupid but is there anything i can add into it to make it spawn the vehicle from the garage? if it doesnt already that is (doing this for a long term mission where we dont wanna have to zeus vics or eden in stuff 24/7) or is it a i have to manually add all the classnames into it myself?

warm hedge
#

Huh, isn't that the code does?

dusky lichen
#

just double checking before i save

warm hedge
#

Anytime test

dusky lichen
#

what ive been working on (its crappy but meh)

dusky lichen
#

2nd issue can someone help me input this into my mission every time ive tried ive messed it up badly.

https://forums.bohemia.net/forums/topic/204747-release-gom-aircraft-loadout-v135/

#

the instructions are simple yet somehow i cant get it to work at all.

#

it still works according to people as of last month

#

and a week ago^

warm hedge
#

Describe how it doesn't work

dusky lichen
#

cant get the menu to pop up on any objects i put into the init as well as just not sure how exactly i combine the description text and other stuff with this mission

#

if you like we can vc and i can show ya.

warm hedge
#

I've asked you for a detailed things, like error messages not “I'm not sure”

#

And no thanks for a VC, we always prefer texts

dusky lichen
#

i. literally, dont. know

#

i followed the instructions to the t and it doesnt work yet others got it to work perfectly first try

warm hedge
#

Oh sorry, I think I've misread what you mean

#

I somehow thought you meant to say it was worked, a week ago it stopped to work

dusky lichen
#

i can send you the file if you wanna open it and take a peek under its hood to figure out what i need to do

warm hedge
#

No need to redistribute

#

So uh, do you know what description.ext is?

dusky lichen
#

the mission im remaking has its already made so idk if im supposed to just copy it over or how to do it

#

script im supposed to add:

warm hedge
#

In your description.ext, do you have a linecpp class CfgCommunicationMenu?

dusky lichen
#

no

warm hedge
#

Then do what I say:

  1. add this line into the bracket right after class CfgFunctions in your description.ext
  #include "scripts\GOM\functions\GOM_fnc_functions.hpp"```
2. Add these lines into somewhere in description.ext
```cpp
class CfgCommunicationMenu
{
    #include "scripts\GOM\functions\GOM_fnc_aircraftLoadoutMenu.hpp"
};

#include "scripts\GOM\dialogs\GOM_dialog_parents.hpp"
#include "scripts\GOM\dialogs\GOM_dialog_controls.hpp"```
dusky lichen
#

do i need to add the }; under it as well or?

warm hedge
#

Under what?

dusky lichen
#

like this? or do i need to add it under

warm hedge
#

Seems fine

dusky lichen
#

alright

#

now onto the files..

#

just drop it in like this or?

#

its in the scripts folder of the mission

warm hedge
#

Is this scripts folder?

#

Then seems fine

dusky lichen
#

what aboit initplayerlocal?

#

..nvm said it wasnt needed

#

now onto eden right?

warm hedge
#

I guess

dusky lichen
warm hedge
#

Show the entire description.ext

dusky lichen
warm hedge
#

I would appreciate if is a text file not a image

dusky lichen
#

OnLoadName = "Antistasi Ultimate - Agent Orange";
OnLoadMission = $STR_antistasi_mission_info_camlaonam_blurb_text;
briefingName = "Antistasi Ultimate - Agent Orange";
overviewText = $STR_antistasi_mission_info_altis_description_text;
loadScreen = "Pictures\Mission\pic.jpg";
overviewPicture = "Pictures\Mission\pic.jpg";

class CfgDiscordRichPresence 
{
    applicationID="884134734874165378";
    defaultDetails="";
    defaultState="";
    defaultLargeImageKey="camlaonam_big_picture";
    defaultLargeImageText="Antistasi Ultimate - Agent Orange";
    defaultSmallImageKey="arma_3_logo";
    defaultSmallImageText="Arma 3 Custom Scenario";
    useTimeElapsed=1;
};

class CfgFunctions
{
    #include "MissionDescription\CfgFunctionsContents.hpp"
    #include "scripts\GOM\functions\GOM_fnc_functions.hpp"
};

class CfgNotifications
{
    #include "MissionDescription\CfgNotificationsContents.hpp"
};

class CfgSounds
{
    #include "MissionDescription\CfgSoundsContents.hpp"
};

class CfgDebriefing {
    #include "MissionDescription\CfgDebriefingContents.hpp"
    class End1
    {
        title = "V I C T O R Y";
        subtitle = "Cam Lao Nam is Ours!";
        description = "The population of Cam Lao Nam loves you!<br/>The SDK brave soldiers have proven their valour, and Petros, Cam Lao Nams new Prime Minister, could at last to have a nice holiday. A deserved rest in a Greek island with drinks and fine food.";
        picture = "n_inf";
        pictureColor[] = {0.0,0.5,0.0,1};
    };
    class petrosDead
    {
        title = "Petros is Dead";
        subtitle = "Petros is Dead";
        description = "Congratulations!: Petros is Dead. Now with Syndikat without a leader, you may think about joining them, and free Cam Lao Nam";
        picture = "b_unknown";
        pictureColor[] = {0.5,0.0,0.0,1};
    };
    class destroyedSites
    {
        title = "Cam Lao Nam is Destroyed";
        subtitle = "Cam Lao Nam got Destroyed by OPFOR";
        description = "One third of the population in Cam Lao Nam has been murdered by the OPFOR.<br/>Cam Lao Nam no longer exists, nobody wants to live here.";
        picture = "b_unknown";
        pictureColor[] = {0.5,0.0,0.0,1};
    };
};
class CfgCommunicationMenu
{
    #include "scripts\GOM\functions\GOM_fnc_aircraftLoadoutMenu.hpp"
};

#include "scripts\GOM\dialogs\GOM_dialog_parents.hpp"
#include "scripts\GOM\dialogs\GOM_dialog_controls.hpp"
warm hedge
#

What is "MissionDescription\CfgDebriefingContents.hpp"?

dusky lichen
#

bascially just a code from the antistasi mission im editing i dont know what its for

warm hedge
#

Oh I meant what's inside

#

Not summary

dusky lichen
#
// #include "MissionDescription\CfgDebriefingContents.hpp"

#include "endMission.hpp"
warm hedge
#

And what's inside endMission.hpp?

dusky lichen
#

bascially just all the variables to end the mission if theres an incompatable mod combination

#

like combining rhs and cup will end the mission

warm hedge
#

As I said, what's inside not summary

dusky lichen
#
class modUnautorized
{
    title = "Incompatible Mods";
    subtitle = "Incompatible Mods detected";
    description = "An incompatible mod or incompatible set of supported mods (both RHS and CUP) installed on the server or your PC has been detected. To avoid support problems the mission is finished. Please turn off unsupported (IFA, ASR AI, aLIVE, MCC or any AI behaviour) mods from your computer or server to be able to play Antistasi. See server .rpt log for more information.";
    picture = "b_unknown";
    pictureColor[] = {0.0,0.5,0.0,1};
};
class noPvP
{
    title = "PvP Disabled";
    subtitle = "This slot is unavailable";
    description = "PvP is not enabled on this server.";
    picture = "b_unknown";
    pictureColor[] = {0.0,0.5,0.0,1};
};
class factionDefeat
{
    title = "Faction Defeat";
    subtitle = "This faction was defeated, PVP for this faction is unavailable. ";
    description = "PVP is unavailable.";
    picture = "b_unknown";
    pictureColor[] = {0.0,0.5,0.0,1};
};
class noJip
{
    title = "Can't startup as PvP";
    subtitle = "This slot is unavailable";
    description = "You can't choose PvP until the mission has been started. If you didn't intentionally choose a PvP role, make sure you pick the rebel side (usually green).";
    picture = "b_unknown";
    pictureColor[] = {0.0,0.5,0.0,1};
};
class pvpMem
{
    title = "You are not a Member";
    subtitle = "This slot is unavailable";
    description = "You need to be a Member to use PvP.";
    picture = "b_unknown";
    pictureColor[] = {0.0,0.5,0.0,1};
};
class BossMiss
{
    title = "MIA Rebel Commander";
    subtitle = "This slot is unavailable";
    description = "PvP is not available as there is no Commander for the Rebels.";
    picture = "b_unknown";
    pictureColor[] = {0.0,0.5,0.0,1};
};
class hcDown
{
    title = "HC Disconnected";
    subtitle = "Some Headless Client has been disconnected and mission has to stop to avoid malfunctions.";
    picture = "b_unknown";
    pictureColor[] = {0.0,0.5,0.0,1};
};
class noSinglplayer
{
    title = "No Singleplayer support.";
    subtitle = "Start LAN server to play as single player.";
    picture = "b_unknown";
    pictureColor[] = {1,0.5,0.0,1};
};
warm hedge
#

Hmm seems fine like at all. I've must missing something very simple...

#

It's really hard to debug if I don't have the actual mission

dusky lichen
#

said there was an issue with line 63 when i loaded the mission in the selector

warm hedge
#

I know

dusky lichen
#

i can pack the pbo and send it to you if you like

stable dune
#

Hi,
Easiest way to get count of all players when some disconnect/ connect?
Im trying to use
PlayerConnect and playerdisconnected EHs,
Which is correct place to add EH, and if i try get all players with

_myUnits =
(allPlayers - (entities "HeadlessClient_F"));
systemChat str (_myUnits);

In eh, it returns.
[]

Or count return
0

dusky lichen
#

bear in mind its antistasi so yknow..spagetti code in some places outside my control lol

warm hedge
#

It is not even matter since you are the one who broke it 😛

still forum
coarse heath
#
// AI SKILL SCRIPT FOR ZEUS-PLACED AIs

// add [] execVM "AIskill.sqf"; to init.sqf


//you can change the values

 mad_ifnc_aiskill= 
 {
  params ['_dude'];
    _dude setSkill ['aimingAccuracy', .2 + (random 0.05)];
    _dude setSkill ['aimingShake', .21 + (random 0.05)];
    _dude setSkill ['aimingSpeed', .15 + (random 0.05)];
    _dude setSkill ['spotDistance', .15 + (random 0.1)];
    _dude setSkill ['spotTime', .55 + (random 0.05)];
    _dude setSkill ['courage', .75];
    _dude setSkill ['reloadSpeed', 1];
    _dude setSkill ['commanding',.85];
    _dude setSkill ['general', .9 + (random 0.05)]; 
 };  
 
{
    _x addEventHandler ["CuratorObjectPlaced", 
    {
        params ["", "_entity"];     
        if (_entity isKindOf 'CAManBase') then
            {
                [_entity] call mad_ifnc_aiskill;            
            };        
        if ((_entity isKindOf 'LandVehicle')or(_entity isKindOf 'AIR')or(_entity isKindOf 'ship'))  then
            {
                {
                    [_x]call mad_ifnc_aiskill;            
                } foreach crew _entity
            };    
    }
    ];
} forEach allCurators;```



// AI SKILL SCRIPT FOR ZEUS-PLACED AIs
[] execVM "AIskill.sqf"; in init.sqf

any recommended fix/changes with this script? (not the skill values) (copied it from someone)
tough abyss
#

is there an easy way to change gui from a grid to a safezone

#

?

little raptor
little raptor
#

You can also change the GUI_GRID_H, etc. macros directly

proven charm
#

the ammo command doesn't seem to work with "gatling_30mm" in kajman weapon because it always returns 0

stable dune
fallow vector
#

Hello hello! Has anyone worked with "Cfg sentences" from 3den enhanced before? I've looked up documentation for it on their wiki, but it's very unhelpful...

winter rose
#

depends on what you want to do

fallow vector
# winter rose depends on what you want to do

I'm trying to do 2 "sentences" at the start of the mission

Player loads in

"Sentence A" Starts playing + subtitles"

pause a few seconds til A is done

"Sentence B" Starts playing + subtitles"

Done

#

Subtitles work fine, but I can't get the audio to play :D

winter rose
fallow vector
#

Actually I have! Although unfortunately i'm not too adept at scripting, so it's slightly confusing me on the necessary steps.
From what I gathered, CfgSentences displays already made "sentences" from vanilla, so all I'd need to do is "use" said vanilla assets instead of doing it from scratch

#

This is currently what I have

winter rose
#

CfgSentences is used with BIS_fnc_kbTell, Sentences with kbTell

fallow vector
#

As per the limited instructions from in game Cfg Sentences

winter rose
#

^ what you wrote does not use either of Cfg/Sentences 🙂

fallow vector
#

:(

winter rose
#

if you are fine with writing something like

  • dude1 says "soundA"
  • wait 10s
  • dude2 says "soundB"
    it can be done easily 🙂
fallow vector
#

Yup! That also works :D

winter rose
#

is it MP?

fallow vector
#

Correct! It'll be played on a dedi server

stable dune
#

Hi,
Does allUsers count headlessClient entities?

winter rose
# fallow vector Correct! It'll be played on a dedi server

so, in description.ext:

class CfgSounds
{
  class soundA
  {
    name = "";
    sound[] = { "path\to\fileA.ogg", 1, 1 };
    titles[] = { 0, "subtitle to sound A" };
  };
  class soundB
  {
    name = "";
    sound[] = { "path\to\fileB.ogg", 1, 1 };
    titles[] = { 0, "subtitle to sound B" };
  };
};

and in whatever script you have:

[unit1, "soundA"] remoteExec ["say"];
sleep 10;
[unit2, "soundB"] remoteExec ["say"];
winter rose
#

I would guess "yes"

fallow vector
#

Unfortunately doesn't work :/
I tried bypassing it with playsound (since it's radio chatter anyway) but unfortunately didn't work
(tried doing it with only 1 sound first)

kindred zephyr
winter rose
fallow vector
#

I'm starting to wonder if this is something on my end 🤔

winter rose
#

did you try in Eden first?

#

(and are you sure of the path?)

fallow vector
# winter rose did you try in Eden first?

Could you elaborate please? The way i'm testing it out is by "replaying" the mission over and over after trying out (Plus giving playsound "chat1"; a manual try in game in the debug console)

fallow vector
winter rose
winter rose
fallow vector
#

Fair enough on the question :D

#

Any other ideas you might have by any chance my friend?

#

I suppose it's not something entirely needed for this mission (luckily), but voice acting is something I dabble in quite frequently so this would be very very helpful to figure out if at all possible

winter rose
#

sure, it can make the immersion ofc!

#

lemme try

#

starting A3 after a month

fallow vector
#

Thank you kindly 💙

#

And sorry for the trouble too

winter rose
#

say works fine to me

#
class CfgSounds
{
    class soundA
    {
        name = "";
        sound[] = { "@a3\dubbing_f_epa\a_out\01_Start\a_out_01_start_CHA_0.ogg", 1, 1 };
        titles[] = { 0, "subtitle to sound A" };
    };
};
``````sqf
player say "soundA";
```might be only that your `description.ext` is in fact a `description.ext.txt` if you have hidden file extension in Windows
fallow vector
#

Now both player say and playsound worked

winter rose
#

ah
you need to Ctrl+S with description.ext changes yes

#

(in-game) for the file changes to be reloaded

fallow vector
#

I thought I did, but maybe I was mistaken :D

#

While we're on that topic, at what point does the file "reload"?

#

Is it when you back out to role select?

#

can it be theoretically done "while" testing?

winter rose
#

the game reloads description.ext when it saves or loads the mission
I don't think it does when it enters or exits the preview mode

winter rose
fallow vector
#

Thank you kindly for the assistance, I appreciate it! :D

kindred zephyr
winter rose
#

#restart? as in, filepatching MP mission?

kindred zephyr
winter rose
#

ah nope, we were talking about reloading description.ext changes on runtime
well, that's what I understood so far of course :D

tough abyss
#

in this ARRAYS example is about removing a single element, in this highlighted example changes the value of 4 but then it says (after removing that null object) that arrays is 1 , 2 , 4, what is happening here? my logic says that if 4 was modified and then removed the result should been 1, 3, 5?

cosmic lichen
#

Where is it removing the 4?

#

Arrays start at 0

cosmic lichen
#

In the example, 1 has index 0, 3 has index 1, 4 has index 2 and 5 has index 3, which is then modified

hallow mortar
#

I feel like examples relating to array indexes should use something other than numbers for the array elements, it would be much less confusing

tough abyss
little raptor
hallow mortar
#

Is there a way to play the sound of a weapon firing, as if the weapon had actually been fired? I know I could go into the files and look up the sound filename and play it with playSound3D etc, but then it wouldn't have its associated sound shaders and tails and stuff.

hallow mortar
#

I would also have to create an invisible AI (and/or vehicle) carrying the weapon, and I have pretty much no faith in that working as intended 100% of the time

kindred zephyr
hallow mortar
#

BIS_fnc_setIdentity doesn't use cfgIdentities, so if you wanted to reference a config identity you'd have to go and look it up yourself. *on the other hand you can make identities that aren't in CfgIdentities
The function basically just contains a bunch of the setFace etc. commands. It's JIP-safe because it remoteExecs them.

#

You can look it up in the Functions Viewer to see exactly what it does.

kindred zephyr
#

Oh wow, remoteExec does indeed have a JIP flag, wtf

stable dune
winter rose
thorn saffron
#

Anybody have a properly set up sqf function header for SQFLint?

crystal elbow
#

Hey, does anyone know how to get the units in a group's class name? I want to use BIS_fnc_spawnGroup to spawn my own groups or something to that effect

#

Or will I have to use the creategroup and createunit commands?

winter rose
crystal elbow
#

Create a group with my own units in

#

I take it the BIS function only works with defined groups?

hallow mortar
#

BIS_fnc_spawnGroup can either spawn a config group or a specified list of unit types

winter rose
#

that or createGroup + createUnit yep

hallow mortar
crystal elbow
#

If I put the class names to spawn would it only generate 1 of every class name or would it randomise it?

hallow mortar
#

It spawns one per entry in the array, in order of the array, up to the limits defined in the randomControls parameter. If you want two of a particular unit type, put it in the list twice.

crystal elbow
#

Okay thank you

#

And then to name that group would I be correct in thinking GroupName = BIS_fnc_spawnGroup [MyParamatersHere]?

hallow mortar
#

No, that's not the right syntax for calling a function

groupName = [myParametersHere] call BIS_fnc_spawnGroup```
crystal elbow
#

Thank you

#

And then I could assign waypoints to that groupName using the createWaypoint command?

#

Sorry for loads of questions, haven't really scripted much since A2, even then it was only 1 line at a time stuff aha

hallow mortar
#

Well, groupName contains a reference to a group, and createWaypoint is used for creating a waypoint for a group (which requires a reference to the group), so logically.......yes.

winter rose
stable dune
#

No problem, thanks for adding to wiki.

hallow mortar
#

I have a particle emitter that creates particles in a roughly wall-shaped pattern using its random position parameter. I would like to have this "wall" face in a particular direction. However, the direction of the particle creation pattern doesn't seem to be related to the direction of the emitter; it's a "world space" pattern rather than "object space". Given that I can't control it by rotating the emitter, how can I alter its direction? The position randomisation parameter creates a cuboid, so creating a diagonal shape using that doesn't seem to be possible.

winter rose
#

Maths

hallow mortar
#

I did the maths to find out what direction I need to face, the problem is then applying that direction. I can't figure that one out.
I'm trying switching to drop so I can just instantly create a bunch of particles wherever I like, but the particle params array that worked with the emitter is doing Nothing™ when used with drop. yaaay

heavy lily
#

I have an issue happening where a custom sound will play in singeplayer but not multiplayer. Happening via trigger, trigger script is:
playsound3d [getmissionpath "track01.wav",player]; track01.wav is in the mission folder

#

I feel like I'm missing something entirely obvious but I don't know what

hallow mortar
#

Is it a server-only trigger?

heavy lily
#

nope

hallow mortar
#

Is the trigger actually activating in multiplayer? What's its condition?

heavy lily
#

anyplayer present

#

I think I figured out what was happening. I was testing, dropped down a random character and took control of it in a zeus module, but it wasn't a unit set to player so didn't work

#

Just tried with my zeus character which IS marked as as a player/playable (don't know why I didn't try that in the last hour of troubleshooting) and it worked

hallow mortar
#

That'd do it. When you remote control a unit you're not actually switching bodies, it's more like UAV control. Your player is still back in your original body.

heavy lily
#

First time using player present not bluefor present, live and learn, thx

copper raven
heavy lily
#

Yeah that’s totally fine.

#

It’s a “you found a disk and insert it into your convenient CD player that you totally have to move you to the next objective”…..thing.

coarse heath
coarse heath
sharp parcel
#

would love to hear what medical system you guys are all running. I love the AIS system only self heal is a bugged and the player doesn't heal themselves 100% (still groans and shakes when sighting scope).. Any recommendations outside of native ARMA 3 and ACE medical? cheers RG

stable dune
# coarse heath no errors in rpt as of now. how to call it only once? if i do that can late zeus...

These Event Handlers must be added to the curator object/module, not the player!

So you could once call it from
initServer.sqf
Executed only on server when mission is started. See Initialization Order for details about when exactly the script is executed.

So it will be attached to curator object once.

I cannot say more because do not know how to check if curator is changed etc.

Because curator EHs are local

tough abyss
#
Heli1 addAction ["open Jukebox", {
_display = (findDisplay 46) createDisplay 'RscDisplayEmpty';

_RscListbox_1500 = (call _display) ctrlCreate ["RscListbox", 1500];
_RscListbox_1500 ctrlSetPosition [0.422656 * safezoneW + safezoneX, 0.434 * safezoneH + safezoneY, 0.149531 * safezoneW, 0.154 * safezoneH];
_RscListbox_1500 ctrlCommit 0;
_RscListbox_1500 = lbAdd ["Fortunate sun"];
_RscListbox_1500 = lbAdd ["ride of the valkyries"];
_RscListbox_1500 = lbAdd ["for what it's worth"];
_RscListbox_1500 = lbAdd ["house of the rising sun"];
_RscListbox_1500 = lbAdd ["i was only 19"];
_RscListbox_1500 lbSetCurSel 0;

_RscButton_1600 = (call _display) ctrlCreate ["RscButton", 1600];
_RscButton_1600 ctrlSetText "Play selected song";
_RscButton_1600 ctrlSetPosition [0.422656 * safezoneW + safezoneX, 0.588 * safezoneH + safezoneY, 0.149531 * safezoneW, 0.033 * safezoneH];
_RscButton_1600 ctrlCommit 0;
_RscButton_1600 ctrlAddEventHandler["ButtonClick",{
    params ["_control"];
    _display = ctrlParent _control;
    _listBox = _display displayCtrl 1500;
    _index = lbCurSel _listBox;
    systemChat format['Song is: %1',_listBox lbText _index];
    playSound3D ["", Heli1];
}]
}];

so ive got this but whenever i run it i get an error type display (dialog) expected code at _RscListbox_1500 = (call _display) ctrlCreate ["RscListbox", 1500]; how would i fix this?

warm hedge
#

Where to start, actually...

tough abyss
#

i should propably include that _display is defined as _display = (findDisplay 46) createDisplay 'RscDisplayEmpty';

warm hedge
#
  1. a display is not something you call
#

So call _display is wrong, just _display is enough

#
  1. lbAdd indeed has a return value, which means you can do this:
_someValue = _ctrl lbAdd "bra bra";```
#

I... think these two are enough for now?

sudden yacht
#

How can i set the probability of presence as a script? A generic parameter for that???

#

something similar to say this setVariable ["#unitcount",10]; ?

tough abyss
#

Dialogs are made of controls. (Usually) Dialogs themselves are root definitions that all the children "controls" inherit" contained within that dialog

tough abyss
#

And if the clients don't need to know about it, just store it in a file

#
this setVariable ["#unitcount",10]; 

Is not correct because "#unitcount" is an invalid variable name

this setVariable ["unitcount",10];

And this refers to "this object' whatever that object is specifically the "magic variable" that contains the object in the init section of an object.

#

So if this is not defined the actual code will not actually work.

wicked sparrow
#

Is there a way to scale the effect strength? And make it not increase over time? (Normal chroma from arma wiki)

["ChromAberration", 200, [0.05, 0.05, true]] spawn {
    params ["_name", "_priority", "_effect", "_handle"];
    while {
        _handle = ppEffectCreate [_name, _priority];
        _handle < 0
    } do {
        _priority = _priority + 1;
    };
    _handle ppEffectEnable true;
    _handle ppEffectAdjust _effect;
    _handle ppEffectCommit 5;
    waitUntil { ppEffectCommitted _handle };
    systemChat "admire effect for a sec";
    uiSleep 3;
    _handle ppEffectEnable false;
    ppEffectDestroy _handle;
};
tough abyss
#

As in adjust the powerX and powerY effect and start at a low level then commit and change it in progress over time?

royal spruce
#

when using everyContainer, it outputs [[class1,obj1],[class2,obj2]]

if you select obj1 in the multidimensional array and define it as a variable, will it be affected by things like deleteVehicle?

stable dune
royal spruce
#

haven't really done any testing with it, just something that popped up in my head

tough abyss
#

_x select 0 or _x select 1 then assign it a variable

royal spruce
#

ahhh, so i'd be selecting the entire array within the array?

tough abyss
#

Yes.

royal spruce
#

large and in charge

tough abyss
#

if you iterate over the array you get the embedded array elements

#

then you either select 0 for the class name

#

or select 1 for the object

#
{
    _class = _x select 0; 
   _vehicle = _x select 1; 
} forEach everyContainer;
stable dune
tough abyss
#

Yep it does.

#

effect ppEffectCommit 20;

#

Would result in it committing over 20 seconds

royal spruce
winter rose
winter rose
stable dune
royal spruce
#

here's what i've been messing around with in console, do keep in mind my end goal isn't to flat out delete everything inside, the last line is to make sure I'm selecting objects correctly (i am not)

_debugListObj = [];
{_debugListObj pushback (_x select 1);} foreach _debugCargo;
{deleteVehicle _x} forEach _debugListObj;```
little raptor
royal spruce
#

yeah, but the issue is that everything isnt deleting, that last line is to make sure im selecting objects correctly

#

i aim to do something else other than deleting everything, but currently im focusing on correctly selecting objects within a multidimensional array

little raptor
#

You're not adding any "filter" tho. What objects don't you want to delete?

royal spruce
#

i have something in mind, but that isnt the issue

#

the issue is objects aren't being selected properly

little raptor
#

Because they're not deleted?

royal spruce
#

yes

little raptor
#

The code selects them "properly"

tough abyss
little raptor
#

Well then that means deleteVehicle doesn't work on them

#

I think they're proxy objects or something

royal spruce
#

what'd be used to delete proxy objects?

little raptor
#

Nothing

#

Afaik to remove backpacks you need to remove everything

#

Then add back the items you didn't want to remove

#

But to be sure print the _debugListObj array, in case something else is wrong with your code

royal spruce
#

it prints fine

little raptor
little raptor
royal spruce
#

pain and suffering

#

ill see what i can do with this info tomorrow

little raptor
#

Welcome to Arma 3 scripting

tough abyss
#

Can GUI class Objects be deformed via script? As in rendering the p3d object then performing an affine transformation?

little raptor
#

Yes. IIRC it was called something like ctrlSetModelScale

tough abyss
#

Apart from ModelSetScale I want to transform a grid mesh over the camera perspective

#

And make it "stick to the terrain" from the cameras perspective.

little raptor
#

There was something for that too iirc

tough abyss
#

Then I am assuming I'd have to transform the grid onto the surface, by snapping it to vector points

#

Basically a deformable mesh overlay on the terrain.

little raptor
#

Not 100% sure if you could apply shear tho

tough abyss
#

If I could transform individual vertices that'd be great.

little raptor
#

So not doable. Unless it's possible via animations but I doubt it

tough abyss
#

controlName ctrlSetPosition [x, y, w, h] probably could use that, but, I'd be drawing each point then, drawing the next very computationally expensive.

#

Don't mind me asking how do you transform screen space to 3D world space?

#

I've seen several "different commends" but unsure of their application

#

like screenToWorld WorldToScreen

little raptor
#

screenToWorld gives the world pos where cursor at the specified ui pos intersects the terrain, and it won't work if there's no intersection with terrain
worldToScreen is obviously for world to ui but it won't work if pos is behind camera

little raptor
#

You can use positionCameraToWorld. I think there were commands for cam axes too but if not you can just do that with positionCameraToWorld

#

The screen offset from cam is 0.1m probably

#

And you can get the fov from getResolution

tough abyss
#

Where does Arma 3's GUI origin point begin left or right corner?

little raptor
#

Top left

warm hedge
little raptor
#

Center is [0.5, 0.5]

tough abyss
#

Should I ever use AbsoluteX or AbsoluteY?

little raptor
#

If you intend to support multiple monitors maybe blobdoggoshruggoogly

tough abyss
#

Interesting.

copper raven
#

safezone works for multiple monitors too, safeZoneXABS, safeZoneWABS

little raptor
#

Isn't that what he meant? thonk

copper raven
tough abyss
#

No I did mean safeZoneYAbs and safeZoneXAbs sorry

copper raven
#

safeZoneYAbs doesn't exist, that's why i was confused 😄

little raptor
#

@stark granite you figured it out?

stark granite
#

Think so!

#

Ty 🙂

#

Just moved into an sqf, ran by execvm

#

solves the issue

little raptor
#

Ok. I was about to reply

stark granite
#

not healthy, but as its for admins only like once per op we're good

#

Ty tho!

little raptor
#

I doubt it will tho

little raptor
stark granite
#

About to test dedi, I may yet be back 😂

#

Better option that execVM that will result in the same thing?

#

e.g: script ran on server

little raptor
stark granite
#

yeah didn't work

#

What would I use in place of an ExecVM to run the script everywhere?

little raptor
#

RemoteExec

#

A few examples are pinned here

stark granite
#

I'll take a look thanks

#

So I cant use RemoteExec to call an sqf?

warm hedge
#

You can. Whatever you can in local is possible

hallow mortar
#

You can't run a script file directly with remoteExec, but you can use it to run execVM which runs the file

stark granite
#

yeah think I got it

#

Will test and see, cheers folkes!

#

Sorted, thanks all, just moved my exec into a remote call as suggested 🙂 Perfect cheers!

slender olive
#

Hey guys, I have what I believe to be a pretty tall ask. I would like to know if I could make a Battlefield Breakthrough-style gamemode using the Arma 3 Sector control gamemode. I'd want:

  1. An Attacking team and Defending team
  2. 1-3 objectives (points) grouped up per major sector that BLUFOR needs to capture from OPFOR
  3. Once the major sector of 1-3 objectives is captured, those objectives are locked and BLUFOR is allowed to move on to the next sector
  4. Moving respawn points; the original respawn points should be disabled before the next ones open for the next sector
#

Is this at all possible?

storm arch
#

How would I get a local variable inside a piece of code out. For example {_bob = "123"} hint str _bob; comes back undefined?

south swan
#

you either return it or make it global 🤷‍♂️

#
_code = { private _bob = "123"; _bob};
_ret = call _code;
hint str _ret;
// or
_code = {private _bob = "123"; globalBob = _bob};
call _code;
hint str globalBob;```
#

or you define a variable in parent scope and then change it in a child scope: sqf private _bob = ""; call {_bob = "123";}; hint str _bob; // hints "123"

storm arch
#

bet

#

ty

pulsar bluff
open hollow
#

also not only the sqf side, also the server side is a problem too, having more than 60 ppl connected to a server is a challange

brazen lagoon
#

what's the best waypoint to give to an air vehicle (helicopter or jet) that you want to patrol an area? the loiter waypoint just has them orbit and seemingly ignores enemies

open hollow
#

i made a script exactly like that, but with out knowing sqf... its quite useless for you sadly :/

brazen lagoon
#

idk if i would say that's 1000 hours but it's def not easy

open hollow
#

i can give you the code of this, but modify it will be a pain with out knowing sqf @slender olive

pulsar bluff
#

but yes the core reason for 1000 is that it takes 1 hr to build, then another 9 to debug and solve for all the edge cases and make it work 100% of the time

#

also the 1000 assumes youre experienced enough to avoid feature creep, which can quickly blow out the 1000 to 2000

pulsar bluff
#

Is there a conventional way to prevent a player from picking up a certain weapon (based on weapon classname)

pulsar bluff
#

yea not to evaluate once picked up, but to actually prevent pickup

open hollow
slender olive
#

At least, enough

royal spruce
#

everyContainer works for groundWeaponHolders right

open hollow
copper raven
#

another thing you could try is disabling the controls of certain weapons in the inventory dialog

tough abyss
#

Why do you have to purge the containers before adding back items? Is this a legacy problem?

#

Or is it just the commands are not fine grain control enough?

brazen lagoon
little raptor
#

or should I say the AI itself is iffy

#

for patrol a cycle or SAD waypoint could work tho

dreamy kestrel
dreamy kestrel
little raptor
#

well then yeah the page already explains that.

#

vehicle overrides both position and objectMapID

#

so you can just use [0,0]

dreamy kestrel
#

I see that, but I see no default: notes, so that was sort of my question, what may be accepted there conventionally speaking.

neat monolith
#

Hello, I have an issue. I have sett the VD limit to a mission to setviewdistance 800; on the initplayerlocal and it works

#

But then players can go and chance their viewdistance once the mission has started

#

Is there anyway to loop that command o force it again? With out makeing the server lag.

stable dune
neat monolith
#

Perfect, and how that it fix the fact that a player can then change it back to 10000 inside the mission?

little raptor
little raptor
#

so just put that line in initServer.sqf

dreamy kestrel
gaunt tendon
#

can anyone help me out with this:
if a client shoots a projectile and while the projectile is traveling the client disconnects
what happens to the projectile?
what will getShotParents return upon impact with a target?

little raptor
#

what happens to the projectile?
nothing. the projectile is local to every client

#

what will getShotParents return upon impact with a target?
if that player object is also "gone", probably objNull?

south swan
#

last time i've checked the similar thing (deleting the projectile on a owner/shooter only) impacts on other clients did nothing. Looks like hit detection is purely shooter-side, so, by that logic, if player disconnects after firing his bullet should do nothing 🤔

gaunt tendon
#

I'm trying o make a kill feed
I managed to get the killer's projectile upon death
https://sqfbin.com/itemowozuvecamicavej

1.- how does null _Killer, CaManBase _Instigator, _Instigator != _Victim happen? (1)

2.- Is there a case where _Instigator isKindOf "CaManBase" (non null _Instigator) will be FALSE? (2)

3.-how does CaManBase _Killer, _Killer != _Victim happen? (3)

little raptor
gaunt tendon
winter rose
gaunt tendon
#

aah... okidoki

winter rose
#

Thanks! 👍

proven charm
#

can you sort hashmap in some way?

#

to be used with foreach loop

gaunt tendon
proven charm
#

yeah maybe I need to turn it into an array to have it in "right" order

gaunt tendon
#

an array to keep the order and loop though with a foreach and the hashmap for lookup

proven charm
#

not bad idea

#

i turned my system from arrays to hashmaps for trying to gain some speed

#

not sure if I did 😆

gaunt tendon
proven charm
#

the wiki implies foreach is slower for hashmaps than for arrays

gaunt tendon
proven charm
#

ok

knotty crow
#
    params ["_group", "_fleeingNow"];
    units _group joinSilent createGroup CIVILIAN;
    {_x playMove "AmovPercMstpSsurWnonDnon";} forEach units _group;
    
}];

This is crashing my game when it triggers, dunno why

#

giving a status access violation

knotty crow
#

oopsies

stable dune
#

You should remove current eh after triggered

knotty crow
#

that's what i suspected

stable dune
#
player addEventHandler ["FiredNear", {
    systemChat "This Event Handler is now removing itself!";
    player removeEventHandler [_thisEvent, _thisEventHandler];
}];

Example from wiki

knotty crow
#

didn't know the fleeing event handler triggered continuously, good to know

#

hmm, still crashing

#
this addEventHandler ["Fleeing", {
    params ["_group", "_fleeingNow"];
    units _group joinSilent createGroup CIVILIAN;
    {_x playMove "AmovPercMstpSsurWnonDnon";} forEach units _group;
    this removeEventHandler [_thisEvent, _thisEventHandler]
    
}];
winter rose
#

this removeEventHandler_group removeEventHandler

knotty crow
#

ooooh

#

duh

#

thanks

#

scope always trips me up

hallow mortar
#

Make sure both dimensions of the image are correct multiples, e.g. 1024x512, 256x256, etc

#

If you've changed the image file you may need to restart the game for it to take effect

#

Good for you, but you may need to restart the game for it to take effect

proven charm
#

Could something like this be possible: ```
#define CHECK __EVAL(profilenamespace getVariable ["TestMode",1])

#if CHECK
globalVar = true;
#endif``` ?

brazen lagoon
tepid vigil
#

How does findEmptyPosition work with finding positions for objects? If I pass it a helipad, will it find an area at least the size of the bounding box of the helipad? I want to find empty positions at least the size of a helipad

hallow mortar
#

That should be how it works, yes. (Take care not to use the Invisible Helipad object as it's actually quite small).
Note that some larger helicopters, like the Huron, are substantially bigger than most helipad objects, so you may need to pass one of those instead if you want to fit one in (or something even bigger if you want a safe LZ...)

granite sky
#

Yeah, it's not super-reliable.

#

It'll also sometimes fail to find an empty position even when there is one.

tepid vigil
#

Would it be much slower to just straight up use a large helicopter then instead? I just need to find open areas in general to spawn groups into

granite sky
#

No idea. The algorithm isn't documented. Larger objects might even be faster.

#

(probably not though)

hallow mortar
#

I'm pretty sure things like BIS_fnc_spawnGroup will automatically avoid placing group members inside trees, so depending on the potential hazards you may not need to check (or may be able to use a simpler check)

tepid vigil
#

Last time I worked with spawning groups BIS_fnc_spawnGroup was kind of bad, can't recall how though. I am using my own function that spawns units in a formation

hallow mortar
#

Well, if you're creating them with createUnit, you should be fine as long as you don't use the "CAN_COLLIDE" special parameter. The default mode for the command is to use the nearest free position, so it will avoid obstacles (mostly)

granite sky
#

Yeah, results of NORMAL are a lot like findEmptyPosition IME

#

Both of them occasionally explode vehicles :P

#

Consider isFlatEmpty for finding places for infantry groups, but note the caveats.

#

As far as I know there are no genuinely good position-finding algorithms in the entire command set :P

tepid vigil
hallow mortar
#

That just means that it will try to convert the position it's given into an ASL position, so you'd want to pass it an ATL position rather than one that's already ASL.

knotty crow
#

still doesn't work but at least it doesn't crash my game now

#

might fix it later

brazen lagoon
#

ic

storm arch
#

_baseRedHQ setVariable ["suppAmount", 2000, true];
[_baseRedHQ, ["Grab Supplies (500)",
{
_total = _baseRedHQ getVariable "suppAmount";
_total = _total - 500;
hint str _total;
}]] remoteExec ["AddAction", 0, true];
Can someone tell me why _baseRedHQ is coming back undefined. It was created as a object earlier in the script

#

Also cant seem to get this to work a intended. Any ideas?

copper raven
storm arch
#

Is there another way to broadcast an addaction publicly without using remoteExec?

copper raven
#

no, this is the best way

#

all you need to do is pass _baseRedHQ as a parameter

winter rose
#

just using params should be fine

copper raven
#

oh, i didn't realise the action was being added to the same thing 😅

long plover
#

This is an odd question, however, I am looking to create a virtual arsenal box that allows for the changing of faces only, subtracting all the equipment and items entirely… anyone aware if this is even possible?

winter rose
simple trout
little raptor
grim ravine
#

👋 Does any know if it's possible for the BIS_fnc_target scoreboard to handle multiple targets or can it only handle multiple players?

open hollow
storm arch
#

Hey I am making a gui and want to have a button run this setloadout code but it keeps erroring outmeowsweats . Action = "call compile player setUnitLoadout (missionConfigFile >> 'MyLoadout')";

#

Any help would be huge!

hallow mortar
#

What error does it give? That's always useful info.
I'd hazard a guess it's because the compile command requires a string input, e.g.

call compile "player setUnitLoadout (missionConfigFile >> 'MyLoadout')"```
(though use double `"` for this since you're writing your code inside another string)
storm arch
#

Even without compile I get an error

hallow mortar
#

What is the error though

storm arch
#

Error call: type object expected code

#

Im using this : "call player setUnitLoadout (missionConfigFile >> 'MyLoadout')";

granite sky
#

Remove the call.

storm arch
#

Thank you

#

it works idk why I thought I needed cal

hallow mortar
#

If you were to use it (in this case, don't)...the error tells you the problem: "type object, expected code". call requires a code type argument - e.g.

call {player setUnitLoadout ... }```
#

Without the braces to indicate a code data type, it's instead taking the output of player as its argument, which is the player object.

storm arch
#

Gotcha! Thank you guys for the help

radiant siren
#

need some help with disableCollisionWith. would like to have every ai member of the same group ignore collisions with each other that are in the same group? if that makes sense?

_group1 = [u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, u11, u12, u13, u14, u15, u16, u17, u18, u19, u20];

_group1 apply {_x disableCollisionWith _x};

I think I have this code wrong?

hallow mortar
#

_x is the current thing that apply or forEach is acting on as it goes through the array, so both references to _x will be the same thing in any given iteration

heavy lily
#

Trying to write a script that damages a specific part on the helicopter in flight, but can't find the listing of helicopter parts to specifically damage, does anyone know of a place that lists out that string/index of helicopter parts I can destroy? Thx

hallow mortar
hallow mortar
hallow mortar
radiant siren
#

okay. yeah they do maneuver well already, just seeing if there was a chance to speed it up any. im just having the ai move to positions that close to one another so instead of a few trying to get around each other was thinking they would just ghost through them haha. thank you though for your help and the information! 🙂

hallow mortar
#

Depending on whether anyone's watching you can just teleport them

radiant siren
fair drum
warm hedge
fair drum
#

@radiant siren #arma3_scripting message

well then you're out of luck. but anyways, thats an example of how you do interations within interations

radiant siren
fringe yoke
#

How can I check if an item will create a DLC popup? Using getAssetDLCInfo but it is returning false for retextures of DLC items

warm hedge
#

There is no exact way to get it unless you make a simple object and use getObjectDLC in it

#

You know, this feature really sucks

manic kettle
#

I want to make a script that executes when a player gets close and not prone. Basically a custom VBED or IED script. I also want this spawned after mission start so editor triggers are out

I belive this can be done with createTrigger but I want this on many potential IEDs. Would this be an 'efficient' method? Worried about affecting performance

fair drum
fair drum
manic kettle
#

at mission start*

fair drum
#

and you would just check the distance of the player compared to the IED object using findIf

#

add in whatever conditionals you want

manic kettle
#

Oh very nice, that could work. Thank you
One more question then...I know how to add event handlers but i'm a little stumped on what is perhaps something more basic...
I know how to pass variables into an event handler, but i'm confused on what i would use to find the object ID / variable name of an object i'm running the code locally on

fair drum
#

when you create an object, there is usually a return value. It is that return value that you want to save

manic kettle
#

Ah right...So
_objectname = createvehicle xxxxxx
then passed on.

Fair enough. But what if the object is editor placed? Curious on this

#

or already exists in the world?

fair drum
#

editor placed objects, if you open up the attributes, you'll see a place where you can name it. That name you give it is going to be a global variable.

manic kettle
#

Yes but i meant without assigning a global variable.
I guess nearestObject would do the trick?

fair drum
#

you can sure. any of those commands would work. same with the terrain object version of the command

#

but you usually don't need to do this. what are you attempting to do?

manic kettle
#

Just trying to understand how it works really, nothing specific on that end

tough abyss
#

what is a control number?

#

if it is complicated how do i figure out a control number?

warm hedge
#

Control number? IDC you mean?

cosmic lichen
#

The IdC?

manic kettle
tough abyss
#

yeah idc

warm hedge
#

Okay, then what do you mean figure out? What are you trying?

tough abyss
#

wait sorry i cant read properly im looking for an index

warm hedge
#

Still doesn't really answered me

tough abyss
#
_RscListbox_1500 = _display ctrlCreate ["RscListbox", 1500];
_RscListbox_1500 ctrlSetPosition [0.422656 * safezoneW + safezoneX, 0.434 * safezoneH + safezoneY, 0.149531 * safezoneW, 0.154 * safezoneH];
_RscListbox_1500 ctrlCommit 0;
_RscListbox_1500 = lbAdd ["Fortunate sun"];
_RscListbox_1500 = lbAdd ["ride of the valkyries"];
_RscListbox_1500 = lbAdd ["for what it's worth"];
_RscListbox_1500 = lbAdd ["house of the rising sun"];
_RscListbox_1500 = lbAdd ["i was only 19"];
_RscListbox_1500 lbSetCurSel 0;

getting an error number expected control

#

sorry had to get something to answer you

warm hedge
tough abyss
#

oh didnt realize that would fix the other part didnt really understand

grim pasture
#

Hi, I got a little problem.
I have a forEach loop over an array of editor objects but I only want to run over the triggers in this array. I can't find a way to filter for triggers only though. Is there a simple way to do that?

pulsar bluff
#

_x iskindof “emptydetector”

grim pasture
fair drum
# manic kettle Thank you for assistance, this is working well so far... Question, it is recomme...

You can do it on the server if you'd like, or you can do it locally.

Depends on what you are going to execute after the condition returns true. If it's a bunch of commands that are local arguments or local effects, it's probably better to keep it local rather than running it on server and remote executing it (if time precision is important).

Typically you'll want to keep most things on the server for individual player performance, but I could see a local use in this case.

grim ravine
#

👋 Wondering if some one could help me or point me in the right direction.

I have a variable my_variable which is equal to 0 that I am trying to set to 1 with setVariable inside a trigger.

this setVariable ["my_variable",1,true];

However when I check if it has worked (diag_log my_variable;, it always comes back as 0 eyeshake2

willow hound
#

You are setting a variable in the namespace of the trigger but you are checking the value of a variable (with the same name) in the missionNamespace.

grim ravine
#

Thank you, just found that wiki page 😄

tepid vigil
#

If I have a list of numbers, and I want to find a number from that list which is closest to a given number, how would I go about doing that, is there a simple way? Example of what I mean:

private _list = [1, 13, 50, 97, 150];
private _nearest = [15] call example_fnc_findNearest;
hint str _nearest // Prints out 13
hallow mortar
manic kettle
#

So does anyone know how to 'activate' a script-spawned IED/explosive? If i spawn one in the editor, the mission starts with it in an ON-state, responding to players. I know in zeus i could activate it using a module. But if i spawn one in a script it is unresponsive and doesnt get damaged. It also doesnt blow up when i set damage to 1. (this doesnt happen if i spawn one in editor and give it a variable name to blow up)

What i'm trying to do:
_IED = "ACE_IEDUrbanSmall_Range" createVehicle _spawnloc;
sleep 5;
_IED setDamage 1;

south swan
copper raven
manic kettle
manic kettle
copper raven
#

yes, that's the actual ammo class

storm arch
#

I might have asked this question before but how do I get a local variable out of an addaction? player addAction ["Test",
{
if (x >= 500) then
{
_redFOB = "VirtualReammoBox_camonet_F" createVehicle

#

how do I get redFOB out of that scope?

fair drum
granite sky
#

In some addAction cases, setVariable on the target object is a better choice.

little raptor
storm arch
#

ty John

warm hedge
open hollow
#

ive started to feed the wiki to chatGPT and its learning!

this was the original response, and the other one is after i teach it alive and speed commands 😄
(also this wiki page: https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting )
if (player != objNull && speed vector player > 1300) then { hint "You are supersonic!"; }

cedar cape
#

how would i go about disabling the abort button

#

im using alive and i need players to press player exit instead of abort

tepid vigil
#

How do I check if a headless client object actually has a client connected to it? Does isPlayer return false if a headless client object is not controlled by anybody?

proven charm
tepid vigil
#

hasInterface always returns false for headless clients

cosmic lichen
#
if (!hasInterface && !isDedicated) then {
    // run on headless clients only
};
#

Using isPlayer with a Headless Client Entity returns true if a Headless Client is connected to the corresponding slot.

tepid vigil
cosmic lichen
#

Yeah no probs

heavy lily
#

anyone know what the variable is for whether a character is injured under ace? Trying to set up a warning when a character gets injured, but can't find that variable

#

only done vanilla scripts so far and I'm lost as where to even look

granite sky
#

Well, you can still hook handleDamage.

#

Just remember not to return anything there.

#

I think this line does fire on each new wound created if you wanted something more ACE-specific for some reason:
[QEGVAR(medical,injured), [_unit, _painLevel]] call CBA_fnc_localEvent;

heavy lily
#

Nah, any injury works, I'll give this a shot

#

I don't actually know half of these commands so time to reserach lol

granite sky
#

actually the best EH to use here is probably Dammaged (sic) because it's global.

#

Can't screw up locality or accidentally override damage results.

granite sky
#

not worked with ACE much? :P

heavy lily
#

I've only ever done vanilla scripting until today lol

#

And just started scripting like 3 weeks ago

granite sky
#

yeah ok

#

you probably want to stick with the dammaged EH then :P

#

but QEGVAR(medical,injured) evaluates to "ace_medical_injured" here

heavy lily
#

ah gotcha

#

When I try and google search damaged it just comes back as damage, and everything i've tried there has failed sadly

#

is my latest

granite sky
#

Q => quote, EGVAR => external global var

#

Ah right so you need an actual var there. Hmm.

heavy lily
#

I'm not like....tied to this code at all, i don't care how I get it to work as long as it works and I can learn why

#

I'm looking at the EH page rn

#

It worked!

#

Thanks, gonna have to read the event handlers page and see what other magic I can use, didn't even know this existed

#

Question if you don't mind though

#

For this code

    params ["_vehicle", "_damage", "_source"];
}];```
could I write it as
```this addEventHandler ["Explosion", {
    params ["Transport_1", "0", "_source"];
}];```

To create an explosion with 0 damage on vehicle with vname Transport_1?
little raptor
#

no

heavy lily
#

okay, got it

granite sky
heavy lily
#

thx, trying to learn this stuff is a bit of a slog, I'm totally good with googling and looking stuff up, but when you don't even know what to search it makes it hard, these two pages are getting bookmarked for sure. Thanks again

granite sky
#

The wiki's a pain because you need to know the command name (or at worst a closely-related command) to look it up.

heavy lily
#

Yeah, so far I've been getting by because someone else has had the same or similar question and I can cobble together what I want

granite sky
#

I often remember that there's a command for something and can't remember the damned name.

cobalt path
#

Is there a script to end scenario with an alternative mission screen? What I mean is I dislike that when mission ends you either have mission successful or mission fail screens, is there a way to execute some custom alternative?

heavy lily
#

What are you trying to do?

cobalt path
#

Maybe end an op with a custom mission screen, maybe a custom png or smth. I dont like default end mission screen

willow hound
trail smelt
#

Could someone help me how to make both halves of this gate open when using the script from the classic lifting gate, so only half opens..
Land_PipeFence_01_m_gate_v2_F

tough abyss
trail smelt
#

I'm trying to open both halves but my version of the script only opens half..

hallow mortar
#

Are you sure it's doors 0 and 1, and not 1 and 2? SQF arrays are 0-indexed but animation names often aren't

trail smelt
#

Thanks i am total idiot...

tough abyss
warm hedge
#

I would like to make a verbal warning once again, try not too offtopic just to blame ChatGPT

tough abyss
#

Sorry.

warm hedge
#

Indeed. Do it there. Or nowhere

tough abyss
#

how do you go about getting a selection of an lblistbox on a button press isnt it just checking _selection against a number?
like this in code term's?sqf 1if ((lbCurSel (uiNamespace getVariable "selection")) == 1) then {//code };

#

Not exactly it needs to control ID or index

granite sky
#

well, if the uiNamespace getVariable is returning a listbox's control or IDC then that would be correct.

#

Generally storing controls in namespaces like that can be avoided though. Consider ctrlParent and displayCtrl.

tough abyss
#
Heli1 addAction ["open Jukebox", {
_display = (findDisplay 46) createDisplay 'RscDisplayEmpty';

_RscListbox_1500 = _display ctrlCreate ["RscListbox", 1500];
_RscListbox_1500 ctrlSetPosition [0.422656 * safezoneW + safezoneX, 0.434 * safezoneH + safezoneY, 0.149531 * safezoneW, 0.154 * safezoneH];
_RscListbox_1500 ctrlCommit 0;
_RscListbox_1500 lbAdd "Fortunate sun";
_RscListbox_1500 lbAdd "ride of the valkyries";
_RscListbox_1500 lbAdd "for what it's worth";
_RscListbox_1500 lbAdd "house of the rising sun";
_RscListbox_1500 lbAdd "i was only 19";
_RscListbox_1500 lbSetCurSel 0;

_RscButton_1600 = _display ctrlCreate ["RscButton", 1600];
_RscButton_1600 ctrlSetText "Play selected song";
_RscButton_1600 ctrlSetPosition [0.422656 * safezoneW + safezoneX, 0.588 * safezoneH + safezoneY, 0.149531 * safezoneW, 0.033 * safezoneH];
_RscButton_1600 ctrlCommit 0;
_RscButton_1600 ctrlAddEventHandler["ButtonClick",{
    params ["_control"];
    _display = ctrlParent _control;
    _listBox = _display displayCtrl 1500;
    _index = lbCurSel _listBox;
    systemChat format['Song is: %1',_listBox lbText _index];
switch(_index) do {
case 1: {hint "2";playSound3D ["fs.ogg", Heli1]};
case 2: {hint "";playSound3D ["Ride.ogg", Heli1]};
case 3: {hint "3";playSound3D [".ogg", Heli1]};
case 4: {hint "4";playSound3D ["rising.ogg", Heli1]};
case 5: {hint "5";playSound3D ["19.ogg", Heli1]};
};
}]
}];

so ive got this and no errors but for some reason none of the hints are activaded and no sound played any ideas?

granite sky
#

The UI looks fine though?

#

What does the systemChat say?

tough abyss
#

the ui isnt the problem the bottom part is it fails to execute code that get's the selection and the button press

#

the switch part is the problem

granite sky
#

So what does the systemChat say?

tough abyss
#

systemChat format ["_index is %1",_index];

#

the selection but that is not the part i am concerned about

stable dune
#

playsound3D needs full path to sound

granite sky
#

Indexes not including zero might be a problem.

stable dune
tough abyss
#

Oh yeah all listboxes all coding in general

#

indexing starts at 0

#

Unless you are weird like zsh syntax

tough abyss
#

if the file is in the mission folder

#

Can you execute the playsound3d from the console?

#

yes

#

Works?

#

there is a gint there regardless

#

the hint is not being executed

#

Is the EH being fired?

#

which eh?

#

ButtonClick

#

yes

#

What index is being returned by SystemChat ?

#

i am only concerned about the case loop

#

the other parts work

#

i know they work

granite sky
#

Did you fix the obvious indexing problem yet?

#

cases should be 0-4, not 1-5

tough abyss
#
_RscButton_1600 ctrlAddEventHandler["ButtonClick",{
    params ["_control"];
    _display = ctrlParent _control;
    _listBox = _display displayCtrl 1500;
    _index = lbCurSel _listBox;
    systemChat format['Song is: %1',_listBox lbText _index];
switch(_index) do {
case 1: {hint "2";playSound3D ["fs.ogg", Heli1]}; // should be index starting at 0 to 4
case 2: {hint "";playSound3D ["Ride.ogg", Heli1]};
case 3: {hint "3";playSound3D [".ogg", Heli1]};
case 4: {hint "4";playSound3D ["rising.ogg", Heli1]};
case 5: {hint "5";playSound3D ["19.ogg", Heli1]};
};
}]
}];

granite sky
#

It's still 1-5?

tough abyss
#

ill try that

granite sky
#

I mean you literally set the index to 0?

#

which is the first entry.

#

nothing selected is _listbox lbSetCurSel -1 for reference.

gloomy dome
#

Currently trying to write a script for use on Official Public Zeus servers that detects when a player deletes a marker and then reports the player's name to the Admin and Zeus. (Made because people wanna mass delete markers to troll)

if (isNil "NS242_MarkerTrollSnitch") then {
    NS242_MarkerTrollSnitch = {
        params ["_trollname"];
        _callout = format ["%1 has deleted a marker", _trollname];
        [[_callout], {
            params ["_callout"];
            _PlayerIsAdmin = (serverCommandAvailable "Logout");
            _PlayerIsForcedZeus = call BIS_fnc_isForcedCuratorInterface;
            if (_PlayerIsAdmin || _PlayerIsForcedZeus || IsServer) then {
                  player globalChat format  ["%1", _callout];
            };
        }] remoteExec ["spawn",0,false];
    };
    publicVariable "NS242_MarkerTrollSnitch";
};

if (isNil "NS242_SetupMarkerTrollCatch") then {
    NS242_SetupMarkerTrollCatch = {
        [[],{
            MarkerTrollHandler = addMissionEventHandler ["MarkerDeleted", {
                params ["_marker", "_local"];
                if (_local) then {
                    _trollname = name player; 
                    [_trollname] call NS242_MarkerTrollSnitch;  
                };
            }];
        }] remoteexec ["spawn",0,true];
        hint "Block I MOD 0 Marker Troll Interception System:tm: Initialized!";
    };
    publicVariable "NS242_SetupMarkerTrollCatch";
};

[] call NS242_SetupMarkerTrollCatch;

The issue is that it keeps triggering a kick from the server for a remoteExec violation #24. Is there any way to get this to work?

tough abyss
#

...

#

You shouldn't be executing scripts on official servers period.

#

You get remote execution violation because the server has configured only specific functions

#

to ALLOW remoteExec

gloomy dome
#

My understanding is that it's authorized for even-numbered Public Zeus Servers

tough abyss
#

Nope.

#

Not as far as I know.

gloomy dome
#

I don't believe that's true

#

Bohemia had to enable it in the first place

#

that's the only reason scripting works in Pub Zeus to begin with

#

It's just the remoteExec that's causing a kick

gloomy dome
tough abyss
#

I'd ask someone else who knows more I avoid public zeus these days.

gloomy dome
#

I don't have access to that sort of thing for Official Public Zeus servers run by BI

proven charm
#

I dont understand why your writing script for other peoples server in the first place

gloomy dome
#

It's an Official Public server that BI has authorized for experimental scripting

proven charm
#

oh ic

manic kettle
gloomy dome
manic kettle
gloomy dome
#

If you mean basically the troll sending the message himself, that was the initial idea. However for some reason, when sending a message using the globalChat or commandChat command, only the sender can see the message and nobody else.

#

Anyway it's way too late, and I've gotta sleep. Feel free to ping me if you send anything else, so that I'll see it in the morning

tough abyss
#

How can I transform UI space elements into World space?

#

As in take camera x, y positions and place it in the world with UI

south swan
mortal forum
#
    _cbo = ((findDisplay 1601) displayCtrl (7));
    lbCLear _cbo;
    _count =  count (configFile >> "cfgVehicles");
    for "_x" from 0 to (_count-1) do
    {
        _veh = ((configFile >> "cfgVehicles") select _x);
        if (isClass _veh) then
        {    
            if (getnumber (_veh >> "scope") == 2) then
            {    
                _class = configName _veh;
                if (_class isKindOf _kind) then
                {
                    _index = _cbo lbAdd(getText(configFile >> "cfgVehicles" >> _class >> "displayName"));
                    _cbo lbSetData[(lbSize _cbo)-1,  _class];
                    _picture = (getText(configFile >> "cfgVehicles" >> _class >> "picture"));
                    _cbo lbSetPicture[(lbSize _cbo)-1,_picture];
                };
            };
        };
    };``` I currently populate a list of all usable vehicles with the above code, however if I wanted to filter to show only 3 vehicle classes what would be the best way to do this?
copper raven
#

_class in _myArrayOfClassnames

south swan
#

and then you can just throw 3 outer loops away blobcloseenjoy

copper raven
#

you can also obviously just do a config lookup and loop the "filter" instead

tough abyss
#

How can I create GUIs using just scripting commands? This seems like the best solution for my problem, creating class roots / GUI elements doesn't have the flexibility I am after. If I want my hud system to work in a more modular fashion.

south swan
#

ctrlCreate and such 🤷‍♂️ The examples on its pages are a good starting point

tough abyss
#

and just findDisplay 46 etc?

#

I don't have to worry too much about messing up other mods do I?

tough abyss
#

Appreciate it. ctrlShow etc make for much better modular creation.

copper raven
tough abyss
#

I am after creating a display

#

and ctrls inside that display

#

More specifically RscTitles cutRsc

#

Is there a way to create RscTitles?

copper raven
#

use RscTitleDisplayEmpty for titles

#

with cutRsc

#

for dialogs, RscDisplayEmpty with createDisplay

#

but for the title, it's a bit tricky with getting the display, if something else uses it (fx., some mod), you will probably break it

tough abyss
#

So I should after creating it

#

register with BIS_fnc_layer to avoid breaking

copper raven
#

that won't solve the issue

#

you'll have to retrieve the display from uinamespace, but if some mod used it previously you'll overwrite it with your new display

tough abyss
#

Okay give it a unique UI namespace name and IDD?

copper raven
#

i thought you didn't want to implement your own classes?

tough abyss
#

You can't create your own IDD with just scripting commands?

copper raven
#

no

tough abyss
#

Ah

#

Could I create an IDD then add data to it?

#

Via ctrlCreate ?

#

Like a stub?

#

Which just contains the IDD data?

copper raven
#

in the config file?

tough abyss
#

Yes

copper raven
#

yeah that would be the best solution

tough abyss
#

Figured as much.

copper raven
#

just basic display data with no controls

drowsy geyser
#

is it possible to detect a door by looking at it?

winter rose
#

nope

#

it's a building, then you need the selection name

stable dune
#

Depends what cursor target return, if that return current house object, you need get selectionpoint

winter rose
#

^ this yep
a door itself is not an object by itself, but a building's element

jade abyss
#

Test Scripting (aka "first)

tough abyss
#

use drawIcon3D like a target recticle paa

#

and it will show all the building mount points including the door

#

You can also do Nearobjects and loop through each one then populate all the "garrison points" with DrawIcon3D (I've done this personally)

proven charm
#

the script is of course invalid

#

could have also wrote sqf a = [100,100]; a set [ 0 ]; a

#

to get that same error

winter rose
#

ah the "2 expected, 2 provided" yeah

mortal forum
#
lbCLear _cbo;

_output = [];
_allConfigGrpSides = ("true" configClasses (configFile >> "CfgGroups") apply {configname _x});
{
    _cfgGrpSide = "West"; // _x = All Factions
    _allcfgGrpFactions = ("true" configClasses (configFile >> "CfgGroups" >> _cfgGrpSide) apply {configname _x});
    {
        _cfgGrpFaction = _x;
        _allcfgGrpCategories = ("true" configClasses (configFile >> "CfgGroups" >> _cfgGrpSide >> _cfgGrpFaction) apply {configname _x});
        _allSideGroupTypes = [];
        {
            _cfgGrpType = _x;
            _allcfgGrpCategories = ("true" configClasses (configFile >> "CfgGroups" >> _cfgGrpSide >> _cfgGrpFaction >> _cfgGrpType) apply {configname _x});
            _allSideGroupTypes append _allcfgGrpCategories;
            
            _index = _cbo lbAdd(getText(_allSideGroupTypes >> "displayName"));
            _cbo lbSetData[(lbSize _cbo)-1,  _allSideGroupTypes];
            _picture = (getText(_allSideGroupTypes >> "picture"));
            _cbo lbSetPicture[(lbSize _cbo)-1,_picture];

        } forEach _allcfgGrpCategories;

        _output pushBack _allSideGroupTypes;
        
    } forEach _allcfgGrpFactions;
    
} forEach _allConfigGrpSides;``` Can anyone guide me on what I am doing wrong here, I'm trying to get all Blufor groups and display them in a RscListBox. Currently I can get all classnames however I believe I'm using the wrong code to put these classnames into the box
south swan
#
_allSideGroupTypes = [];
...
_allSideGroupTypes append _allcfgGrpCategories;
_index = _cbo lbAdd(getText(_allSideGroupTypes >> "displayName"));``` are you trying to `getText` the array?
#

also, you can store config entries directly in the variables without configname-ing them and re-reading 🤷‍♂️

mortal forum
#

_index = _cbo lbAdd _x; I think that is wrong and should be

south swan
#

and i think it's easier to just rewrite the code, tbh. Give me couple more minutes

mortal forum
#

My idea is to get all the groups and display it as a selectable element in a UI to allow spawning of AI

#

I used the above code to get all the classes however breaking it down to display as an individual class in the listbox is my problem

south swan
#
//configfile >> "CfgGroups" >> "West" >> "BLU_CTRG_F" >> "Infantry" >> "B_CTRG_InfTeam_Light" >> "name"


disableSerialization; 
private _display = findDisplay 46 createDisplay "RscDisplayEmpty"; 
private _lb = _display ctrlCreate ["RscListBox", 7]; 
_lb ctrlSetPosition [0,0,1,1]; 
_lb ctrlCommit 0; 
 
private _groupsWestFactions = "true" configClasses (configFile >> "CfgGroups" >> "West"); 
{ 
  private _factionCategories = "true" configClasses _x; 
  private _factionName = getText (_x >> "name");
  { 
    private _groups = "true" configClasses _x;
    private _categoryName = getText (_x >> "name");
    { 
      private _groupName = getText (_x >> "name");
      private _index = _lb lbAdd (format ["%1 >> %2 >> %3", _factionName, _categoryName, _groupName]); 
      _lb lbSetData [_index, str _x]; 
      _lb lbSetPicture [_index, getText (_x >> "icon")];
    } forEach _groups; 
  } forEach _factionCategories; 
} forEach _groupsWestFactions;``` something like this for a starters 🤷‍♂️
mortal forum
#

works perfectly and is much cleaner

#

I don't suppose it can be filtered for infantry groups only around 4 or less in size?

south swan
#

would take some more lines of code, but why not?

mortal forum
#

awesome, hopefully should be the answer to what I need now

south swan
#

https://sqfbin.com/sibiruwawaxokagusuho another neat trick is to run setVariable on the GUI control to store arbitrary data on it, and not only strings allowed by lbSetData (see lines 10-11, 30, 39-40)

mortal forum
#

brilliant thank you for the help

dreamy kestrel
#

Anyone know anything about the sqflint vscode plugins? I seem to have started receiving spurious errors for things like macro expansions. The same natural SQF language code is fine. This seems like a false positive to me, or perhaps one of its dependencies has changed from under it, any of which I do not have explicitly installed in my vscode. Experiencing this LINT false positive in the last day or so.
https://github.com/SkaceKamen/vscode-sqflint
https://github.com/mr-guard/vscode-sqflint (fork)

GitHub

SQF Language server extension. Contribute to SkaceKamen/vscode-sqflint development by creating an account on GitHub.

GitHub

SQF Language server extension. Contribute to mr-guard/vscode-sqflint development by creating an account on GitHub.

tepid vigil
#

Does anybody know if running findEmptyPosition on an area also caches it, or is findEmptyPositionReady required for this to occur?

heavy lily
#

Trying to get a helicopter to come sling load an object after it's been unloaded. Is there a command to get it to go through the animation? I can do setslingload but it just appears under said helicopter

#

Currently looks like this in the device_1 init

 params ["HVT", "device_1"]; 
endinghelo_1 domove (getpos "HVT");
NEED PICKUP HERE
NEED MOVETOPOS HERE
}];```
robust crystal
#

hello there, does anyone have script for music at the start of mission?

heavy lily
#

What I tried to do was set the helicopter fuel to 0 until players reach a point, then use waypoints for the helicopter to "lift cargo" but it goes to the initial spawn point of said object

heavy lily
# robust crystal hello there, does anyone have script for music at the start of mission?

you need to put the music file into your mission folder. Name your music file intro.wav. Then create a folder called "sounds", put the file in there and put this code into your description.ext

{
    class intro
    {
        name = "intro";
        sound[] = {\sounds\intro.wav, 1, 1.0};
        titles[] = {0, ""};
    
    };
};```

Then create a text document called init.sqf and have a line that says ```playmusic "intro"```

That should work
robust crystal
#

ty

fair drum
tough abyss
#

Thats O(n^3)

#

Thats far from optimal

#

It would be better for them to create intermediate arrays then manipulate them in a non-nested loop

sand rune
#

what could be a reason .bikb audio is partially not playing? I have a conversation where the player unit talks to another unit, the player unit's audio is fine. But the response from the other unit only has the text and lipsync, but no audio. The actor classname is properly defined in both, the audio is present and in the right path.

I figured it out, it seems units need to have a radio in order to be able to speak with kbTell, even in proximity voice? Should probably be added as a mention in the wiki.

winter rose
tough abyss
#

Is it possible to make CT_STATIC flash?

copper raven
wind flax
#

What's the best way to make a player hold an animation? Like the "UnconciousReviveMedicBase" animation (laying down)

fallow vector
#

Hey guys! Is anyone else having a funky time with BIS_fnc_EXP_camp_playSubtitles ? Sometimes they work and appear, sometimes they don't :D
(Whilst Testing in single player)

tough abyss
south swan
#

There's exactly 0 looping over the same data, so no O(n^3) 🤷‍♂️

tough abyss
#

I noticed. It didn't take long to execute.

#

I guess this is a case where you can get away with it.

#

Trying to think of a way right now to animate a paa file inside the UI space

#

Wait a minute.

#

I know where I can find that answer.

#

Strategic Map uses animated paa files

#

Is it possible to draw map controls in the screen space?

tough abyss
#

Nvm worked it out

stark bone
#

hi yall, if i was to stop magazines from being deleted once empty of ammunition what part of arma 3 would i have to override in a mod? trying to make repacking mags and carrying loose rounds in the kitbag instead of 20 mags a thing

pulsar bluff
#

you'd be better off abstracting to a virtual magazines system

stark bone
#

hmm thee idea is that it still takes inventory space

#

would it really be that difficult to just not have it remove the mag once it has no rounds left in it?

warm hedge
#

Not really. It is defined in config AFAIK so the zero ammo magazine will be removed from the inventory

stark bone
#

in the config of the mag?

warm hedge
#

It should be

stark bone
#

I'll take a look

warm hedge
#

However it is possible to make a zero ammo magazine via addMagazine command

south swan
#

in config? I was under the impression of most magazine stuff being hardcoded in engine

warm hedge
#

Never messed with this feature, so might wrong

stark bone
#

afaik nothing in arma cant be rewritten except what loads the pbos lmao

#

at least thats my mentality

stark bone
#

oh nice

#

assuming they all inherit from a base i can just change it there ☺️

#

cheers

south swan
#

At least worth a try, because description kinda doesn't make sense 🤔

stark bone
#

though best not make single use "mags" like rockets and GL's repackable lmao

south swan
#

And then you get to fun parts, like west mg belts using disintegrating links and soviets using 50-cartridge segments...

stark bone
#

yeah the idea will be those will be modeled in the mod aswell (well maybe not modeled but coded for sure)

#

because most come with some form of box or bag to hold the rounds in that will serve as the "mag" and for that one you would just need the rounds and the links

spark turret
#

they are reliable, but not pretty or very fast tho 😄

#

just note that the crate has to be on the same machine as the helo, otherwise it can not release it

little raptor
storm arch
#

When setting up respawns, after the second death no map appears for the player when choosing a spawn. How would I go about fixing it? I tried adding a map/GPS to the player on the onPlayerRespawn.sqf file but no luck

#

Is there a setting I can add to the description.ext?

tough abyss
fair drum
storm arch
#

yup

frank mango
#

whats your onplayerrespawn like?

#

Becuase should be a simple thing of saving loadout on death and loading on respawn

#

(providing they have a map when they die)

fair drum
# storm arch yup

post what you have in your description.ext that is related to respawns so far; as well as your onPlayerRespawn.sqf

storm arch
#

I got it to work

hushed tendon
#

Is there a way to get the default ammo type for a weapon? Kinda like when you pick a weapon in the arsenal and it already has a mag in it

warm hedge
#

Get magazine and get its ammo type in the mag?

hushed tendon
#

Well for when you only have the classname of the weapon. I'm getting a list of items in a container and from the weapons in the container I'd like to get the classname of the default magazine if that's a thing

warm hedge
hushed tendon
#

That's a handy command that I didn't know existed. Thanks a bunch meowheart

warm hedge
#

It's added recently ye

hushed tendon
#

oh that would make sense then

pulsar bluff
#

whats the best way to get a magazine class from an ammo class

#

i have the ammo/projectile type, cfgammo doesn't generally have a "displayname", so trying to get the display name of the magazine it came from

#

my method falls over in multiplayer due to "weaponstate" command local only

granite sky
#

You get the same ammo in multiple mags so I'm not sure what output you're after.

hallow mortar
#

Yeah, any given ammo type could be contained in an unknown number of different magazine types, so I don't think there's any way to find out for certain. If you can identify the shooter you could make an educated guess based on their currentMagazine, but finding magazine type based solely on the ammo class is logically impossible.

ivory idol
#

anyone have an example of wastelands money script? im trying to set up a PMC group where I can give my players money and they can use it to buy stuff but I have very limited knowledge of SQL coding and dont want to have them wait months for me to learn it

thorn aspen
#

idk if thats fits here but if i spawn a vehicle via a script is there any way to configure its looks ?

round scroll
#

for the wires mod I use a hashmap to store wires related information. Now in Multiplayer on dedicated server I try to restrict the creation of the hashmap and setup of ropes/wires to the server. But it seems the content of the hashmap is not sent via network via publicVariable. Any ideas how to resolve this?

little raptor
#

Depends how you want it to blink

#

You can use ctrlSetFade 1 for example
And then use ctrlCommit _duration
And then after _duration set the fade back to 0

cold pebble
#

Quick question for someone who has hardly used zeus, is there an EVH for when somebody has opened/closed the zeus menu?

little raptor
#

You can use curaterRegisteredObjs or whatever it was called

#

Then add a destroyed EH to the curator display

cold pebble
#

CuratorObjectRegistered
LALocal
Triggered when player enters curator interface. Assign curator cost to every object in the game. This is the primary method that a mission designer can use to limit the objects a curator can place.

#

Sounds about right 🤔

little raptor
cold pebble
#

Yeah happy days

#

Just wanted something to detect opening the menu so all good over here 🙂

little raptor
round scroll
little raptor
#

Then why broadcast it? thonk

round scroll
#

how does the client access it otherwise?

little raptor
#

Can't you just construct it in init.sqf or something?

#

What does it store?

round scroll
#

the positions of the wires on the map, so i can check later if an airplane is close

little raptor
#

You mean as a grids map?
Anyway I don't see why don't want to make it on the clients. If the hashmap is read only then it means position of the wires is constant. So you can just make the hashmap at init

round scroll
#

yes, that's a good way out, I just need to separate the object creation (createVehicle, ropeCreate) from the position storage I guess

#

is sqfbin down?

#

the setup code is basically: sqf (_wires_globals get "ttt_wireAreas") set [_key, [_p1, _p2, _p3, _p4] ]; (_wires_globals get "ttt_wireObjects") set [_key, [_anchor, _syncedAnchor] ]; (_wires_globals get "ttt_wireRopes") set [_key, [_ropeLeft, _ropeRight] ]; (_wires_globals get "ttt_wireCenters") set [_key, _wireCenter];

#

so _p1 to _p4 are the coordinates of the bounding box where a wire can grapple a hook, the rest are objects

little raptor
round scroll
#

ok, so basically replace the set above with a remoteExec everywhere and fill the maps like that

little raptor
#

Yeah. Or just 1 remoteExec

#

Which sends an array of new key value pairs

#

Which you use on the client's end to make a hashmap from and then merge it into the original map

pulsar bluff
#

whats the best way to use "simulWeatherSync" .. causes momentary stutter when used

#

im thinking when player does common concealable actions ... like when they open map they wont notice stutter

#

or get in/out of a vehicle, or respawn, or tab in/out of arma (although i think tab in/out already executes a simulweathersync event)

#

if not used then using Time multiplier causes overcast desync (rain in clear skies, etc)

pulsar bluff
#

just using weaponstate to get muzzle

#

then _magazines = getArray (configFile >> 'CfgWeapons' >> _muzzle >> 'magazines');

#

then just compare ammo

#

_ammo2 = getText (configFile >> 'CfgMagazines' >> _x >> 'ammo'); } foreach _magazines

#

if (known ammo class from projectile == _ammo2) then {

#

_displayName = getText (configFile >> 'CfgMagazines' >> _x >> 'displayName');

#

this fails in MP however, as i struggle to get the muzzle of a vehicle ... for instance a BTR firing a titan missile, or an air to air missile fired by a jet

willow hound
#

It might be easier to retrieve the displayName and setVariable it in a Fired EH, but that might not be suitable for your use case (plus it introduces its own set of locality headaches).

#
MyObject addEventHandler ["Fired", {
  params [...];
  _projectile setVariable ["displayName", getText (configFile >> "CfgMagazines" >> _magazine >> "displayName")];
}];
willow hound
#

Now that I think about it some more, locality headaches would be reduced (and performance increased) if you were able to build a map of CfgAmmo classes to displayName strings.
Either build a full map for all CfgAmmo entries at the start of the mission (probably unnecessary) or build it dynamically:

MyObject addEventHandler ["Fired", {
  params [...];
  private _class = configOf _projectile;
  if !(_class in MyMap) then {
    MyMap set [_class, getText (configFile >> "CfgMagazines" >> _magazine >> "displayName")];
  };
}];
```Then you can easily retrieve the `displayName` for a projectile with `MyMap get configOf _myProjectile`.
copper raven
#

you'd need to keep a map per vehicle

#

and even then it's unreliable (but fine for most cases i guess)

#

you cannot really get the accurate magazine which ammo came from, from the ammo itself

pulsar bluff
#

incoming missile event, we have the ammo and vehicle

#

weaponstate works perfect for units on foot, but fails for units in vehicle

copper raven
#

you'd need to use the alternative syntax for it

#

but you don't have the data

#

(in that EH)

willow hound
copper raven
copper raven
# pulsar bluff incoming missile event, we have the ammo and vehicle
_vehicle addEventHandler ["IncomingMissile", {
    params ["_target", "_ammo", "_vehicle", "_instigator", "_missile"];
    private _magazine = weaponState [_vehicle, _vehicle unitTurret _instigator, currentWeapon _instigator, currentMuzzle _instigator] select 3;
    hint _magazine;
}];

you could try this, but the issue is that they can shoot & switch gun immediatly which would give wrong output

pulsar bluff
#

the issue with that is weaponState fails in multiplayer ... local args only

#

at least, for that syntax

#

gives an empty result on remote vehicles, works perfectly on local tho

copper raven
#

ah 😅

sudden yacht
#

is possible to say initiate a command through something like side chat?

#

Or system chat?

#

Something with out say a user interface?

willow hound
#

It should be possible with the HandleChatMessage Mission Event Handler.

sudden yacht
#

@willow hound ty

cobalt path
#

Question, is there a script which I would be able to activate on a unit in zeus that would launch a smoke screen around it?

sudden yacht
#

Drop smoke effect on a unit. Or arty smoke.

#

Or create a trigger with smoke effect, an event handler.

#

The list goes on.

cobalt path
#

I wanted to see if there was a way to actually trigger an actual smoke screen effect like we have on some vehicles

fair drum
slender beacon
#

How exactly can I set the mission init via set3DENAttribute?

slender beacon
#

Thanks!

slender beacon
#

Do I have to use save3DENInventory in Eden, or is it ok if I only change cargo?

stable dune
slender beacon
dreamy kestrel
#

Q: I am trying to add some waypoints to a GRP, I think I've got the positions correct, and I see that I add them in. But the units are all behavior rather twitchy. All of them are 'move', and I close the loop with the first position being the 'cycle' WP. I conclude the circuit by doing the _units doFollow _leader command.

winter rose
dreamy kestrel
winter rose
#

vanilla?

hallow mortar
#

What does "behaving rather twitchy" actually mean? What are they doing that's different from what they're supposed to do or from normal Arma AI jank?

dreamy kestrel
#
private _wps = _positions apply {
  private _wp = _grp addWaypoint [_x, _radius];
  _wp setWaypointType "MOVE";
  _wp setWaypointBehaviour "SAFE";
  _wp setWaypointFormation "LINE";
  _wp setWaypointStatements ["false", ""];
  _wp;
};

private _cycleWP = _grp addWaypoint [_positions select 0, _radius];
_cycleWP setWaypointType "CYCLE";
_wps append [_cycleWP];
#

seems to be a function of _wp setWaypointBehaviour "SAFE". when I change that to _wp setWaypointBehaviour "AWARE" the behavior changes. but still no movement between positions. I know there are at least 8 unique positions, and I arrange a "there and back again" cycle pattern.

is this a side effect of being in proximity of surrendered civilian units?

copper raven
winter rose
#

dang, one hour too late
I blame timezones

dreamy kestrel
hallow mortar
#

The waypoint condition is like a trigger condition; the statement is repeatedly checked to see if it returns true, at which point it completes. If you just put false, it can obviously never return true and so the waypoint never completes. It's like writing if (false) then {

dreamy kestrel
#

ah and now we have movement.

#

yeah fair enough; in fact I'd be better served not to spec condition/statement at all if we do not have one.

copper raven
onyx breach
#

Sorry if this is the wrong spot

#

But my server is getting spammed 21:23:44 Duplicate magazine OE_M7290 detected (id 10:10915490) in slots OE_M7290_Muzzle and OE_M7290_Muzzle 21:23:44 Duplicate magazine OE_M7290 detected (id 10:10915490) in slots OE_M7290_Muzzle and OE_M7290_Muzzle 21:23:44 Duplicate magazine OE_M7290 detected (id 10:10915490) in slots OE_M7290_Muzzle and OE_M7290_Muzzle 21:23:45 Duplicate magazine OE_M7290 detected (id 10:10915490) in slots OE_M7290_Muzzle and OE_M7290_Muzzle 21:23:45 Duplicate magazine OE_M7290 detected (id 10:10915490) in slots OE_M7290_Muzzle and OE_M7290_Muzzle 21:23:45 Duplicate magazine OE_M7290 detected (id 10:10915490) in slots OE_M7290_Muzzle and OE_M7290_Muzzle 21:23:45 Duplicate magazine OE_M7290 detected (id 10:10915490) in slots OE_M7290_Muzzle and OE_M7290_Muzzle 21:23:45 Duplicate magazine OE_M7290 detected (id 10:10915490) in slots OE_M7290_Muzzle and OE_M7290_Muzzle

hallow mortar
light nimbus
#

hi again guys! I asked this before but never got an answer I could pull off, but I didn't wanna be a burden so I waited a few weeks to ask again.:

Does anyone know some type of script i could type into the command prompt to change the player unit into another unit like say, Kerry to an OpTre spartan II? Or perhaps at the least just paste the variables that make Kerry trigger cutscenes and level scenes to the spartan who i then possess?

Thank you.

light nimbus
#

uh, yeah actually someone recommended me that last time but I couldn't get it to work for the life of me and I didn't wanna risk being annoying and asking meticulously how to actually work it

#

😅

#

but yeah exactly

#

if I remember correctly that page contained an example command like "Kerry SelectPlayer; (spartan II)", but i tried it repeatedly in different ways and it never sorked