#arma3_scripting
1 messages ยท Page 749 of 1
If someone can hop in VC with me this is getting out of hand, none of my scripts are working
How would I get a battleship to fire on a area of the map?
#arma3_scenario just create waypoint "Fire" and sync to ship
Oh.. its that easy?
@coarse dragon better just utube it.. https://www.youtube.com/results?search_query=arma+3+order+bots+fire
Hey, I am currently trying to make a RHS-SU-25 make a bombing run on a designated target (by waypoints).
Current script is this forceWeaponFire ["rhs_weap_fab250", "LoalAltitude"];
Looked the weapon type up and added the one which was shown on the list. Under Mode (firing mode) there is just a "this. Might this a problem with "LoalAltitude"? Why doesnt it work with "this" then?
Currently thinking of maybe switching the pylons somehow to vanilla bombs and use the base script I found, but would there the addMagazineTurret or smth like that work?
this means you should pass the weapon class itself as the firemode
it does
Yet it don't
well how are you using it?
How does preloadObject work? I don't see an indicator for locality on the wiki page, or really an explanation of how it functions.
i would treat that as a local command
I'm having a hard time figuring out if it's a setting for the object or for the machine rendering it
after a player takes control of a unit, the units face gets swapped to the players face. is the data about which was the units old original face completely discarded, or does that information still live somewhere during the mission?
Does anyone know what are the common culprits for BIS_fnc_init being evaluated to false and causing BIS_fnc_preload to timeout? Created a new MP Type module and starting to loose the plot.
Symptoms:
- Connect to server and play mission - no problem here; server and clients preload <300ms
- Complete mission or issue #restart server command
- Mission starts. Server preload finishes <300ms. Client preload times out at >20000ms - only load screen active is BIS_fnc_preload but BIS_fnc_init check returns false throughout preloading
edit:
no (custom) functions running in the preinit or postinit phases. Only 1 module placed running a custom function - module function is spawned. No script errors in the RPT
What you ask is not related to regex at all. regex is used to find a pattern in text.
maker types are defined in config
in mission.sqm
oh right
well type is used for many other stuff, not just markers, so you still need to check the config, ordataTypein mission.sqm
but anyway, the regex is:
type *= *"(\w+)"
if there are no spaces before and after = you can just write:
(?<=type=")\w+?(?=")
which won't highlight the type=" part
If a unit has allowDamage set to false, are there any event handlers relating to a unit being hit that still get called? I want to make a unit that runs away if hit but cannot be killed/actually damaged. I tried Hit, but it seems it didn't work
have you tried handledamage?
tho it's probably the same story
use handleDamage to prevent damage directly, instead of allowDamage false
there are some weird cases that handleDamage can't handle tho 
damage from projectiles and other external sources should be ok
Will that work with ACE, though?
aslong as it's not something with flipping vehicles upside down, it's ok from my experience ๐
I mean I did try it earlier and it didn't work, but I'll try again in case I did something wrong
I noticed that sometimes my AI units die from "fall damage". but it works like 99% of the time, and I have no idea why that 1% of the time it fails 
handleDamage should still trigger even if damage is disabled
I remember that ACE had a weird damage bug despite the fact that I had disabled damage
I think it was passing the damage from handleDamage 
if so it should work then
Here's hoping ๐ค
if it doesn't work I'm pretty sure ACE should still have its own "handleDamage" event.
if so you might be able to use that instead
It does! Thank you so much
Hello,
what would be the script to play the mission completed ending cinematic on the server without actually ending the mission?
I want the player to know the mission is over so they can disconnect, but I want to save their loadouts so I need the mission to keep running.
you can end the mission and execute a script?
(Mr Kain, let me tell you I appreciate your legacy)
An oldtimer, eh? Nobody remembers the game these days. ๐
Anyhow, I'm not good at scripting, I need to export them manually. I'v tried the export mission.sqm in the zeus, but it won't export players loadouts, only AI. Is there a script to export players loadouts?
well how do you want them? is stored in your user profile ok?
This is what I'm doing: I'm hosting a mission on my dedicated server. The mission is zeused by me. I want to carry over players equipment in between missions, so they start a new mission with the equipment they had on themselves at the end of the previous mission.
okay, now I see ๐
you could save the loadouts in e.g profileNamespace (saves even after restart) or uiNamespace (lost after game shuts down) or "just" the clipboard
profileNamespace setVariable [
format ["KAIN_%1_%2", missionName, systemTimeUTC],
allPlayers apply { [name _x, getPlayerUID _x, getUnitLoadout _x] };
];
```something like this
So, I can execute this script at the end of the mission and this will create a file somewhere (like a log with all the loadouts)?
@little raptor do better plz
well what about the case where a player disconnects? they lose their loadout
also:
format ["KAIN_%1_%2", missionName, systemTimeUTC],
how are you gonna fetch this again? system time changes
allVariables
well what about the case where a player disconnects?
server-side
he manually runs the script at the end of the mission
format ["KAIN_%1_%2", missionName, systemTimeUTC]
```can be replaced by```sqf
format ["KAIN_%1_end", missionName]
```ofc
yeah that's what I meant
if I were doing it I'd be using a hashmap on the server, with [uid, loadOut] pairs. I'd update this HM with every time someone disconnects. (tho not sure if the loadout can even be fetched then?)
once the mission ends (using MPEnded EH), I'd save the hashmap to profile namespace...
so yeah it's a long answer and I'm not in the mood 
I can just execute it manually before the mission ends. And I just need the loadouts of surviving players that are still connected.
then just use what Lou wrote
Ok, I will try it out. Thanks.
can i turn a units string representation back into a reference to the unit
you can use a hashmap for example
or use setVehicleVarName and assign unit to that var
_unit setVehicleVarName "varName";
missionNamespace setVariable ["varName", _unit];
//get:
missionNamespace getVariable [str _unit, objNull];
but ofc you better avoid this whole nonsense 

I mean you should never str objects. always pass them directly
normally i wouldnt but currently i am trying to collect any number of 3den entites in the editor, based on their attributes, and store them somewhere to be processed after the game has started
i am trying to avoid giving them variable names
they have their string representation in the editor tough, so i was wondering if i could use that
well their "string representation" is gonna change after the game has started
the game recreates those objects so there's no guarantee what their string representation is gonna become
Why dont you just use layers for that, it is easier to split your stuff into layers then you can access these layers' objects using these commands:
https://community.bistudio.com/wiki/get3DENLayerEntities for 3DEN
https://community.bistudio.com/wiki/getMissionLayerEntities for Mission (watch out, server only)
Plus, it is more productive, you can easily add/remove any object easily from related layers in case of change is needed.
can i write a macro where i get an element from an array
since # means quote
oh right i forgot the about select command
I'm trying to use the ED-1 Science drone ( "B_UGV_02_Science_F") as a prop. Small problem: when set to a simple object, a permanent light is created. How do I delete this light?
maybe through animation I'd wager
Intriguing! How do you mean?
see animateSource (https://community.bistudio.com/wiki/animateSource)
or hideSelection perhaps (https://community.bistudio.com/wiki/hideSelection)
Thanks. We'll investigate ๐ฉโ๐ฌ
Does animateSource have an effect on simple objects?
If I expect a hashmap in params, is it correct?
private _buildings = param [0, [], [[]]];
no
private _defaultHashMap = createHashMap;
params [
["_buildings", _defaultHashMap, [_defaultHashMap]]
];
Thanks ! ๐
Is there anyway to add 2 actions to one interaction?
this addAction ["Interact", {systemChat (selectRandom
[ "Text1", "Text2", "Text3", "Text4" ])
["task1","SUCCEEDED"] call BIS_fnc_taskSetState},
nil, 1.5, true, true, "", "alive _originalTarget", 4, false, "", ""];```
An action is an interaction, do you mean make an action do 2 things instead of 1 thing? If so, of course, it can do unlimited things based on your code included in it.
Yeah I mean whats the proper format to get 2 actions under an interaction
What do you want to do exactly?
Have the system chat display a random text along with task being set to succeeded
If I through a && it will run but will give a debug message
Simply end your first line with ;
So if I wanted to add more to an interact I'd just end each param with a ;?
and here I was doing the most.
not each param but each statement or each time you use a command(to simplify), you need to end that line with ;
I appreciate it
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting Check out to see some basics. Know your tool. ๐
There might be another page for basics but I don't know.
@pearl night wazzup
profileNamespace setVariable [
format ["KAIN_%1_%2_end", missionName],
allPlayers apply { [name _x, getPlayerUID _x, getUnitLoadout _x] };
];
```but this won't create a file at all
it will store data in your user profile
you can get it using getVariable
ok, where should I put the getVariable comand?
profileNamespace getVariable "KAIN_theMissionName_end";```
of course replace theMissionName with what missionName was at the time
and I can just give the command as a zeus through the execute code module?
When I use the script, it should give me the variable in the right top corner right?
no
what you want to do should ideally be scripted in-mission, either that or give your players access to an Arsenal really
Are you asking about this?
Well, basically, I'm hosting a mission on my dedicated server. The mission is zeused by me. I want to carry over players equipment in between missions, so they start a new mission with the equipment they had on themselves at the end of the previous mission.
I wanted to export them by hand, but now I'm trying to make through the variable.
well, you could
using player UID and array correspondence
but meh
oh well servernamespace is a thing right
I forget that..
altho I never got to use it...
profileNamespace no? because serverNamespace will disappear as soon as the mission exits iirc
profileNamespace is not a suitable thing for such operations, a player can cheat with it.
that's him, the Zeus
Too bad that the Export Mission SQF module exports only AI and not the players.
hmm, he ll store all loadouts to his profile... Mmmmmhhhh...
Ah I was wondering that... I hoped it would work like profileNamespace...
Well if there is no other way...
In 15 minutes, the winning team will be the winner
I want a script that defines a combat zone between two teams, and whoever controls the combat zone within 15 minutes will be the winning team
ok
how do you approach the issue?
idk if this is the right channel to spit ball but
it'd be cool if there was a way via sqf to change the sky colour
afaik stuff like that is defined in CfgWorlds which I know can someone be fiddled with via scripting
Anyone got a template lying around for making a mod. (I have read all I can come across). However I cannot get it to work. All I need is a "minimum Viable example".
It is literally just a FSM file but I want it in the "Mod-format" so it can be uploaded to Steam-workshop". Kinda like the Smarter tanks FSM.
I had linked you the minimum viable example. What is the problem?
It doesnt work
I mean it is packed and signed
The image loads
However on mission-init nothing happens
so you say you got a fsm file and how is it being initiated?
class CfgFunctions
{
class DCO
{
class init
{
postInit = 1;
};
class VehicleFSM
{
ext = ".fsm";
recompile = 1;
};
};
};
what does FSM contain?
/*init.sqf*/
//[450, true, true] call DCO_Fnc_Vehicle;
sleep 1;
[450, true, true] execFSM "Functions/Fn_VehicleFSM.fsm";
hint "DCO_Vehicle_FSM has loaded dudes and dudettes";
Oh it is a big file
It does work fine when placed in a mission
and initiated from init.sqf
is that all that is in this file?
The Vehicle.fsm file contains about 5k lines
Yeah, it should give a sys-chat saying "FSM loaded"
And plenty stuff in the RPT file
but nothing
Config wise, you do not define a file for functions to be read from, thats the first thing. You need a file for init.sqf to be found.
Wouldnt that be cfgFunctions.hpp?
Config.cpp:
class CfgPatches
{
class MyAddon
{
// Meta information for editor
name = "DCO Vehicle FSM";
author = "Tally";
// Minimum compatible version. When the game's version is lower, pop-up warning will appear when launching the game. Note: was disabled on purpose some time late into Arma 2: OA.
requiredVersion = 1.60;
// Required addons, used for setting load order.
// When any of the addons is missing, pop-up warning will appear when launching the game.
requiredAddons[] = { "A3_Functions_F" };
// List of objects (CfgVehicles classes) contained in the addon. Important also for Zeus content (units and groups) unlocking.
units[] = {};
// List of weapons (CfgWeapons classes) contained in the addon.
weapons[] = {};
};
};
#include "cfgFunctions.hpp"
no you need to target the function's file (ie. fn_init.sqf within init class)
or even better target the parent class with the folder fn_init.sqf is in
#include "cfgFunctions.hpp" just copy pastes ur cfgFunctions.hpp file into config.cpp and does nothing else.
oh, can u show me?
something like ```sqf
init = someVarName;
?
is the function inside a folder called DCO ?
I do have postInit = 1
DCO is the TAG
ok, trying again
OK, so new error popped up
script all/fn_init.sqf not found
this is the path:
\functions\all
and there I do have the file
even tried copying a all folder to the root dir
but no luck
show new cfgFunctions
class CfgPatches
{
class MyAddon
{
// Meta information for editor
name = "DCO Vehicle FSM";
author = "Tally";
// Minimum compatible version. When the game's version is lower, pop-up warning will appear when launching the game. Note: was disabled on purpose some time late into Arma 2: OA.
requiredVersion = 1.60;
// Required addons, used for setting load order.
// When any of the addons is missing, pop-up warning will appear when launching the game.
requiredAddons[] = { "A3_Functions_F" };
// List of objects (CfgVehicles classes) contained in the addon. Important also for Zeus content (units and groups) unlocking.
units[] = {};
// List of weapons (CfgWeapons classes) contained in the addon.
weapons[] = {};
};
};
#include "cfgFunctions.hpp"
cfgFunctions:
class CfgFunctions
{
class DCO
{
class all {
class init
{
postInit = 1;
};
class VehicleFSM
{
ext = ".fsm";
};
};
};
};```
So the file path from root should be... all/init.sqf
not functions/all/init.sqf
You are working on config now, not description.ext
If you want it to stay as functions/all/init.sqf
you need to utilize file attribute...
I tried copying a all folder to the root dir
What if I just DM you a zip-file containing the project
?
Kinda hard to explain stuff without being able to send screenshots etc
Just utilize the file attribute and be done with it, it is better anyways in the long run. Just type in the directory you want and it will be done.
If you are having trouble with this sort of stuff, the easiest way is to check in game with fileExists command to see.
https://community.bistudio.com/wiki/fileExists
How?
Any one have idea on this, using this via "Addaction" to Halo AI
private _target= _this select 0;
private _crew = fullCrew[_target, "cargo"];
{
_x spawn {
params ["_trooper"];
if (local _trooper) then {
unassignvehicle _trooper;
moveout _trooper;
waituntil {sleep 0.5; isNull objectParent _trooper && getPosAtl _trooper select 2 < 100 || !(alive _trooper)};
if !(alive _trooper) exitWith {};
private _position = getPosATL _trooper;
private _para = "Steerable_Parachute_F" createVehicle _position;
_para setPosATL _position;
_trooper moveInDriver _para;
};
};
sleep 1;
} forEach _crew;
issue is when you eject like 50 ai server goes to like 25 fps while eject is happening
if you have no idea just try not to post useless information (that some one might take for good advise )
i am trying to make an init script that deletes everything in a certain area
so i am trying to use the deleteAT and inAreaArray together, but its just giving me errors, any ideas?
deleteAt deletes elements from an array. It doesn't delete anything from the game
ah, that does explain why its not working not doing what i want it to haha
The error is because you're using them wrong syntax-wise
That's different from "not working"
Because mounting/ejection/vehicle creation are slow processes.
You have to add sleep between each ejection
u read the code at all ?
Did you?
lol i wrote it
do you have any suggestion in how i could get it work?
if not i will just keep looking around, thanks in advance
actually that's i what i am trying atm. the problem is i need to delete everything in the given area, so
i am trying to use deleteVehicle with inAreaArray as of now actually
so? if you fill the gaps correctly it should work
i am just asking if he had any suggestions
and if not i am going to keep working at it
the problem is, i dont know how to fill the gap
which is what i am attempting to do
what do you have currently?
it might be better to just run one of the commands that return nearest objects instead of inAreaArray
Do you use it in a loop? (e.g. forEach)
well i am doing
this addaction["Delete Vehicles", {vehicle forEach vehicle inAreaArray ["targetAO", 50, 50, 0, false, -1]; deleteVehicle vehicle;}];```
your forEach is wrong
did you look at the wiki examples?
actually it's not just the forEach. your inAreaArray is wrong as well
this addaction["Delete Vehicles", {{deleteVehicle _x} forEach (vehicles inAreaArray "targetAO");}];
anyone have some tips for getting into arma scripting composition and public zues not server side? i already know quite a bit just looking for ways to learn more
u all doin good scripts, keep on keeping on
@little raptor Is there anyway to change MG 42's ammo amount, like change 50 to 1500 rounds? I tried "setAmmo" script like this one: solder1 setAmmo [fow_w_mg42_deployed_high_ger_heer,1500]; but it does not work.
cause you are the best, I think
well I would answer anyway. but when you ping me your message seems to be specifically addressed to me, and other people might not answer you, even tho they can
ok, I see
but this one still does not work
does BIS_fnc_playVideo have to be executed on each client?
you sure you don't have a typo?
typo?
you've written solder1 instead of soldier1
oh, i will try again
no, not working,
I tried to use this: "
unit setAmmo [weaponOrMuzzle, count]"
how did you get that weapon name?
it is a static mg42 with a soldier
well you have to get the name of the weapon first
what you just said is the name of the vehicle
oh...
you can do something like this:
weapons staticWpn apply {
staticWpn setAmmo [_x, 1500];
}
still does not work, I put this line in init of MG42(static type) also in the gunner, but it still does not work
it doesn't magically give you 1500 ammo. the weapon must support that
Can triggeracivated and alive house. Be in the same trigger?
because it has local effect
wdym?
I'm doing a task. One is to blowup a house. And then 2nd one is to escape.
So was wondering if the one trigger can have both of them commands init for the condition
yes you can have both
this && !alive house
Triggeractivated task1 && !alive house;
What is the difference between #lightreflector and #lightpoint ? The first one appeared on the wiki recently, and is only mentionned for setLightConePars and setLightVolumeShape commands
Reflector is directional
As setLightConePars takes a local argument and has local effect, I'd assume a reflector has to be spawned locally too ?
yes, createVehicleLocal
I have this on my screen right now
but it does not mention the reflector
I just wanted to lift any doubt
a reflector is a classic old lightpoint, but directionnal
yes
this tutorial could be updated to reflect the #lightreflector introduction
If I want a ship to fire at a area on the map. Do I need to put the name of the weapons in the script
Good day. I'm researching the revive system, could you share the values of
bis_revive_ppColor
bis_revive_ppVig
bis_revive_ppBlur
?
If I understand it right, they are not global variables, but macro defined in 'defines.inc' ๐ค
Afaik they are global vars
If they're written like that they're most likely not macros
macros are typically written in uppercase only
Thanks, got it
wat?
Me want boatie to fire.
Nothing works
what boat?
typically you have to give them a target, then make them fire using fireAtTarget, or doTarget and doFire
A ww2 battle ship to bombard a town
quick question: does the playVideo function allow for the video to be played in the field of view of all players?
most of the examples of it involve it being played on a screen.
I need it to be more of a cutscene.
fireAtTarget ["LIB_UK_ARMY", "groundtarget"]; how wrong is this?
you have to remoteExec the function
it is by default
size: Array - (Optional, default [safeZoneX, safeZoneY, safeZoneW, safeZoneH])
Excellent! The guide wasn't entirely clear on the default.
that's fullscreen
does it just start playing automatically, or is there a way to get it to fade to black, fade back in?
if you know GUI coordinates it is clear
I do not, as I am big dumb-dumb noob figuring this out as I go
but thank you for assisting
it doesn't fade iirc. it just plays, and goes away when done
ah, I'll have to do something to try to get it to do so, then.
very
i cannot get the hang of this stuff
thaaaaat'll do it.
you could put it all together in a .sqf file and then execvm it on every machine
at least that's what my pea brain would do
excellent, now I can do it in game rather than trying to get all of them to play a youtube video 
oh dear
all of this is because my play group is a bunch of morons and I'm trying to idiot proof it for them
big case of herding cats
if it's the group i'm thinking of I believe I've seen a couple documentaries
fireAtTarget [groundtarget,"LIB_UK_ARMY"];
just look at the wiki page and its examples.... 
groundtarget is just the name of the target object
also you're missing the left arg (sourceVehicle)
and I don't know where you got the LIB_UK_ARMY from, but I'm 99% sure that's not a weapon/muzzle name. if you don't know it just don't include it. it's optional
name of the tank i made immotral
then you write something like:
my_ship fireAtTarget [immortal]
my_ship is name of the ship
and you should not write something like this in init, if that's what you're doing
the conditions better?
what condition?
ok, where is best place to write it
ยฏ_(ใ)_/ยฏ
just use doTarget and doFire instead. I doubt you'll be able to use this command properly
my_ship doTarget immortal;
my_ship doFire immortal;
if you want to try it in object init replace my_ship with this
if that doesn't work try in anywhere but init (e.g. trigger activation)
if that still doesn't work your ship may not be able to target/fire at all
Is it possible to add and enable zeus for #adminLogged at runtime, by running server-side code from the start menu?
drop the ;
I done two separate triggers and it works lol thanks
i'm having an issue using BIS_fnc_unitPlay, hopefully someone can find the error or the sqf gods show me the error the moment i post it
#include "..\data\alphaFlightPath.sqf";
#include "..\data\bravoFlightPath.sqf";
//#include "..\data\charlieFlightPath.sqf";
private _helis = [
[alphaHeli, _alphaFlightPath],
[bravoHeli, _bravoFlightPath]
//[charlieHeli, _charlieFlightPath]
];
{
[_x # 0, _x # 1] spawn {
params ["_obj", "_data"];
_obj engineOn true;
[_obj, _data, [], true] spawn BIS_fnc_unitPlay;
waitUntil { isTouchingGround _obj };
sleep 3;
_obj engineOn false;
};
} forEach _helis;
this is my code, the ...FlightPath.sqf files contain the private variable _...FlightPath that have the unit capture data
problem: bravo is doing the alpha flight path
yes, the capture data is not the same
they follow the same path with like a second delay
the gods have spoken, i recorded alpha's flight path while i thought i was recording bravo's ๐ญ
Hello guys, is it possible to stop players from joining your server with different branches?
Like the Profiling branch
Could use
https://community.bistudio.com/wiki/productVersion
Though it says "Stable" if its profiling/performance builds, you can probably check the build index and check if its beyond a certain number. May have conflicts with actual arma updates though.
Something like this (Not Tested)
// Run on server init
serverVersion = productVersion;
publicVariable "serverVersion";
// Run on client
if (productVersion # 2 == serverVersion # 2 && productVersion # 3 > serverVersion # 3)then{
//Probably not on default build
};
They actually fixed it, disregard.
Can just check productVersion # 4 == "Stable"
Hi, any way to access a debug console while at the Arma 3 main menu?
Not that I know of*
mods perhaps
Ok, I'll make a mod, thanks
got a question, could someone point me in the direction of a repair and rearm script, you know where they drive onto a like heli pad lookin square and it re arms?
im a noob to this lol
over time or immediately?
look on bi forums think there is already one or two i got an edited version but can not share because script sometime buggy
immediately
like a re arm, repair type thing
i modded dayz for years, trying my hand at arma now lol
you can simply use a trigger for that if you're making a mission. use something like this in the trigger activation code:
{_x setDamage 0; _x setFuel 1} forEach thisList;
thats exactly what im doing making a mission, so i can just add that on the heli pad or whatever item i wanna use?
so repair would be setrepair?
there's no setRepair. setDamage is for repair
so i can just add that on the heli pad
no. you make a trigger around the helipad and use the code in there
ok, i got ya, is there a good website that has a list of these scripts
idk. if you want to learn scripting see those links
Simple question but maybe not an easy answer
Is there an effective way to block off entry into a certain area that effects some players and not others?
I basically want to make a somewhat interactive and visual weapon and kit select at the start of an op by having "room of guns" but limited to different classes.
essentially I don't want the medic being able to run into the room filled with sniper rifles or every rifleman magically having an LMG and such
I know I COULD restrict each item individually but I was hoping for a way of just making a barrier based on what role is selected that way I could modify the contents of a room without having to add checks on each item there
more specifically I am intending to set these up in shipping containers with one end open so that I could in theory just block off one end with whatever barrier I can
you can make a simple object locally that only has a geometry lod, so it's invisible
then use that to block players
iirc there's already a vanilla object for that
don't remember its class name
but it's probably under VR objects
Simple enough to check if someone is in slot "Alpha 1-1 Autorifleman", "Alpha 1-2 Autorifleman" etc to make said object appear/disappear as needed?
you could do that too yes
I'm entirely new to scripting is the problem but I'll start digging into it
you can put something like this in the player inits (change per role):
this setVariable ["unitRole", "medic"];
and then make an initPlayerLocal.sqf file in the mission root, and add this:
params ["_player"];
switch (_player getVariable ["unitRole", ""]) do {
case("medic") : {
barrier1 hideObject true; //remove barrier
};
}
adjust roles and variable names (in that script only barrier1, don't change other vars) before using the script
Eden editor has an "Invisible Wall" object you can use to block areas off. You can even have an addAction on it, in case you want to (for example) add a Virtual Arsenal to something without ACE.
rather specific, so this is more of a hope and a prayer.
does anyone know how to get a return on the current hellfire trajectory mode on ace hellfires
anyone who can help me with this?: https://forums.bohemia.net/forums/topic/237703-help-a-thicko-understand-weights-in-loot-system/ greatly appreciated and sorry for the stupid question
where's the script?
so is your question about how to convert the numbers to percentages?
Well basically I don't understand how much the weights impact things in the config file. My understanding was that it went up to 1 (being 100 percent chance of something spawning?) and then 0.50 would be fifty percent or something like that, but obviously in the example the guy who made the script uses numbers such as 10, 4, 5 etc.
weights don't have to add up to 1, or be 1
if you want to convert those numbers to percentages, first sum them all, then divide all of them by the sum
that gives the "chance" of spawning each item
but you don't need that anyway
I see, thank you for clarifying
it's more like a mental calculation
e,g, if FAK is 10, but medikit is 1, the chance of getting a medikit vs FAK is 1 to 10
That's a much better way of thinking about it
That makes sense to my little old head
Thanks a lot mate
np
My coop mission has a Support Requester (CAS) module. In order to make it interesting for all the players, I'd like to give each one a go when it is used.
Right now I've got a simple expression that picks the first player:
[] spawn {
if ( isMultiplayer ) then {
_modCAS synchronizeObjectsAdd [(selectRandom (allplayers arrayIntersect units _playergroup))];
};
};
How would I repeat this after the CAS run has been completed? Is there a way to return a variable?
if (player getVariable ["casUse",true]) then
{
[] spawn {
if ( isMultiplayer ) then
{
_modCAS synchronizeObjectsAdd [(selectRandom (allplayers arrayIntersect units _playergroup))];
player setVariable ["casUse",false];
};
};
};
Instead of worrying about repeating it, just make sure the same player cannot use it more than once, this will do that assuming your code executes locally from a player
- Nevermind. I will try this.
player getVariable ["casUse",true]
This information is accessible (to the server) in the missionNamespace?
if you broadcast it, yeah.
Right, eg publicVariableServer . I'd like this rotation to repeat, once all the players have had a go. Might be a pain to make it JIP, now I think about it ๐ฌ
how do you jump to config entry starting from an object typeOf instead of configFile root?
https://community.bistudio.com/wiki/config_greater_greater_name
the example uses configFile
Do you mean something like
configFile >> "CfgVehicles" >> typeOf(vehicle player);?
If you're trying to omit configFile, I don't believe you can
how would i put a pause in between animations? i am thinking using the sleep command but don't think i can use it on an individual unit
Are you unable to use something like
_unit = unit1;
_unit switchMove "firstanimation";
uiSleep 2.1;
_unit switchMove "secondanimation";
```?
i plan on using it in public zues im pretty new to incorporating animation commands i believe that would need to be in a file correct?
wait no it wouldnt i read through a bit more
ill see
Anyone here got some experience using CBA? I am looking to add some checkBoxes / sliders in eden editor. I just need a hint / script whatever I can reverse engineer to get started
The purpose is to change some values on a mod
switch it on / off etc
im using this the script with the animations im using its giving me a ; missing error at _unitswitchMove[#]AcrgPknlMstpSnonWnonDnon_AmovPercMstpSrasWpstDnon_getOutHighZamak";
hashtag indicates error message
_unit = unit1;
_unitswitchMove"AcrgPknlMstpSnonWnonDnon_AmovPercMstpSrasWpstDnon_getOutHighZamak";
uiSleep 2.1;
_unit switchMove "ChopperLight_L_In_H";
Theres no space in _unitswitchMove - _unit switchMove
more like
_type >> "stuff"
there is a config >> name command in wiki but the description contradicts the example
my mod requires checking at runtime whether a vehicle or man has a weapon with a particular property
As far as I know, theres no way to just pull the config of an object, unless you specify which config to look in.
Most people will use something like
switch true do {
case(isClass (configFile >> "CfgMagazines" >> _className)): {};
case(isClass (configFile >> "CfgWeapons" >> _className)):{};
case(isClass (configFile >> "CfgVehicles" >> _className)):{};
case(isClass (configFile >> "CfgGlasses" >> _className)):{};
};
Could also use the third syntax of https://community.bistudio.com/wiki/isKindOf
To differentiate
the sleep command is having a generic error ive searched on bi forums other than that no real idea why it is causing it though
It means you're using it in an unscheduled context (in a call instead of spawn)
So you would have to spawn the script that you have the sleep in
just the ui sleep or the whole script?
I would say the entire script
ok thanks a lot im learning a lot
how would i make all players in a plane forcibly eject and deploy parachutes upon the plane reaching a certain waypoint?
I understand the line im looking for is [something] spawn BIS_fnc_PlaneEjection;
i dont know what the 'something' is supposed to be (the plane or the waypoint) and how id use this command
see https://community.bistudio.com/wiki/BIS_fnc_planeEjection - it is for jets ejection
bugger. not sure what the right command would be then.
action ["eject", theVehicle]
with an unassignVehicle of some sort
{
_x action ["Eject", _vehicle];
[_x] remoteExec ["unassignVehicle", _x];
sleep 1;
} forEach units _groupToEject;
```should do
awesome... does this go in the "on activation" of the waypoint?
no, it's a general script - you have to define vehicle and units to eject
got it
where would i place it tho?
sorry if thats a stupid question, complete newbie to arma scripting
the "on activation" field is ok. You need to fill in the gaps on lou's code.
_groupToEject - Has to be the group name going to eject
_vehicle - Has to be the plane from the units will eject.
thanks a ton, ill give it a try now.
^
"error generic error in expression"
it kicks me out but not any AI in my group
though i dont really need it to work for AI just other players
missing then ๐
what's the code and where do you execute it?
onactivation of the waypoint. the code is the one lou posted
working too much in Enforce Script ๐
traitor ๐
well in that script _vehicle and _groupToEject are not defined
you need to spawn it
i did define them
hey, i've been struggling with my mission. i have 2 things i want to do - 3 tasks that require you to destroy a building 92 of them are spawned, 1 is default) and i need a car that will drive to the last known patrol's position which i imagine to be a 10-15 second timer that writes down the location of a car and then the move waypoint is placed on those coordinates. while i can google the first thing, getting last known coordinates and driving to them was a struggle for me
did you spawn it like sharp. said?
dont know what that means - how do i spawn it
I didn't get what you need help with exactly. the position? the waypoint? the task?
last known coordinates
which coords?
last known patrol's position
which patrol?
i need a car to drive to the last known position of another car. i came up with this:
_lastKnownPos = getpos aicar1
which will check for the last position every 15 seconds and then if trigger is activated then
_aisquad2 move _lastKnownPos
coords of patrol
a car circling around
opfor
im pretty bad at coding so if i have mistakes - please forgive me
better not use getPos. use ASLtoAGL getPosASL
but apart from that it's correct
does it not work rn?
neveeer!
well, i dont know what modules to use and how to make it correctly. i need a module that checks the position every 15 seconds if the group is alive (like they will tell their position on radio), i think it's gonna be a trigger that has a condition of game logic present ```sqf
!alive aisquad1
and on activation
```sqf
_lastKnownPos = getpos aicar1
``` (or ASLtoAGL) and the other one is a trigger that activates when the group is dead and it will have ```sqf
_aisquad2 move _lastKnownPos
correct?
sorry to interrupt any way to stop ai randomly turning when doing animations? ive checked the animations in animation viewer and they dont turn right at all
_unit disableAI "MOVE"
_myUnit disableAI "MOVE";
will prevent the unit from moving or turning
any way to make that start and then stop when animation's done?
what modules
you mean trigger?
checks the position every 15 seconds if the group is alive
you can't usealivewith groups. you need to check its members
this means all units are dead
units aisquad1 findIf {alive _x} < 0
so
!alive units aiteam1 > 0
```?
no
okay, thanks
any way to make that start and then stop when animation's done?
use an event handler or a loop or something
how many animations do you have?
how do you play them?
wait 1 ill get the script
[this] spawn {
params ["_unit"];
_unit switchMove "GetIn_Vertical_Unarmed";
Sleep 3;
_unit switchMove "ChopperLight_L_In_H"
};
if you are using
playMove
to do the animation, you can use eventhandlers like
AnimChanged
or
AnimDone
[this] spawn {
params ["_unit"];
_unit disableAI "MOVE";
_unit switchMove "GetIn_Vertical_Unarmed";
Sleep 3;
_unit switchMove "ChopperLight_L_In_H";
_unit playMoveNow "ChopperLight_L_In_H";
_unit addEventHandler ["AnimDone", {
params ["_unit", "_anim"];
_unit enableAI "MOVE";
_unit removeEventHandler ["AnimDone", _thisEventHandler];
}]
};
Question: In laser attachments (in general, any custom attachment that can emit a laser), is there a way command wise to get the origin of the laser without having to manually setpositions relative to the player?
no
Ahoy! Quick question
when I just moveOut a bunch of units in a helicopter, the helicopter will attempt to pick them back up instead of continuing
any simple way to prevent that? or will I have to figure out something with waypoints?
use leaveVehicle/unassignVehicle
unassignVehicle _x; moveOut _x still does the same thing
what about leaveVehicle?
who do you move out?
one second
[vehicle this] spawn {
group (crew param[0] select 2) leaveVehicle param[0];
{moveout _x; sleep 1;} forEach units group (crew param[0] select 2)
}
This happens on waypoint activation, with a flying taru that has a bunch of paratroopers riding along
the select 2 is just a magic number because pilot+copilot+1 gets me first passenger
[vehicle this] spawn { {unassignVehicle _x; moveout _x; sleep 1;} forEach units group (crew param[0] select 2) }
This didn't work either (with or without the unassignVehicle)
and what happens is that the helicopter just stops and lands and the paratroopers get back in the helicopter, when I actually want it to just continue and the paratroopers to do their thing
first of all, why do you do param [0]? just use a single params ["_veh"]
second of all, your code is running schd. so the leader can order his units back into the vehicle. you must unassign them all at once (tho not 100% sure if it will work):
params ["_veh"];
_1stCargo = fullCrew [_veh, "cargo"]#0#0;
isNil {
group _1stCargo leaveVehicle _veh;
units _1stCargo apply {unassignVehicle _x};
};
{moveout _x; sleep 1;} forEach units _1stCargo;
Is there anyone way to force a ai aircraft to drop bombs then rtb and despawn with rhs?
Is there a way for mission debriefing to show after mission end in a Persistent dedicated server? After testing, if persistence is off, debriefing shows. Is there any scripts or code I need in order for the debriefing to show or is this not possible with a persistent server?
Could just use the CAS module and link it to a trigger. There won't be an rtb then despawn, seems useless, but could use the in-game CAS module for ambient strikes or whatever
wait what's up with that #0#0?
select 0 select 0
oh, didn't know you could use # instead of select xD
they're not exactly identical
# has higher precedence than select. and # is only for selecting an index from the array, unlike select that does multiple things
but it does the same thing
tells me it doesn't know _1stCargo
then your unit wasn't in the cargo seat
also I edited the code
not sure which one you used
the older one had an error. _1stCargo wasn't defined in the outer scope
I don't get it
it says undefined variable in expression, but it should be in scope though
use your old method then:
crew _veh select 2
*sigh* if only arma had console.log...
it has diag_log and systemChat ๐
ah...
I actually just remembered
it's not "cargo" but "gunner"
so yea, fullCrew with "cargo" returned empty array so that didn't work
dunno how arma thinks "undefined variable" is a helpful description of what happened, but oh well ๐
...aaand the code runs now
and the helicopter still waits and does nothing
but the infantry at least doesn't care about the helicopter anymore, so I guess it's half a win
then probably related to the rest of your code
I mean, there is no rest of my code
other than the _ = spawn {} surrounding the whole thing
then how's the heli supposed to move? 
waypoints
and how does it land?
this is just an empty scenario with one player and the heli
it's not supposed to land, just continue and move off-map
I can add code to despawn it or something once I get the basics to work
you just kick those poor units out in the middle of the air? ๐คฃ
yes
how many waypoints have you added?
two
is the second one far enough from the 1st one?
about two or three km, yes
you're running the code in waypoint completion statement?
yep
[vehicle this] spawn {
params ["_veh"];
private _1stCargo = fullCrew [_veh, "gunner"]#0#0;
isNil {
group _1stCargo leaveVehicle _veh;
units _1stCargo apply {unassignVehicle _x};
};
{moveout _x; sleep 1;} forEach units _1stCargo;
}
That's the current code
I'm pretty sure the helicopter still has it stuck in his head that he wants to pick the infantry back up
[vehicle this] spawn {
params ["_veh"];
private _1stCargo = fullCrew [_veh, "gunner"]#0#0;
isNil {
group _1stCargo leaveVehicle _veh;
units _1stCargo apply {unassignVehicle _x};
};
group _veh addWaypoint [blablaPos, -1];
{moveout _x; sleep 1;} forEach units _1stCargo;
}
add a systemChat or something that runs in a loop and tells you what waypoints the pilot has
[vehicle this] is vehicle group, so no good
vehicle leader this perhaps
waaait.
this is the leader in Condition - is it as well in OnActivation?
group leader - it's OK. my bad for the false alarm
https://community.bistudio.com/wiki/Magic_Variables#this_2
WAT
I just added a variable name to the pilot
waypoints group pilot is giving me [] now
but right after starting the mission
when it very clearly still has a waypoint
but the pilot is in his own group with the copilot, and that's the group with the waypoints
you sure you didn't assign the vehicle or some other unit to it?
that's the copilot tho ๐
but anyway you're using the group, so shouldn't matter
I had this in my console watch list: deleteWaypoint [group (crew taru select 0), 0]
okay got rid of that, back to debugging
This is the waypoint list before dropping infantry:
[[O Alpha 1-1,0],[O Alpha 1-1,1],[O Alpha 1-1,2]]
ah, and it stays the exact same afterwards
what's the waypoint type and condition?
[0,1,2] apply {waypointType [group pilot, _x]}: ["MOVE","MOVE","MOVE"]
completion condition?
in 3den
is your heli too high? (more than 200-300m)
Airport personnel reported no smell of weed
the waypoint does change as well
currentWaypoint group pilot is 1 at mission start and then changes to 2 when the paratroops drop
so they're not high? 
AI have (had) a bug at high altitudes
they can't complete waypoints
nah, they're at a few hundred meters max
then the helicopter actually lowers to like 100m or so
and then it just hovers there
oh well, gotta go so I'll leave it at this and see if I can figure it out some other day
@little raptor Thanks for the help though ๐
(if anybody knows an obvious answer, please ping me)
can I use remoteExec on execVM
yes
I shall allow it.
Is there any place where I can see all the holdAction idle icon names and the icons themselves? I remember that previously in https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd I could open up the list and it'd also show the icons themselves, which made it significantly easier to choose the most fitting one for a custom holdAction.
Currently it seems that the list only shows the names, even though I'm 90% certain it used to also show the icons previously.
Thanks, this is exactly the page I was thinking about
Anybody got experience using CBA_Settings?
I am trying to set up some check-boxes and sliders to define variable values in Eden-editor
So far I am having no luck
the basic error I get is:
Error Missing {
18:05:56 File vehicleFSM\functions\fn_init.sqf..., line 193
18:05:56 Error in expression < Fall back to default value.", TO_STRING(_value), _setting]] call CBA_fnc_log;
_>
18:05:56 Error position: <(_value), _setting]] call CBA_fnc_log;
_>
18:05:56 Error Missing ]
18:05:56 File vehicleFSM\fnc_init.sqf..., line 177
18:05:56 Error in expression < Fall back to default value.", TO_STRING(_value), _setting]] call CBA_fnc_log;
_>
18:05:56 Error position: <(_value), _setting]] call CBA_fnc_log;
_>
looks like you have an undefined macro
how do i make a trigger to fire when a buidling (custom, added to the map) is destroyed?
I can't seem to find it- the difference between stamina and fatigue with disableStamina and disableFatigue?
afaik they're the same
the only diff was in setStamina and setFatigue. fatigue is in range 0-1. stamina is overall stamina (affected by loadout)
I was hoping to disable the stamina bar and allow unlimited sprinting, but also still force people to respect weight caps.
anybody?
you should use event handlers for something like that. see:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Killed
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#MPKilled
oof, alright, i'll try my best
Killed works on vehicles?
also, is !alive going to work on buildings?
yes and yes
so i can just ```sqf
!alive buidling;
Not present
well it says so in the desc for that command
huh?
"Check if given vehicle/person/building is alive (i.e. not dead or destroyed). "
wrong reply?
ya
okay
for alive
better just use the EH. a trigger is a loop, constantly checking and eating away performance. an EH only fires when the event happens
hi everyone, I'm trying to make a function that accepts a vehicle as an argument and marks on the map the position of its laser.
The lasertarget command does not work for me because I want it to work even when no specific target is being pointed at.
The closest I can get to how I want it to work is by using getPilotcameraTarget which always returns a position. The problem is that it works great for jets but not for drones, since they both have a pilot camera and a gunner camera, and the laser shoots from the gunner turret.
I also tried with a "Fired" eventHandler but the game does not treat the laser beam as a projectile, so I cannot get its position that way.
Any suggestions?
you should be able to use the weaponDirection command 
if not, selectionVectorDirAndUp
and then do some weird line intersection stuff?
yeah
what? there are commands for that
probably index 0 of https://community.bistudio.com/wiki/lineIntersectsSurfaces
thank you I'll give it a shot
if using weaponDirection i guess you would also need the selectionPosition of the weapon muzzle converted to world space as the begin point
how do i delete 2 objects via trigger?
deleteVehicle obj1;
deleteVehicle obj2;

if more, use a forEach loop
does it have to be vehicle? i got confused and that's why i asked
no. vehicle = object in Arma terms
okay, thanks
there's no way to get that info just by knowing the weapon name right?
There is. You can get the selection name of the pos and axis of the camera from the config
oh ok thank you, I guess it's time to get familiar with the whole config thing
Do the commands enableEnvironment and fadeEnvironment affect sounds created by createSoundSource ?
Would anyone have an idea as to why my triggers only fire if the player walks inside them, and jumps/climbs within it?
what is the trigger set to activate on?
Player entering it
does the trigger not work if they jump? im guessing with a mod
No, it will fire if they jump inside the box of the trigger (or if they climb on an object inside the trigger box). It's also a 5 x 5 x 1 box, btw
maybe make the z higher vertically and double check it is completely on the ground
The trigger is also inside a cargo tower, so that makes sense
from memory triggers attach themselves to the ground like a helipad and then work up a bit maybe going on an object changes the z to be into the trigger
I'd imagine it does. The ones in my cargo tower are the only ones misfiring
that would make sense then
it could also be that the z co ordinate is the only place the trigger activates like if the z coordinate is 50 the player has to be at 50m high
both of those make sense to me so try them both
I'll try that, thanks!
no problem
I am trying to set up an RHS version of Domination, how do I use this?
#ifdef __RHS__
How do I force it to use RHS things?
I mean, how do I define this to make Altis Domination load as RHS? Thanks.
define the macro somewhere in some main configuration file(id assume it has one)
if i want a trigger that fires when a does not equal 1, ill do ```sqf
a != 1;
Yes
is there any way to change objects size not using setobjectscale? i want to try make a small tank
No, setObjectScale is your only choice
or you could make everything else bigger by setObjectScale
now im thinking of making a huron sized hummingbird with tiny people hanging off the side
does deleting a keyvalue pair in a HashMap while iterating with a foreach cause undefined behavior or is it safe?
why use a trigger for that? if you're the one changing a, you know exactly when that becomes 1
it's a radiostation that needs to be destroyed, so when it's destroyed a becomes 1, and i need to have a trigger that calls for backup if the team is dead and radiostation is up
well YOU are changing a
you know WHEN it's gonna happen
so using a trigger is a waste
it's like you're the one with the key to a house and you know only you can open it, but you always visit the house every minute to see: is it open yet?
well if you opened it it's open. if not it's closed...
if you don't know what I'm talking about:
let's say you do this in one trigger:
a = 2;
and then in another trigger you're checking:
a != 1
which does some code
just put the code under that a = 2 in the first trigger 
yeah that's not how i set it up
so, i have 2 triggers, 1 for destroying radio and the second one for backup that has to meet 2 conditions: 1 is team is dead and the second one is radio is up and running, and radio trigger sets a to 1. so i need to check if a != 1
ok
Quick question, where do I define dependencies for mods?
I got a FSM mod that relies on a couple of CBA functions
requiredAddons in cfgPatches
Thank YOU!
If I could give you a price I would
For all the answers you gave me the last few days trying to conver the FSM into a mod
Been a pleasure for me ^^
Any way to check if you are actually in a mission (not main-menu or editor)?
I want to use it as a condition to initiate a function, that should otherwise not be initiated
You can use the postInit property of CfgFunctions for that: https://community.bistudio.com/wiki/Arma_3:_Functions_Library
It still initiates at main-menu
nice
I am curious-
My (coop) missions are scripted with about 30 different triggers. Triggers for branching objective outcomes (destruction vs completing addAction). Triggers for music. Triggers for EndMission. This costs performance for server and client. I figured at least the triggers controlling branching outcomes could be handled by a server executed FSM.
There's a thread on the BI forums praising FSM, but not giving any concrete examples. The campaign scenarios use a missionflow.fsm . And ~15 other FSMs. But I couldn't find how they were executed (eg there were no execFSM commands in any files, nothing in description.ext).
Does anyone use FSM files in their multiplayer missions, or can link me to an example ?
I figured at least the triggers controlling branching outcomes could be handled by a server executed FSM
you can just create the triggers dynamically
Triggers for branching objective outcomes (destruction vs completing addAction)
these don't need triggers
also FSM doesn't have any perf advantage over plain SQF
missionFlow.fsm auto executes if it exists iirc
the main advantage for fsm is the visualisation aspect
for the mission designer I mean
Does anyone use FSM files in their multiplayer missions, or can link me to an example ?
Good examples would be missions in coop-campaign Apex protocol by BI
a3\missions_f_exp\campaign\missions
Hi, is there any tool I can use to pack a pbo in cli?
Mikero's
tho I think A3 Tools has a command line version too 
Right thanks!
Can a trigger with alivecheck be synced with a end scenario?
sure, why not
How would I do that? Do I need triggeractivated too?
you can put a BIS_fnc_endMission call in the OnActivation field
that's not a command...
Help? ๐ฌ
typically people and campaign missions just do something like !(isNil "variable") for that kind of thing
no, first, tell us the end goal in human terms
then we try and seek a valid scripted approach
Want the mission to end when I die
That's very interesting. I assume it has to be in the (mission) root directory for this to happen?
sp already does that? got more human term end goals that you want outside of what already happens?
in mp you can create an eventhandler for "killed" which will avoid using triggers and scheduled
If I get out of the city alive. For the mission to end aswell
you need to override onPlayerKilled.sqf iirc
Thank you
Thanks
The following is a "Fired" event handler function. The issue I'm having is not being able to setVariable to the _payload (the projectile of the event handler). After setting the variable, doing "allVariables _payload" returns an empty array.
What am I doing wrong?
private _fn_onPayloadSent = {
private _unit = param[0];
private _payload = param[6];
if (getNumber (configOf _payload >> "laserLock") == 1) then
{
_payload setVariable ["originPos", position _payload];
_unit getVariable "tracedPayloads" pushBack _payload;
};
};
take your code apart first and see if it is even firing at the setVariable spot
start with the line you want to work, then start adding in around it
it is
I'm sure the projectiles are being pushed in the array at the second line
are you sure that the projectile still exists and is not objNull?
I am
so in my little test I just did, it looks like you can't give variables to projectiles
yup, can confirm ๐ฆ
even though it counts as an "object", a projectile/ammo is not a valid subtype
to get around this (probably not wise), you can actually just use a different name space and set an array that you can grab later
missionNamespace setVariable ["my_projectile_1", [_projectile, "myValue"]];
thank you very much I'll try
when i've used it i did so yeah
Question
When I delete an object in Zeus
And/or it dies
Does it become objNull?
Well sorry, specifically if I delete it
Or does it just... cease to exist?
Working on a script that I want to attach to an object, but commit die when the host object is deleted
it gets removed, so it does not "become" anything
the variable that was pointing to it becomes objNull though
isNull (alive returns false for objNull)
Is there anywhere I can access a full list of human memory points? I.e. head, shoudler, legs etc
is htere a way to change object type with a script
Don't suppose you might know? ๐
In a little bit of a rush ATM
LEGENDARY, thanks!
you're welcome! ๐
Hey un I have an AI spawn point down. But when it gets to the manpower limit its giving me a error. Doesn't break it. But its annoying having the errors on the screen
any help?
no
you have to delete the object and create new one
sadge
how did you set it up?
3 sectors then the Spawn Ai. And 3 Spawnpoints.
Manpower is 100.
Every 15 secs. Mostly infantry
Yea it all works. Just an annoying error when the limit is reached
Posting the error here might help
I ain't typing that whole thing out
those errors only occur when there's a problem with the module sync and data
but it's hard to tell which one you did wrong
Would having the wrong values at a certain spawn point cause it?
The total only came upto 90% On one of them
dunno. maybe
copy your module setup in an empty mission (use vanilla maps, preferably VR) and DM me. I'll take a look
I'll test it out 1st see if I get it again
Seems grand now
Other than my game seems to have bugged out now. Yaay
Gun wouldn't fire. Then ran now I'm dead with no menus and stuck here.
Is there any significant difference in functionality or performance between hashmaps and CBA namespaces?
hashmaps are probably a bit faster
idk what CBA namespaces use
iirc they used a helper object and did setVariable on it
if so they are a lot different in functionality too
anyway, there's no point in using scripted stuff when there's native engine support for something
Don't they use locations as namespaces?
yes they do
locations or simple object, depends if local or global.
object might be better for network as you can publish only one "key", with hash map you need to send the whole thing over the network.
I've got an issue using
player setDamage 0;
If someone has sway after being shot their scope will be stuck on a different place on the screen than the standard middle when I use setDamage. I don't know how to fix it...
try player switchMove animationState player
why does
_obj setVariable ["myvar",nil]
not remove "myvar" from allVariables _obj?
How would I go about getting the pos for where a bullet landed? I'm not bothered if it's a bit slow or inefficient as long as it works
_soldier addEventHandler [
"fired",
{
[param[6]] spawn {
private _bullet = param[0];
while { true } do {
private _pos = position _bullet;
if(isNull _bullet) exitWith {};
someGlobalVar = _pos;
}
}
}
]
Thanks, works perfectly
for now... ๐
it's riddled with errors
tell me I'm learning
well
- you don't use
FiredEH with "soldiers". you should useFiredMan - you should never use a "waiting" while loop without some form of suspension (
sleeporuiSleep). rn your while is wasting the scheduler's time and executing multiple times per frame, yet the bullet cannot change in one frame, obviously. - you shouldn't use scheduled environment in such places in the first place, due to scheduler limitations. if for some reason there are multiple scripts running, the interval between "scheduler visits" to your script keeps getting longer, and the error gets large
nil doesn't remove variables
I purposely avoided the waiting thing because in the documentation they said that the shortest sleep duration is 0.02, and with a 800m/s bullets it's 16 meters of accuracy that you might be losing. He seemed more concerned about making it accurate than performant, so yeah
shortest sleep duration is 0.02
whatever doc said that is wrong
and like I said, there's no guarantee your script runs every frame
you're not guaranteed any amount of sleep time, it depends on the scheduler's load
it's scheduled
doc clearly says "To remove a variable, set it to nil" ๐
well in technical terms it is removed
but the identifier is not. the variable will simply be bound to no value
Now, is there any way to make this track more than one bullet from the same gun?
every time you fire, that's going to fire. with some of the mgs in the game, you just spawned a TON of individual scheduled instances
oh okay gotcha
I'm not bothered if it's inefficient, it's just for my use for testing something.
well you can't test something if you just made the game a slideshow for potentially a long amount of time...
maybe he wants to fire a couple of bullets, give him a break ๐
the game won't become a slideshow tho...
the scheduler does... 
use an array or something
But if it's writing to a global variable won't the second shot overwrite it?
use a hashmap
hashmaps can't be used with objects
i know, use an artificial id
no. you just add stuff to it.
you won't overwrite anything
global hashmap, assign artificial id to every bullet once fired, push the position to the hashmap using the id as key
wat? why use "artifical id"? just use the hash value
like I posted here:
https://community.bistudio.com/wiki/HashMap#Unsupported_Key_Types
oh that's nice I didn't know that
Not really sure how to do that in this case. It's writing to the global every loop but I only want to know where it lands not where it's been along the way.
So if I just tacked the pos on each loop that won't really be of any use
#AmmoEventHandlersForPresident
projectiles = [];
onEachFrame {
private _deleted = false;
{
_x params ["_projectile", "_lastPos"];
if (alive _projectile) then { //update pos
_x set [1, getPosWorld _projectile];
} else {
//do whatever you want here with _lastPos, for example
systemChat format ["projectile %1's last pos: %2", _projectile, _lastPos];
//
projectiles set [_forEachIndex, 0];
_deleted = true;
};
} forEach projectiles;
if (_deleted) then {projectiles = projectiles - [0];};
};
_soldier addEventHandler [
"FiredMan",
{
projectiles pushBack [param[6], getPosWorld param[6]];
}
]
this is a slightly better version of that script
oh and I totally forgot to rant about position ๐คฃ
normally it's the first thing I mention... ๐
omg please forgive my 2am brain ๐
so do you know what I'm talking about?
I noticed that in another one of your scripts too
I mean I know there's the whole ATL, AGL, ASL and whatever, is that it?
yeah
yeah I forgot about a lot of things, I started programming for the first time with this game like 8 or 9 years ago
sweet memories : ')
Anyone know a script that I can use to move an object across a plane at a certain speed?
use a loop that +'s to relevant axis, a sleep command will determine how fast
And what would the command look like?
It would look like this: #arma3_animation message
(You can unwrap it from the loops if it's just a single object)
Thx!
Works in dedicated. Very smooth sailing. But the object hath wonky physics. ๐ ware.
I need some help. I am trying to create artillery that works with a trigger and fire mission. It works but all the artillery just fires at the fire mission point. How can I spread the artillery fire to target all the vehicles in the tigger area,??
I think this involvesscripting
This could suit your needs: https://forums.bohemia.net/forums/topic/154838-finally-got-artillery-working-right/
You'll need to set up triggers and get the (shell transit) timing right. Which you can easily rehearse in Eden if you know where the enemies/players are beforehand.
Ok thanks
it only does with missionNamespace, uiNamespace etc, afaik those have some special handling for it
Code in MPKilled EH vs Killed EH operates similar to remoteExec, correct?
what do you mean?
Disregard, appears to be correct according to wiki.
Killed eventHandler code is local, MPKilled basically remoteExecs to all.
hi guys im working on this:
but it doesnt work
class CfgVehicles {
class Rope;
class RopeRabbit : Rope {
maxRelLenght = 1.1;
maxExtraLenght = 20;
springFactor = 0.5; // higher == less stretchy rope
segmentType = "RopeSegmentRabbit";
torqueFactor = 0.5;
dampingFactor[] = {1.0,2.5,1.0};
model = "\A3\Animals_F\rabbit\rabbit_F.p3d";
};
};
class CfgNonAIVehicles {
class RopeSegmentRabbit {
scope = 2;
displayName = "";
simulation = "ropesegment";
autocenter = 0;
animated = 0;
model = "\A3\Animals_F\rabbit\rabbit_F.p3d";
};
};
Note: Lenght is purposely misspellt for some unknown reason.
So an example for using the above custom rope definition with the ropeCreate command:
// ropeCreate[fromObject, fromPoint, toObject, toPoint, length, ropeStart, ropeEnd, ropeType];
myRope = ropeCreate [vehicle player, "slingload0", myCargo, [0, 0, 0], 10, ["", [0,0,-1]], ["", [0,0,-1]], "RopeRabbit"];
i dont know how to insert it in the vr i guess
it says bad vehicle type
oh i see the creator is here, dedmen wrote this i think somewhere
oh okay thanks mate
where did you put the config?
also:
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
!code test
no you have to type what the bot says
class CfgVehicles {
class Rope;
class RopeRabbit : Rope {
maxRelLenght = 1.1;
maxExtraLenght = 20;
springFactor = 0.5; // higher == less stretchy rope
segmentType = "RopeSegmentRabbit";
torqueFactor = 0.5;
dampingFactor[] = {1.0,2.5,1.0};
model = "\A3\Animals_F\rabbit\rabbit_F.p3d";
};
};
class CfgNonAIVehicles {
class RopeSegmentRabbit {
scope = 2;
displayName = "";
simulation = "ropesegment";
autocenter = 0;
animated = 0;
model = "\A3\Animals_F\rabbit\rabbit_F.p3d";
};
};
myRope = ropeCreate [vehicle player, "slingload0", myCargo, [0, 0, 0], 10, ["", [0,0,-1]], ["", [0,0,-1]], "RopeRabbit"];
the first 2 classes i tried description.ext ...
you can't declare vehicles in description.ext
#include is just a preprocessor, it will still end up in description.ext
you would have to create a mod to add new vehicles to the game
using mod in my VR ?
what do you mean?
i want to use this roperabbit ... could u explain me how to do it, or how to learn how to do it ?
i have no experience with ropes, but I do know that you can't create a CfgVehicles class on a mission level. You would have to mod the game, aka create an addon/mod
I'm trying to create a Zeus curator for #adminLogged at runtime.
this outputs no errors but it's not working
private _moduleGroup = createGroup sideLogic;
"ModuleCurator_F" createUnit [
getPosATL player,
_moduleGroup,
"this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];"
];
_moduleGroup setGroupOwner adminLogged
I'm not even sure if this is possible but it would be extremely useful if you could enhance/ fix workshop missions on the fly
no, that won't work\
try adding this setVariable ['owner', '#adminLogged', true] in the init
holy shit it actually works
private _moduleGroup = createGroup sideLogic;
"ModuleCurator_F" createUnit [
getPosATL player,
_moduleGroup,
"this setVariable ['owner', '#adminLogged', true];this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];"
];
thanks dude
is there a way to resize the ingame exeption message popup?
not afaik
If I don't remove a given Event Handler that was added with addEventHandler, what effect on the server?
it will rise by 1ยฐC
Hey guys quick question.
Struggling with quite a basic script but really can't get it to work. Basically I have a task where I want the player to pick up the backpack and once the player has, for the task to succeed. Anyone know the script to do it? Thanks ๐
you make the condition that the player is carrying the backpack
So would that be naming the bag and then adding: bag = backpack player; in trig condition? I know how to do conditions with items and what not, just unsure about the backpack hahaha
You would want the classname of the bag
So just put it on in the editor and type backpack player in the debug console
and itโll give you the classname
backpack player == โbackpack_classname_in_quotesโ
= is to assign a variable, == is to compare values
you can also use this if youโre comfortable with event handlers
best would be to not use triggers. take event handler in combination with https://community.bistudio.com/wiki/BIS_fnc_taskSetState
hi everyone, can anyone tell me how I can check if a bomb is currently locked onto a target or if it's just freefalling?
tho not sure if that works for bombs
yeah it returns an object so don't think so, thank you anyways it will be useful in the future
["Car", "init", {
clearWeaponCargoGlobal (_this select 0);
clearMagazineCargoGlobal (_this select 0);
clearItemCargoGlobal (_this select 0);
(_this select 0) setVehicleAmmo 0.45;
[
(_this select 0), // Object the action is attached to
"Claim this Vehicle", // Title of the action
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Idle icon shown on screen
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Progress icon shown on screen
"(alive player) && !dialog && player distance _target < 8", // Condition for the action to be shown
"_caller distance _target < 8", // Condition for the action to progress
{}, // Code executed when action starts
{}, // Code executed on every progress tick
{[(_this select 0)] call HG_fnc_setOwner}, // Code executed on completion
{}, // Code executed on interrupted
[], // Arguments passed to the scripts as _this select 3
0, // Action duration in seconds
0, // Priority
true, // Remove on completion
false // Show in unconscious state
] remoteExec ["BIS_fnc_holdActionAdd", 0, true]; // MP compatible implementation
}] call CBA_fnc_addClassEventHandler;
wat?
what did you expect it to return then?
target = object
a laser position would have been great
Can anyone help me figure out why this isn't working? It uses a CBA event handler to try to add an action to a vehicle when it spawns, the other commands (clearWeaponCargo and such) are working but it won't add the action in mulitplayer
there's no such thing as "laser position"
the laser target is an object too
the more you know...๐ค
you mean it works in SP?
yes, it works in SP but does not in a dedicated
I also tried remoteexec with addAction instead of BIS_fnc_holdActionAdd but had the same issue
probably because the object is not fully initialized or something 
I don't see any reason why it shouldn't work
I'm not sure that's the case, the other lines in the CBA event handler are working (clears its cargo and reduces ammo)
i'm looking closer at the condition
it should return the laser object, if it's a gbu and locked on for example
anyone know how to create laser targets with a script I have this code
if (_side == West) then {_LaserType = "LaserTargetW"; _LaserBaseType = "LaserTargetWBase";};
if (_side == East) then {_LaserType = "LaserTargetE"; _LaserBaseType = "LaserTargetEBase";};
_LaserObject = _laserType createVehicle _LasePos;
_BaseObject = _LaserBaseType createVehicle _LasePos;
_laserObject attachto [_BaseObject, [0,0,0]];
but I can't lock onto the laser target with my plane
try InitPost instead of Init
k, how does InitPost work?
it executes after all the other init event handlers
hello, do I just have to add this line to init.sqf to activate the option? null = [this] execVM "R3F_LOG\USER_FUNCT\do_not_lose_it.sqf";
well, no one will be able to tell what that script does
unless you tell us
if you put it in init.sqf it will run on every machine, do you want that?
sorry it's for r3f logistic to be able to recover the cases when the vehicle is destroyed
http://team-r3f.org/madbull/logistics/EN_DOCUMENTATION.pdf it's on page 15 but I didn't quite understand
since it does something with this, it tells me that it's supposed to be in some init field
I tried reveal but the laser target still doesn't show up is it because I have it attached to another object;
yes I searched in the files but I can't find where to add this
he also talks about it on page 9
it looks like it goes in the objects init field in the editor
no, attaching shouldn't be an issue
there are the report sensor commands, should try those
How do i write configs. I just want to add a simple cube
obviously the object init field
There is only one required parameter to call the script : the reference to the object to not lose. If
called in the mission editor's initialization line, this reference is the keyword this
thank you for your response Leopard20 but where should I add this line?
nul = [CargoNet_01_box_F, "cargo_pos"] execVM "R3F_LOG\USER_FUNCT\do_not_lose_it.sqf";
set to "cargo_pos" to unload the object around the destroyed cargo
idk. as the doc says:
Read its description in the script to know how to use it.
the line itself goes into the object init. as I said already
do you not know what it is?
ok thank you i will look again in the files
https://community.bistudio.com/wiki/reportRemoteTarget https://community.bistudio.com/wiki/setVehicleReceiveRemoteTargets this will reveal it regardless of the vehicle not having proper sensors to detect the lase, otherwise if the vehicle can detect it by itself, reveal is enough
its working now thanks for helping
How would I go about counting how many ai on my team die. Then being able l to spawn that many ai back into the game when I'm at a FOB.
you could increment a counter every time one dies,
but the simplest might be to simply get the count at the beginning of the mission then get the difference with what's left
How would I go about the first option?
e.g event handlers
Lastly, how can I add a addAction to every object in the mission with a certain class name
Because the objects are added in part way through mission by anothr mod
addAction, forEach and allMissionObjects
if you have cba you can use the init event handler
Hey guys, does anyone know if it is possible to make certain components of vehicles (Engine/Turret/Gun) take no damage or instantly repair?
We are using ace and planning on an operation using hmmvvs however aces vehicle damage model a few updates back fucked them so russians firing 7.62 take out the engine and turret in like 1-2 shots.
its more important to know if its RHS or cup humv since i believe RHS has its own damage handler for vehicles
ahhh I cant remember off of the top of my head, but I want to say RHS? Let me check
Yeah, RHS USF
are you using the ace compatibility patch for RHS?
yeah
i personally for ease, would just make a new handle damage event handler and add the health back when struck by a 7.62 weapon
Hmm gotcha, thats what I was looking into, just wanted to check. Well ill get into that tomorrow, its 2 am here. Thanks for the info
Any way to make object detectable with mine detector? Using Ace.
why does my ai helicopter keep lifting off despite writing ```sqf
FB_HELI_PILOT disableAI "all";
mods or wrong target most likely
I deleted the copilot to be sure
the pilot just does not care
It's an RHS helicopter if that makes any difference
but the waypoint is transport unload, he keeps doing his passengers dirty and lifting off lol
did you name the pilot or the helicopter this ๐
iirc transport unload is ViV drop, no?
otherwise try in an empty VR mission in vanilla and compare
not "with vanilla units", in vanilla - without mods loaded
I'll try disableAI for the pilot in vanilla later




