#arma3_scripting
1 messages · Page 688 of 1
yep
see https://community.bistudio.com/wiki/alive
for examples
the pinned message in this channel about SQF is a good starting point too if needed
The one by you?
gotcha
The one by me 😎 😜
I still am trying to figure out how I use the CursorTarget command
cursorTarget
🙃
Am I using the remoteExec syntax correctly?
["Hello", 100, 100, 1, 0, 0] remoteExec ["BIS_fnc_dynamicText", 0];

yes
not sure about the arguments
0 is optional for remoteExec
yeah ik
I mean idk if they're correct. if you checked the wiki then they're probably correct
Do I have to define something?
why don't you explain what you're trying to do?
{if cursorTarget unlinkItem hmd}
😐
not shooting 
I'm asking what are you trying to do
I still don't get it
I need more details
unlinkItem hmd cursorObject
I think I made it worse
wdym?
insisted on doing it my way
and have no idea what im doing
still getting an error
unlinkItem hmd cursorObject
eh
How do you target something ..
aiming down sights? 😁
Im trying to do a Zeus module
and what does "targeting" have to do with a zeus module? 
🍿
I'm using the Zeus module to target a unit to remove the attached NVGs they have
@little raptor
you can't do it with a module
What ..
could you not do it with a custom Zeus drag & drop module?
That's what I'm trying to create.
(I don't know a lot about Zeus)
you mean like the Arsenal one?
I'm reading other code to try to understand how to code Zeus modules.
script starts off with these ```sqf
params ["_logic"];
private _unit = attachedTo _logic;
deleteVehicle _logic;
private _isAttached = !isNull _unit;
No idea what any of that is
Is it talking about game logic?
Might be way to advanced for me
I'm assuming it gets attached to zeus then? 
if so you can try this:
params ["_logic"];
private _unit = attachedTo _logic;
unlinkItem hmd _unit
no
I just found this:
_unit = objNull;
_mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]];
if ((_mouseOver select 0) == typeName objnull) then {_unit = _mouseOver select 1;};
BIS_fnc_moduleRemoteControl
@noble flint
params ["_logic"];
_mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]];
if ((_mouseOver select 0) == typeName objNull) then {
_unit = _mouseOver select 1;
unlinkItem hmd _unit;
};
deleteVehicle _logic;
Might be close but not yet there
that's literally it. you're probably not doing it right
["Custom Modules", "Remove NVG",
_mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]];
if ((_mouseOver select 0) == typeName objNull) then {
_unit = _mouseOver select 1;
unlinkItem hmd _unit;
};
] call zen_custom_modules_fnc_register
that's wrong
what is?
sharp already told you
{}
["Custom Modules", "Remove NVG",
_mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]];
{if ((_mouseOver select 0) == typeName objNull) then {
_unit = _mouseOver select 1;
unlinkItem hmd _unit;}
};
] call zen_custom_modules_fnc_register
is that closed now?
hi, anyone has a method for additemcargo or additemcargoglobal but on dedicated server?
It works on multiplayer but on dedicated server, they dont show up for player. I was thinking of adding them local but idk if for each player, the item increase due to locality
additemcargoglobal should show up for everyone, regardless of locality
Looks like its still not running
i tried on the init in eden but it isnt working
yea, because you're doing the same mistake again
like it work on multiplayer but not in DS
init, you mean init field of an object?
["Custom Modules", "Remove NVG",
{_mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]];
if ((_mouseOver select 0) == typeName objNull) then {
_unit = _mouseOver select 1;
unlinkItem hmd _unit;}
};
] call zen_custom_modules_fnc_register
still wrong, }; ] call zen_custom_modules_fnc_register
that ';' is illegal
["Custom Modules", "Remove NVG",
{_mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]];
if ((_mouseOver select 0) == typeName objNull) then {
_unit = _mouseOver select 1;
_unit unlinkItem hmd _unit;
}
] call zen_custom_modules_fnc_register
unlinkItem hmd _unit https://community.bistudio.com/wiki/unlinkItem
that one's my fault 
Wrong usage?
_unit unlinkItem hmd _unit;
ye because there's a missing '}' now
What is the correct way to indent
_a = 1;
{
_a = 2;
}
vs
_a = 1;
{
_a = 2
}
so
[
"Custom Modules",
"Remove NVG",
{
_mouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]];
if ((_mouseOver select 0) == typeName objNull) then {
_unit = _mouseOver select 1;
_unit unlinkItem hmd _unit;
}
^ here
] call zen_custom_modules_fnc_register
you can clearly see a missing '}' now
more generally
{
{
{
}
}
}
by 3 it looks like prob preference right?
usually it's 4
Welp
I feel pretty dumb
I'm going to digest what I've learned today.
The best way to see what things is to look at other code, and the wiki?
Also whats the best way to debug your code
There are also code examples on the wiki
using brain.exe 😄
there is debugging and debugging
if you write code and it doesn't compile, write/indent/check it properly
if you write code and it doesn't do what you want then yes, debug by asking here, checking the wiki, etc
Can tags not include numbers in them?
tags?
the tag for my functions
Quick question (I hope)
I create a waypoint for a group using:
_wp0=nase addWaypoint [getMarkerPos "shilka_1",0];
_wp0 setWaypointDescription localize "@STR_cwr3_cwc30_wp1";
So far, so good. But how can I hide the black markers and line connecting my position and the waypoint destination?
[nase,0] setWaypointVisible false; doesn't do that
you mean on the 2d map?
yes
i know what you mean, but i don't think that's possible, maybe map content difficulty setting?
Thought as much as I can't find anything to hide them, no matter how long I search
isn't there a setWaypointVisible command?
that hides it on 3d
it links to showWaypoint for the map! @worn bone
Let me try that. Should work with no waypoints for players at all. Makes your life more enjoyable 😆
Nope, still visible. Even when 'waypoints' are set to hide in game options.
_wp0 =nase addWaypoint [getMarkerPos "marker0",0];
[nase,0] showWaypoint "NEVER";
how can i make a script that select a code in random and execute it?
this addaction ["hi",{selectRandom [hint "1",hint"2",hint"3"]}];
i keep getting 3
you're calling selectRandom on nothing basically
oh it is not inside the []
this addaction ["hi",{hint str ceil random 3}]; ?
this addaction ["hi",{call selectRandom [{}, {}, ...]}];
this addaction ["hi",{call selectRandom [{hint"1"}, {hint"!"}, {"hint"3"}]}];
Generic error in expression
yea, you can see it based on syntax highlighting
got it. perf thank you!
@digital torrent better selectRandom the text
hint is just pseudocode
what do you mean?
i guess
Today I learned a new SQF command:
https://community.bistudio.com/wiki/importance
so funny that there are so many commands that I still keep seeing new command names
sure, but you need to script it
How would I know when to use a function or command?
And what does it mean to define something
#define
when you need it? 😄
So many commands
I dont even know where to start
To even learn
What does _this select 0 do?
Or where can I find that
Belongs to?
im still having this problem in the editor where my units arent starting with the equiptment i gave them through the editor
does the edit loadout feature just not work?
ai units?
i mean if you have respawn enabled, you need to reapply them
that's the only reason i can think of for it to not work
im using the menuposition respawn template
and apply the loadout(s) on respawn
you can also use the built in respawn loadouts https://community.bistudio.com/wiki/Description.ext#CfgRespawnInventory
if i apply this to initplayerlocal then it will only do it for someone once they join right?
and not everytime they respawn
correct
Does anyone know how to make it so a script is ran after blufor captures a sector module? Thanks in advance.
player addEventHandler ["WeaponAssembled", {
params ["_unit", "_staticWeapon"];
if !(_unit getVariable ["Engineer", false]) then {
player action ["Disassemble", _staticWeapon];
playSound "Denied";
["<t color='#FFBB00' size = '.5'>You're not an Engineer.</t>",-1,0.8,5,0.5,0,789] spawn BIS_fnc_dynamicText;
};
}];
The script above applies to every static assembly, but I would like it to only apply to the "B_G_HMG_02_high_F". Would someone be able to help me write this correctly please?
so this is great. Got the live feed to work, but can someone please help me out.. ? I want to play it on a tv I already have spawned in the game. OR... figure out how to place the tv where I want it. with this script it just places it ahead of me facing the opposite direction . Thank you _video = ".ogv";
_screen = "Land_TripodScreen_01_large_F" createVehicle (player modelToWorld [0,10,0]);
_screen setObjectTexture [0, _video];
[_video, [10, 10]] call BIS_fnc_playVideo;
sry, not live feed, prerecorded video
I have spent a lot of time with this, surely it's something small I am missing. please help
add another if then statement or add it to the current conditional.
if (typeOf _staticWeapon == "B_G_HMG_02_high_F") then {};
the sector module has an "expression" box you can input code into. write it in VSC/Notepad++ and copy paste it to there. You have the following variables to work with...
params ["_module", "_ownerSide", "_previousOwnerSide"];
just change _screen to your preplaced tv if you've given that tv a variable in the editor.
_screen = myTVScreenVariableHere;
Anyone know of a function or code to reset ace stamina mid-mission?
params[ "_sector", "_owner", "_ownerOld" ];
if !( _owner isEqualTo sideUnknown ) then {
[east, 50] call BIS_fnc_respawnTickets;
wa1 hideObjectGlobal false;
"Respawn_west" setMarkerPos [2671.527,2873.644,0];
deleteMarker "Respawn_east";
s1 enableSimulationGlobal false;
};
}] call BIS_fnc_addScriptedEventHandler;```
I'm new to scripting so i'm properly missing something obvious but how to i make it so this only fires when blufor takes the sector, thanks in advance again.
thx all, I'll give it a try
so I figured out most of it but still the placement is troubling still. I am using now CreateVehicle GetMarkerPos "my marker name here" .. is there a way to get it to face a different direction?
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
plz 😅
_video = "video file path";
_screen = "Land_TripodScreen_01_large_F" createVehicle getmarkerPos "marker variable name";
_screen setdir 180;
_screen setObjectTexture [0, _video];
[_video, [10, 10]] call BIS_fnc_playVideo;
oh, ok.. . thx
how come none of the camera target functions (camSetTarget etc) wont work for curatorCamera ?
which camera commands do work with this camera?
I also believe "because it would lock Zeus onto one target" and it is not an acceptable state
I have only tried camSetPos and target...
yeah could be
but camSetPos doesnt work either
curatorCamera SetPos does work but when I try to turn the camera with setVectorDirAndUp then the camera freezes
maybe worth making a ticket?
nah 😄
u kidding?
well… I don't see that being fixed but I might be wrong 🙂 search for an existing ticket if any, otherwise create it yeah 🙂
ok yeah im creating the ticket...
How do I make a trigger be activated by a specific object?
Sync the object with the trigger.
what if its a an object that gets spawned in by script @cosmic lichen ?
pretty sure it's https://community.bistudio.com/wiki/triggerAttachVehicle
Private
_Detector = createTrigger ["EmptyDetector", (_Pos), false];
_Detector setTriggerActivation ["Any", "PRESENT", true];
_Detector setTriggerArea [6.2, 6.2, 0, true];
_Detector setTriggerTimeout [0.5, 0.5, 0.5, true];
_Detector Setpos (_Pos);
waituntil {(_Detector distance _Pos) < 5}; // seems to be a slight bug where the trigger is irregular in registering objects, this line gives the trigger the time needed to register properly
uisleep 0.5;
_Detector Setpos (_Pos); // as stated above, this ensures that the trigger is in place.
if (list _Detector IsEqualTo []) then {_Fob_Clear = true};
if !(_Fob_Clear) exitwith {["Something is blocking the car-spawn area, teleport try to clear it out", [0.7,0.1,0.1,0.8]] spawn Tally_Fnc_Short_Msg; deletevehicle _Detector; };
You could use this and tweak it a little to make it fit your use,
Maybe change the if Condition to
if ((MyUnit) in (list MyTrigger)) then {Your code};
why even use triggers like that
_Spawnposition = "BP1Spawn1";
_grp = createGroup [east, false];
_unit1 = _grp |#|createUnit [ "O_Rifleman", _Spawnposition, [], 0, "FORM"];```
Expected 3 elements... received 0... this is almost exactly the example on the BI Wiki though...? Did I miss something obvious?
_Spawnposition is a string
it should be an array (3D position)
So how would you complete that task? Make a position and register nearby objects?
you can just use a loop, which is faster
alternatively:
specificObject in thisList
almost, you don't need this to be a scripted event handler at all. the module takes care of all of that for you. just do your code starting at params ending with the end of the if then statement
Could you give me a practical example?
of the loop I mean
_Detector = createTrigger ["EmptyDetector", (_Pos), false];
_Detector setTriggerActivation ["Any", "PRESENT", true];
_Detector setTriggerArea [6.2, 6.2, 0, true];
_Detector setTriggerTimeout [0.5, 0.5, 0.5, true];
_Detector Setpos (_Pos);
_Detector setTriggerStatements ["specificObject in thisList", "code_on_act", "code_on_deact"];
waitUntil {
sleep 1;
specificObject inArea "marker"
};
//completion code
you can also use a distance
Ok got it
Sooo I just have to share this:
Private _Texting_String = {
params ["_Ctrl", "_String", "_Time"];
private _Letters = (count (_String));
private _Sleep = (_Time / _Letters);
private _Selector = 1;
for "_i" from 1 To (_Letters) do {
_Ctrl ctrlSetText (_String select [0, (_Selector)]);
_Selector = (_Selector + 1);
sleep (_Sleep)}};
I just got so proud of this little thing, and only the nerds on here will even bother to critique it
_selector is the same as _i 
Thank you! that why I posted it 😄
Get feedback
Hey
Say I need something like
_x=y;
_x addAction ["asdf", {_x setPos ...}, ...];
is the only way to do this with a global variable?
And if so, how do I get a unique global variable?
if you need the reference to an object that has the action itself, see parameters -> script https://community.bistudio.com/wiki/addAction, it's already given for you
if you need a different object, then you can pass it through the arguments (see wiki)
I see, thanks!
@copper raven how about in general?
Like if I'd need a reference to an object inside some callback that doesn't provide either of those (for some reason)
is it then globalvar?
And is there a way to get a unique global var?
most of them do
but global variable and setVariable (using the object's var space) are the other alternatives
like mktemp or tmpnam
like
TAG_someVariable
Yeah but the points is I'd rather not 😄
rather not what?
that's a really edgy case, i'd call that a bad implementation 
Come up with the names manually
like I said, most of the times you don't have to
for example, even if you wanted to pass 100 variables to an addAction code, you can
using its arguments param
Yeah perhaps I'm thinking about it unnecessarily 😄
i mean, just stick to common naming conventions, there is not much else about it, you want to use a unique tag so you don't override some other variable, e.g by some other mod or mission. yea you could say that then they're the ones breaking the rules, but it's better to be safe from your side with stuff like that, i.e myVehicle vs emil_myVehicle
you have to use params
params ["_target"];
or
private _target = _this#0;
exactly the same thing
ah I see, thanks!
i mean you can try and search scripts online 
you can set a vehicle as a rearm/refuel capable in the editor, not sure if you need 3den enhanced
How do I find the ammo class name of a weapon? such as "CUP_Vmlauncher_ub32_technical"
got it
two month old message. thats dedication lol
sqf "ServerIntro.sqf" remoteExec ["Execvm", 2];
Does anyone see why this would be executing 6 times on a server when the script does not have any loop? (and is pretty simple overall)
you put in in init.sqf or an object init and played with server + 5 people
server executed, and you remoteExec server?
anyways that's not the issue, perhaps your trigger is repeatable?
it is repeatable, is that the issue? I want to be able to run it more than once but not fire it 6 times at one click
well that answers your initial question
so repeatable is making it fire for every clienet even on the server???
Ok... so can you reset a trigger after a few seconds or something?
reset?
Because I wont need to run it more than like once a minute at worst
i mean you just need to adjust your condition
I think the condition has to become false first before it fires again
Like a lightswitch
how did you manage to avoid the code block in this message to give the example of the tildes?
\
…next time, please answer "magic" 😋
Attributes > ACE Settings > Rearm,
or something like that, I don't remember the exact tree
thanks for the replys but how do i stop it firing when other sides captures the sector and it only fires on blufor
I managed to fix the dreaded black screen after rejoining as Zeus in a scenario. Only when I now rejoin I don't enter the Zeus mode and fall to the ground. Due to the ZEN mod. Any solution to that?
I use this to fix the black screen:
{
if (!isnull (getassignedcuratorunit _x)) then {
_unit = getassignedcuratorunit _x;
if (isnull (getassignedcuratorlogic _unit)) then {
unassignCurator _x;
sleep 1;
_unit assignCurator _x;
};
};
} foreach allcurators;
so, I can use isFlatEmpty to decide whether a position and radius is over water in whole or in part?
https://community.bistudio.com/wiki/isFlatEmpty
Or better yet probably lean on the BIS_fnc_findSafePos algo...
https://community.bistudio.com/wiki/BIS_fnc_findSafePos
is there a convenient way to get a config path based on a classname? So you supply a classname and it will return the path
You using 3den enhanced?
Believe there's a "find in config viewer" option which will take you to the right page and shows the full path on the lower portion of the screen.
BIS_fnc_configPath
Though there's no examples of using a classname, it does accept a string as first parameter so may work.
yes, but input needs to be a config
params [
["_sector", objNull, [objNull]],
["_owner", sideUnknown, [sideUnknown]],
["_ownerOld", sideUnknown, [sideUnknown]]
];
switch _owner do {
case west : {
/* Code if the owner is switched to blufor */
};
case east : {
/* Code if the owner is switched to opfor */
};
case independent : {
/* Code if the owner is switched to independent */
};
default { /* do nothing if nothing matches */ };
};
thank you for all ur help
making a training map for my unit , it has a bunch of training ranges. I wanted to get some tanks to fire down range the whe time with an interval. No specific target.
Forcing to add objects to curator seems to fix it for ZEN. Made a CBA_A3 rule for my scenario for it.

alright, how much scripting knowledge do you have?
welcome then. you are going to need to read up on a couple of few things then for your idea.
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting
https://community.bistudio.com/wiki/Variables
https://community.bistudio.com/wiki/Scheduler
https://community.bistudio.com/wiki/while
https://community.bistudio.com/wiki/doFire
Thanks.
[] spawn
{
while {alive tank} do
{
private _targetPos = getPos tank vectorAdd [random 1000, random 1000, random 1000];
tank doWatch _targetPos;
sleep 6;
[tank, "cannon_120mm_long"] call BIS_fnc_fire;
tank setVehicleAmmo 1;
};
};
Works with the MBT Kuma
if you use a different vehicle you need to get the muzzle of the vehicle
Easiest way is to get into the gunner seat, select the wanted weapon and execute currentMuzzle player
replace "cannon_120mm_long" with the muzzle you retrieved
@fair drum That did it, thank you very much!!
after i disable a sector module with enableSimulationGlobal when i enable the sector it just doesn't let me capture it, thanks in advance
I don't think sector modules can work like that. I bet when you disable its simulation, you mess up the background loop and it errors out.
is there any way to make it so it only activates once the previous one has been taken?
are you using the sector module itself to define the area or a synced trigger?
the sector module itself
try syncing it with a trigger for the area, then disabling the sim of the trigger. that way the sector module can keep doing its thing and not error out. change the trigger, not the module
alright thanks
hello, i am i having difficulty for creating a simple random adding item/weapon into a cargo box. The SQF would be called on the box/cargo's init
If someone can add or suggest how to make that the selectrandom select 2 or N set of weapon out of the list instead of 1, it would be appreciated.
you want to randomly select two or n amount of the cases available?
Q: is there a way to determine if a player is "in" a building?
Q: or for that matter, count the number of units "in" a building?
so i was making a script, and in part of it. it would run an fps check.
i found arma has one built in: A3\functions_f\diagnostic\fn_fps.sqf
and that it outputs to hint and global chat, so i thought hey ill use it. but it doesnt work. it throws alot of errors. am i missing something obvious?
i presume im missing an #include etc
Without telling us how you do, nothing can be said
execVM ["A3\functions_f\diagnostic\fn_fps.sqf"];
@warm hedge
wait...
i might be stupid
give me 2 seconds
so far what I can come up with is this, but I'm not positive how to turn the question more or less inside out. for instance, it is possible to ask for allUnits, but that's cumbersome and inefficient. my starting point is a building, for instance. that is the perspective from which I would like to ask the question.
// responds with the building 'containing' the player, for starters...
CF_ALL_OBJECTS = 32;
lineIntersectsObjs [atltoasl (getpos player), atltoasl (getpos player vectoradd [0, 0, 20]), objnull, objnull, true, CF_ALL_OBJECTS];
yeah i realised my mistake, for anyone who may stumble across this:
[10, "", 0] call BIS_fnc_fps
^^ is the line to use, [duration, sceneid, start delay] then run the func
when I place a tv or billboard, whatever it may be. I can change the texture to a video, but how do I make it so the sound actually sounds like it is coming form the tv?? I know the say3D command but it doesn't seem to do anything when the video starts playing. Thanks
hm are you sure its bc of the type of parachute?
i have in the past attached units to normal parachutes and added velocity [0,0,-5] f.e. without problems
is BIS_fnc_timeline_play global?
I would say most likely not as it is UI-based
so I need to use remoteExecCall? since I want to use a timeline with a camera in it so I can play a cutscene to the MP players
remoteExec
it can be spawned, so don't worry
thanks
If I have the "AI Unconsciousness" option in ACE Medical off, could it be scripted to allow some eden placed units to be set to an Unconscious state allowing them to be revived? Or is it an all or nothing option?
Is there an easier way to ask this sort of question, re: does building contain units. i.e. similar to vehicle crew?
If there is, great; I took a slightly different tact side slipping the question.
ah ok, thanks...
how to edit the fatigues carry weight and to have it carry more items?
you mean a clothings inventory size?
yes
config mod. no scripting afaik
uh its config 😄
the cpp?
idk the name of the field sry.
yeah cpp sounds right
okie thanks
theUnit setUnitTrait ["loadCoef", 0.5];
does not improve room but improves weight capacity
what does that mean? my guy is much more faster?
oh okie thanks
how can we "setVelocity" on a "Steerable Parachute" ?
_parachute setVelocity [...]?
can someone help with a select random for additemcargo. Trying to make it a sqf that is run on each lootbox
is there a BIS function to get a random position inside an area (marker/trigger)? Didnt see one on biki
ah thanks, i was looking for marker/ area/trigger all the time 🙃
it can be marker or trigger, look example 5 and replace position player with getmarkerpos or anything you wish
Can anyone help on that?
@copper raven this is the problem we can't do "_parachute setVelocity [...]"
how come?
i mean, it could be written better, but i don't see why it wouldn't work
it just says error that why i am lost
maybe the _lootbox is undefined
i think the (_this select 1) dont work
remove the first assignment entirely, and yes
yes
it is saying error
_lootbox = (_this select |#|select 1);
.....etc
error select: type object, expected array,String,Config entry
well that's self explanatory
but _lootbox is the init of the box i am putting no?
so technically (_this select 1) should work no?
how are you calling the script
well you're passing an object
and then you're calling select on it
which obviously won't work
so either wrap this into array, or omit the select
but the additemcargoglobal are being added on the object
[123] execVM "script.sqf"
// inside script.sqf
// _this is [123]
_oneTwoThree = _this select 0;
hope it makes sense
equally,
123 execVM "script.sqf"
// inside script.sqf
// _this is 123
_oneTwoThree = _this; // no more select, because we passed a number 123
@copper raven thanks it worked
How do I add a custom horn sound?
not sure if this is the correct channel to ask this question but I am having some trouble getting my description.ext to work, any help/info is greatly appreciated
no u
what are you trying to do, what doesn't work? 🙂
im trying to add the new CDLC radio AI fire support thing into a mission that i no longer have the original folder for, so im trying to add the description.ext file into it after the fact and im not sure if its the code that i have put in or if its just not loading the desc.ext file when added to the .pbo file
if the config works in the editor, it should work in the pbo'd mission
yea so i wasnt sure how to test if the code even works or if there was other stuff i needed in the desc.ext file
just to be sure, description.ext, not desc.ext, descr.ext or description.ext.txt
yea its just "description.ext" without the quotes
i was only shortening it for ease of typing
for info you don't really place code in description.ext, but config
can you show your file (on pastebin for example)?
its the example code from the savagegamedesign wiki page on it
but ill get a paste bin link to it one sec
so this is the config/code i guess for the radio system to work as far as i am aware https://pastebin.com/raw/bBnaw8wg
i never changed anything other than the availability binary array
When using keyframe animation and hosting using client server, when I switch to camera thats is attached to the keyframe animation, on my POV it works fine, but when it moves my friends POV is basically the camera clipping through the map, while for me its fine
using remoteExec to both start the timeline and switch to camera
is there a command to disable and enable revive i can put in an sqf file. i dont want to put it in my desctiption.ext
there is a config switch only im pretty sure
you can maybe look into the revive functions and see if you can find a way to do it
there is the Revive function group to check
i figured it out
well actually
thank you @astral dawn
that code you provided me with saved me
is it BIS_fnc_reviveInit @winter rose
How can i make the below work on Dedicated server? the Setfuel dont happen. Tried to run the sqf in both init and initplayerLocal
if(isServer) then {
waituntil{
if (speed car23 >= 30) then {car23 setfuel 0; "Limit speed script" remoteExec ["hint"];}
else {car23 setfuel 0.1};
sleep 1;
false
};
};
my way of doing it is kinda stupid but works for me, [car23 ,0] remoteExecCall ["setFuel"];
on dedicated server?
I tried it on a server client, so not sure
ok i will try it. bc i know on multi it work but idk for dedicated
yep worked
i though setfuel was global, guess was wrong XD
global effect, local argument
hey guys,
Hopefully this might be a simple fix.
trying to pass an array variable over to another SQF.
Shows that _tracks is undefined when running the script
parameters = [_tracks];
_selecter = 0;
_selecter = fl>
23:03:02 Error position: <_tracks];
_selecter = 0;
_selecter = fl>
23:03:02 Error Undefined variable in expression: _tracks
Main.sqf
_tracks = ["LeadTrack01_F", "Track15_MainTheme", "Track14_MainMenu", "LeadTrack03_F_Mark"];
["_tracks"] execVM "music.sqf";
Music.sqf
params = [_tracks];
_selecter = 0;
_selecter = floor(random count _tracks);
playMusic (_tracks select _selecter);
This is the simplest example I can give cause music.sqf would be on a different function that repeats and would not like to have it check\rebuild an array every time on the actual official script.
any input is appreciated
In main.sqf you don’t need the speech marks around the _tracks variable
And music.sqf doesn’t need = in params, go look at wiki for how it’s meant to be
_selecter = floor(random count _tracks);
playMusic (_tracks select _selecter);
playMusic selectRandom _tracks;
params = [_tracks];
this is just wrong
Read params command page
🙃
Some entries in CfgMarkers have color[] = {"color_Civilian",1}; their color defined this way. What is color_Civilian referring to?
is it not the blufor/opfor/indfor/civilian profile colour?
That would be color[] = {"(profilenamespace getvariable ['Map_BLUFOR_R',0])","(profilenamespace getvariable ['Map_BLUFOR_G',1])","(profilenamespace getvariable ['Map_BLUFOR_B',1])","(profilenamespace getvariable ['Map_BLUFOR_A',0.8])"};
So idk 😄
Feels more like a left-over from pre-arma3 times
it is technically that yes, the civilian side color
i remember just hardcoding civilian gui color if color[] size is 2
Did that as well, not bothering with it any further.
its possible to create a object inside a house that always have the same dir, indepent if dir of the house is different without use the command attachto?
setVectorDirAndUp and vectorModelToWorld
ok, thanks
if the house is always upright (which it should be) and so is the object, you can just use _obj setDir (getDir _house + _offset)
A simple question: I got an icon at "Arma 3\Addons\ui_f_data\map\diary\signal_ca.paa"
but when I put that in```sqf
iconPicture = "Arma 3\Addons\ui_f_data\map\diary\signal_ca.paa";
it doesn't work obviously, so what is the true way to put the path?
\a3\ui_f\data\...
thanks, another question: pbo is ui_f_data, why do I have to do that?
idk how exactly arma's addons are packed, but it's pboprefix stuff, something similar to this id imagine https://community.bistudio.com/wiki/PBOPREFIX
iconPicture = "\a3\ui_f\data\map\diary\signal_ca.paa" wouldn't work :(
well the file path is correct, i can tell you that much 
class respawnpanelunlocked
{
title = "Vehicle respawn panel unlocked";
iconPicture = "\a3\ui_f\data\map\diary\signal_ca.paa";
description = "Vehicle respawn panel has been unlocked!";
color[] = {1,1,1,1};
duration = 5;
};
``` in description.ext under class CfgNotifications
restarting the game fixed it
thx
typo while copy paste? hmm okay
config changes are only applied when the mission is saved in 3den
exiting back to eden (not just restarting the mission) will work too
Can someone help to add a vectorAdd to a createVehicle? Tried many times now, but nothing works
private _createChest = "B_supplyCrate_F" createVehicle (player getPos [10, getDir player]);
Should work
Yea, but how 😮
I didn't post all my possible tryings to get it working 😅
Can I just add addVector in that line?
IDK, but your actual code works
then vectorAdd?
now all I've tried dropped me an "missing )" error
private _createChest = "B_supplyCrate_F" createVehicle ((player getPos [10, getDir player]) vectorAdd [0,0,5]);
won't work well because this syntax will try to spawn it on the ground, but still
hmm i tried the exact same but with an "," between
private _createChest = "B_supplyCrate_F" createVehicle ((player getPos [10, getDir player]) vectorAdd [50,0,50]);
, where?
private _createChest = "B_supplyCrate_F" createVehicle ((player getPos [10, getDir player]), <-- here vectorAdd [50,0,50]);
yeah… but why
to seperate I thought
don't think 😛
Yea, should stop that 😢
So I've tried without , but now the crate does not appear 🤔
it appears where createVehicle can create it; sometimes up to 50m away iirc
so make sure to setPosATL/ASL it for precision positioning
Usually it should be 10m in front of the player, and that space was free
the position should in the end not be precise, rather close to the player
that 10m is just for quicker testing
if I remoteExec creating a vehicle, in a server with 5 players, will it spawn the same vehicle 5 times?
depends on the target
create at [0,0,0] and setpos after, or you can try using CAN_COLLIDE option in the alternative syntax
0
I need to play a sound to all players and then a shell follows (in the same sqf) but that means if I remoteExec the sqf it will play the sound for them and then 5 shells explode, is there a workaround?
sideRadio
yeah so remoteExec that, only
if a command has a global effect, running it once will have the effect on all the network machines
if you remote exec to everyone a createVehicle, it will create a vehicle × number of players yes
https://community.bistudio.com/wiki/Multiplayer_Scripting#Locality can help you (and the whole page as well)
I knew this but I was just being lazy lol
Thanks
Pin the message?
meh, idk
we already have plenty
player addEventHandler ["Take", {
params ["_unit", "_container", "_item"];
if (_item == "ace_csw_100Rnd_127x99_mag_yellow") then {
[_item, true, [0, 3, 1], 0] call ace_dragging_fnc_setCarryable;
};
}];
Attempting to set these ammo cans as an item that can be carried by hand. But it's not working. Can someone point out what I'm doing wrong please?
you are trying to attach a string as an object? IDK, I don't know ace_dragging_fnc_setCarryable
ta-daaa
i don't think that's how you're suppose to use it 😄
Hmm says in the CSW framework it's already set as Carryable. https://ace3mod.com/wiki/framework/crew-served-weapons-framework.html
But doesn't seem to be the case.
Or does "Carryable" mean you can put it in your inventory not carry by hand?
¯_(ツ)_/¯
@winter rose you still the wiki man? I see that "GroupCreated" and "GroupDeleted" on the missioneventhandler page have not been included yet.
no I'm not anymore
just a tip: use getSafePos to find a position where your crate wont collide. very helpful. only restriction is, it has to be on ground, not editor built platforms etc
ah didn't know if you gave up that role with the promotion or not
who has wiki edit access still? I never got to create an account since account creation was closed years ago.
…I still am x)
why are you like this lol
no u 😄 I would have expected more suspicion from you hahaha
hypoxic you just have to dm dwarden, wait 9 months and then miss the 2hour window where he is available
lou i want priviledges to summon the !rpt and !sqf bot, pls ❤️
just type those
!rpt
Arma generates a .rpt log file each time it's run, which contains a lot of information like the loaded mods, or any errors that appear, this log file can be very useful for troubleshooting problems.
To get to your RPT files press Windows+R and enter %localappdata%/Arma 3
Additionally see the wiki page for more info: https://community.bistudio.com/wiki/Crash_Files
To share an rpt log here, please use a website like https://sqfbin.com/ to upload the full log, that way the people helping you can take a look at it and try to figure out the problem you're having together with you.
Note: RPT logs can hold personal information relevant to your system, the game or others.
always have been, don't you ever question it ❤️
added!
since we are at wiki:
waypoints side says AI is incapable of airlifting precisely with "hook" waypoint. thats not true (anymore)
works 100% of the time, if the waypoint is at posASL of crate to be lifted.
plz link?
Looking at the CSW framework page there seems to be a setting "Scope = 2;" that is missing in the current csw.pbo file. Anyone happen to know what the setting means? Is there a way that I can add or overwrite the current config with that setting to see if it fixes the issue?
class CfgMagazines {
class prefix_100rnd_hmg_mag;
class prefix_100rnd_hmg_csw_mag: prefix_100rnd_hmg_mag {
scope = 2;
type = 256; // Must be 256 to show up in Arsenal
count = 100;
model = "\A3\Structures_F_EPB\Items\Military\Ammobox_rounds_F.p3d";
ACE_isBelt = 1; // Enables belt linking for this magazine
};
};
Fixed
❤️
- if the class inherits from one that has
scope = 2, you don't need to redefine it - you can overwrite a config through a mod (#arma3_config)
@winter rose Ok thank you for the help, I'm afraid a mod might be a bit out of my league at this point.
https://steamcommunity.com/sharedfiles/filedetails/?id=2504211087 oooh, interesting @cosmic lichen 👀 🙂
Whats the script for insta-killing anything inside a trigger?
{
_x setDamage 1;
} forEach list _trigger; //or thisList if in one of trigger statements
where are you executing that?
as I said:
thisList if in one of trigger statements
so:
{
_x setDamage 1;
} forEach thisList
fair enough
Can somone point me to directions on how to change the horn for a car?
in mutiplayer
is there a way to retract landing gear of a plane controlled by ai?
Will that work with vanilla server?
Like unmodded
no
you are doing a modification, so a mod 😄
I mean like the player doesn't have to install addons
just join and play thing
like a texture switch
you could maybe intercept and script it
yes
how?
there's an action
I don't remember its name
maybe Gear?
or LandingGear
oh
you mean that one
I already used it
LandGearUp
Description: Raises the landing gear of an aircraft. Only works on player controlled aircraft.
that's wrong
wiki bruh moment
it does work on AI aircraft
I will try it then
great job thanks
in case anyone wonders:
https://community.bistudio.com/wiki/Arma_3:_Actions#LandGearUp
fixed
again, great job
Saw that already. Actually not as interesting as I thought. Works unfortunately only if Export to SQF is used. Hope he will add some more features
sorry for probably a noob question but,
Im trying to make a trigger that warns you (only the player that enters it) that you entered the area
does anyone have any suggestions on how to do this?
along with telling you when you leave it
heres what i have right now that doesnt work
condition
player in thislist```
On activation
```sqf
hint "You are now entering a restricted zone.";```
On Deactivation
```sqf
hint "You are now leaving a restricted zone.";```
nevermind, perhaps i simply missed it earlier but it appears to be working so i guess im just dumb lmao
[taskName, taskState, showHint] call BIS_fnc_taskSetState
What is taskName?
Its not the taskID, so Im confused.
It's supposed to be a string
it is task id
Well, for some reason when I use taskID it doesn't work.
maybe you're setting it to the same state?
[west, "tskrekdri", ["Got a report that a person is driving around recklessly. Find them, arrest them and bring them to the cells", "Find Reckless Driver and Arrest", ""], person, "CREATED", 1, true, "car", false] call BIS_fnc_taskCreate;
while {true} do { if (person inArea cellone isEqualTo true) then { deleteVehicle person; ["taskrekdri", "SUCCEEDED"] call BIS_fnc_taskSetState; }; };
Nope, it starts out as CREATED
ah, i see it now
plus use https://community.bistudio.com/wiki/waitUntil instead of while
I would, but for some reason it doesn't work with then
Unless Im using it wrong.
you don't need an if statement
but what do i put after?
what you want to do after person is in the area cellone
wont it just execute the next line of code anyway, disregarding the waitUntil?
nope
oh, so its like a sleep almost?
waitUntil suspends further execution until the condition is true
when I place an object and add a texture to it, the very first time running the mission I have to move my character directly in front of the object for the texture to be applied. After the mission has been run and the textures activated, the mission can be loaded and the textures are applied at the very beginning of the mission as they should be. How do I fix this? thank you
hey does anyone here have any experience with HUDs and cutRsc?
@modest nova #arma3_gui
i realised that sorry, i put my question in there now
Edit: i found solution to problem nvm
Is anybody decent with setVectorDirAndUp?
I'm trying to get an arrow to point in the same direction a player is looking when a script is run. Getting a rotation around the z axis is easy enough with setDir, but I'm trying to get the vertical component as well
I'm using getCameraViewDirection to get a direciton where the player is looking
When keeping dir at 0, it's easy enough to tilt the arrow to match the player view direction like so
_up = getCameraViewDirection player;
arrow setDir 0;
arrow setVectorUp [0,_up#2,-0.5];```
But doing that will still tilt the arrow to the north when the direciton is to the east
I've tried fooling around with the setVectorUp quite a bit but I can't seem to find a method that comes close to achieving the results I'm looking for
you need to get the normal of the direction the player is looking in
hm thats getting a bit complicated.
i think you can get the right facing vector of the player by getting his direction + 90°. then build the cross product of visual dir and right dir, thats your visual normal. use that as the up vector of the arrow
like that
hey look, maybe thats what you want 😄
https://community.bistudio.com/wiki/vectorUpVisual
.
Thanks, I'll give that a try. vectorUpVisual player seems to always return [0,0,1] from what I've seen so far though. I'm going to have to table this till morning when I have brains to do things
np
done.
put this into a function
//gets vector up of a vector
_paramsCorrect = params[
["_object",objNull,[objNull]]
];
if (!_paramsCorrect) exitWith {
["incorrect params given. expects [object], given: ",_this] call Bis_fnc_error;
};
//get visual
visual = vectorNormalized (getCameraViewDirection _object);
//get up
up = vectorUpVisual _object;
//get right
right = vectorNormalized(visual vectorCrossProduct up);
//get visual up
visualUp = vectorNormalized(right vectorCrossProduct visual);
objPos = ASLToAGL (eyePos _object);
diag_log["getVisualUP:","up",up,"right",right,"visual",visual,"visualUp",visualUp];
then call this in console`
onEachFrame {
[myDude] call IRN_fnc_getVisualUp;
drawLine3D [objPos,objPos vectorAdd up,[1,0,0,1]];
drawLine3D [objPos,objPos vectorAdd right,[0,1,0,1]];
drawLine3D [objPos,objPos vectorAdd visual,[0,0,1,1]];
drawLine3D [objPos,objPos vectorAdd visualUp,[0,1,1,1]];
};
There is a vectorFromTo thingy
most likely a stupid question, but here goes. I am trying to make stuff happen in MP using keypresses. It triggers everything from initPlayerLocal, and I am trying to get scripts to run from the server based on keypresses. Currently does not work, as I assume as it originated from initPlayerLocal, all scripts thereafter are not considered 'serverside'. I think (not sure) what I need to do is remoteExec things, but as I understand it, remoteExec manages functions and/or commands, but not scripts. So my question is - how can I call a script from player, but have it run on the server? Sorry, I hope that makes sense 🙂
you can run execVM through remoteExec, but its probably easier to turn your script into a function and remoteExec that
for starters you can use soething like that, with execVM "myscript.sqf":
{[] exceVM "myscript.sqf";} remoteExec ["call",2]; // Statement 1
but for the long term, learning about functions is inevitable
np
// …?
[[], "myScript.sqf"] remoteExec ["execVM", 2];
Is there a way to get stuff from an API in-game? Like you can load and run mission files, but we've got like 10 zeus templates that all need preset loadouts that change quite often. Is there any way we can make it download that stuff just from a website?
you can also use Intercept
thanks @winter rose 🙂
but as @spark turret stated, if it is something that will get executed many times, make it a CfgFunctions and remoteExec that
faster, no HDD read, etc
on it mate 😉
I have a working radio system, that calculates radio contact for units. I need to override chat settings, to show chat messages only for those who can receive it. HandleChatMessage can't do it, so my idea is to block the standard chat (returning true in EH), and put the edited message string (depending on conditions) into another text message. It is very handy to use hints, but for me hints are widely used for other types of radio messages. Is there any other message functions that fit this role?
HandleChatMessage can't do it
huh?
is there an easy way to check the player's current optic mode's iteminfo subclass or number (eg if they're using the RCO reddot or magnified optic)?
you can only check the zoom info
not the optic type (e.g. something like "red dot" is not defined afaik)
don't really care if it's defined literally as "reddot" I just want to figure out which optic mode is currently active
class MyOptic{
class ItemInfo{
class opticMode1{
id = 1;
};
class opticMode2{
id = 2;
};
};
};```
obviously the engine knows which one of those is active currently (swapping them with ctrl + RMB), was hoping there was a way to get them through scripting since there's no standard with class names or order
@winter rose"huh?"
As I understand, we can't filter players with this EH when displaying chat messages. If the message has been sent, it is displayed for all players, or not displayed at all, or I'm wrong?
I believe you are wrong on this one, I think you can locally prevent the message to be displayed 🙂
see https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#HandleChatMessage
Fires when a message is received, before adding it to the chat feed. Fires clientside. The output message could be overridden
Ah, thanks, I missed that "it fires clientside" 🙂
not that I know of
I can only think of comparing the player's FOV with the optic's FOV
that's not really helpful for what I need to do. I need to know which class or at the least id the current optic mode is to check against other params in those classes, particularly if the optic is 3d or uses model optics, and if model optics if it allows NVG
what is your end goal?
trying my hand and finishing up a branch of ACE's nightvision that allows you to set the NVG colour through config. I'd prefer to have any NVO not copy the colour of the player's NVG since they're their own standalone NightVision device, while still allowing reddots, ACOGs and other low magnification/3d optics to just use the player's NVG, as if they were looking through the optic through the NVG. I can't find any good way to do that without kinda hacking it, like above, getting all the subclasses of ItemInfo and check if the current zoom matches any of those classes, which won't work
not sure if i understand, but if you only want to allow low magnification, and can get a zoom level, than thats all you need?
if (zoomLevel < maxAllowedZoom) {do NVG shader} ?
no, I only want to check those with model optics, I don't care about the zoom I only care about what the current optic mode is, and if it uses model optics
ah okay
Hey guys I'm using the moveInCargo command to move AI squad into the rhs blackhawk. They all move in ok but a few of them are always standing up instead of sitting down on the bench and they're bobbing up and down. Any ideas to fix this or is it just bug.
single player or MP?
be sure to remoteExecute it as the argument is local
https://community.bistudio.com/wiki/moveInCargo
execute the command again
it's a command bug
(afaik it happens with vehicles that use door animations)
I'm running it under MP but just playing 1 player
Basically I have a script that runs by player trigger to spawn in an AI squad on the liberty but they cannot board a helicopter on the back because they would rather swim in the water or go somewhere else so I use moveInCargo to get them into the chopper so you're saying I need to remote exec on the server?
ok I think I can just move all my code to execution server only
ok that fixed it so I just did moveInCargo for each squad member, then have them dismount, then moveInCargo again and they all sit in
Good day. Is 'setAmmoOnPylon' command is LE or it just should be called where the vehicle is local?
https://community.bistudio.com/wiki/setAmmoOnPylon
please try and tell us so we can update the wiki ^^
I would guess aL or aG, eG
random guess without knowing anything:
where vehicle is local.
i had issues with Helis airlifting crates where heli wasnt same locatily as crate. i could imagine that its similar with weapons
how is setPylonLoadout eL though Oo
https://community.bistudio.com/wiki/setPylonLoadout
Yep, where the vehicle is local. Started the dedicated server, did not touch Heli, called the function - pylons ammo changed.
I do understand that locality of a vehicle changes when player jumps in, but why does it stays local when empty 
it is local where it has been created
and remains local to the PC of the last person leaving it
Thanks @winter rose appreciate the help 👍
@winter rose About HandleChatMessage EH. If it fires locally - then I need to add this EH to each client, right? And they don't interact with each other?
yep
Does anyone know a way to remove a seat such as gunner seat from an armored vehicle?
what do you mean remove it?
if you don't want anyone to use it, you can lock it
wouldnt locking it make all the seats inaccesible?
what I want to do is make only certain seats inaccessible
ok, thank you!
so what do i need to use so a player gets an addaction when they are in a certain area?
im assuming some sort of trigger
add the action, and in the condition of its appearance check inArea
is there a way to createa sort of custom eventhandler that triggers when a certain condition is met without using a while loop with waituntil inside
scripted EH, but you would trigger it with a loop anyway (but at least only one)
is that BIS_fnc_addScriptedEventHandler? I couldnt figure ou how to use i when i looked into it before
ye
@winter rose I wonder why HandleChatMessage doesn't work with exitWith command, like
if (_person == player) exitWith {[_name,_text]};
Does somebody have an idea for an efficient/elegant way to "intercept" when a unit has a waypoint/move command into / out of a building, and insert extra behaviour into the waypoint in that case?
I have bunkers that have heavy doors that open slowly, and airlocks that only open one door at a time. I would like AI to be able to acess the buildings, but i dont want them to just run through the doors.
I could break the pathing connection if the door is closed, so they cant find a way. but this would make it frustrating for players to move their AI in/out of the buildings
So i'm wanting to add a world marker from another script so i'm trying this, however i keep getting this error: ```22:20:33 Error in expression <0,2];
_k = 12 / (player distance _pos);
drawIcon3D
[
"\a3\ui_f\data\map\mapcont>
22:20:33 Error position: <drawIcon3D
[
"\a3\ui_f\data\map\mapcont>
22:20:33 Error 0 elements provided, 3 expected
calling the below script using this line `[wave15aMarker] remoteExec ["BEF_fnc_waveMarker",0,true];`
Script is properly defined in functions.hpp
script where the marker is created: https://pastebin.com/vJMJM8tv
@ornate marsh _pos variable is not defined inside the function.
If you want to take a distance to marker, retrieve its coords, 'cause markers are not physical objects:
_pos = markerPos _marker;
I guess you could periodically get a list of all waypoints of a group:
https://community.bistudio.com/wiki/waypoints
Then get positions of all of them, put all that data into an array.
At next check you should check if the data is the same. If it isn't then someone has added a waypoint to the group and you should do your magic
with the waypoints.
Then about checking for buildings, I think that raycasts work best here. Just cast a ray from ground and upwards, if it hits an object of house type, then the waypoint is in a house.
surely it's defined here? _pos = player getPos [10, 0] vectorAdd [0,0,2];
hey, how would I go upon disabling any sort of player from dropping any inventory item?
Hm, guess that could work. If there was an eventhandler every time a new waypoint was executed, that would be much easier.
I agree, I didn't find such an event handler. 😦 Maybe CBA has implemented polling mechanism like this?
yo guys i public zues every once and awhile. And sometimes we get good scripters, they add zues addons, zombies ect. Is there a way for me to get these scripts so i can improve my ops?
Sorry if it sounds like im a evil hacker dude
im having some trouble in my script, I have it so that in initplayerlocal.sqf it checks when the player enters the area of a marker and uses publicvariableserver to tell the server this. but for some reason it only does this for the first player who joins the mission from the lobby. anyone know why it is doin that?
Does anyone have a way to track steam 64 ID in arma to only allow specific accounts to choose a certain role
I can’t write it
what's the script?
basically the script adds a hud which displays the amount of players in the area of a marker on the map
So does anyone know how to get setObjectScale to work server side? I can get it working locally but when I upload it to my server the footprints I am trying to scale down are comically large
Any suggestions for a revive system that works with dynamically spawned units in something like alive?
i get recommended AIS which doesn't really work with that super well or sunday system which as far as i can tell just flatout doesn't exist on the internet anymore
how do you handle it server side?
I am using publicvariableeventhandler server side
yeah but what do you do with it?
send full code
you're supposed to run it where the object is local
call {……} your whole EH code so that exitWith exits into main EH scope
The client uses publicVariableServer to send a 1 or -1 depending on whether it is leaving or entering the zone, when the server receives that number, it adds that to the zones player count and then sends that back to all the clients in a list of client Id's using publicVariableClient. this count is then used on the client to display the zones player count
seems correct, allthough this is arma 2 kinda thing, with the public variable event handlers
🤔 i mean if everything is implemented correctly, don't see how that wouldn't work
yeah its been giving me an anneurism all day, i cant figure out why only the first person to get into the mission is detected when entering the zone
how can I get the amount of ammo left in a vehicle's weapons
well magazine class is class of the magazine 😄
gonna be SmokeLauncherMag i think for smokes
turretpath will be [-1] i guess, driver
what is turretPath tho?
how do i put in an embed to upload my script so that it is easy to read?
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
allTurrets [_vehicle, true] + [[-1]] apply {[_x, _vehicle weaponsTurret _x, _vehicle magazinesTurret [_x, true]]}
will get you all weapons/magazines with corresponding turret
hmm
_ifritSmokes = _ifrit magazineTurretAmmo ["SmokeLauncherMag", [-1]];
I followed the syntax from the wiki
im just looking for a value; i need to know how many smokes an unarmed ifrit has left so that i can basically replace the vehicle
well the usage is correct
like i said, don't know if thats the correct classname for the smokes mag
use the code i gave you to find the correct one
what do you mean? how does that code work?
it returns array of arrays with [turret path, weapons, magazines]
this is an example from the wiki, so I think it is the correct classname:
_tank addMagazineTurret ["SmokeLauncherMag",[0,0]];
ok
turret path might be wrong, i don't think ifrit has a commander turret, [0,0] = commander
ok
that is probably for strider then
in a strider, the commander does the smokes
_ifritSmokes = _ifrit magazineTurretAmmo ["SmokeLauncherMag", [-1]];
//.......
_veh setMagazineTurretAmmo ["SmokeLauncherMag", _ifritSmokes, [-1]];
ok so this is what I have
Good day. How do I save and load vehicle appearance? 🤔 Can't find a thing. Need this for vehicle respawn thing that defaults vehicle texture.
Hmm. Doesn't work or maybe I'm doing something wrong... Okay, thanks for the advice 👍
[_vehicle, [_vehicle, "MYTAG_appearance"]] call BIS_fnc_saveVehicle;
//... and then after respawn
[_newVehicle, [_newVehicle, "MYTAG_appearance"]] call BIS_fnc_loadVehicle;
//Vars from old to new are transferred by BIS_fnc_moduleRespawnVehicle
yea because you're serializing it into object's namespace
either pass the old vehicle in(if it still exists)
or use missionNameSpace
Unfortunately that is not an option, I have dozen of them vehicles.
nvm didn't read Vars from old to new are transferred by BIS_fnc_moduleRespawnVehicle part
well if they're indeed transferred, it should work
@unique sundial "call {……} your whole EH code so that exitWith exits into main EH scope"
Emm...
As I understand, exitWith should also return something in this case (like return in Python), overriding EH parameters, or no?
And what I need to do exactly? To put the EH function code in code brackets and call it? 🤔 Like
addMissionEventHandler ["HandleChatMessage",fnc_ChatMessageHandler];
fnc_ChatMessageHandler = {
[_this] call {
params [...,"_text",...];
if (something) exitWith {true};
_text
};
};
he meant that yes, but omit [_this] and params
useless
well params should stay actually, if you're gonna do something with them
Hm... It works. But why? 🙂 What is the difference between exitWith {_text} and just a _text in the end?
because it's not a new script instance, local variables carry over into lower scopes, but not into new scripts
ah for that part i don't really know myself (ignore the above, didn't see you edited the message) 😄
BIS_fnc_exportVehicle worked for me (= A bit overkill, maybe, but working.
i mean just make your own function
you can look at the source of the other ones, and make your own
Well yeah, if only functions viewer had decent search >_> Thanks for the help.
does playSound play the sound to all players regardless of the 3d position of sound origin? (like a radio message) ?

It has local effect
remoteExec moment
but I basically want it to act like sideRadio, does that work?
RemoteExec to all units on that side
no no I meant it doesn't have a point of origin
all players will hear it in the same volume
playSound has origin? 
Then just playSound?
thats what I'm asking
playSound is a 2D sound. No 3D origin
thanks
You can check the wiki 
👀
I did but I had a bad history with using sounds in arma 3, thats why I'm asking pardon me lol
playSound "speech1";
[["Sam", "Hello", 0],
["Sam", "and welcome", 2]] spawn BIS_fnc_EXP_camp_playSubtitles;
I'm trying to play a sound and show subtitles at the same time (apex style subtitles) but its terribly out of sync (the first message appears 5 seconds after the sound has ended playing) any fix to this?
also, using playSound still has a local effect
No I'm testing it singleplayer
I still didn't finish the code to modify it to mp I'm in testing phase lol
you can use a function that will take [sound, subtitles] as arguments
make it play 1s before playsound then 😄
Good idea
I know 😎
But you got me interested in conversations, so I will learn it
I wrote the page (some years ago) so I may still remember how to do stuff 😄
oh, three years ago
Hello i have a question, how do i script a AA missile always miss?
how to set default duration to 0 ?
description.ext
#define SOUND(NAME, DURATION = 0) class NAME\
{\
name = NAME;\
sound[] = { "\sound\##NAME##.ogg", 1, 1, 50 };\
titles[] = { 0, $STR_##NAME };\
duration = ##DURATION##;
};
SOUND(mySound, 6);
#define SOUND(NAME,DURATION) class NAME\
{\
name = NAME;\
sound[] = { "\sound\##NAME##.ogg", 1, 1, 50 };\
titles[] = { 0, $STR_##NAME };\
duration = ##DURATION##;
};
SOUND(mySound,0)```
no default, it's a macro, not a function 🙃
↑
any reason you can't just set the locked on target invincible briefly?
Well i'm making a mini movie about a squadron of AAF A-149 gryphon on a suicide mission to sink the nato fleet
And i need some missile miss the aaf fighter for dramatic purpose
@acoustic tangle hmm this seems difficult im not sure how you'd do this
I would look and see how the missile AI works and try to see if you can modify it to stop tracking after some time, or something like that
Ok then thx
hello
are you going
to place this in a sqf or what
[] spawn {
_l = (velocity vehicle player) select 0;
_z = (velocity vehicle player) select 1;
_h = (velocity vehicle player) select 2;
aamissile = "M_Titan_AA_long" createVehicle (player getRelPos [700, ([120, 240] call BIS_fnc_randomInt)]); aamissile setVelocity [_l * 3,_z *3 ,_h *3]; [aamissile, (getPos vehicle player) select 2] call BIS_fnc_setHeight;while {alive aamissile} do {aamissile setDir (aamissile getDir vehicle player); sleep 0.3; if ((vehicle player) distance aamissile < 5) then {aamissile setVelocity velocity vehicle player; aamissile setDir (aamissile getDir player getRelPos [200, ([300, 60] call BIS_fnc_randomInt)]); sleep 3; deleteVehicle aamissile;};};
};
thats if a player is in the vehicle you are firing the rocket at
Ok thx
Q: re: allDeadMen seems to include alive units as well?
huh this is curious...
_units = allunits + alldeadmen;
_units = _units arrayintersect _units;
_units apply { [_x, netid _x]; };
yields this: [[KPLIB_eden_commander,"2:2271"],[KPLIB_eden_commander,"2:1959"]]
how can there be two netid ?
getting positions, possibly one of those units may be the spawn system at work... i.e. with positions,
[[KPLIB_eden_commander,[23587.7,20496.8,0.00167656]],[KPLIB_eden_commander,[10,10,9.78562]]]
probably two different objects with the same name
well, yeah, I figured that much; just trying to account for what's what there...
my goal there is to tell dead units from alive ones. when killed, units fall off the allUnits radar, for instance, so unless I had an accounting of those objects to begin with, I lose sight of them. but allDeadMen tells me more than what I need to know.
this doesn't make sense
how did you figure out it does?
shouldn't it be```sqf
private _unit = allunits arrayIntersect alldeadmen;
@winter rose yes I did that, see above
no you didn't
yeaaah…?
that's different from what Lou sent
youre performing an identity operation not an intersection
(allunits + alldeadmen) arrayintersect (allunits + alldeadmen);
// different from
allunits arrayintersect alldeadmen;
I see, but it also does not exactly answer the question. my goal is to include dead units along with the living. allUnits only includes the alive units AFAIK.
yes, but how did you get the idea that allDeadMen includes living units…?
more or less, "what is your issue" here 😆
allDeadMenseems to include alive units as well
no ^^
allDeadMen select { alive _x } // should return [] every time
huh, maybe it is doing the right thing then, but I wonder if those remnants need to be GC... separate question.
(allunits+alldeadmen) apply { [_x, isplayer _x, alive _x] };
result: [[KPLIB_eden_commander,true,true],[KPLIB_eden_commander,false,false]]
thanks for clarifying.
Looking at making a free cam (like Spectator and Splendid Cam) but im not sure how to get the movement done - wondering if I should continue looking at ways to move a new created camera or look into seeing if i could edit the spectator to my needs
If anyone has any ideas DM me if possible
it's in this pastebin https://pastebin.com/vJMJM8tv
_marker doesn't exist in the EH
it's a whole new scope, a totally different script
_pos is undefined too
yeah that pastebin hasn't been updated one sec
fixed the _pos, how would I pass _marker to the EH?
use a global variable
I tried it
and tried different values such as 1.39 or 1.3 or 1.4 etc
still out of sync
seems the subtitles get delayed because they have a "fading" time
class finalsound
{
name = "finalsound";
sound[] = { "finalsound.ogg", 3, 1, 0 };
forceTitles = true;
titlesFont = "PuristaBold";
titlesSize = 0.07;
titles[] = { 0,"Hello",
2,"And welcome.",};
};
titlesFont = "PuristaBold"; is way better, fixed it
Hi everyone, I would like to know why the UH-34 from the new dcl is not impact with the command : [UH, 600, 30, true, 10] spawn BIS_fnc_UnitCapture;
He move but don't shot.
is there a good function to get nearby friendly units?
as in, friendly AI within a 50-100m radius?
am I just gonna have to do nearEntities
select {side _x == west} maybe?
_origin nearEntities [["Man"], 100] select {playerSide isEqualTo side _x} // change playerSide to whatever
Guys, is there any way to get rid of small map markers, like that ones for wind turbines?
Is there a way I can make a blank mod that has a dependency of all the mods for my group. This way people can just use this mod and it will update when we change mods up
the function is not written properly.
yeah but what's the point?
automatic mod list distribution instead of sending out html files
^ that @little raptor
if I use execVM to execute a script will it execute on the same level of the script where I used execVM?
so if I put it in initPlayerLocal.sqf, will the script that I execute using execVM run locally for the player?
do you have the pbo packing automated or do you do it manually every time?
Manually
as so often, the quality of life increase for players is a QOL decrease for the admin lel
Yes.
thanks
whats an easy way I can make it so that only players on one side can access a virtual arsenal?
Use the initPlayerLocal.sqf and add a side check.
Ok so what the problem ? 🙂
Is there a hook that I can use to call a script when the mission ends?
essentially I need to make a server-side addon to activate an script on mission end
but the wiki says that exit.sqf is mission based
use an EH then
MPEnded seems more like it
But I don't know if it's going to work for what I'm planning. I want to make an addon to call the function to save the OCAP recording
Guess there is only one way to find out
Say I want a players loadout to be reset every time they teleport somewhere, but the players are able to have custom loadouts, how would I have an option on the Arsenal box for them to save their loadout and whenever a certain script is ran, that loadout gets reset to what it was saved as.
not possible
@fierce solar Easy. Just save players loadout and restore it by request 🙂
I did something similar before: https://youtu.be/N2w3T3DA7eA
This doesn't answer my question, I get the basic concept of how to do it, but how would I do it without any mods such as ACE?
How does it tied with ACE?
https://community.bistudio.com/wiki/getUnitLoadout
Thats my bad I forgot the scroll actions are just in a different fashion with mods
if I'm not mistaken
hey guys I have a really basic question about the ARMA 1 mission editor
what command do you use to set a player's primary weapon? am I missing something?
Not entirely sure this is a proper place to ask (since this is really Arma 3 dedicated place officially) but the motto here is "don't ask to ask just ask"
ah I’m just realizing it’s not dedicated to all armas
Anyways I was just trying to figure out how to enable my mission so when I die it automatically takes over another teammate that’s still alive - as opposed to the bird flying thing
But sure to ask. I ain't a moderator so
How can I whitelist weapons, per role in the Arsenal. I know how to whitlist roles per uid. But is it possible for me to only allow select roles to see select weapons in the Arsenal
yes but not easy
So you know of a way to do it or you’re just saying it’s possible?
is it possible to figure out if a shot is a headshot with the handledamage eventhandler?
if ( player == blue1 && !isNil BlueLoadout1 ) then {
why does it say BlueLoadout1 is a undefined variable?
have u done BlueLoadout1 = (something) before that line
you have to define it first
No, the variable only means something once someone saves their loadout using a different script, thats why it says !isNill, making it to where it only executes the script if the variable exists
Read BIKI carefully. isNil takes a code or a string
BlueLoadout1 is a variable
But still
im confused
Read BIKI. It explains
Yes. Bohemia Interactive Community Wiki, BIKI. What sharp. posts
Didn't know you guys call it that lol
omg you fixed everything
Sorry for not understanding that was kind of right in my face 😅
np. If it doesn't work, always your friend, BIKI is there
hi how do you make an "array of units" and does it accept the variable name of a specific unit?
is it [test][test1] or ["test"]["test1"]
[test,test1]
thanks!
yo bros how do i freeze a chopper in position?
i used unitcapture on a helicopter to land in a specific spot, but i want it to stay there forever, but as soon as the unitplay ends, the chopper takes off immediately.
i tried disabling AI features on the pilots, but they still take off
take away its fuel?
