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.
#arma3_scripting
1 messages · Page 36 of 1
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 :|
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.
Oh, I was going to switch our stuff to that. Thanks for the warning.
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
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;
How does that determine whether something's a pylon vs an actual turret (e.g. attack helo gun turret)?
IIRC _baseWeapons there contains all the non-pylon weapons.
Oh, okay
(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.
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!
??? this does work just not on CSLA helicopters. I'm going to scream
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
... 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
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.
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.
just set the units/vehicle to not be dynamically simulated then?
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)
So if I disable Zulu's dynamic support, and just do it manually + some event handlers, that may work
you should always factor in the HC crashing/disconnecting for random reasons
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;
};
};```
.. 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
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
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"
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
// 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
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
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
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.
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
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
@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
If it's a true HashMap it would be accessed in O(n) or O(1)
If you can run a few quick raycast checks, to see if players can see your spawned AI
Then spawn them in places that are 'sensible'
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?
}];```
No this channel is fine
thats where i got it from
!code
How to use SQF syntax highlighting in Discord
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
im guessing i remove the // parts?
Depends where you put the code
init of a prop
As I said it doesn't create the vehicle
Do not forget this line: _vehicle = createVehicle [ "Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE"];
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?
Huh, isn't that the code does?
just double checking before i save
Anytime test
what ive been working on (its crappy but meh)
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/
Bohemia Interactive Forums
GOM_fnc_aircraftLoadout V1.35 by Grumpy Old Man Features: Change serial (tail) number on compatible aircraft (currently supported: Gryphon, Shikra and Black Wasp) Change pylon priority (makes multiple pylons act as a single weapon if they have the same priority) Works with all addon aircrafts wit...
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^
Describe how it doesn't work
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.
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
i. literally, dont. know
i followed the instructions to the t and it doesnt work yet others got it to work perfectly first try
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
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
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:
In your description.ext, do you have a linecpp class CfgCommunicationMenu?
no
Then do what I say:
- add this line into the bracket right after
class CfgFunctionsin 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"```
do i need to add the }; under it as well or?
Under what?
like this? or do i need to add it under
Seems fine
alright
now onto the files..
just drop it in like this or?
its in the scripts folder of the mission
I guess
Show the entire description.ext
I would appreciate if is a text file not a image
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"
What is "MissionDescription\CfgDebriefingContents.hpp"?
bascially just a code from the antistasi mission im editing i dont know what its for
// #include "MissionDescription\CfgDebriefingContents.hpp"
#include "endMission.hpp"
And what's inside endMission.hpp?
bascially just all the variables to end the mission if theres an incompatable mod combination
like combining rhs and cup will end the mission
As I said, what's inside not summary
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};
};
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
said there was an issue with line 63 when i loaded the mission in the selector
I know
i can pack the pbo and send it to you if you like
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
Please
bear in mind its antistasi so yknow..spagetti code in some places outside my control lol
It is not even matter since you are the one who broke it 😛
If your keys are just strings, the hashmap doesn't care how complex it is, it can't see that
// 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)
Use allUsers (or whatever it was called)
allPlayers gets the player objects, which are not initialized when someone connects
allUsers gets the user info
If it's in config, you can create new macros to cancel the grid conversion factor
You can also change the GUI_GRID_H, etc. macros directly
What's broken exactly?
Thanks
the ammo command doesn't seem to work with "gatling_30mm" in kajman weapon because it always returns 0
Does it gives errors?
Seems it called everytime when some1 joins game, because it's called in init.sqf to forEach curators.
So you should call this only once.
I do not know does curator eh get added for every curator (i mean if you give Zeus etc in game). Some1 knowledge maybe could answer this
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...
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
Did you see this page? https://community.bistudio.com/wiki/Conversations
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
CfgSentences is used with BIS_fnc_kbTell, Sentences with kbTell
As per the limited instructions from in game Cfg Sentences
^ what you wrote does not use either of Cfg/Sentences 🙂
:(
if you are fine with writing something like
- dude1 says "soundA"
- wait 10s
- dude2 says "soundB"
it can be done easily 🙂
Yup! That also works :D
is it MP?
Correct! It'll be played on a dedi server
Hi,
Does allUsers count headlessClient entities?
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"];
if you give it a try and report back, I can put the info on the wiki
I would guess "yes"
Thanks Dr.Hou- I mean, Lou! I'll give it a try in a second and report back 💙
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)
it should in theory, as it gets the ID of the users.
According to getUserInfo, you can get the ID of a HC and even get a boolean if its a HC.
All commands related to it relate to player, which all works in HC
Confirmation is never bad though
ah yes, sorry: the a3\ path should be preceded by a @! try @a3\...
Unfortunately still not working!
I'm starting to wonder if this is something on my end 🤔
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)
This is where I got all the necessary info from
as in "you are not uploading the mission to the server everytime, right"
of course, make it work in Eden first before doing any kind of MP test
I don't know if these values are valid but I see no reason why they would not be
Oh yes of course, i'm not insane enough to keep reuploading it to the server ahahahaha
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
can you paste the file path?
@a3\dubbing_f_epa\a_out\01_Start\a_out_01_start_CHA_0.ogg
Thank you kindly 💙
And sorry for the trouble too
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
What the?! It worked now?!
Now both player say and playsound worked
ah
you need to Ctrl+S with description.ext changes yes
(in-game) for the file changes to be reloaded
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?
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
nope; only functions can be reloaded during Eden preview
Thank you kindly for the assistance, I appreciate it! :D
you can use #restart to make them reload iirc, might be mistaken
#restart? as in, filepatching MP mission?
ah, I misundertood then. I though you were refering to the mission files reloading upon a "hard restart" on a mission.
ah nope, we were talking about reloading description.ext changes on runtime
well, that's what I understood so far of course :D
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?
array indices are zero based
In the example, 1 has index 0, 3 has index 1, 4 has index 2 and 5 has index 3, which is then modified
I feel like examples relating to array indexes should use something other than numbers for the array elements, it would be much less confusing
forgot about that, thanks
agree
I don't think it does when it enters or exits the preview mode
it does. @fallow vector probably just restarted the mission, which doesn't work. you need to go back to editor and start the mission again
"I", "II", "III" 😛
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.
https://community.bistudio.com/wiki/doFire and delete the bullet 😄
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
is https://community.bistudio.com/wiki/BIS_fnc_setIdentity fundamentally diferent to the actual setIdentity command?
How come the function is JIP compatible but the command is not?
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.
so if you were to remoteExec the setIdentity command would that make it JIP compat?
I will check indeed, thanks for the insight.
Oh wow, remoteExec does indeed have a JIP flag, wtf
Hi,
Yes, you was right.
It counts headless clients too. 👍
thanks for the feedback!
Anybody have a properly set up sqf function header for SQFLint?
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?
what do you want to do
spawn a defined group, or create a group and put your own units in it?
Create a group with my own units in
I take it the BIS function only works with defined groups?
BIS_fnc_spawnGroup can either spawn a config group or a specified list of unit types
that or createGroup + createUnit yep
https://community.bistudio.com/wiki/BIS_fnc_spawnGroup see parameter: toSpawn
If I put the class names to spawn would it only generate 1 of every class name or would it randomise it?
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.
Okay thank you
And then to name that group would I be correct in thinking GroupName = BIS_fnc_spawnGroup [MyParamatersHere]?
No, that's not the right syntax for calling a function
groupName = [myParametersHere] call BIS_fnc_spawnGroup```
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
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.
added the info, thx!
No problem, thanks for adding to wiki.
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.
Maths
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
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
Is it a server-only trigger?
nope
Is the trigger actually activating in multiplayer? What's its condition?
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
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.
First time using player present not bluefor present, live and learn, thx
keep in mind that playSound3D is effect global, meaning once the trigger activates, you will be playing the sound on every player for every machine.
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.
not sure if there's something broken, just asking if there's anything to change for better script. thanks
no errors in rpt as of now.
how to call it only once? if i do that can late zeus-joiners be able to use the script too?
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
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
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?
i should propably include that _display is defined as _display = (findDisplay 46) createDisplay 'RscDisplayEmpty';
- a display is not something you
call
So call _display is wrong, just _display is enough
lbAddindeed has a return value, which means you can do this:
_someValue = _ctrl lbAdd "bra bra";```
But indeed your syntax is apparently wrong, please take a read here:
https://community.bistudio.com/wiki/lbAdd
I... think these two are enough for now?
How can i set the probability of presence as a script? A generic parameter for that???
something similar to say this setVariable ["#unitcount",10]; ?
Dialogs are made of controls. (Usually) Dialogs themselves are root definitions that all the children "controls" inherit" contained within that dialog
That would be done by storing it in the MissionNameSpace
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.
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;
};
What do you mean?
As in adjust the powerX and powerY effect and start at a low level then commit and change it in progress over time?
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?
Depends how you do your define. Do you have example/ code how you are trying to get current object deleted?
haven't really done any testing with it, just something that popped up in my head
_x select 0 or _x select 1 then assign it a variable
ahhh, so i'd be selecting the entire array within the array?
Yes.
large and in charge
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;
Your answer doest maybe tell much if other doesn't know current select return.
private _myArray = ["first item", "second item", "third item"];
_myArray select 1; // returns "second item"
_myArray set [1, "hello there"]; // _myArray is ["first item", "hello there", "third item"]
https://community.bistudio.com/wiki/Array
https://community.bistudio.com/wiki/select
Pretty sure you can use the ppEffectCommit to increase the commit time which means it's effect overtime
Yep it does.
effect ppEffectCommit 20;
Would result in it committing over 20 seconds
wait... if you do set on the class field of everyContainer, would you be able to replace the class of the object flat out?
it can work in an object. even ;89 51_@'> could work
please use params (Arma 3)
Depending on what you're trying to accomplish, there may be faster ways to do it, but I can't tell without the substance. I mean you should give an example or give a goal of what you are looking for so that someone can tell you what to do and what is the right way to do that thing.
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;```
well you are deleting everything 
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
You're not adding any "filter" tho. What objects don't you want to delete?
i have something in mind, but that isnt the issue
the issue is objects aren't being selected properly
Because they're not deleted?
yes
The code selects them "properly"
Sorry.
{
_x params ["_className","_object"];
} forEach everyContainer _container;
Well then that means deleteVehicle doesn't work on them
I think they're proxy objects or something
what'd be used to delete proxy objects?
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
it prints fine
Then the problem is simply this
And this is the workaround
Welcome to Arma 3 scripting
Can GUI class Objects be deformed via script? As in rendering the p3d object then performing an affine transformation?
Yes. IIRC it was called something like ctrlSetModelScale
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.
There was something for that too iirc
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.
Not 100% sure if you could apply shear tho
If I could transform individual vertices that'd be great.
https://community.bistudio.com/wiki/Category:Command_Group:_GUI_Control_-_Object
This is all there is apparently
So not doable. Unless it's possible via animations but I doubt it
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
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
So screenToWorld is what you should use
But if you need to also get postions not intersecting with terrain you should use your own matrix
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
Where does Arma 3's GUI origin point begin left or right corner?
Top left
https://community.bistudio.com/wiki/SafeZone
Actually take a read this
Center is [0.5, 0.5]
Should I ever use AbsoluteX or AbsoluteY?
If you intend to support multiple monitors maybe 
Interesting.
safezone works for multiple monitors too, safeZoneXABS, safeZoneWABS
Isn't that what he meant? 
AbsoluteY, to me it sounded like they were talking about the actual absolute coordinates 😄 "AbsoluteY" doesn't mean anything in safezone
No I did mean safeZoneYAbs and safeZoneXAbs sorry
safeZoneYAbs doesn't exist, that's why i was confused 😄
@stark granite you figured it out?
Ok. I was about to reply
I doubt it will tho
It might work with 1 client but not with multiple
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
ExecVM is local so yes
yeah didn't work
What would I use in place of an ExecVM to run the script everywhere?
You can. Whatever you can in local is possible
You can't run a script file directly with remoteExec, but you can use it to run execVM which runs the file
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!
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:
- An Attacking team and Defending team
- 1-3 objectives (points) grouped up per major sector that BLUFOR needs to capture from OPFOR
- 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
- Moving respawn points; the original respawn points should be disabled before the next ones open for the next sector
Is this at all possible?
How would I get a local variable inside a piece of code out. For example {_bob = "123"} hint str _bob; comes back undefined?
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"
1000 hours of work, after you learn SQF
painfully true lol
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
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
i made a script exactly like that, but with out knowing sqf... its quite useless for you sadly :/
idk if i would say that's 1000 hours but it's def not easy
i can give you the code of this, but modify it will be a pain with out knowing sqf @slender olive
learning MP code is part of the 1000.. or do u mean server admin/moderation
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
Is there a conventional way to prevent a player from picking up a certain weapon (based on weapon classname)
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Take probably, and doing stuff from there
yea not to evaluate once picked up, but to actually prevent pickup
im having a bad time lately trying yo organize +80ppl events, for some reason a few ppl with connection problems are able to pile up more than 2M of Guaranteed packets and crash/lag the server.
im quite sure that scripts arent the problem, but yea, MP scripting is hard af when +60 players are connected, its quite easy to auto-ddos your server lol
I'm sure I could figure it out if u sent it to me
At least, enough
everyContainer works for groundWeaponHolders right
ngl you will have a hard time to figure it out lol, but here is the code, tomorrow ill try to make an simple mission so you can use it
https://github.com/Flyingtarta/NTK_NsN_Toolkit/tree/master/NSN_mission_27_08_2022.cup_chernarus_A3/gamemodes/node_control
Okay thanks
i don't think it's possible, you can use that EH, and remove it from their inventory if it's not allowed, also put it back in the holder/whatever they picked it up from
another thing you could try is disabling the controls of certain weapons in the inventory dialog
then also you would want to use https://community.bistudio.com/wiki/inGameUISetEventHandler combined with takeWeapon action to prevent that aswell
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?
any suggestions on this? should I give them a bunch of move waypoints and cycle?
last I tried messing with air vehicle waypoints they all seemed iffy
or should I say the AI itself is iffy
for patrol a cycle or SAD waypoint could work tho
Q: am I correct in understanding, if I provide a _target object here, I can give anything empty array or something for _position which should be ignored?
createGuardedPoint [side, position, objectMapID, vehicle]
what target?
vehicle I suppose, I call it _target, a valid object
well then yeah the page already explains that.
vehicle overrides both position and objectMapID
so you can just use [0,0]
I see that, but I see no default: notes, so that was sort of my question, what may be accepted there conventionally speaking.
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.
https://community.bistudio.com/wiki/setViewDistance
_
Client-side max view distance is limited by the server's view distance
_
Perfect, and how that it fix the fact that a player can then change it back to 10000 inside the mission?
when it says any position you can put whatever you want, as long as it's in a position format, which is [x,y,z] (Position3D) or [x,y] (Position2D)
it doesn't give a "default" value because it's not optional so default makes no sense
as prisoner said you should set the view distance on the server
so just put that line in initServer.sqf
this was my confusion. not optional unless vehicle is provided, then it is derived, for instance. but it should be at least a 2D position, then. fair enough. thanks...
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?
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?
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 🤔
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)
_Instigator isKindOf "CaManBase" (non null _Instigator) will be FALSE?
I guess getting killed by an autonomous drone would be one
https://sqfbin.com/ please
ok ill test
mmm ... sorry, what I do with this?
please replace your code with the link to the page in which you pasted your code 🙂 so we don't have a wall of code in the channel
aah... okidoki
Thanks! 👍
This also means that the order in which the forEach-loop processes a HashMap's key-value pairs is not deterministic.
yeah maybe I need to turn it into an array to have it in "right" order
maybe u can use array + hashmap
an array to keep the order and loop though with a foreach and the hashmap for lookup
not bad idea
i turned my system from arrays to hashmaps for trying to gain some speed
not sure if I did 😆
also human readability
the wiki implies foreach is slower for hashmaps than for arrays
so yea when u want to look up data from hashmap in specific order, you can just make an array with the keys in certain order
ok
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
Never ending
oopsies
You should remove current eh after triggered
that's what i suspected
player addEventHandler ["FiredNear", {
systemChat "This Event Handler is now removing itself!";
player removeEventHandler [_thisEvent, _thisEventHandler];
}];
Example from wiki
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]
}];
this removeEventHandler → _group removeEventHandler
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
Could something like this be possible: ```
#define CHECK __EVAL(profilenamespace getVariable ["TestMode",1])
#if CHECK
globalVar = true;
#endif``` ?
what does this do btw? is this surrendering?
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
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...)
Yeah, it's not super-reliable.
It'll also sometimes fail to find an empty position even when there is one.
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
No idea. The algorithm isn't documented. Larger objects might even be faster.
(probably not though)
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)
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
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)
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
Given position will be magically transferred into given position + getTerrainHeightASL value Yeah no thank you, I prefer that my scripts work without magic
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.
supposed to make AI surrender when the flee behavior kicks in
still doesn't work but at least it doesn't crash my game now
might fix it later
ic
_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?
_baseRedHQ does not carry into action's scope
Is there another way to broadcast an addaction publicly without using remoteExec?
no, this is the best way
all you need to do is pass _baseRedHQ as a parameter
https://community.bistudio.com/wiki/addAction see "arguments"
just using params should be fine
oh, i didn't realise the action was being added to the same thing 😅
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?
please don't crosspost, I deleted your similar post in #arma3_editor
It is possible. You would need to build the arsenal yourself.
It doesn't have to be that complicated. You can just make a simple dialog with a combox/list box and an "ok/apply" button
👋 Does any know if it's possible for the BIS_fnc_target scoreboard to handle multiple targets or can it only handle multiple players?
https://github.com/Flyingtarta/Node_control_framework_byFlyingtarta
Here is the code and a demo mission.
i tryed to coment as much as i can, but yea, will be hard to touch any thing with out advanced knowledge of sqf ( its much harder to work with others code lol)
Edit: added a image so anyone else want to try it and modify it https://media.discordapp.net/attachments/723213191437615214/1053776943503388822/image.png?width=1154&height=418
Hey I am making a gui and want to have a button run this setloadout code but it keeps erroring out
. Action = "call compile player setUnitLoadout (missionConfigFile >> 'MyLoadout')";
Any help would be huge!
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)
Even without compile I get an error
What is the error though
Error call: type object expected code
Im using this : "call player setUnitLoadout (missionConfigFile >> 'MyLoadout')";
Remove the call.
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.
Gotcha! Thank you guys for the help
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?
_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
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
Also, check the documentation for disableCollisionWith. An object can only be collision disabled with one object at a time (it's more complex than this but hard to explain), so you can't use it for what you're doing.
oh okay, any work around it?
Different vehicles may have different components. You can see what a given helicopter has by using https://community.bistudio.com/wiki/getAllHitPointsDamage on it.
Not really, no.
AI typically have a pretty loose interpretation of collisions anyway so I wouldn't be surprised if they just phase through each other without you doing anything.
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! 🙂
Depending on whether anyone's watching you can just teleport them
that is definitely an option, ill give it a go, thank you again!
_group1 = [u1, u2, u3, u4, u5];
_group1 apply {
private _unit = _x;
_group1 apply {
_x disableCollisionWith _unit;
};
};
ill try this out. 🙂
disableCollisionWith doesn't let you to disable it for more than one object
https://community.bistudio.com/wiki/disableCollisionWith#Example_3
@radiant siren #arma3_scripting message
well then you're out of luck. but anyways, thats an example of how you do interations within interations
yeah, i just tried, theyre trying to fight their way around each other still haha. thanks for giving it a go for me, much appreciated for the help!
How can I check if an item will create a DLC popup? Using getAssetDLCInfo but it is returning false for retextures of DLC items
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
https://community.bistudio.com/wiki/Biki_Export_Scripts#Arma_3:_DLC_Restrictions
You can check my script if you wonder how I've made the complete list
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
I've actually wanted to get this put into a BIS function for a while now. This could be easily modified for that purpose. I use a modified version for myself when making missions.
Are you going to make more IEDs during the mission? If so, will zeus create them or will you script their creation?
No. The idea is these are specifically not placed by zeus. IE placed randomly along a road etc. Scripted creation by checking along roads or other criteria
at mission start*
then if you are going to create them and store them in a global array, you can create a EachFrame event handler when the local player loads the mission and do the check inside of that
and you would just check the distance of the player compared to the IED object using findIf
add in whatever conditionals you want
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
when you create an object, there is usually a return value. It is that return value that you want to save
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?
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.
Yes but i meant without assigning a global variable.
I guess nearestObject would do the trick?
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?
Just trying to understand how it works really, nothing specific on that end
what is a control number?
if it is complicated how do i figure out a control number?
Control number? IDC you mean?
The IdC?
Thank you for assistance, this is working well so far...
Question, it is recommended to run this on local players rather than the server? I was thinking of using distance to allplayers
Looks like 'CBA_fnc_addPerFrameHandler' allows event handlers every x seconds rather than every frame, that seems very useful
yeah idc
Okay, then what do you mean figure out? What are you trying?
wait sorry i cant read properly im looking for an index
Still doesn't really answered me
_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
I have already answered you
oh didnt realize that would fix the other part didnt really understand
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?
_x iskindof “emptydetector”
thanks
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.
look up its config
👋 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 
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.
Thank you, just found that wiki page 😄
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
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;
maybe try https://community.bistudio.com/wiki/triggerAmmo 🤷♂️
it should be ACE_IEDUrbanSmall_Range_Ammo
So this triggers the ammo off, which is not exactly what i was looking for but thank you for showing me this
This was it. Thanks!
I guess it always needs to be ended with _Ammo eh?
yes, that's the actual ammo class
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?
Also, createMine is the other way to do this.
Global variable seems reasonable there.
In some addAction cases, setVariable on the target object is a better choice.
No. It's just a name.
You should find the ammo class in cfgAmmo. You were using a cfgVehicles class, which are just objects
ty John
Config is 100% irrelevant with the restriction, AFAIK it comes from the p3d path
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!"; }
how would i go about disabling the abort button
im using alive and i need players to press player exit instead of abort
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?
maybe this: https://community.bistudio.com/wiki/hasInterface
hasInterface always returns false for headless clients
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.
I've just noticed it also mentiones it on the isPlayer page https://community.bistudio.com/wiki/isPlayer
I was a bit unsure about it when reading the isPlayer page, so I decided to ask just to be sure
Yeah no probs
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
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;
Nah, any injury works, I'll give this a shot
I don't actually know half of these commands so time to reserach lol
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.
what is the QEGVAR portion?
not worked with ACE much? :P
I've only ever done vanilla scripting until today lol
And just started scripting like 3 weeks ago
yeah ok
you probably want to stick with the dammaged EH then :P
but QEGVAR(medical,injured) evaluates to "ace_medical_injured" here
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
Q => quote, EGVAR => external global var
Ah right so you need an actual var there. Hmm.
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?
no
okay, got it
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
The wiki's a pain because you need to know the command name (or at worst a closely-related command) to look it up.
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
I often remember that there's a command for something and can't remember the damned name.
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?
What are you trying to do?
Maybe end an op with a custom mission screen, maybe a custom png or smth. I dont like default end mission screen
@cobalt path The vanilla system supports some customization: https://community.bistudio.com/wiki/Arma_3:_Debriefing
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
So, I'm not quite understanding what you want here, could you clarify which of the following you want?
- You want only half of the gate to open
- You want both halves to open but only halfway
I'm trying to open both halves but my version of the script only opens half..
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
Thanks i am total idiot...
ChatGPT will make coders dumber. That I am sure of. The reason you write a lot of generic functions or boilerplate is not to make it easier, but to understand certain things. Letting ChatGPT do it all for you, defeats the purpose of learning...
I would like to make a verbal warning once again, try not too offtopic just to blame ChatGPT
Indeed. Do it there. Or nowhere
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
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.
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?
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
So what does the systemChat say?
systemChat format ["_index is %1",_index];
the selection but that is not the part i am concerned about
playsound3D needs full path to sound
Indexes not including zero might be a problem.
playSound3D [getMissionPath "mySound.ogg", player]; // to play a mission directory sound
Oh yeah all listboxes all coding in general
indexing starts at 0
Unless you are weird like zsh syntax
it functions with just "a.ogg" in the box
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
_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]};
};
}]
}];
It's still 1-5?
ill try that
I mean you literally set the index to 0?
which is the first entry.
nothing selected is _listbox lbSetCurSel -1 for reference.
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?
...
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
My understanding is that it's authorized for even-numbered Public Zeus Servers
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
I'd ask someone else who knows more I avoid public zeus these days.
i believe you must white list remoteExec commands: https://community.bistudio.com/wiki/Arma_3:_CfgRemoteExec
I don't have access to that sort of thing for Official Public Zeus servers run by BI
I dont understand why your writing script for other peoples server in the first place
It's an Official Public server that BI has authorized for experimental scripting
oh ic
You're not going to be able to remoteexec on servers or other players for reasons stated. You might be able to settle on just hinting yourself?
Yeah I was thinking the same, but I'm hoping for a better option to pop into mind
I know little about zeus servers. How about making yourself say something in chat?
"X is a troll"
Side or even just group chat for any other zeus
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
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
https://community.bistudio.com/wiki/positionCameraToWorld if you want to have a fixed "depth" offset
https://community.bistudio.com/wiki/screenToWorld for the first terrain collision
_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?
you already have the _class, so just use that with in
_class in _myArrayOfClassnames
and then you can just throw 3 outer loops away 
you can also obviously just do a config lookup and loop the "filter" instead
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.
ctrlCreate and such 🤷♂️ The examples on its pages are a good starting point
and just findDisplay 46 etc?
I don't have to worry too much about messing up other mods do I?
Appreciate it. ctrlShow etc make for much better modular creation.
if you use the mission display, it will be a title basically in a way (overlay), if you need interaction, use https://community.bistudio.com/wiki/createDisplay with it being it's parent
I am after creating a display
and ctrls inside that display
More specifically RscTitles cutRsc
Is there a way to create RscTitles?
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
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
Okay give it a unique UI namespace name and IDD?
i thought you didn't want to implement your own classes?
You can't create your own IDD with just scripting commands?
no
Ah
Could I create an IDD then add data to it?
Via ctrlCreate ?
Like a stub?
Which just contains the IDD data?
in the config file?
Yes
yeah that would be the best solution
Figured as much.
just basic display data with no controls
is it possible to detect a door by looking at it?
Depends what cursor target return, if that return current house object, you need get selectionpoint
^ this yep
a door itself is not an object by itself, but a building's element
Test Scripting (aka "first)
I've actually used simple script to check all the mount points in a building
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)
out of curiosity i noticed this weird scripting error. no big deal but just interesting: https://postimg.cc/DJ5V7Ww7
the script is of course invalid
could have also wrote sqf a = [100,100]; a set [ 0 ]; a
to get that same error
ah the "2 expected, 2 provided" yeah
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
_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 🤷♂️
_index = _cbo lbAdd _x; I think that is wrong and should be
and i think it's easier to just rewrite the code, tbh. Give me couple more minutes
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
//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 🤷♂️
works perfectly and is much cleaner
I don't suppose it can be filtered for infantry groups only around 4 or less in size?
would take some more lines of code, but why not?
awesome, hopefully should be the answer to what I need now
https://sqfbin.com/elejujadurasicowutuy seems to work
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)
brilliant thank you for the help
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)
Does anybody know if running findEmptyPosition on an area also caches it, or is findEmptyPositionReady required for this to occur?
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
}];```
hello there, does anyone have script for music at the start of mission?
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
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
ty
@robust crystal don't forget to make the file path a string though. And when to use and not use a leading slash on the path.
Yikes how often does this execute?
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
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.
Worth a note on the Conversations article indeed! Thanks for the finding
Is it possible to make CT_STATIC flash?
also you don't need to recompute all that everytime, cache the data
What's the best way to make a player hold an animation? Like the "UnconciousReviveMedicBase" animation (laying down)
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)
3DEN Enhanced if you are only doing it to AI
That's linear for group classes. And there are roughly 240 of them in vanilla iirc
There's exactly 0 looping over the same data, so no O(n^3) 🤷♂️
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?
Nvm worked it out
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
you'd be better off abstracting to a virtual magazines system
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?
Not really. It is defined in config AFAIK so the zero ammo magazine will be removed from the inventory
in the config of the mag?
It should be
I'll take a look
However it is possible to make a zero ammo magazine via addMagazine command
in config? I was under the impression of most magazine stuff being hardcoded in engine
Never messed with this feature, so might wrong
afaik nothing in arma cant be rewritten except what loads the pbos lmao
at least thats my mentality
At least worth a try, because description kinda doesn't make sense 🤔
though best not make single use "mags" like rockets and GL's repackable lmao
And then you get to fun parts, like west mg belts using disintegrating links and soviets using 50-cartridge segments...
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
you can force the helicopter to slingload an object, iirc it gets teleported underneath the helo.
You can also use a slingload waypoint and have the helo pick it up. The AI is pretty good at that
example for force slingload with a "must be above 5 meters and close to object": https://youtu.be/5wgo4m1uy1Q
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
only manually
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?
Is it computationally expensive to do so?
do you have any of the respawn settings in the description.ext yet?
yup
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)
post what you have in your description.ext that is related to respawns so far; as well as your onPlayerRespawn.sqf
I got it to work
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
Get magazine and get its ammo type in the mag?
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
Maybe use this command
https://community.bistudio.com/wiki/compatibleMagazines
That's a handy command that I didn't know existed. Thanks a bunch 
It's added recently ye
oh that would make sense then
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
You get the same ammo in multiple mags so I'm not sure what output you're after.
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.
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
idk if thats fits here but if i spawn a vehicle via a script is there any way to configure its looks ?
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?
Not much
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
Quick question for someone who has hardly used zeus, is there an EVH for when somebody has opened/closed the zeus menu?
You can use curaterRegisteredObjs or whatever it was called
Then add a destroyed EH to the curator display
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 🤔
BIS_fnc_initVehicle iirc
Just make sure you return nil at the end so you don't modify the costs (hopefully that won't break it either)
Yeah happy days
Just wanted something to detect opening the menu so all good over here 🙂
Even if it did work (which afaik it should) you shouldn't do that anyway
Instead of broadcasting the whole hashmap just broadcast the changes
it's initialized at mission start and then basically read only
Then why broadcast it? 
how does the client access it otherwise?
the positions of the wires on the map, so i can check later if an airplane is close
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
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
Well if the createVehicle stuff can also happen during the mission then just sync the changes as I first said.
Instead of using set (or other hashmap cmds) directly make a function e.g. Te_fnc_addPosToHashmap
Then remoteExec that function
Which just sends what you want to add
ok, so basically replace the set above with a remoteExec everywhere and fill the maps like that
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
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)
hmm, unfortunate ... i get exactly what i want in editor ... basically the "displayname" of the projectile
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
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")];
}];
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`.
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
incoming missile event, we have the ammo and vehicle
weaponstate works perfect for units on foot, but fails for units in vehicle
you'd need to use the alternative syntax for it
but you don't have the data
(in that EH)
Why?
because an ammo can be shot from multiple magazines/different weapons
_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
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
ah 😅
is possible to say initiate a command through something like side chat?
Or system chat?
Something with out say a user interface?
It should be possible with the HandleChatMessage Mission Event Handler.
@willow hound ty
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?
Drop smoke effect on a unit. Or arty smoke.
Or create a trigger with smoke effect, an event handler.
The list goes on.
I wanted to see if there was a way to actually trigger an actual smoke screen effect like we have on some vehicles
no, you'd have to just make a function that throws a bunch of smoke grenades out around the unit instead
How exactly can I set the mission init via set3DENAttribute?
Thanks!
Do I have to use save3DENInventory in Eden, or is it ok if I only change cargo?
Do you use
https://steamcommunity.com/workshop/filedetails/?id=623475643
?
That open many options in editor via attributes.
And no you do not need use save if you modify object cargo via editor, or via config
I do.
I'm trying to write a script to create and set up entities according to a list.
My friend once used addItemCargoGlobal or so to fix a class error, and they didn't need to use the save command. I wanted to know if it's consistent
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.
addWaypoint → "MOVE"
addWaypoint → "MOVE"
addWaypoint → "MOVE"
addWaypoint → "CYCLE" (near the first "MOVE")
that's how it should be, no scripting needed
right but I am doing it procedurally.
vanilla?
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?
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?
you put false as wp condition, so it never finishes iirc
dang, one hour too late
I blame timezones
ah I see, so it never advances to the next WP? thanks I will check that out...
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 {
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.
if cond is true, and the waypoint is actually completed depending on whichever one it is
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
This is to do with the config of whatever weapon uses OE_M7290 magazines; it's not a script problem and it's unlikely to be specific to your server unless you've modified that mod. The issue has been reported before and may receive an engine fix in the future (<#arma3_feedback_tracker message>)
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.
you mean like: https://community.bistudio.com/wiki/selectPlayer ?
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