#arma3_scripting
1 messages ยท Page 27 of 1
I think it's possible in at least a janky way
do you know how
I think you can do something with https://community.bistudio.com/wiki/drawIcon3D
but it's pretty janky I would say
and wouldn't be too accurate
@still forum Apologies for the ping but since this was being talked about earlier, I saw that the GitHub for intercept hasn't really changed in a couple of years, is this anything to worry about for development? I have a few scripters who are interested in using it (for performance reasons)
I think something like https://community.bistudio.com/wiki/ParticleArray could also be used
I have this code:
{
if ((_x isKindOf "LandVehicle") or (_x isKindOf "Air")) then {
_vichitpoints = getAllHitPointsDamage _x;
/* add 0.2 damage to specific parts over exisiting damage */
};
} foreach _nearbyunits;
``` I'm trying to add damage to specific parts of the hitpoints based on the hitpoint names received in the _vichitpoints list. How'd I go about in doing this in an efficient away instead of typing in all hitpoints individually.
will take a look, ty
One solution I have is this for each and every hitpoints I want damaged```sqf
_x setHitPointDamage ["HitEngine", (_x getHitPointDamage "hitEngine") + 0.2];
anyone here ever used the HALs Store script? I'm trying to add an ammo box as a valid type of container for stuff to buy or sell but no matter what classname I try, it doesn't show up. Container types are defined through containerTypes[] = {"LandVehicle", "Air", "Ship"};, I checked most of the files and couldn't find which one valids the type of container if it doesn't take anything else into that field
Does anyone know of a good youtube series to learn SQF/arma scripting?
Do you have prior scripting experience of any standard languages (C, C#, JS etc)?
C, C#, Python yes
Mostly my struggle is with understanding the organization of scripts and mods
and also learning the language commands/types
I would start by reading through these:
https://community.bistudio.com/wiki/Arma_3:_Functions_Library
https://community.bistudio.com/wiki/Multiplayer_Scripting
Is there an article or a resource for explaining file structure for scripts
Scripting commands and functions are indispensable IMO
https://community.bistudio.com/wiki/Category:Arma_3:_Scripting_Commands
https://community.bistudio.com/wiki/Category:Arma_3:_Functions
Would also suggest Visual Studio Code as your editor, including a couple of key extensions:
SQF Language Updated v2.1.0 (blackfisch) / https://github.com/Armitxes/VSCode_SQF
SQFLint v0.12.1 (SkaceKachna)
There are a couple other extensions depending on your editing environment and how automated you want things to be, i.e. time stamps.
Between the language and LINT, it's not perfect, but it gives you pretty decent clues how close your code is to 'working' before running any servers.
And of course any other tooling you might need, Git for source control, I use Beyond Compare as a difference viewer, and so on.
Thank you, yes I am setting VSCode up with those extensions, but I am also in need of a resource to help explain things such as how cfg's work, and code practices
The functions library link explains file structure quite a bit and is important to understand. Here's another if you're going to use mods instead of mission file scripts: https://community.bistudio.com/wiki/Arma_3:_Creating_an_Addon
switch ((_x in _array1) or (_x in _array2) or (_x in _array3) or (_x in _array4)) do {
case _array1: {/*run stuff*/};
case _array2: {/*run stuff*/};
case _array3: {/*run stuff*/};
case _array4: {/*run stuff*/};
};```
i dont think this is correct use of the `switch` statement, is anyone able to correct where ive gone wrong in the first line to make `case _array#` work please?
Switch on true and make the arr1 in arr2 statements your cases
ah, thought it would be that simple -- thanks :)
It's pretty liberal. You can put your scripts just about anywhere you want as you have to define a relative path to it at some point; be that in configuring a function or using something like execVM command. What's your specific use case? It would be much easier to explain.
For missions they just need to be under the mission folder, addons (mods) can be slightly more complicated if your wish. This is a decent explanation of basic addon structure.
https://community.bistudio.com/wiki/Arma_3:_Creating_an_Addon#Addon_Prefix
SQF doesn't require integral types for switch statements like C/C++, can go pretty wild with them
so something like
switch (true) do {
case (_x in _arr1): {systemchat "1"};
case (_x in _arr2): {systemchat "2"};
};``` and so on, right..?
yup
hmmmmm
if _arr1 is an array pulled out of a .hpp file, it should still work, right?
I am just trying to learn the basics of SQF for mod creation, so I would like to get versed in understanding the relationship between scripts/missions/configurations etc
I am using CBA_loadingScreenDone in my initPlayerLocal.sqf, however even with that being used, my mission still has some sort of loading screen happening after I press start from the map screen, thus making me miss some seconds of being able to see my fancy pancy intro I am doing. does anyone know a better alternative way of waiting for loading screens to be done?
thank you for linking
@sullen sigil Whether it's from a .hpp file or not is irrelevant - data included in a file via #include is basically just copy-pasted into the file at the spot where the #include statement is
so as long as the code in the .hpp file is valid, it shouldn't matter at all
so just _arr1 = ["classname", "classname2"] right? (in the .hpp)
yes
hm... systemchat checks dont seem to be working
what's the full code
#include "classnames.hpp"
addMissionEventHandler ["Draw3D", {
{ switch (true) do {
case (_x in _arr1): {drawIcon3D [getMissionPath "img\target.paa", [1,0,0,1], ((ASLToAGL getPosASLVisual _x) vectorAdd[0,0,1]), 2, 2, direction _x, "", 0, 0.03, "PuristaMedium", "center", true];};
case (_x in _arr2): {drawIcon3D [getMissionPath "img\target.paa", [1,0,0,1], ((ASLToAGL getPosASLVisual _x) vectorAdd[0,0,1]), 2, 2, direction _x, "", 0, 0.03, "PuristaMedium", "center", true];};
case (_x in _arr3): {systemChat "b"};
case (_x in _arr4): {systemChat "c"};
};} forEach (ASLToAGL getPosASL player nearEntities 20);
}];
that'd be your issue
uh oh
The _arr1..._arr4 won't be defined in the Draw3D event handler
ah right lol
move your #include inside the {} of the EH
Fix your indentations, I keep trying to read this and getting lost >:|

discord window size too smol :(
here is vsc screenshot
(obviously with 1 and 2 not flipped here)
call {
if (_displayName == QGVARMAIN(Android_dlg)) exitWith {
call {
if (_mode != "BFT") exitWith {_mode = "BFT"};
_mode = "MESSAGE";
};
};
};
Is there something about putting random code in call {} blocks that has any desirable effect?
Not really, no
anonymous function
but why
Where is class CfgFunctions stored? in Description.ext?
because it's useful when you want to execute code without defining a named function separately
It's not stored anywhere, and your questions probably belongs to #arma3_config
Yes, for a mission. I think it's slightly different for a mod but the structure is the same
Thank you
But it's executing the code once, it would have the same effect with less code to just execute it as is
Except you can store the return value
Note that the actual function scripts are not usually in CfgFunctions, CfgFunctions just points to the script files located in the mission folder
In the case you're showing, yes, it's not very useful
thank you
but it can be
If you stored it, sure, but the code I'm working with has this all over the place and I'm frankly offended. Thought I'd check with you folks to make sure I've not just not been initiated into some secret
In that case it's ugly code from someone who doesn't understand what call does
which is unfortunately common
same thing with people spamming execVM
my use of a .hpp here is fine for it just containing arrays, right..? dont need to use a different file format?
class CfgFunctions // Functions library
{
class ZEEK { // ZEEK_fnc_exampleFunc
class FunctionsA { // the function category
class example {}; // a function
}
}
}
And so the function example would be at <root>/FunctionsA/example.sqf
yes?
Okay
Like I guess it's using it to have something to exitWith out of... but I'm getting a headache staring at it
replacing the #include with the .hpp content did nothing either so im assuming its an issue with my code 
And here it is with good indentation clearly separating the levels of code:
https://i.imgur.com/lHaDpSM.png
Are you certain that the conditions are actually being fulfilled - there are actually objects of the relevant classes within 20 metres of the player?
That'd do it
it did indeed
What's that code doing? Painting target markers on other players?
You might want to consider to move the logic out of the event handler and update it elsewhere, then just run loops over your arrays. Checking all entites over 4 arrays feels costly per frame
proof of concept atm
If you're doing this from description.ext, it will look for the function at <mission folder>\Functions\FunctionsA\fn_example.sqf. It includes the Functions layer when in description.ext, but not when from a "true" config file (e.g. in a mod).
Note that you can specify a particular folder to look in in the category class, e.g.
class ZEEK {
class FunctionsA
{
file = "FunctionsA";
class example{};
};
};```
will cause it to look for `<mission folder>\FunctionsA\fn_example.sqf`
Also note that the `fn_` at the start of the sqf file name is important.
<https://community.bistudio.com/wiki/Arma_3:_Functions_Library>
optimisation comes later on
hmm. okay
Side note, it bothers me a lot when people go "oh go ask config people" for CfgFunctions stuff. It is technically a config but it's so innately tied to scripting that there's no point arguing about it. It's also...not that complicated.
config makers channel gets less traffic so is less likely to get lost in the soup
I am curious if you send script commands for an AI to do something does it override the engines commands
or are they competing
Just need a bit of help knowing how to make a cutscene video play before a mission. I have the mission and cutscene made, and the video I want played is in .OGV format, I just want to know how to play the video, then have the mission start immediately after. It's for a campaign I'm working on
I also want to use the BIS_fnc_playVideo btw
My extension for Arma is finally complete! Yay! I've already done quite a bit of refactoring and once I finish it and test it more, I might release it as open source. (It's a "smart" anti-stacking system based on the scores of players in a TvT mission.) Related plug-ins might also follow. Thanks for helping me guys 
Can I change the marker system that they are only local ?
what "marker system"?
the one from arma
when I left click on the map
Is there a option to disable that its getting synced with every player in the channel.
And I dont want to disable the channel either
i don't think there is a vanilla option for that.
EH can maybe work, but no guarantees on it working at all (or not breaking stuff). sqf addMissionEventHandler ["MarkerCreated", { params ["_marker", "_channelNumber", "_owner", "_local"]; if (!_local && {isPlayer _owner}) then {deleteMarkerLocal _marker}; }];
thank you, I will give it a try
What is the best way to organize scripts for missions? E.g how do I structure intro/task related scripts/sequencing etc?
CfgFunctions categories imo
that entire piece of code is nonsense
as previously said, _arr1 to _arr4 is undefined, also you can use a hashmap here instead of having 4 arrays
wiki: https://community.bistudio.com/wiki/BIS_fnc_playVideo use some init script for it if you want to play in the beginning
ive managed to simplify it down to a few isKindOf checks ๐
Besides linux support side, nothing changed that really needs changes.
Also couple years is wrong, there definitely was a change last year
My bad, there was a contribution three months ago
It's very creative tho xD
I'd never would have thought to use call/exitWith instead of just then/else xD
I'm trying to check whether the defined (user input) classname of the object exists before creating it. Which of these (if any) is correct for the said function? The input _input_vic is passed as a string.
A: ```sqf
if (!isNil _input_vic) then
_created_vic = createVehicle [_input_vic, [0,0,0], [], 0, "CAN_COLLIDE"];
B: ```sqf
if (!isNull _input_vic) then
_created_vic = createVehicle [_input_vic, [0,0,0], [], 0, "CAN_COLLIDE"];
i'd say this, so you don't get log spam when creating scope=0 things ๐คทโโ๏ธ sqf if (getNumber (configFile >> "CfgVehicles" >> _input_vic >> "scope") > 0) then { _created_vic = createVehicle [_input_vic, [0,0,0], [], 0, "CAN_COLLIDE"]; };
having the big mind melt trying to do this -- how would i toggle the effects of a missioneventhandler? i.e -
code executes first time, missionEH added
code executes second time, missionEH removed
third time added, fourth removed etc
im like 90% sure its a super easy thing but i am super stupid
Code sets a variable, and the first line in the mission EH is an exitWith depending on the state of that variable
ah, thanks
Hi
Remember you can invert booleans with !, e.g.
kjw_var_state = true;
kjw_var_state = !kjw_var_state;```
yeah, think i just suffer from the stupid
I use _thisEventHandler as the index in the remove, right?
Yes, provided you are using it inside the EH code
wait global variable is still local to each machine isnt it
Yes, unless it's broadcast for some reason (publicVariable, setVariable with broadcast true, etc)
god i really do suffer from the stupid
i was trying to do it all with private variables because i thought public variables = global variables
The main reason for using private and local variables is to avoid conflicts with other scripts, or other instances and scopes of the same script. Just remember to account for that as applicable to your script (i.e. don't use super generic variable names)
ah I can't use _thisEventHandler as the EH runs on each frame (Draw3D)
I guess I'd just make the index global?
Seems likely
goated
why not? Seems to work on my machine
because it removes it after each frame :p
you mean after running once?
code executes first time, missionEH added
code executes second time, missionEH removed
third time added, fourth removed etc
because it removes it after each frame
adding EH on even frames and deleting on odd ones? What?
I was initially checking if the EH had been added the frame after the EH was added and thus removing it
Rather than checking if the EH had been added the frame before the EH was added and removing it if it had been added already
extra O_o
So, 1 is "add EH - frame ends - run EH - it deletes itself"
and 2 is "add EH1 - frame ends - EH1 runs and doesn't delete itself - add EH2 - frame ends - EH1 runs, finds EH2 and deletes itself - EH2 runs"?
no, should never be an EH2
im probably explaining this terribly
at the moment its
code starts -> checks if there is already an EH present, exits with deletion if so --if not--> creates EH
prevent from adding EH for the second time? Only allow one?
yes
then yeah, saving the index returned by addMissionEventHandler seems to be the way. Or just any random "hey, EH is created already, don't bother" boolean flag.
ya, its working now anyways ๐
what options i have to play music to a specific player in multiplayer?
playMusic
I managed to get that to work but im having trouble picking specific player
playMusic has Local Effect, which means it only takes effect on the machine where the command is executed. Options for targeting include remoteExec, use of addAction, or any other means by which code can be made to only execute on particular machines
Well, remoteExec is usually a pretty good choice for this kind of thing, but it can depend on exactly what you want to do. For example, if you want to play the music only for the players who enter an area, it might be better to check for that locally to each client, e.g. with a trigger with the condition player in thisList. That's usually easier than checking on the server and remoteExecing to the players, for that use case.
Alright
the things im trying to do are basically situational music, halo jumping, underwater, in certain vehicle, close to target etc
hi. i need some help. i want let ai say3d activated by player. the sound should be looped as long a player is in the triggerzone. what i got so far, ai called dead and in trigger i got this while {true} do { dead say3d "woundedguyc_02"; }; problem, loop dont stop when a player leave the triggerzone and frames drop till its unplayible. can someone please help me?
Those would all require various degrees of different implementation and some of it will be quite specific to how exactly those scenarios occur.
Usually a trigger is an easy way of activating something when the player is in a particular area - it's up to you to determine where that area is, so that could cover "situational", "underwater", "close to target".
For HALO jumping you could try an event handler that detects when the player ejects from a vehicle, or if it's already scripted, insert the music somewhere into the script. "In certain vehicle" could be covered by a trigger with condition player in yourVehicleVarName, but you might want other conditions too.
while {true} means the loop runs forever, not dependent on the trigger. It starts when the trigger is activated but stopping is not controlled.
You are also running say3D every frame, without waiting for the previous instance to finish. That stacks up pretty quick.
[] spawn { // spawn the loop into a scheduled environment so we can use sleep
while {triggerActivated yourTriggerName} do // This condition means it stops as soon as the trigger is not activated
{
dead say3d "woundedguyc_02";
sleep 1; // adjust this to the duration of the sound
};
};```
hey man thank you very much. i give it a try
i got another thing that drive me crazy, to make ai stop talking i got this setSpeaker "NoVoice" work great on vanilla ai but for the mod max women soldiers it dont work. is there another way to do it?
ask the author
this disableAI "RADIOPROTOCOL" seems to be another popular solution to make a unit stop talking
thank you also very much!
The ideas for these i had were basically to:
Pmayer height > x halo jump music
player height < x underwater music
for vehicle i thought i try to attach a trigger to the vehicle so it (hopefully) detects the player sitting in the cockpit
i kinda could make a trigger for the objective proximity too but apparently large trigger areas are not very performance friendly
this would be done locally on the client
attach a trigger to the vehicle
use an event handler
Thanks for advice!
I have a "vehicle spawner" trigger that checks every half an hour for vehicles within half a click and spawns a new one if no vehicles in sight, chosen randomly from a switch do. However I would make it Darwin-proof in case player wants an award and keeps spawning these vehicles until the mission breaks.
how can i maintain these freshly spawned vehicles so if one is abandoned for some time, it will be deleted? I can't make some global garbage collector as there are pre-placed vehicles and some used by AI that should stay.
I thought about having them being given a variable and added to some kind of array, but I have no idea how to measure "abandonment" of these cars and idk how to assign variable with random number
it's for a SP mission so locality does not matter
you can potentially add event handlers to timestamp when the vehicle was last used
and you can just append the object to an array right? is there a need to generate variable names?
I assumed I'd have to keep variables of these objects in array so there is no chance a non-spawned vehicle is deleted
and I can't find any EH that would work as a measurer, there is VehicleAdded but I don't think this is the one
//Spawn new vehicle:
private _newVehicle = createVehicle [...];
MyVehiclesArray pushBack _newVehicle;
//Remove abandoned vehicles:
private _toDelete = MyVehiclesArray select {/* Vehicle abandoned condition */};
MyVehiclesArray = MyVehiclesArray - _toDelete;
{ deleteVehicle _x; } forEach _toDelete;
TAG_activityTimestamp = {
params ["_vehicle"];
_vehicle setVariable ["TAG_timestamp",time];
};
{_vehicle addEventHandler [_x, TAG_activityTimestamp]} forEach ["Fired", "GetIn", "GetOut", "SeatSwitched", "Engine"];
``` quick concept for timestamping vehicle usage, this can be checked along with whether the vehicle is occupied and if there are nearby units for example
_vehicle getVariable "TAG_timestamp";
``` will return the last time any of those event handlers fired
hey. I don't use it with battleEye.
afaik it is, but you should ask Dedmen to be sure
So I set up it like this
- trigger with condition
(count (nearestObjects [travel_hideout_carholder, ["Car", "Tank"], 20])) == 0 - Execution of file with following code:
_jeep = createVehicle ["C_Offroad_02_unarmed_F", (getPos travel_hideout_carholder)];
{_jeep addEventHandler [_x, HNG_activityTimestamp]} forEach ["Fired", "GetIn", "GetOut", "SeatSwitched", "Engine"];
_jeep setDir (getDir travel_hideout_carholder);
waitUntil { sleep 1; vehicle player == _jeep };
while { alive _jeep } do {
_lastTimeUsed = _jeep getVariable "HNG_timestamp";
if ((player distance _jeep > 10) && (_lastTimeUsed >= (time - 20))) then {
deleteVehicle _jeep;
};
uiSleep 1;
}```
and it properly deletes a vehicle when I leave it, however a new vehicle will spawn only as long as I'm in the old one, when I leave it, new car never respawns
it didn't work without the waitUntil because variable was empty and this was the first solution that came into my mind
Hello,
I was wondering if there is a way to manipulate a player inventory based on objects ID, or in this case as described by the command "ID for primary gunner":
https://community.bistudio.com/wiki/magazinesDetail
There are other similar commands that deliver specific IDs, but is there actually a way to interact/delete/modify them using the ID as reference?
it didn't work without the waitUntil because variable was empty
provide a default value for it
_lastTimeUsed = _jeep getVariable "HNG_timestamp";
if ((player distance _jeep > 10) && (_lastTimeUsed >= (time - 20))) then {
so driving the vehicle by a remote player or AI doesn't count as activity?!
these vehicles aren't supposed to be manned by any other player (singleplayer scenario) or AI, and since AI doesn't jump into non-assigned vehicles autonomically I felt it's okay
ok 
I didn't read this...
anyway, depending on how many vehicles you have you can go several ways about this
if there are several vehicles I personally recommend a single loop
while {true} do {
{
if (player distance _x > 50 && {!alive _x || crew _x findIf {alive _x} < 0}) then {
if (_x getVariable ["deleteTime", -1] > 0) then {
if (time > _x getVariable "deleteTime") then {deleteVehicle _x;};
} else {
_x setVariable ["deleteTime", time + 60]; //delete after 60s of inactivity
}
} else {
_x setVariable ["deleteTime", -1]
};
} forEach spawnedVehicles;
sleep 2;
spawnedVehicles = spawnedVehicles - [objNull];
}
I'm a bit rusty... 
global array that stores auto-spawned vehicles. On spawning new vehicle if there are too many of them in the array - delete the one furthest from the player ๐คทโโ๏ธ i am officially a slowpoke
so this would go along with ansin's array for the vehicles?
the reason I didn't bother with Fired EH and other stuff and simply used count crew _x == 0 is that an empty vehicle can't fire
actually wait crew also includes dead crew 
use crew _x findIf {alive _x} < 0
is there any easy way to invert players wasd controls for a few seconds
u back!? ๐
This channel was pretty much "end of life" without you
thanks. I added a check for distance from the spawner, so a car that was just spawned will stay there as long as player doesn't take it
I am beginning my scripting journey, hopefully I can find the right resources to actually become competent. So many commands! So many different conventions
SQF is broad but mostly primitive, tbh
Oh, the syntax of course, but the commands themselves to interface with the world.. yikes ๐
I also need to take some time to learn some vector math as well
params ['_group'];
_group addEventHandler ["UnitJoined", {
params ["_group", "_newUnit"];
if(count units player > 1) then
{
params ["_group"];
[_group] spawn (SQLS_PublicArray#3);
} else {};
}];
``` y is group undefined?
is it possible to get what addon a faction is from + get classnames from just that addon?
If you plan to stay in the Armaverse for a longer time (years in other words), just so you know, Arma 4 will use completely different scripting (or more like programming) language
there is any way to change a stance of a player via script?
player playAction "PlayerCrouch";
player playAction "PlayerProne";```
https://community.bistudio.com/wiki/playAction/actions
welcome to the club lol
Yea i am aware
But, A4 wont be out until, hell, 2026?
We don't know to be honest. 2024-2026 would be my estimate
I doubt A4 will be out in 2024 if they just started development
It's been in development for a while already though (most likely), it depends on how you define starting the development
Engine? Been in the works since 2013. Game itself? We don't know
Well its obvious they have been focusing on DayZ/Reforger for a bit now, unless they have been secretly working on A4 in parrallel
They probably have been working on it in parallel. Can't say for sure, but it's normal practice in the industry
Reforger is essentially a tech demo for Arma 4. Many parts of Reforger development are also Arma 4 development.
private _actionPress =
params ["", "", "", "_action", "", "", "", "", "", "", ""];
if (_action) then {
//myOwnCodeHere
inGameUISetEventHandler ["Action", ""];
};
["Action", _actionPress];
Does EH return true for all AddActions (which are added to player or how this work , cannot test it currently)
nope ๐
I took a few days off
_action is a string so i'm not sure what you're trying to do there
sorta yes
you can get which addons modify/create a certain faction
to get classname of objects and weapons from addons you can simply read the units[] and weapons[] entries in cfgPatches
it's not the best approach but it's the fastest one
Sry, just trying get code called if AddAction is "used"
_engineName: String - engine based action name ("User" for user added actions)
so_action isEqualTo "User"
"user added actions" i assume added via addAction 
but why not just execute code when action is pressed instead?
as in, in the action's activation code itself
_blabla addAction ["blablabla", {
call blabla_fnc_onAction;
// some more code
}];
Are there any known issues with remoteExec from headless clients to scripts on the server? I'm having trouble remoteExec'ing a script that's in a serverMod from the Headless Client and I'm not sure why else it's not working
no such known issues AFAIK
hmm, any suggestions on debugging it? No errors are thrown, and it's just a simple diag_log on the other end that never gets logged anywhere (server or HC)
Have you tested it using a non-HC client?
I'm sure this is just a phrasing thing and you already know this, but just in case - remoteExec doesn't do "naked" scripts, it only does functions and commands. If you need to remoteExec a script, you have to remoteExec execVM with the script as an argument.
depends if you remoteExec code, a script file, or a function indeed
It's a function registered in the functions library
The function is registered in a serverMod and no "file not found errors" are coming up in the server RPT, so the file as a function should be getting loaded properly
Maybe the dedicated restricts what can be executed?
I added it to both a cfgRemoteExec whitelist in the serverMod it's trying to execute the script from as well as disabled the whitelist entirely in the missionFile (most local)
your remoteExec code being?
This is in the headless client mod and the line is successfully logged to the HC RPT
diag_log format ["HC DEBUG |-> MPKilled Called"];
[_unit, _killer] remoteExec ["HCServer_fnc_handleKillRequest", 2, false];
Then, in the server mod, and the inside the function registered as handleKillRequest in the functions library
params [
["_unit", nil, [objNull]],
["_killer", nil, [objNull]]
];
diag_log format ["HC DEBUG |-> handleKillRequest Called"];
I would expect that to get logged to the server RPT but it doesn't for some reason
class CfgFunctions
{
class HCServer
{
class handlers
{
file = "HCServer\addons\core\handlers";
class handleKillRequest {};
};
};
};
Also, no errors of any kind are logged to either RPT
file name?
fn_handleKillRequest.sqf inside the handlers subdirectory
You can try if you change
file = "\HCserver\addons\core\handlers";
I'm done many UI where in description doesn't need 1st but in mod (addon) it is needed
Have you done a nil check for that function on the server?
Or called it locally on the server?
I have not, but it's in a serverMod that is being loaded (confirmed in the RPT) and the RPT isn't throwing any file not found errors (it does that if it can't find a file that's supposed to be registered in the functions library but doesn't exist)
so it should be getting loaded fine, I will try that though
Try it just to be certain maybe?
Something else might have gone wrong and there are no errors for functions that weren't found
Should I be able to remoteExec it from the debug console in a dedicated server?
how would i check if a camera was created via camCreate
i tried cameraOn but it still returns the player
AFAIK there's no way
i still love arma XD
yeah, what does it return?
ah doesn't return, but you should be able to see it in the server logs
but yeah, basically join the server, open the console, execute isNil "HCServer_fnc_handleKillRequest"
And if that returns false, try executing it directly
hmm, so the isNil check when executed with SERVER EXEC does come back true
But I did change the path to the file to see if the RPT error for that file missing came up and it did. When I changed it back, it didn't anymore. So it's definitely finding the file...
Does it return true for this aswell?
isNil "HCServer_handlers_fnc_handleKillRequest"
It does
did you try that? HCServer_handlers_fnc_handleKillRequest โ HCServer_fnc_handleKillRequest @blazing zodiac
I did, it returned true
Alright, I finally got it. It was actually Addonbuilder packing it causing issues. Packing it with PBOman fixed it
also
config.cpp only: Anywhere outside of running mission, refer to the functions stored in uiNamespace. e.g:
arguments call (uiNamespace getVariable "TAG_fnc_functionName");
in https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Function_Declaration O_o
as in "if you want to use it in 3DEN or something like that"?
Is there anyway to tell if a unit is owned by a headless client from the server?
owner _unit == owner _HC?
I'll try that out, thanks
is there any way around needing a different SQM file for each terrain, or rather, any way to have multiple SQM files in the same mission directory and have the mission/server select the correct one?
we can build a multi-terrain mission, but we need to keep a collection of inflexible mission.sqm around
would be ideal to have the ability to select terrain without changing PBO, maybe based on server.cfg
move the logic to the mod (possibly a servermod), keep the bare minimum inside the mission.sqm ๐คทโโ๏ธ
i remember seeing hearts and minds having multiple .sqm files in the mission folder
i am imagining in the arma engine, a fileExists search for "sqm\worldname\mission.sqm"
no clue whatsoever what it does but maybe it is what you're looking for
thats pretty much what i do now, its just frustrating to need to mess around with mission.sqm files
imo if the "worldname\mission.sqm" file is in the directory, we should be able to select terrain from server.cfg and the game can find the correct sqm
Not entirely sure what you are trying to achieve, but you can #include .sqm's in a description.ext i am pretty sure
at runtime, no
inb4 using multiple mission folders with everything except mission.sqm sym-(or hard-)linked into them ๐ฟ
hmm, but the server still requires the mission.sqm in mission directory. basically i want a single generic mission file where i can select the terrain in server.cfg :\
a fileExists search for "sqm\worldname\mission.sqm" would be ideal
a mission.sqm does not denote what terrain is used
Isn't the terrain dictated by the PBO name (i.e. missionName.worldName.pbo / the mission root folder missionName.worldName for unpacked missions)?
it is
at most what you can do is some preproc stuff
with the __has_include and filepatching? perhaps? idk
where you conditionally #include something in the mission.sqm, but again, that will have nothing to do with terrain choice, only the mission data
hmm interesting, i thought mission.sqm was terrain linked
it's not
mission.Altis > mission.Stratis, same mission.sqm will work just fine (ofc the placement will be total nonsense)
The mission.sqm is also often the largest file (after media resources like audio or images), so making clients download several of them when they only need one is also 
just make some shell script that packs pbos for you using different sqms and names them accordingly
then in server.cfg all you will need to do is change the worldname
I've been noticing Killzone_Kid has been using this in his new in-game functions:
// one example
private _valid = _this isEqualType configNull;
_valid = _valid || _this isEqualTo [];
_valid = _valid || _this isEqualTypeArray ["",0,0,0,0,0,0,0,0,0,[],0,0,0,0,false,false];
instead of using params
Is this the new best way of doing this? Or is it just something he always did that is old?
they are not comparable, here he does more checks
if you use params and you're expecting a single parameter, it's sometimes not ideal when passing arrays
because you have to put your array argument into another array, else you will break things
_fn_setpos = {
params ["_pos"];
player setPosASL _pos;
};
[1, 2, 3] call _fn_setpos; // _pos will be 1
[[1, 2, 3]] call _fn_setpos; // ok
sometimes people do [_this] params ... to avoid it, but it's also wrong, because then if user passes it "correctly", it will break
So I've run into an error I have never seen before. Anyone know what this means?
GIAR pre stack size violation
It pops on runtime for the script, and I didn't make any significant changes to the script when it broke
check for this, i guess?
Its a new name for "Generic Error" ๐
Can you send the script that it happened in and full error?
Si, I'll dm you it. Thank you
Problem located. I'm an idiot. It was a missing semicolon
hello
Has anyone got any idea of how I would be able to reduce a 30mm autocannons accuracy via script
e.g. increase CfgWeapons dispersion value
without editing config
use fired eh
You can't modify CfgWeapons without...modifying CfgWeapons.
You could try reducing the accuracy skills of the gunner AI unit, although this won't affect players or any other AI that switches into the seat.
Possibly you could use a Fired EH on the vehicle to adjust the projectile trajectory after firing, but you'll have to have a very steady hand with the numbers.
You can also use this mod to affect AI accuracy with vehicle weapons overall: https://steamcommunity.com/sharedfiles/filedetails/?id=1862208264
Yeah, I know this, but I've never used GameUISetEventHandler, so I thought I could check if the player is already using (vanilla) addAction and EH return true if they are. I will test this today and get results on how it works
weird question
would it be possible to turn the cruise missile into a tv guided missile?
with some heavy scripting, yes
If you disable an AIs features like movement will it still respond to commands in a script? How could you override vanilla AI
doMove should already "override" their movement
What's the consensus on using profileNamespace for long and complicated persistent missions? On my use case I would not just have one persistent mission, but multiple persistent missions that players can play. Think Antistasi, Mike Force, Vindicta and HeartsAndMinds all available to players.
My gut tells me that bloating the profileNameSpace is not a good idea. When is the profileNameSpace loaded? At every mission start?
it's loaded when user's profile is loaded
if you want to keep it mission specific, there is https://community.bistudio.com/wiki/missionProfileNamespace
We would play persitent missions during the week, and proper scripted scenarios(missions) on the weekends. They all would be present on the server's mpmissions folder
I know about that, I'm just pondering about the cons of letting profileNamespace bloat, as most all persitent missions, with exception of Domination and Vindicta(FileXT) uses the server profile
it can become corrupted
When is it best to separate your code into functions? And which calling method is appropriate?
anytime you have boilerplate code
wdym boilerplate code
ok
and ofc if you have a 1000 line file
better to seperate it and give each part a name
Trying to figure out how I would start fiddling around with scripting but im not sure what to practice
It depends on what you have now and what you want to do. The editor has a lot of modules and triggers etc. that you can use to make the task work. If you want to do these things using a script, you should first decide what you want to execute. Without a plan, it's hard to start building scripts
@agile cargo Worst problem for me in practice is that because all data for all mods and missions is in the one file, you can't swap one without the other.
I recommend using hemtt. Learn it once, saves you so much time and frsutration.
hmu if you need a template to go off of
Hello. I'm trying to turn the lights on and off. I have a sound from the light bulbs, but I do not understand how I can turn them off. say3d can only be disabled by deleting the object. Can anyone suggest? Mission for multiplayer.
[] spawn {
while {electricity_on} do {
if (electricity_on) then {
hint"electricity_on";
sleep 0.2;
_obj= "HeliHEmpty" createVehicleLocal [0,0,0];
_obj attachTo [blight1,[0,0,1.5]];
[_obj,["neons", 20, 1]] remoteExec ["say3d",0,true];
sleep 1.8;
_obj= "HeliHEmpty" createVehicleLocal [0,0,0];
_obj attachTo [blight2,[0,0,1.5]];
[_obj,["neons", 20, 1]] remoteExec ["say3d",0,true];
sleep 4;
_obj= "HeliHEmpty" createVehicleLocal [0,0,0];
_obj attachTo [blight3,[0,0,1.5]];
[_obj,["neons", 20, 1]] remoteExec ["say3d",0,true];
};
};
};```
What is the HeliEmpty object for?
To make a sound out of it.
Is anyone aware of a way i can add a script to a turrets init that when its upside down the crew wont bail?
cant just turn simulation off as i need it to still function
The alternative syntax provides the ability to keep the crew in vehicle when it is upside down.
call compile format ["
_wp setWaypointStatements ['true','[%1] call execParadrop']"
,_transport];
Getting an error about missing ] in the expression [O Alpha 1-1:2] call execParadrop.
translates to "your command doesn't make sense from the syntax standpoint"
What is the proper way to get the variable into the statement?
variable by name or the contents of variable?
by name - _wp setWaypointStatements ["true", format ["[%1] call execParadrop", "globalVariableName"], but you have a local/private variable (it starts with _) in your example, and it can't be transferred this way
by contents - i can't think from the top of my head. Maybe _wp setWaypointStatements ["true", format ["[%1] call execParadrop", _vehicle call BIS_fnc_objectVar], but that's "make a global variable for it and go by the name of this new global variable"
the param type is objNull
another question lmao
Is there any way to disable gravity on a vehicle/turret without turning off its simulation so it still functions?
tried looking but was only able to find directions to disable simulation all together
format makes it into a string ๐คทโโ๏ธ Another workaround would be to setVariable it onto a trigger or some other object, but that also is effectively making a global(-ish) variable
don't know any other variants except setting the object's position (to desired one) and velocity (to 0) every frame
alright, thanks regardless
on your "Is there anything similar to the zeus Attach to in eden?": something like [this, objectToAttachTo] call BIS_fnc_attachToRelative in the Init field may work ๐ค
@novel delta you can probably create negative gravity with addForce by using 9.8 in the upward direction per frame.
and it seems to work to hold a vehicle stationary in the air while still having it working ๐ค
as in "detecting enemies, rotating turret and shooting" and taking damage
Attaching the vehicle to something is also a valid solution for having it float, as long as you make sure to do the attach before it falls out of the sky. Just put a dummy object somewhere out of the way and attach in place - there's no proximity requirement to attach
So im trying to setup a teleport script ive used in the past but it keeps spawning the player on the ground/sea level when i need it to spawn them in a atc tower (entrance to a bunker)
Script is attached to a bunker
this addAction ["exit base", {player setPos (getPos in1)}]
(in1 is a cone and is the "spawn" point of the teleport)
is there a way to change the altitude it spawns them at so i can tweak it till its right
Don't use setPos/getPos, it's slower and causes errors in translation because of how the two commands interpret positions differently
Use setPosASL and getPosASL
ok
that worked, thank you very much!
how would i go about using an addaction on all helis ingame? i understand in allmission objects you can filter air is configclasses the only way to determine helis?
is there a good way to get all classnames for an addon? well more specifically for a mod. Is that possible? to figure out what addons make up a mod?
You have to approach from the other direction, as far as I know. Scan all classnames, check their source mod/addon.
@tough abyss The existence of an entry within a vehicle config, like mainRotorSpeed, can be checked if you want to be very specific. You can also have an array list for them and add/subtract when vehicles are created/destroyed.
Do vehicles automatically travel on roads when their destination can be reached by road using Move or related commands? Or do I need to do something more to make vehicles move using roads
Second question, is there a SQF equivalent to yield, or some way to process lots of data without necessarily hogging engine time?
spawn or execVM. They return a script handle that can be used to determine when the script has finished, see BIKI for additional info. AFAIK execVM should be used only for scripts that get executed only once during a mission if you want to optimize performance and we have CfgFunctions as further optimization anyways now.
Also, both commands operate within the limits of internal scheduler: max 3 ms of execution time per frame (the execution will continue in the next frame) and the scheduler itself just simulates threading aka being actually single-threaded, so if you add too much and/or too heavy scripts to it, the script execution will slow down noticeably. The script execution order is not guaranteed either, but there are workarounds for that now (see spawn BIKI page).
Can you clarify what you meant with CfgFunctions being an optimization? Is there also a way to perhaps delay execution of iterative scripts so that they are executed more spread out? E.g 20-30ms?
Add sleep
DedMen was faster ๐
There's also uiSleep command
Does sleep necessarily improve performance in this case? As it is still executing in a sense?
Or would this be a script that calls other scripts and sleeps in between?
Thanks
I am new to SQF
it makes it run slower
Slower as in the execution is slower (which is a negative in this sense) or the script does not hog resources
sleep pauses the script
Ah
when its paused, it doesn't run
Does the script effectively get suspended until I assume a timer calls back to it?
it checks regularly-ish if the time is over yet
Is this done in SQF or the native C++ the engine is written in
so this can be useful for performance reasons
Engine doesn't run SQF for its stuff
When you run scheduled scripts, you don't have to worry about hogging too much cpu time
if you pause the game, simulation doesn't run, and thus sleep just suspends indefinetly until you unpause (you use uiSleep then if that's not what you want)
I see, thanks for correction ๐
Scheduled vs unscheduled scripts?
I would assume all scripts are scheduled in a sense?
Thank you
Okay so effectively a unscheduled script is a function? And it can return a value, but scheduled scripts cant and just return a handle?
no its not a function
Oh
unscheduled code just means it runs here and now
Is it blocking?
Okay
How does sleeping work in a scheduled environment if execution is limited to 3ms, i assume results vary?
Thats just what the biki says
blabla = { 1337; };
0 spawn {
private _result = call blabla; // runs scheduled, but still "returns"
};
Hmm ok
โRunning code in a scheduled environment starts a new script. The executing instance will not wait for the result of scheduled code and will continue on with its execution, so it is not possible to return any values from code executed in this manner although a Script Handle for started script is provided.โ
when you use sleep, engine sets a flag to the current scriptvm that this script needs to wait x amount of time, then scheduler checks this flag, "are you finished waiting yet? no? okay, yes? execute"
Hmm, the biki seems to be conveying that sleeping for example 1ms will not be 1ms due to scheduling differences
yes, because it depends on frametime
Hmm ok
Yes, you can communicate the result of executed via other ways though
Do I need to use math a lot when dealing with positions or does SQF have most of that taken care of
it's abit missleading, what it means is that, if you start a new script with spawn or other commands, you cannot return from it other than a script handle
Ah
- scheduler load
Hey leopard, any news on your AI endeavors?
no. I'm taking a break from modding for a while
Ah alright
is there a script to see the memory points on a model
mb, misread see as set
I mean the list of them as names
https://community.bistudio.com/wiki/selectionNames
_object selectionNames "Memory"
oh and that writes them in clipboard?
No, that's not how sqf syntax works
I'll put it in init
Put what in init? The code you just posted? Don't, it won't work
oh ok
_memoryPoints = _object selectionNames "Memory";
copyToClipboard str _memoryPoints;```
Or you can use this in the debug console while looking at the object, and copy the results from the output field:
```sqf
cursorObject selectionNames "Memory";```
In the first example I wrote a variable name wrong. Fixed now.
is there a list of the default memory points
what they mean?
cause I found a lot of non english names
a lot of the names are czech
there is https://community.bistudio.com/wiki/ArmA:_Armed_Assault:_Selection_Translations @polar belfry
what exactly are you looking for?
as in memorypoints vary a lot and pretty much all of them can be defined in config and model to be whatever
as long as they correspond to each other
The best option is to make a function, e.g. MF_fnc_flickerLight ...
params ["_origin", "_duration"];
private _sound = _origin say3D ["neons", 20, 1];
sleep _duration;
deleteVehicle _sound;
```... to use with remote execution:
```sqf
while {electricity_on} do {
[blight1, 1.8] remoteExec ["MF_fnc_flickerLight", 0]; //Don't add this to the JIP queue (that would create problems).
[blight2, 4] remoteExec ["MF_fnc_flickerLight", 0];
[blight3, 0.2] remoteExec ["MF_fnc_flickerLight", 0];
};
I saw that a plane in one of my reskins has a tailhook on it and wanted to check if the tailhook has a memory point so I can make a naval landing variant
thx!
so i made a fob with ai and props but i want all that to spawn when im in a certain distance of the fob
Is there a way to grab all grenades (thrown and/or launched) similar to allUnits and vehicles?
@sullen sigil nearObjects with "Grenade" as the type
thanks, guess i just have to have it as a really large range if i want all of them on the mission?
allMissionObjects "Grenade" may work if the entire mission is your goal
gotcha, thanks -- low gravity script 
have fun with that, messing w/ gravity without demolishing performance is a pain in the ass
yeah, think ill just have to either take the performance hit or come up with some other excuse and only have it for grenades or something
also keep in mind network latency if you're planning on having it work in MP
i am indeed planning on that however probably not indoors somehow so shouldnt be too big of a deal
good luck ๐
thank you ๐
speaking of, are you aware of any decent tools to help test network latency without having to just get 5 people onto a dedi server etc?
inb4 in-house mod that modifies the massive amounts of https://community.bistudio.com/wiki/CfgAmmo_Config_Reference#coefGravity
unfortunately not, and ultimately you're not going to see realistic results without actual MP playtesting
arent grenades cfgmagazines
๐ค
ideally at some point we'd just get a setGravityCoef sqf command or similar that modifies gravity at the engine level
that mightve just been the most stupid thing ive ever said nvm
but until then it's a tricky thing to pull off well
iirc its hardcoded into the engine
I asked one of the devs already in the ace discord I believe
stupid if so, but wouldn't be the first hardcoded thing that usually wouldn't be hardcoded in any other engine ever
that being said i cant seem to find when i asked them lol
oh no it was lou saying he thinks it may be hardcoded
things = nearestObjects [testarea, ["HOUSE"], 500];{
_m1 = _grp createUnit ["ModuleCivilianPresenceSafeSpot_F", _x, [], 0, "NONE"];
_m1 setVariable ["#capacity",3];
_m1 setVariable ["#usebuilding",false];
_m1 setVariable ["#terminal",false];
_m1 setVariable ["#type",5];} foreach things;
_cen = getpos testarea;
_m = _grp createUnit ["ModuleCivilianPresence_F", [0,0,0], [], 0, "NONE"];
_m setVariable ["#area",[_cen,500,500,0,true,-1]];
_m setVariable ["#debug",true];
_m setVariable ["#useagents",true];
_m setVariable ["#usepanicmode",true];
_m setVariable ["#unitcount",10];
```Civilian Presence module being spawned. long story short how can i add in additional arguments for code executed on spawned units?
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
#oncreated variable, fx., _module setVariable ["#oncreated", { hint format ["%1 just spawned", _this]; true }]
@copper raven ty
I have an interesting question and I'm not sure how to ask it.
Basically, got an object I ain't attached too, but I want to copy the rotation values of it, then add to the object's forward-relative roll
im not sure if that makes as much sense as I hope xD
Making a clock. I have it so the hands are always the same orientation and position (offset) from the face object. But, now I want to have them rotate around the center.
I think I'ma need to do maths x3
Sadly, I never too- uh- is this trig? idk. Or if I did, I don't remember it xD
trigonometry and setVectorDirAndUp. You'll start at 90 degrees, then 0 > 270 >180, likely going 1 degree at a time, use cos and sin to get your x and y (depending on orientation) for the position of the hand. I recommend keeping the face on only 2 axes to keep calculations simple
i want the heli crew to turn engine off and leave the heli
heli1 action ["engineOff", vehicle heli1];
_grp1 leaveVehicle _heli1;
is this correct ?
the pilot might still turn the engine back on
you cannot override AI's behavior on vehicle's engine
also it should be driver heli1 action ...
it works they land and turn off the engine but dont exit
heli1 action leaveVehicle _heli1;
is heli1 the pilot and _heli1 the vehicle?
if this is multiplayer, check the locality
no the pilot is grp1 and the heli is heli1
wat?
so get rid of the underscore on _heli1
vehicle heli1 why the vehicle then?
if i dont type vehicle it doesnt turn engine off
heli1 is the driver here, otherwise your action wouldn't work, what i wrote here:
also it should be driver heli1 action ...
didn't realise
is there a thing that will tell me if my code is obviously wrong? Like, missing a semicolon or something
yes
private _vehicle = vehicle heli1;
heli1 action ["engineOff", _vehicle];
_grp leaveVehicle _vehicle;
(and also as Lou said, locality)
giving a vehicle an action to perform may tell the driver to perform the action, so in this case it might work
heli1 is the vehicle name btw and pilot is grp1
there is a difference between _grp1 and grp1 @fresh crater
oops wrong reply
yes to me or
yes to you
most of the time, yes
what is it then?
wat?
nvm ive done it
heli1 action ["engineOff", vehicle heli1];
_grp1 leaveVehicle _heli1;
the thing that tells me if my sqf file has syntax errors
just removed the _
before the variable
it lands stops engine and they leave the heli
rpt/ingame error box thing
I don't think that'll work
make sure you have -showScriptErrors
well it worked pefectly
in the future name your variables better
heli1 action ["engineOff", vehicle heli1];
_grp1 leaveVehicle _heli1;
is the 2nd line meant to be local and other two not?
underscore prefixed variables are local variables, in any other case except things like this, thisTrigger it's a global variable
A local variable is one that only exists in the current scope (i.e. instance of script, function, etc.) and scopes derived from it.
Note: don't confuse local variables with network locality, which is to do with which machine code is running on in multiplayer.
{//Scope A
_valueA;
{//Scope B
_valueB;
}
}
Not sqf exactly, but basically, an _ means "to child scopes"
_valueA will be accessible to Scopes A and B, however _valueB will not be accessible to scope A.
Not using an underscore means it global. All scopes can access the value.
oh heh- I was so focus'd on typing I missed this xD
Yea, this can probably explain it better
locality is very very annoying I find in SQF/Arma :P
Question.... If i resume a saved game of a custom mission.... Will the initiation field... Reapply itself?
The Item in the glasses slot gets deleted when you die and getting replaced by the glass item you have selected in the profile. Any Ideas how to stop that ?
on respawn or?
loadouts and eventhandlers will; addactions, custom ui with disabled serialization and scripts that are loops won't afaik. Best would be to add that stuff you want to check, export mission to singleplayer, go to scenarios, play it, save, go back to main menu, resume/continue and see if it still works.
how can i create a tracer using scripts(not talking about the module)? Whenever i use createVehicle to make the projectile, there is no tracer effect
yes
i assume there is a built in script to apply a texture to the bullet when it is actually fired, not spawned. Although i couldnt find the script, i found the tracer texture in \a3\data_f\tracer.paa
Maybe Lou knows
ah apparantly you can't spawn tracers
you need to create some unit and make it shoot
you can spawn them, they just dont have the tracer effect
that's what i meant
which is why im asking if theres some way to simulate it so that the tracer effect does appear
The glasses spawns in immediately I think
"message" remoteExec ["hint", clientOwner];
``` if u local exec this in debug is it gonna only run for the person who run it
then why not just hint "message";? What the remoteExec is for?
clientOwner returns the network id of the executing machine, so that remoteExec makes no sense, what artemoz said^
well finding the addon is easy enough I mean the parent mod. or do you think the only way is going to be by inspecting file paths of addon pbos?
basically what I actually want to do is. given a faction classname i want to get all classnames from the mod that the faction is from
I don't really see the difficulty. There's configSourceModList and configSourceAddonList.
like, literally. sqf _cfg = configfile >> "CfgFactionClasses" >> "CUP_C_RU"; _modlist = configSourceModList _cfg; _result = "count ((configSourceModList _x) arrayIntersect _modlist) > 0" configClasses (configFile >>"CfgVehicles"); ๐คทโโ๏ธ
make sure you cache the result
why has addVest and removeVest global argument/global effect
but addBackPack and removeBackPack local argument/global effect ??
just want to know the reason behind it
most likely answer: no one knows
is there a reason lineIntersectsObjs [(eyePos player),(ATLToASL screenToWorld [0.5,0.5])],objNull,objNull, false, 32] is not detecting an object placed at 5m high ?
https://community.bistudio.com/wiki/screenToWorld
Returns the position on landscape
You don't have landscape at 0.5,0.5 - you don't get coordinates
https://community.bistudio.com/wiki/positionCameraToWorld this should work for looking up, i reckon
Likely because backpacks are actual separate objects/entities, and not just a config name linked into a character attributes/inventory/whatever
How would I add "this setSpeaker "NoVoice"" equivalent to units spawned from a module?
problem solved using
(lineIntersectsObjs [(eyePos player),((eyePos player) vectorAdd (getCameraViewDirection player vectorMultiply 100)),objNull,objNull,false, 4])
id imagine that its just an older command from previous games that never got touched (it had to be arglocal for limitation reasons? just a guess :D)
fx this https://community.bistudio.com/wiki/addMagazine the alternative syntax, arglocal in a2, argglobal in a3
addvest is a3 only and is argglobal
what module?
vanilla modules usually have some "on unit created" script that you can use
ARMST_mutantsModuleSpawn, ARMST_mutantsModuleMonster~, bottom one is interchangeable (armstalker monster spawners)
I'm using Bon's Ai Recruitment script and i want to change the spawning from random around the object with init code to on a position.
Original code
_unit setRank "PRIVATE";
[_unit] execVM (BON_RECRUIT_PATH+"init_newunit.sqf");```
Can i just shorten
```_unit = group player createUnit [_unittype, [(getPos bon_recruit_barracks select 0) + 10 - random 10,(getPos bon_recruit_barracks select 1) + 10 - random 20,0], [], 0, "FORM"];```
to
```_unit = group player createUnit [_unittype, [(getPos markerPos "marker" select 0)], [], 0, "FORM"];```
It won't behave exactly the same, but you'd want to do
_unit = group player createUnit [_unittype, markerPos "marker", [], 0, "FORM"];
ty i will give it a go
i spawned 2 ai, both spawned where i placed the marker
ty
np
private _nearMen = _chemLight nearEntities [["Car","Motorcycle","CAManBase","Air","Tank"],600] select {isPlayer _x};
Will that detect players inside the vehicles? When they are drivers? When they are passengers?
nearEntities explicitly ignores entites in vehicles, you'll need to use entities instead
entities [["CAManBase"], [], true]
alternatively, if you still need to make sure they're within a certain radius of your chemlight, you can do a distance check
i.e. entities [["CAManBase"], [], true] select {_x distance _chemLight <= 600}
Thank you! I went with:
private _nearPlayers = [];
_nearPlayers = allPlayers select {_chemLight distance _x < 600 && alive _x};
if (_nearPlayers isNotEqualto []) then {
{[_chemLight]remoteExec["_VAL_fn_enhChemLightEffect",_x,true];} forEach _nearPlayers;
}; ```
wtf when did they add that
Some patches ago ๐
nvm, my bad
No worries... no one is supposed to be up to date with all the additions the devs add...
one thing to note with allPlayers is that it'll include headless clients
so make sure that's ok for what you're doing
how does the size parameter in setParticleRandom work? There seems to be some kind of exponential growth? How does this number affect the calculation for the size of the particle?
for example, setting the parameter to 10 on a particle source whose size is 1, the particles can be hundreds of meters larger
nvm, figured it out. the particle size increases/decreases by 2^(randomsizeparameter). Such a weird way to calculate it
When is it appropriate to use high level/low level AI functions? What is the difference
what functions? example?
first one takes group, the second takes a single unit
should use doMove though i've never seen anyone talk about it here
Well I would assume for say AI mods functions that deal with individuals not groups need the individual functions
yes
look up the mod's documentation or something
never heard of that one
if (_nearPlayers isNotEqualto []) then { {[_chemLight]remoteExec["_VAL_fn_enhChemLightEffect",_x,true];} forEach _nearPlayers;
you don't need to check if array is empty if all you will be doing is just looping over it with forEach
also: allPlayers select {_chemLight distance _x < 600 && alive _x}; you could use inAreaArray
oh yeah duh inAreaArray is way better
For your usecase it should be safe to use playableUnits rather than allPlayers - automatically excludes dead people and anyone on the game logic side, so less filtering needed
So I have a weapon with a working โhold space to unlock in arsenalโ action, however there is also an option to pick up the weapon. How can I have the weapon model on the ground without the option to grab it?
The thing on the ground isn't actually the weapon, it's a weapon holder (essentially an invisible box that just exists to have inventory space and display the models of items inside it) that contains the weapon. So you could try using lockInventory on it.
Other options to try:
- disabling simulation: the option to pick up may still appear but nothing will happen when you try. Not certain your addAction will work though.
- making a simple object of the weapon model: it won't be interactive, but also won't have attachments or a mag. You'll also need to make hidden non-simple object to attach the action to, since actions don't work on simple objects.
- adjust the system: you could, for example, have a universal action on the player that unlocks their current weapon. They'd have to pick it up to unlock it but you wouldn't have to worry about this problem.
on wiki page for BIS_fnc_replaceWithSimpleObject, it says "
Use with caution as this technique is not very clean - it should not be used for many objects and definitely not in MP games." -- why shouldn't it be used in MP?
My guess would be that it has something to do with synchronization between clients in MP
would make sense, localonly isn't working as desired for me sadly so need to optimise network as much as possible
what happens when i put a private variable in the JIP parameter for remoteExec?
example please
remoteExec ["spawn",0,_grenade]
where _grenade is a private variable, _grenade is a grenade in the world
it works
it's not about putting a private variable
if you pass an object into the jip parameter, that remoteExec will happen on JIP machines too aslong as that object is still there
thats why im putting an object in the JIP parameter
so eh? why would you ask that if you know what it does? ๐
how do you get if a turret is fixed or flexible?
or I guess a better question is how do I figure out what weapons a vehicle has + if they are gimballed or fixed
like what I want to do is get a list of weapons on a helicopter and see if they are fixed or flexible and I thought all weapons had to be in cfgvehicles >> classname >> Turrets but I'm not sure that's the case now?
well does allturrets work for, say, fixed wing aircraft
if it has any turrets - it would. If it doesn't have turrets - there are no turrets to list ๐คทโโ๏ธ
well sure but then how does the gun work
like, the CUP Ka-50 has no turrets. but it does have an autocannon
how does the config for that work?
https://community.bistudio.com/wiki/weaponsTurret
Use turret path [-1] for driver's turret.
Non-pylon driver weapons are located inweaponsin the base level config, e.g.configFile >> "CfgVehicles" >> "B_Plane_CAS_01_dynamicLoadout_F" >> "weapons".
_vehicle weaponsTurret [-1]will return all weapons under the driver's control, including non-pylon and pylon weapons.
Well yes, any config property can be looked up without spawning the object, as long as you know the classname
like, https://community.bistudio.com/wiki/weaponsTurret has the function in the comments that does pretty much that
yeah I'll take a look at that
though it still doesn't really tell me if something is gimballed or fixed.. or I guess it kind of does
You can also find the class' default pylon weapons by looking in configFile >> "CfgVehicles" >> "B_Plane_CAS_01_dynamicLoadout_F" >> "Components" >> "TransportPylonsComponent" >> "Pylons"
if it shows up in turrets it's gotta be gimbaled
whatever is not in turret is fixed. Whatever is in turret is gimbaled to its rotation limits ๐คทโโ๏ธ
yeah
essentially I want to dynamically select attack/light choppers. it's kind of very difficult because there is not really a consistent definition of what an attack chopper is...
drawing lines is hard in general
Not......necessarily.
On the Wipeout, for instance, the driver turret (configured at base level, not under a turrets subcat) includes both the fixed 30mm gun and the laser designator, which is connected to the targeting pod camera which is of course gimballed
would Hummingbird with .50 minigun and a bunch of Hydras be a light of an attack? The answer is: ||it'll be whatever it's used for ๐คฃ ||
yeah. I had the same issue when selecting tanks. the line between tank and ifv is pretty porous
ok well then that's confusing. so how do you determine if a weapon is fixed or flexible then
and then some bastard (like me) scripts a 155-mm howitzer onto a Neophron and gimbals it into a pilot camera as well ๐ฟ
lol
You probably don't
inb4 "Laserdesignator_pilotCamera" weapon is hardcoded in-engine to follow the camera
It's probably something like that
๐คจ
I mean really the root question is
I want to figure out if a helicopter has an autocannon. if it's fixed or not idc, if it has an autocannon that fires type shotShell and has some amount of armor that's good enough to consider it an attack helo
Well you can do that pretty easily by chaining config lookups
ye
that's not the hard part
the hard part is like. an Mi-24 has a 50 cal on a gimballed mount
but you'd still consider it an attack chopper despite the lack of a shell firing gun
but you can't just select has gimballed gun because lots of choppers have 50 cals on flex mounts that are definitely not attack helis
I guess if it has an autocannon it definitely is. and if it has a flex mount gun and enough pylons it is. but that makes the mi-8 v3 with the wing pylons an attack chopper
inb4 checking how the bots are supposed to name it and hoping for mod authors to fill that sensibly
LOL that's what I did originally
check if name singular is gunship
but nobody follows that
though honestly. it kind of is...
Has autocannon -or- has pylons seems sensible to me. Anything that has pylons available is at very least a multirole, and most of them have a fair amount of firepower available on the pylons
yeah like it needs to have some amount of armor or its a light chopper
if it has a fair amount of armor and has no guns it's unarmed transport
if it has armor and guns but no pylons it's an armed transport
if it has armor and guns and pylons it's an attack chopper
if it has armor and an autocannon at all its also an attack chopper
and then somebody says "screw it" and just fills the lists with manually selected classnames
idk military designations are dumb they mean lots of things to different people
tbh that might be less work but I like doing hard things sometimes. it's fun
if it has armor and guns but no pylons it's an armed transport
Unless it's an attack helo from before the dynamic pylons update / configured by someone lazy
the same vehicle can be classified as, say, "Tank", "Tank Destroyer" and "Anti-Tank Gun Self-Propelled" (if i remember the names correctly ๐คฃ )
the painful thing abt arma is that you have to deal with 20 some years of cruft going back to OFP
one of the biggest reasons I'm waiting for reforger to get big
Don't forget the Rhino MGS is an "APC" in Arma
I mean it kind of is
It is not
don't forget that "Snake" is "Man" in Arma
well, in Metal Gear Solid as well
long story short, drawing lines is hell
"CAManBase" is the class for the human-human
Similarly there are transport helos in some modsets that share data with heavily-armed versions, just with nothing on the pylons.
nothing by default, or nothing compatible at all?
Compatible in some cases.
"inconsistent in general"
What kind of maniac lets a vehicle have config for pylons it visually doesn't have
CUP_B_30mm_AP_Green_Tracer is a bullet somehow
Well, if it's some sabot penetrator...
sure, that's fair. but then so is CUP_B_30mm_HE
hah
๐คฆ
class B_30mm_AP: BulletBase looks vanilla though?
yeah that's what I don't get. how is it a bullet when it has explosive filler. isn't that obviously a shell
This is the same for vanilla 40mm autocannon rounds btw
so i guess it's better to look at cfgammo >> classname >> explosive and see if anything is >0
cant wait to find out that 12.7x108mm is somehow explosive
CUP 30mm HE inherits from vanilla 30mm HE. Vanilla 30mm HE inherits from vanilla 12 cal HE ๐คฃ
vanilla 12 cal HE inherits from BulletBase
the joys of digging in Arma configs
I guess bullet vs shell is more about how simulation is synchronised? Like bullets get a local copy everywhere but shells are global.
indirectHitRange config property is a reasonable way to tell if it's explosive
HOW IS A LASER BEAM EXPLOSIVE
never watched Star Wars?
I thought that wasn't allowed here :^)
also i think those are called blasters or something
That's the ammo used in the laser batteries for handheld designators. I'm like 90% certain it's just the ammo equivalent of fakeWeapon and it's never actually fired, so whoever did the config was probably just goofing. It also has a hit value of like 500
how can I make a switch for ctrlCreate ["RscButton", 1601];
more details please
I have two RscButton's I want a switch for each one to chose a case inside of a func
switch (_cond) do
{
case 1: {};
case 2: {};
};
```https://community.bistudio.com/wiki/switch
how do I define _cond
not sure how to
https://sqfbin.com/izomecubudifokugacek this is the function that I want the gui to chose from
How you need to define it is very contextual. It really depends on exactly what you're trying to do. Have a look at the switch page Lou linked and see if that helps.
Lock inventory is interesting, but perhaps unlocking a weapon by picking it up is more natural, and then the player who found it can use it instantly and the others can pick it up at a crate; will look into that also
I'm actually reasonably proud of this script so I'm gonna put it here if anyone wants a script to dynamically select helicopters or get helicopters by faction - you'll probably need to make changes to it for whatever scenario you're using it for but I feel like it would come in handy for more ppl than just me https://sqfbin.com/xalimagotavulobuvuzo
at least seems to work w/ vanilla and cup reasonably well. haven't tested w/ rhs though
oh and obv it's written w/o performance in mind so it's slow. like 3 calls of that take nearly half a second. could prob be optimized down but it's intended for setting stuff up at the start, like a static data type thing
Are variables with _ in them local?
yes
Is there a way to excecute sth exactly when the player opens their eyes for the first time? What I've found during research wasn't helpful.
Hitting the respawn time is easy, but the first spawn is elusive.
Background is that I have a greeting script and neither want to have people waiting long in front of a black screen nor have them miss it, depending on how quickly they load in
introSeq = [] execVM "intro.sqf"; Is this how you are supposed to execute a mission intro in init.sqf
Is there away to repair a drown engine ?
Yeah, but it still is not exactly the point where it happens. Depending on how quickly they load in this still has a spread of several seconds
will this wait until all players have loaded the mission and are in the game?
waitUntil {{preloadCamera getPosATL _x isEqualTo true}forEach allPlayers}; //initPlayerLocal.sqf
i need to ensure that all players have loaded the mission so i can execute a code
Does anyone know if we can measure performance on a Headless Client in a similar way to measuring server FPS on the server executable? diag_fps seems to consistently return 10 (or very close to it) which I assume is the headless clients actual framerate, not equivalent with the server's FPS
yes
one sec
@blazing zodiac this will show you avg server fps, avg hc fps, avg client fps
OK great, thanks. Do you know normal ranges for HC FPS?
@shut reef Maybe existence of display 46? Not tried it though.
no, it won't
@blazing zodiac depends on ai count. it'll cap at 50 fps
higher is better. below 25 fps is usually a bad sign
In most cases you don't want to dump all the AI on the HC because then the server's not doing much.
oh, so the headless client has the same rules as the server executable?
I believe so
I see, I wasn't sure since the HC is technically a client and FPS is measured differently on the client as far as I know
I'll do some more testing, to see if it lines up
Is there a reliable way to ensure that all players have finished loading the mission?
I have a question: Is there a way to get the vectorDir of given selection of an object ?
I'm so stupid, can't seem to get a simple IF statement to work. What's wrong with this?
C = floor (random [1,5,10]);
if (C < 4) then
{
"mrk1" setMarkerAplha 1;
}
else { "It's false" };
alpha misspelt, no semicolon at the end of the if statement.
oh, there's an else. Just the alpha then.
Also you really shouldn't use a global variable there although I think one called "C" is technically legal.
General tip: Install this mod and paste your code into it. It's really good at picking out the syntax errors.
https://steamcommunity.com/sharedfiles/filedetails/?id=2369477168
Thanks I'm so stupid, also huge thanks that tool will be a life changer
is there a way to check if a unit's flashlight is on?
That is a good clue tho, thank you, I'll give that a try
and also for some reason adds one closing parenthesis too many each time xD
go look at the mission files for the first APEX mission. the files there will show you how to do this
has to do with sending the server a check that the client is ready, when all clients are ready, it will fire
I wasn't the one who asked, I just commented on the advanced dev tools
HC is also a weaker machine with fewer cores/etc
okay, i tried this:
//initPlayerLocal.sqf
waitUntil {getClientStateNumber >= 10};
sleep 1;
trigger1 enableSimulation true;
and this returns true as soon as the first player is in game, it does not wait unit all players are in game.
because initplayerlocal is executed for every player individually, initServer is for whole.
also, every machine (both client and server) gets its own copy of the trigger when it's not set to "server-only" :3
https://community.bistudio.com/wiki/BIS_fnc_garage
So this function works as intended except for the vehicles spawned by this apparently dont take damage, anyway to fix it?
I want my player to have limited respawn tickets for a mission, but if they collect items and return to base and give them to something it will restore some tickets.
Does anyone know if this is firmly possible or not and if it is possible does anyone know how to set it up?
Hi guys, im having trouble with a script of mine.
I want to know when a mortar flare is being lit so i can execute code when it happens. Right now i got these two files:
Init.sqf:
mortar1 addEventHandler ["Fired", { munitionstyp = _this select 5; projektil = _this select 7; execVM "munitionfired.sqf"}];
munitionfired.sqf:
if (munitionstyp == "vn_mortar_m29_mag_lume_x8") then {
sleep 1; projektil addEventHandler ["SubmunitionCreated", {hint "flare is lit"}];
};
My problem is, that once munitionfired.sqf is executed and the "submunitioncreated" EH is called, i get the following error:
Error Foreing Error: Unkown enum Value : "SubmunitionCreated"
I tried searching already and only found this page here https://community.bistudio.com/wiki/Unknown_enum_value which basically states that this type of error occurs when you did a typo, which doesn't apply here. So anyone got suggestions?
@trim tree You're applying projectile-only event handler to a unit, not a projectile
_this select 7 is _gunner, the unit that pulled the "trigger"
Thus it errors out as that event handler is invalid for units
The shot is _this select 6
Also, pass arguments right into munitionfired.sqf instead of assigning them to global variable. What if you'll have two mortars firing, second one will overwrite global variables if both fire.
mortar1 addEventHandler ["Fired", {_this execVM "munitionfired.sqf"}];
private _munitiontyp = _this select 5;
private _projektil = _this select 6;
if (_munitiontyp == "vn_mortar_m29_mag_lume_x8") then {
_projektil addEventHandler ["SubmunitionCreated", {hint "flare is lit"}];
};
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Fired
_this select 6 is "_projectile" (7th argument, counting from 0)
You run it locally, THEN you have to tell the server that the client is ready. The wait and final execution needs to be on the server side. You would use publicvariable/server/client for variable sending and request.
So for example, I start everyone off with a black screen that says waiting for players. When the client is done, it grabs an array variable that is public, modifies itself to it, then sends it back. Server is waiting until all of the clients are present in that array, then executes mission start.
thanks, i thought i had counted it right ๐
Ok so now it doesnt spit an error anymore but it also wont show the hint when the flare goes active. I fear that submunitionCreated isnt the right EH for this case, or am i missing something else?
execVM "munitionfired.sqf"} don't execVM in a fired event handler 
if (munitionstyp == "vn_mortar_m29_mag_lume_x8") then { sleep 1; projektil addEventHandler ["SubmunitionCreated", {hint "flare is lit"}]; };
you don't even need to schedule a new script immediatly, stay in unscheduled for as long as you can, especially a fired event like this
my i ask why?
execVM (re)compiles the script everytime
so performance reasons i guess?
make it a function
and also call first to stay in unschd, then later, if it's the correct ammunition type, spawn the sleep part
Because theoretically i would only need this called at the very beginning of the mission for one time only
the sleep was only put in there by me just in case there were some overlapping issues, it is not really needed
make a function (preferably using https://community.bistudio.com/wiki/Arma_3:_Functions_Library),
if (_this select 5 != "vn_mortar_m29_mag_lume_x8") exitWith {};
_this select 6 addEventHandler ["SubmunitionCreated", { hint "flare is lit" }];
mortar1 addEventHandler ["Fired", { call mytag_fnc_onFired }];
alright, ill have a look into it
Am I correct in the assumption that playSound should be used for playing sound to the player and only the player in the context of an action bound to a key that makes a sound?
It's either that or playSoundUI
ty, was concerned with subtitles and such
anyone know what drag coefficent game uses on falling human bodies?
or where to find the data
or another way to find the gravitational velocity curve
or rather i should say the drag force, given that the game seems to not using shape at all
createVehicle command is broken. if you use "FLY" so that it does not immediately plummet to the ground, it ignores the z. so there is no way to make anything spawn at intended altitude.
it will be made airborne at default height
looks intended though?
or at least documented ๐คทโโ๏ธ
setPosATL/ASL afterwards
I found that only works with a delay through spawn, presumably because otherwise it gets executed before the thing exists.
is it possible to get location of parts of an object? Such as position of your hand or position of a certain part of a vehicle
without using attachTo
thx, i was searching "hitpoint" instead of "selection"
you can wrap all this in an isNil {} so it executes unscheduled
createVehicle -> createVehicleCrew -> setPosATL in debug console seemed to work in my local testing ๐ค
what exactly is the point of the "incapacitated" hit index?
There are two versions of createVehicle. One of them waits until the vehicle is created before returning.
Wait no, that's createUnit :P
_TEST = [2,1,1,2,1,2,2,2,1,1,1,1,2,2,1,2,1,2,1,2,2,2,2,2,2,2,2,1,2];
{
if (_x isEqualTo 2) then {_TEST deleteAt _forEachIndex;};
}forEach _TEST;
_TEST
Output: [1,1,1,2,1,1,1,1,2,1,1,1,2,2,2,2,1]```
_TEST = [2,1,1,2,1,2,2,2,1,1,1,1,2,2,1,2,1,2,1,2,2,2,2,2,2,2,2,1,2];
{
if (_x isEqualTo 2) then {_TEST = _TEST - [_X]};
}forEach _TEST;
_TEST
Output: [1,1,1,1,1,1,1,1,1,1,1]
is that normal ?
that deleteAT automatically resize the array and the forEachIndex is gonna be wrong for the next index
Yes, don't delete from an array that you're iterating over.
Can anyone help with making some BIS_fnc_holdActionAdd for players on a MP dedicated server?
https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd
Doesn't Example 2 help you?
How do I get a zeroing of the current weapon of a certain turret of a vehicle?
vehicle player currentZeroing [currentWeapon vehicle player];```Something like this doesn't help me
Oh wait - I need to pass player as the argument not vehicle itself?
However it only returns the manual zeroing, won't return lased distance
use select if you want to filter
there it's actually a value that does not rely on array elements, so using _arr = _arr - [_value] is better
How do I get a list of units within a group?
units groupName
Damn SQF is somehow complicated and simple at the same time
first result of your exact question (+ arma 3) on google is units command 
Sometimes discord is my friend ๐๐ญ
The problem with SQF is less often that the language itself is complicated and moreso that a good deal of the commands have weird edge cases and alternate behaviors to consider
that and there's usually 3+ commands that can all do the same thing with various levels of efficiency/efficacy
which is why the biki should be your friend
As a workaround, can I somehow access to a control that is defined in RscInGameUI in script level and use some ctrl related commands like ctrlText?
yeah, just look up its IDD
Can you? findDisplay 300 can't find it
ah, its a title probably
its probably initialized with the initDisplay thing which stores it in uiNamespace
whats the classname of it?
uiNamespace getVariable "classname" should work
Any of it. Let's say if you've an MX rifle then it should be RscWeaponZeroing
And urm, does it either? I only get nil from uinamespace getvariable "RscWeaponZeroing"
is that a subclass of RscInGameUI?
check the config, it should have some onLoad event
i dont have a pc next to me atm, would check ๐
i remember doing something similar though
Interesting. Let me know if you've got it
will ping you
has anyone done a vehicle rearm script which doesn't use "setVehicleAmmo"?
looking at the vanilla re-arm, it steps through vehicle weapons and refills them 1 at a time
this seems preferable, however there seems to be some missing script commands
well different vehicle weapons would have different ammo counts vs capacities
setvehicleammo simplifies everything to the point there is no "getvehicleammo" getter
if a player drives onto a re-arm pad, do i set the rearm state to empty, add a sleep delay then "setvehicleammo 1" ... or add ammo to what is already there
what commands are you missing?
I just want an array of the vehicles weapons (those that are affected by setvehicleammo), the current ammo count, and the ammo capacity
then i can just step through with "setammo"
ive been playing with "magazinesAmmoFull"
but it excludes things like countermeasures
also use https://community.bistudio.com/wiki/setMagazineTurretAmmo not setAmmo
eventual goal is to disable the vanilla vehicle rearm stuff, since it allows bad behavior, like parking an AA gun right beside an ammo truck for unlimited AA
@copper raven that command has a bright red "broken" warning
Broken when vehicle has multiple magazines of the same type.```
yes remove and readd them one by one if you have multiple
sounds complicated :\
i don't know why you want to "step through" instead of using setVehicleAmmo
i dont want to reduce the existing ammo count
reduce how? example?
if there are 85/200 shots in the machine gun and 19/24 shots on the cannon
ah so you want to rearm the mag, and keep the 85 shots or what?
i want to rearm the 19/24 one by one, so 19,20,21,22, etc ... and keep the 85/200
thats roughly how the vanilla system works
if you start re-arm and then leave
"setvehicleammo" slightly annoying too, does not fully re-arm the vehicle, only the current mags, doesnt refill empty ones
"setvehicleammodef" does refill the empty ones, but then it overwrites any scripted weapon changes
all in all, an unpleasant experience to script vehicle rearm ๐
Does anyone know how to "cancel" and attachtorelative?
Example I am using
[ObjectOne, ObjectTwo] call BIS_fnc_attachToRelative;
I just want to know how to make this false after and "detach" the object
detach command
oh... that's simpler than i thought lol
[objectOne, objectTwo, relativePos, finalWorldPos] call BIS_fnc_detachFromRelative;
```๐
Hey, is there any way to hide units from enemy high command on the map? The map markers seem to persist and follow the revealed unit for a long time after not being seen. How can i force them to be hidden?
I think it's the player setvariable ["MARTA_hide", groups here ]; that does that
thank you!
yw
So question about the wiki. I wish to add an example to a page but for years now it just says "Registraion of new accounts for the Community Wiki has been temporarily suspended. We apologize for the inconvenience." Is there any way to make contributions?
You can ask for changes to be made in #community_wiki , and if you ask very nicely they may allow you to have an account
Thanks, I've been wondering how people got there stuff up there
Been a few things I would've liked to put up in the past couple years, but I can't remember what half of them are ๐
is it possible to change or remove the black background of hint notifications?
hmm the player landing autopilot doesn't seem to land on the nearest airfield. I wonder what criteria it uses to select the airfield where to land at?
it should, try in vanilla Eden?
it doesn't seem to work but it maybe that my tests are not accurate as the runway can be really long sometimes
checking the distance to the middle of the runway
red shows the path
you should ask that in GUI modding, it maybe possible to edit the config
I received this line of code to input into a modded module(MGI Spawn Group Attack), and I was wondering if someone could help me edit it so it selects a marker position from a list.
params ["_group","_leader","_vehs"]; private _wp = _group addWaypoint [getMarkerPos "marker_0",0]; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointSpeed "FULL" ;
And setWaypointType "MOVE";
Didn't even think about that one. Its purpose is to have the AI essentially try and capture a handful of zones (which is another demon I'm wrestling with)
Do you have an array set up for the list already, or just a bunch of marker names?
Currently neither. Was hoping for the how-to first
I have where I want the markers to be, just nothing set yet
params ["_group","_leader","_vehs"];
private _mrk = selectRandom ["my_marker_0", "my_marker_1", "my_marker_2"];
private _wp = _group addWaypoint [getMarkerPos _mrk, 0];
_wp setWaypointBehaviour "COMBAT";
_wp setWaypointSpeed "FULL";
But if you're doing zone capture stuff then you'll probably want to start writing proper scripts at some point, with unified data.
For the time being, I'm just trying to get the spawned in AI to create an aerial presence. Because this will be applied to multiple modules, I may apply a Destroy waypoint to some to have different actions being executed. Thank you for your help.
Is there any way to add/remove the open door action? (Locking variable won't work for this purpose)
I believe making the building a simple object would do it, although it'll be indestructible
Should be fine for this purpose as the doors are their own objects/can be -- though wiki says BIS_fnc_replaceWithSimpleObject should not be used in MP games, I need it to be MP compatible so
If it's Editor-placed, tick the box in its attributes.
If it's script-spawned, you may have to create it as a simple object rather than converting it.
So I'd have to replace the object with a simple object via createvehicle and setpos blah blah blah?
Well, I'd recommend using createSimpleObject rather than createVehicle, or perhaps BIS_fnc_createSimpleObject
oh right yeah but same principle
sadly not the answer i was hoping for but it'll work ๐
me again, is there any way to easily change the direction that particles are emitted?
setParticleParams
i said easily ๐
whats the issue, the velocity is the 7th element in the array, change that and leave everything else the way you want it
trying to copy everything from CfgCloudlets precisely into a script format and not getting a single thing wrong is the issue lol
there might be a function i dont know of, otherwise you will have to make your own
Hey all, I'm having some trouble getting the new Modded Keybinding system to work: https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding. I've added the following to my missionFile description.ext and they don't come up in the menu or in the config viewer.
class CfgUserActions
{
class FK_groupPing // This class name is used for internal representation and also for the inputAction command.
{
displayName = "3D Group Ping";
tooltip = "Create a 3d marker in the game world that your entire group can see.";
onActivate = ""; // _this is always true.
onDeactivate = ""; // _this is always false.
onAnalog = ""; // _this is the scalar analog value.
analogChangeThreshold = 0.1; // Minimum change required to trigger the onAnalog EH (default: 0.01).
};
};
class CfgDefaultKeysPresets
{
class Arma2 // Arma2 is inherited by all other presets.
{
class Mappings
{
FK_groupPing[] = {
0x25, // DIK_K
"256 + 0x25", // 256 is the bitflag for "doubletap", 0x25 is the DIK code for K.
"0x00010000 + 2" // 0x00010000 is the bitflag for "mouse button".
};
};
};
};
class UserActionGroups
{
class ExileKeybinds // Unique classname of your category.
{
name = "Exile"; // Display name of your category.
isAddon = 1;
group[] = {"FK_groupPing"}; // List of all actions inside this category.
};
};
iirc this is meant for mod config, not mission description.ext file
Got it, I'll add it to a client mod and see if it works.
Unfortunately, this had no effect. Still nothing in the config viewer or the controls menu