#arma3_scripting
1 messages · Page 715 of 1
I need to run code when players run default actions like Connect to a drone, or open the Vant Terminal, or hack a drone, and many others.
Ooops, sorry.
does the "VEHICLEINVEHICLEGETIN" waypoint use waypointattachvehicle or waypointattachobject
Okay but how do I tell the waypoint which vehicle to Load into
¯\_(ツ)_/¯
It's probably waypointAttachVehicle or the nearest vehicle if no vehicle is attached
Fortunately you can test it pretty easily by putting the waypoint near 2 possible candidates, attaching it to one that isn't the closest, and seeing which one it picks
The problem I’m having is that no matter which I use the vehicle to be loaded just drives up next to the vehicle I want it to load into and never completes the waypoint
Is the target vehicle unlocked, and does the passenger vehicle fit into the target vehicle?
yes
just to prove the point, use setVehicleCargo on it and see what happens
if you can't convince the AI to load up on their own, you may need to waitUntil they're close enough and force it using setVehicleCargo
Hey all, is there a script or mod that can randomly spawn type/quantity of AI in specific area? I know nothing about scripting yet, but am willing to learn
Hey guys, i have a rather old script which worked very fine the last time i tried it but gives me a CTD every time i run it now. If someone could tell me how to do the proper SQF formatting that i can put it in here without making my eyes bleed i would be very happy.
This script basically gives me a VTOL flying from a random point over a fixed point and then heading out to the other side.
As i couldnt get the AI to fly a dead straight line and ignore the fighting below it i removed it and am just moving the plane along the axis. As i said this worked out great the last time i did that (tbf that was probably 1,5 to 2 years back). But now it gives me a CTD between iteration 75 and 400 of the loop. Long before it even reaches anything else it should do.
This script is run on the server in a Eden MP Session
oh and it is an Status_Access_Violation error btw.
please use https://sqfbin.com/ for such code chunks, thanks
https://sqfbin.com/urevijanufaqiqewiguv here for you
I'm still having issues with triggers pre-maturely activating when loaded from an sqf. It's completely inconsistent as to which obj are being triggered, anyway I can get it to double check before marking as complete or delaying it?
maaaybe post your code yes?
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
private _logics = [];
private _logicIDs = [];
private _item722 = objNull;
if (_layerRoot) then {
_item722 = (group (missionNamespace getvariable ["BIS_functions_mainscope",objnull])) createUnit ["ModuleTaskCreate_F",[859.971,7759.42,0],[],0,"CAN_COLLIDE"];
_this = _item722;
_logics pushback _this;
_logicIDs pushback 722;
_this setPosWorld [859.971,7759.42,26.4063];
_this setVectorDirAndUp [[0,0.980326,0.197384],[-0.432101,-0.178006,0.884083]];
_this setVariable ['Owner',4,true];;
_this setVariable ['ID',"Birdge3",true];;
_this setVariable ['IDParent',"isle1",true];;
_this setVariable ['Title',"Observe and Neutralize combatants in Melara",true];;
_this setVariable ['Description',"",true];;
_this setVariable ['Marker',"",true];;
_this setVariable ['Destination',1,true];;
_this setVariable ['State',"CREATED",true];;
_this setVariable ['Type',"attack",true];;
_this setVariable ['AlwaysVisible',0,true];;
_this setVariable ['ShowNotification',1,true];;
_this setvariable ["BIS_fnc_initModules_disableAutoActivation",true];
};
private _triggers = [];
private _triggerIDs = [];
private _item758 = objNull;
if (_layerRoot) then {
_item758 = createTrigger ["EmptyDetectorAreaR50",[1643.18,7597.99,0],true];
_this = _item758;
_triggers pushback _this;
_triggerIDs pushback 758;
_item758 setPosATL [1643.18,7597.99,0];
_this setTriggerArea [50,50,0,false,-1];
_this setTriggerActivation ["NONE","NOT PRESENT",false];
_this setTriggerStatements ["count (units east inAreaArray thisTrigger) == 0","",""];
trg1 = _this;
};
🇼 🇹 🇭
If you want I can post all relevant code into sqf bin lmao
is it "sqf export" result?
Yeah
oh, mb then 😄
I have a select that runs the sqf to load all saved obj but the params are being ignored while being loaded.
theeen IDK, too many variables
try to isolate the one piece of code that fails
I was trying that until it started just randomly completing tasks. It's never the same ones lol
So I'd rather just run a double check before task completion but have to find a way to incorporate it into the sqf
no, the best thing would be to identify the issue
otherwise you are attempting to fix in the dark, and that's never good
I feel the issue is load order but units are spawned in before the trigger or task, maybe I should change it from Unit -> trigger -> Task?
what is the current order now?
init-marker-unit-trigger-task-conn/sync
module sync/act is last as it should be
Could it just be loading improperly on the server?
So it goes Obj is used to open Strategic map and when mission is selected to run, on activation it runs
0 = [] execVM "missions\Mission1.sqf" and in the sqf the load order goes sqf [[_objects,_groups,_triggers,_waypoints,_logics,_markers],[_objectIDs,_groupIDs,_triggerIDs,_waypointIDs,_logicIDs,_markerIDs]]
dunno 😬
seems too complex / unclear / never dealt with SQF export too
wiki down? not anymore
Is there a way to align text in a briefing? (Left, Center, Right)
No workie:
"<left>HQ/SUPPORT</left> - <center><font face='PuristaBold' align='center'>POS</font></center> - <right><font face='PuristaBold' align='right'>SOC</font></align></right>"
units SIDE is new command, never used it myself but I guess it behaves as any other units command, i.e. if unit is not alive, it is not counted. it is possible that unit can be created but "not alive" yet
Results!!!
https://youtu.be/7Wry84tlfg0
afaik the only font tags you can use are color, size, and face in creating a diary entry
img
font
color
size
face
br
marker
execute
executeClose
log
gear
teamSwitch
kick
ban
mute
currentTask
is there a way to grab the dimensions of a .paa texture ingame?
Resolution?
yeah that's what i mean
just don't want to go and search through some mod files to find the resolution of a flag and pull it up
https://community.bistudio.com/wiki/getTextureInfo
Note 2.06 command
ah poo not on dev atm 😦
But the 2.06 update is almost here I think
Anyways if theres a way that's the command
does the res even matter tho? 
well i want to put some stuff in some diary entries, but it has a max x of 370. just want to convert its ratio down easily first so it doesn't cut off
are you sure? can you give me the wiki link?
https://community.bistudio.com/wiki/createDiaryRecord
under show text at the top of the screen. in the img tag section
I don't think it's referring to image resolution
it means the resolution of the image that you put into the diary
so the texture can be any res you want
hmm I'll test it then. hope if I just put a x value of 370 that it will follow ratio and auto size the y down. As is, with this flag texture, its 512x256 and if I don't put it a x or y value, it cuts off the right side of the flag
Maximum width supported seems to be 370 pixel
I don't think it's correct either
it probably depends on the maximum font size based on user's display settings
so just messed with the width value. it will keep the aspect ratio the same and size it down if you don't put in a height value
thnx. will add
also, can confirm that max width. threw in some large images for fun and they all cut off around that point... 370 +- 10 or so
ok but at what resolution and UI scaling?
if 1080p and small, I think that's what R3vo used too
also I think it's the height
not width
i'm 1080p and small
like I said, it probably uses the max font size
so no surprises there
well the height just keeps going and it makes a scroll bar on the side
i tested this with a 1024x512 image this time. full height is shown (with scroll bar) but about 370 of width is shown (no scroll bar, just cut off)
you can't have a 1024x512 image ... 
all textures are squares
Not necessary?
well textures have to be, but other images idk
i might have messed that up since i just loaded it as a .jpg .png then saved it as a .paa I totally forgot about image2paa and how it errors if its not x^2/y^2... then what did I just create lol
i mean png
does arma convert it to .paa in the process? i though it was standard to make everything .paa for speed
No? Depends on the “in the process” you mean
jpg are less efficient for Arma.
But for a diary picture or loading screen its fine, but paa is always preferred
jpg are used for Editor previews 👀
no they don't? you can use non-square images in arma just fine, I've used them plenty
as long as each dimension is still power of two
at least for textures like you said
¯_(ツ)_/¯
I've used 1024x512, 1024x256 as textures without issues
Is String in SQF a reference type? If I do
_someVar = "%SOMEVALUE%";
_someHashMap =
createHashMapFromArray [
["a",_someVar],
["b",_someVar],
["c",_someVar],
["d",_someVar]];
Will it use the _someVar link or copy "%SOMEVALUE%" for each record?
yes
but the question is, why would it matter?
I don't think there's any command that can modify strings by reference
Thanks, got it.
Just wanted to make sure I won't waste precious bytes of server memory (=
And was curious too
you're wasting more memory with your hashmap than the strings
But they're soooo convenient (= (jk I really need it here, but thanks for the warning)
Everything is by reference by default in SQF
Only + and some other commands may copy
Does anyone know whether there is any way to use the Zeus "Edit Custom Objective"-screen in the High Command onTaskCreated code?
https://community.bistudio.com/wiki/Arma_3:_High_Command#Code_for_Create_Task
the Zeus "Edit Custom Objective"-screen
the what?
So some vehicles come with variations, e.g. the Leo 2SG with/without the camo net on the hull/turret. Is there a way to change that via SQF after a vehicle has been spawned?
these are usually done with animations
if you check their config class you should be able to find the animation name
and then you can animateSource it
Ah, thanks.
Relatedly, the Eden Config Viewer is one of the most puzzling pieces of UI I have encountered 😄
The two small textboxes at the top seem to do nothing, don't even allow input
the what?
Might be an Eden enhanced thing
These textboxes display what you have typed
You search the list by selecting it and typing
same for the properties list
This thing: #screenshots_arma message
to create a scope
but why?
reasons...
if you mean "in editor", it was a CBA workaround for an init field issue
another reason is
call {
if (reason1) exitWith { stuff };
if (reason2) exitWith { stuff };
if (reason3) exitWith { stuff };
};
there is no "in general"
it depends
In general to create a scope like I said... 
but why?
to create a scope 🤣
don't tempt me, I can go on for quite some time!
ok thx, I was just curious
soooo i posted this yesterday but i cant see it in the list and therefore dont know if there were any anwsers.
This script of mine which worked perfectly 1,5 to 2 years ago is causing STATUS_ACCESS_VIOLATION - CTDs now for me. Anybody got an idea why that is?
Back then i could run this script like 50 times by just spamming "execute on server" and watch those vtols fly straight into each other without any problem. No my game crashes looooong before the plane reaches the trigger area
Happens on hosted MP in editor and on dedicated server
It crashes ~ between 3 and 8 seconds into the scripts
for "_" from 0 to 1 step 0 do{
Yeah... commy told me once that it should be faster than while {true} and i use it since then... i am aware that the difference is probably very very small.
The new Commy tell you to not do that.
In the example @winter rose a new scope is created so exitWithwill not exit the script or the scope that is still needed. It will just exit the scope that was created with call
the infinite for will be faster than while true, yes
Well... looks like i am screwed. as soon as i have a plane or helicopter anywhere on the map my game crashes... and that is still remaining after i just did a full reinstall of the game 😦
having a quick look at the code, maybe you're running it in unscheduled? 😄
yeah if you're running it in the debug console it'll be unscheduled right?
nope, unless you declare a variable private in a scope before that
will it be defined by the time you are calling it?
ok, but I mean
will the variable still be defined when you are calling it
would be easier if you showed an example
basically what sharp said, if the variable points to the code at the time of calling yes it will work
IM execVM - ing it. The code is definitly running in scheduled environment...
yes, aslong as the first if is true
I know my problem. My game is crashing as soon as there is a plane or helicopter on the map. I just dont know a solution. I already did a complete reinstall of Arma 😦
Well. It wasnt the script. Changing the memory allocator actually solved my CTD problem. I am back to being able to crash 50 planes into each other (for testing purposes only ofc)
Is there a way to write an eject script if a vehicle is destroyed.
Tried a couple things and it didn't work
_heli = vehicle player;
if ({alive _x} count crew _object == 0) then{
unassignvehicle vehicle player;
player action ["eject",vehicle player];
sleep 0.5;
MoveOut player;
};
This is what I have
_object isnt defined
Is there a generic definition for helicopters?
do I have to name all my helicopters?
I'm trying to make it so I don't have to define a vehicle
And this function will constantly be called.
if the vehicle is destroyed.
Soo, I am trying to learn how to build an extension using C#. (For the purpose of making a server-mod)
I am currently reading this (https://community.bistudio.com/wiki/Extensions), and as with all new things programming wise it is complete greek to me... Anyone got any resources/ examples I could use as a starting template.
I dont need much, just something that I could call ingame that would return a string like "Hello world" or "BTC: 46 000"
U could use config-file
hmm
I found it quite useful for categorizing weapons, Should be easy to do for vehicles as well
Well u got ```sqf
_Object IsKindof "Air";
[] spawn {
while {true} do {
sleep 5;
if (_Object IsKindof "Helicopter") then {
hint "yum";
};
};
};
This wont work because object isn't defined right?
correct. you need to pass it as a parameter:
[_Object] spawn {
params ["_Object"];
while {true} do {
sleep 5;
if (_Object IsKindof "Helicopter") then {
hint "yum";
};
};
};
Why would you need to check if it is a helicopter for every 5 seconds? 🤔
Is there a way to detect if a unit has been hit even when allowDamage is false for them?
Use HandleDamage EH instead. It can disable the damage while the unit can be hit
Will they take ACE damage?
...IDK
Am I correct in my understanding that this doesn't work because the private variables are confined to the {} surrounding them and won't pass to the second line for the hint?
if (isNil {_Test123}) then {private _Test123 = 0;} else {private _Test123 = 1;};
if (_Test123 == 0) then {hint str _Test123;};
if (_Test123 == 1) then {hint str _Test123;};
True. The last two ifs won't recognize it
Is there a specific way to use private variables in if then statements?
private "_test123";
if (isNil {_test123}) then {_test123 = 0;} else {_test123 = 1;};
if (_test123 == 0) then {hint str _test123;};
if (_test123 == 1) then {hint str _test123;};```Still kinda wrong, tho. It should work
ahh I see
you can also do this:
private _test123 = if (isNil {_test123}) then {0} else {1};
or even better:
private _test123 = [1, 0] select isNil {_test123};
also use isNil "_var" if you want to check if a var is nil. it's faster
True true
also just a reminder. in this expression _test123 is always nil at first
because you privated it before the expression
I've just tried to point out the direction without “breaking” it too much
But I know the idea
No no I appreciate both
I know. it was just a reminder for @elder sail
I've been using global variables while learning everything, but now ive moved onto optimization for the most part and want to know as much as possible
Ah, well
Thank you both very much, I'll definitely be employing the select isNil idea too instead of my caveman method lmao
note that that method can be slower if what you're trying to select is anything but numbers, strings, and variables
e.g.:
[nearestObjects [...], nearestObjects [...]] select _blabla
is worse and slower than if
[["Hypoxic",1],["Leopard20",1]]
which is the command that lets me find if "Hypoxic" is in the nested array and grab that index? I don't think in can do that.
you can use hashmaps for that. but what you're looking for in the case of arrays is findIf
_arr findIf {_x#0 isEqualTo "Hypoxic"}
gotcha was gonna try that next if there wasn't a direct way
(note: it is much slower than find/in)
Is there a way to pull local variables from a separate file? Like if I wanted to have a file that the local variables are written/changed to and then call for their values by another?
Has anyone tried using Unit capture simple in a multiplayer environment over the course of like a while
To capture an persons movements through a mission
you can #include it but I don't recommend it
unit capture doesn't work with soldiers
Hmm
Would there be some other way to do this
record the position and whatnot of a player throughout a mission to an output file sorta thing
you can find community made unit capture scripts that can do this
I've mostly seen them for cinematic sorta uses
I'm thinking something more along the lines of basic where is this unit twice per second
and doing that for like 20 people
without screwing everyones frames lol
sounds kinda impossible
I don't see how it's different from what you want to do
if it's well written it won't ruin the frames
lmao hopefully I can write something well then
I stumbled on an old forum post about using call compile preprocessFileLineNumbers "ScriptName.sqf';to pull local variables from another file but the example they provided doesnt work lol
The only way I think Ive found is to pass the params while executing another script with [_variable1] execVM "ScriptName.sqf"; from within the first
call compile preprocessFileLineNumbers "ScriptName.sqf';to pull local variables
the local variables will only exist in that script
your script won't see them unless you have defined them in yours, and they're not privated in that file
as I said, the best way to do it is #include
It looks like the unit capture stuff also simply copies it to clipboard
and not to a file
so doing it for multiple units at once
would be impossible
scripts can't write to file
I gotchya. I'll look into that. Thank you for the clarification
hmm
you can write your own thing
and it can copy to clipboard, all of them at once
I am not that confident in scripting unfortunately
so that's a rip
I've actually found a reddit thread where they discuss this
if anyone comes along in the future looking to do the same thing as me https://www.reddit.com/r/arma/comments/2z7umn/is_there_a_good_after_action_report_tool_for_arma/ here ya go
yup I see that thx 🙂
Did you report the crash on feedback tracker?
How about I just fix that 🤣
Is easy to check if condition == "true" 😄
trying to set the P0-30 Orca's skin to black on respawn and this works fine and i've got it working with other vehicles. Just I'm not qutie sure how to find default texture names, been using hidden ones up to this point posted on a forum.
trying to get the black skin for the helicopter. Any idea where in the config viewer or something it is? opfor was the best looking under "texturelist" but I can't find anything that's just "texture"
(_this select 0) setObjectTextureGlobal [0, "skin name here"];
[_this#0, "Black"] call BIS_fnc_initVehicle;```perhaps, not tested
huh just tried that with "Black" instead of "opfor" before and got "black" file not found, must have typed it in wrong because your code works perfectly.
yeah lol (_this select 0) setObjectTextureGlobal [0, "Black"]; gives me "picture "black" not found"
BIS_fnc_initVehicle != setObjectTextureGlobal 😛
params ["_heli"];
if (local _heli) then {
_heli setObjectTextureGlobal [0, "a3\air_f\heli_light_02\data\heli_light_02_ext_CO.paa"];
};
hint format ["Searching, %1!", name player];
Hi, how can I make this script show progression?
What progression?
of the car script, obviously!
@warm hedge I have holdAction script for searching a building and I want to know if it's possible to write a script that shows progression in % (0%, 10%, 20%...).
https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd
codeProgress, progress
or hintSilent the same message with different text 🙂
Soo, I am trying to learn how to build an extension using C#. (For the purpose of making a server-mod)
I am currently reading this (https://community.bistudio.com/wiki/Extensions), and as with all new things programming wise it is complete greek to me... Anyone got any resources/ examples I could use as a starting template.
I dont need much, just something that I could call ingame that would return a string like "Hello world" or "BTC: 46 000"
Well good C# examples are already here
https://community.bistudio.com/wiki/Extensions#C.23_3
What this does is just return what you put in.
So if you build this, and then use the script
"MyExtensionName" callExtension "Hello World" it will return "Hello World" to you
of course replace "MyExtensionName" by your real name
what did you change it to? what was it before?
of course replace "MyExtensionName" by your real name
and your credit card number
It was empty so i have no idea(probably standard). As suggested in https://community.bistudio.com/wiki/Arma_3:_Unusual_process_exit#0xC0000005_-_ACCESS_VIOLATION i changed it to "system".
Not yet, i wanted to do the things that are suggested first and would have opened it afterwards.
i actually just implemented that in my optimizer 
he does SQFCPP, of course
Well 🙃
I'll probably just add a bool flag to the loop to make it skip the condition check entirely
on the other hand, while true loops run in scheduled which is slower in general anyway, so this ultra tiny difference matters even less so its not even worth to invest the 10 minutes into improving this
and goto!

Is there any way to put a texture on a custom simple object from a .p3d model? I'm currently experimenting with putting mod objects in a vanilla mission, using the simple object functionality and sometimes an error pops up saying it can't find xxx\xxx\xxx_co.paa, after creating the custom simple object. Because of that I think there might be a way to put a texture on a custom simple object, please correct me if I'm wrong 🙂
Simple objects support texturing...
It's not even worth optimizing...
How long does it even take to evaluate that in every iteration? 0.0004ms?! 
So 4ms after 10000 iterations... 
whatever you do in the while is gonna be slower anyway
https://gyazo.com/c56abb74a8ff9f40648eab16490313bc
https://community.bistudio.com/wiki/Arma_3:_Simple_Objects
ya you can texture simple objects like Leopard said
Hello people! I need help with a ballistic calculator. Someone will tell me where to find a function for a standard ballistic calculator, I want to understand how to calculate a ballistic trajectory in mathematical formulas and implement it through my gui. I interrupted all the formulas available on the internet, but none of them give a real correction for range as it gives a ballistic calculator. Please help me find the right elevation formula for jet artillery.
Hello, quick question:
Assuming I want to use a function multiple times that involves getting all the units avaliable in the map of opfor, would using the function like this would be more efficient
myFunction _target;```
than this?
```myFucntion [allUnits select {side == EAST}];```
@kindred zephyr
units east;
the first case stores the current east units in _target. if there are new units later, it will never be updated - it depends on your mission.
this is useful to know, thanks
indeed, units will only decrease in this case. Would that affect myFunction if not avaliable units are included in the array?
depends on what you do with them
you might have dead bodies in your array
but iirc units east is not that expensive, go for it (unless it's on each frame IDK)
Thanks Lou
So, I would just copy the source file into the mission folder?
Or in the case of a server-mod it would be copied into a @ModFolder?
Ok so I did a quick, copy-paste thing using Visual studio, the return value was ""
Did try using the wrong name and the reslut was the same
I put the C# code and stored it as "MyExtension.cs"
Then I called it ingame like this:
"MyExtension" callExtension "Hello World";
What am I doing wrong here?
the VS file name itself is not a big matter, be sure that the dll itself is named that 😉
MyExtension.dll / MyExtension_x64.dll
be sure to compile that file to a dll ofc
Ctrl+Shift+B 😬
ah well 😄 now you know!
Severity Code Description Project File Line Suppression State
Error CS5001 Program does not contain a static 'Main' method suitable for an entry point ArmA_3_extension source\repos\ArmA_3_extension\ArmA_3_extension\CSC 1 Active
🤦♂️ FookIt I give up
💔
you need a simple Main, it should exist when creating a dll project in VS
Yeah there*s this:
static void Main(string[] args)
Should I wrap the example in that?
hmm so theese are the first 10 lines
using System.Text;
using System.Runtime.InteropServices;
using RGiesecke.DllExport;
class MyExtension
{
class Program
{
static void Main(string[] args)
{ }
Should I remove the program part? Wrap it diferently?
have you compiled it? (hit F5) does it still show the error? Which project type are you creating?
No build error, but I am unable to call it ingame
I'm having an issue with unit capture
I can record everything normally
after recording, I get the popup on the top right telling me to copy to clipboard
I hit F1, and paste it into my script, but nothing pastes
like, the recording data is not copying to my clipboard
I know this question has been asked a hundred times. I've been beating my head against it for hours. I can't for the life of me figure out what's going wrong, and I don't know if it's my music file (which DOES play correctly in vlc) or my ARMA.
I'm trying to get custom music in an MP mission. I created a description.ext with the following:
class cfgMusic
{
tracks[] = {};
class MusicTrack01
{
name = "MusicTrack01";
sound[] = {"music\approach.ogg", db+10, 1.0};
titles[] = {0,""};
};
class MusicTrack02
{
name = "MusicTrack02";
sound[] = {"music\infiltration.ogg", db+10, 1.0};
};
class MusicTrack03
{
name = "MusicTrack03";
sound[] = {"music\escape.ogg", db+10, 1.0};
};
};
Trying to even just locally playMusic "MusicTrack02"; gets me nothing
Interestingly, looking at the log file, when I just try to preview the music via a trigger, I get this:
22:38:04 Sound: Error: File: C:\Users\[username]\Documents\Arma 3 - Other Profiles\[profilename]\mpmissions\[mission name]\music\infiltration.ogg not found !!!
That file definitely exists though (I redacted a few things)
.. Annnnnnnnnd it's the OGG encoding. Got it working. Thanks anyway!
Trying to hint for the person who called an addAction with some special stuff but it's wrong and idk why.
"<t color='#807E78' size='0.8' font='PuristaBold'>Selected</t><br/><t color='#FFA32B' size='1.4' font='PuristaMedium'>Live Fire</t>" remoteExec ["hint",(_this select 1)];
Hey im new to argo scripting how hard is it to convert an arma 3 mission into argo?
post the whole thing
why would you want to? A3 is superior
Bc I don't have Arma 3??
wait for a sale and grab it. it regularly goes down to 5-10 dollars. you won't be able to use many of the scripting commands in argo
I'm well aware, and I would get it if I could but I can't anytime soon my family is rlly struggling
_manager addAction ["<t color='#807E78'>Live Fire Exercise</t>",
{
(_this select 0) setVariable ["ExerciseType", "LIVE", false];
"<t color='#807E78' size='1.5' font='PuristaBold'>Selected</t><br/><t color='#FFA32B' font='PuristaBold'>Live Fire</t>" remoteExec ["hint",(_this select 1)];
[(_this select 0)] call WAG_fnc_addMenuActions;
}];
so how hard is it to convert?
im trying to convert a zombie infection mission into argo from arma 3
you won't be able to. there isn't even documentation on the BI wiki on what commands are available in argo
I just need to convert a couple assets but idk how
can you even open the mission in the argo editor?
that and if its a zombie mission, it probably has mods and those won't work with argo
yes, its just an error with 2 assets from arma 3
you'll have to open up the mission.sqm file after un-binarizing it and find the asset and delete it in all of its locations
un-binarizing???
if the .sqm file is binarized (typically since it makes things load faster) then you can't open it in a text editor
how would i decode it?
you'll need arma 3 tools for that or mikero's tools
no. people don't really play argo. i don't even think it has workshop support
nope 😦
which tool from mikero?
you need parseText
While I don't like handouts I have no clue on where to put that bc of the remoteExec
handouts are fine in this case lol:
_manager addAction ["<t color='#807E78'>Live Fire Exercise</t>", {
params ["_target", "_caller", "_actionId", "_arguments"];
_target setVariable ["ExerciseType", "LIVE", false];
private _text = parseText "<t color='#807E78' size='1.5' font='PuristaBold'>Selected</t><br/><t color='#FFA32B' font='PuristaBold'>Live Fire</t>";
[_text] remoteExec ["hint", _caller];
[_target] call WAG_fnc_addMenuActions;
}];
i "think" its deRap
@hushed tendon also, thats a sleek choice of text and color
why thank you
ok ty
ok i think i fixed it, but now I start off in the ocean way off I intended to spawn? any clue why?
or any idea on ho0w to fix it?
you're entering territory where I would have to learn how the mission is written which I'm not willing to do as that is a large time sink. you need to read up on the description.ext file
which contains respawn system information
ok ty, is there any way to edit 2 missions at the same time and be able to bring one asset into the other?
no unless you edit the .sqm's side by side which is not fun
no. those assets are a part of arma 3 itself
bc i also scuffed the vehicles so i wanted to borrow the assets from a working vehicle mission
ok
you can only use what argo provides you
whats a "composition"?
Why cant I use the vehicles I added? it keeps saying i need supporters pack
Because that's how Argo worked
next time arma goes for 5 bucks i'll just get it for you if you are struggling
If you could man I wouldn't be able to thank you enough
You should've acknowledged how Argo and Arma work. Argo isn't meant to be a vehicle warfare game
The caller is already local
Again, caller is local. No need for remoteExec
Arma projectiles, especially missiles, behave differently than real life ones.
ACE might have a ballistic calculator, but probably for their own projectile system. idk
Thats not my goal, but its a huge map so some transport would be ideal
So is there no way to use vehicles for free?
i do in other servers no problem
Without using some hacky solution. Still Argo is mainly an infantry only game
wdym hacky?
Whatever it is, fully scripted solution
how do I add "Installations" or is that only for arma?
How do you pull this UI up?
I can't send pic rip
hey guys
im trying to do a simple teleport script
this addAction ["Enter", {player setPos (-719,-765,12)},nil,1.5,true,true,"","true",5, false,""];
this shows a missing ) error
its behind the -719 the game said
where did i go wrong here?
setPos again 
I wonder when people are gonna stop using that 
sorry, im new
anyway, the problem is (-719,-765,12)
yep
uhhhh whats wrong with it exactly?
because i modified this from my flag teleport script
it takes an array
usually in that array would be another object
ok...so what do i need to use to get it to work with xyz coords?
like I said, it must be an array
i.e. brackets []
i see
soooooooo to add to this
the point of the script is to teleport players inside a bunker
but uh, that suddenly stopped working, and im falling through the floor
obligatory arma 4 plez
use setPosATL
i see
Thanks for the answer! I understand all the differences but I need to know how the developers use the ballistic calculator to set the required elevation? How much do they calculate it?) Where are these files in Arma 3 to look at them?
XD
but anyways
uhmmmmm how would i use atl exactly?
properly
the same as you are using setPos right now
the exact formulation is not documented
the one for missiles (and any other self propelled projectile) is a total mystery. all I know is that they apply some magic numbers to make it work
the one for bullets is a simple projectile equation with quadratic drag
the one for throwables (e.g. hand grenades) and mortar shells are without any drag and the easiest
set a higher third value (altitude) then
hmmm ait
so i changed 11.8 (the exact alt to 12, fell through the floor again, will try 12.5 then 12.8
higher than that, im above the tunnel
you must get the correct ATL height at the destination too
use getPosATL
i seeeeeee
wait
i dont have a getpos
this addAction ["Enter", {player setPosATL [- -718.794,-764.335,12]},nil,1.5,true,true,"","true",5, false,""];
I mean first go there on foot
then use getPosATL player to get your ATL coord
then put the coordinate there
wait
i noticed something
[- -718.794,-764.335,12]
ok look at this for a moment, theres something wrong i can feel it
yeah its fixed
XD
also why is that coordinate negative?
are you putting yourself offmap?
its an out of map strcture
oof. don't
I understand this because I have been working on this issue for over a week. I went through everything I could find. Maybe there is a way to find out what functions are used when using a ballistic calculator? As far as I understand everything that is written there, i think its maybe event handler "maplick" run all function or code for calculation elevation, this event can be assigned at the level of the higher family class.
Is it even possible to look at the events attached to the object and look at them in the middle?
Maybe there is a way to find out what functions are used when using a ballistic calculator
no
they're not functions afaik
if you mean the ballistic computer used with mortar shells, that one is easy as I told you
it's just a normal projectile motion
no drag
i try to jet artillery whith roket
yes ballistic computer
as far as I understand it is a banal GUI with an event "mapclick" after which the calculation is performed and the arrow tower is set in the required position in the direction and elevation
Hey i have a script here that makes dynamic waves of AI spawn and hunt the player thing is i want to limit the amount of groups that are being spawned in each time the loop runs so that only around 2 groups of AI can be spawned at the same time now there are instructions for that by the original script maker but i broke my head for hours just to realize i don't understand shit if anyone could help me with the instructions it would be much appreciated
The instructions:
Yeah.
Set two variables at the top:
Maxgroups - Assigned a number for the maximum number of groups to exist in one time.
GroupsSpawned - Assign the number zero.
Before the loop where you update the way-point for groups reset GroupsSpawned to 0 again.
Then in the loop increment GroupsSpawned per loop (GroupsSpawned )
Then wrap the script where you spawn and set up a new group in an if statement that checks : IF (GroupsSpawned < Maxgroups ) ...
the script https://sqfbin.com/ekuboquriqexesunonax
Hello, I have a question,
do you know how to make sure to recover the position (ideally in PositionRelative ) of the most advanced point of a vehicle
Because I am doing a loading script, and therefore to attach this one I have to know the position of the frontmost point, so that it does not fit into a wall x)
I tried something with bouding box, but nothing very functional
if I understand you correctly, you can use lineIntersectsSurfaces
It can be interesting, how to do it?
using modelToWorldWorld to get two ends, one at front and one at back
then running intersections along these lines
then you can convert these positions back to model using ASLtoAGL and worldToModel
Well I suck, I don't see how to do it x)
Is it possible to put a texture on a custom model, which due to being custom doesn't have a config? Like I said - i.e. a model from a mod's unpacked .pbo.
well that's a super simple object, so no
setGlobalTexture?
Sorry for bumping in I just wanted to suggest
that's not even a command. but anyway, like I said, objects that have no config are super simple. the game takes the hidden selection textures from the config, so without it it cannot retexture
Oh wait yeah
My bad
anyone tried spreading around enemy AI locality between players if a non dedicated server is used? did you notice any performance gains?
well if you have many AI, it will improve the server FPS, so less lag/desync for others...
but I've never done that myself so I'm not sure
Hi it's me again... For some reason I'm getting an "Error in generic expression" on Line 1. Yesterday the script worked just fine. The only thing I changed was the variable name (pc1). Can you help please? I'm quite new to arma scripting so I apologies if this is a dumb question.
[pc1, //pc1 je název objektu u ktéreho se akce provádí, změnte dle potřeby
"Stáhni", //název akce
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"player distance pc1 <5", //podmínka pro ukázání akce
"player distance pc1 <5", //podmínka pro provedení akce
{}, //kód se provede po spuštění akce
{}, //kód se provede každý tick, když akce běží
{pc1 call BIS_fnc_initIntelObject;
if isServer then{
pc1 setVariable ["RscAttributeDiaryRecord_texture", "test.jpg", true];
[pc1 "RscAttributeDiaryRecord", ["Nový Intel", "Jsi kokot"]] call BIS_fnc_setServerVariable;
pc1 setVariable ["recipients", west, true];
pc1 setVariable ["RscAttributeOwners", [west], true];
};
}, //kód se provede pokud bude akce splněna
{hint "Pustil jsi klávesu"}, //kód se provede pokud bude akce přerušena
[],
5, //doba trvání v sekundách
0,
true, //vymazat pro provedení (true nebo false)
false] //ukázat v bezvědomí (true nebo false)
remoteexec ["bis_fnc_holdactionadd", [0, -2] select isDedicated, true]; //MP kompatibilita
what data type is pc1?
@fair drum it's a object in mission. It's an open laptop
I have everything setup correctly. The trigger is synced to the laptop, i have "execVM" done right. But I can't find the mistake.
your error is in line 12
, 😮
Got it! Thanks!
Is there a way to do what 'intersect' does without using a lod. I am trying to get all the memory points of an object that I am looking at.
selectionNames
Thanks, any way to get just one I am looking near without using lods?
the question would be: "why?"
yes
selectionPosition
and modelToWorldWorld
and vectorFromTo (or vectorDiff) + vectorCos
^ yeah. why?
Thanks, fixing a system that I made ontop of a already trash piece of code and rewriting would take ages.
heya i'm trying something new like copying the previous missions init file over to the new one to continue the story essentially keeping ammunition and vehicles in the same places as they finished but when i put the init on the new mission it seems to duplicate everything on the spot and it all just blows up, does anyone know a fix for this, many thanks cam 🙂
just warning you, doing that is probably gonna be slower than intersect
also selectionNames still needs a lod
Can you use the Memory lod in intersect?
....afaik no
keeping ammunition and vehicles in the same places as they finished
are they created using the init file? also it's hard to say what's wrong without looking at the code
Yeah so we drove to an area to setup a "camp" with the vehicles and ammo and dug trenches. I took the init file from the mission to place onto the new one which is exact same mission i have just updating it, but when i spawn the vehicles and ammo all explode and it seems to duplicated itself on top of each other which what's causing the issue - https://pastebin.pl/view/7e0fc7d7
oof. did you type all that? 
No so basically on your server it updates the init whever an item is placed etc from when the mission begins so i copied that as it places objects in the last location and spawns them in
well I didn't read all that
but I guess your issue is that it's scheduled
run the code unscheduled
in other words, wrap it in an isNil { }
ok thank you i'll give it a try now
you know what I meant right?
good day guys. does anyone knows any way to make the pop-up target to ignore shots, without making it a simple object?
the thing is that i'm trying to make a two-hit target using the eventhandler, everything works fine, except that fact, that it falls after the first shot, while when it is a simple object, it does not react to my "terc" commands at all 😦
thanks in advance
I would assume you could assign it a "hp counter" and the use eventhandler to manually decrease it and then excute whatever you want after a certain threshold.
There isn't by chance a scripting command to return values from a modelcfg of say, a building/structure is there?
no, what u need specifically?
I was working on some math some months ago to predict which way a door would open
but ended up having to have an entry for every single door for every single building
I could determine which way the door was oriented in the model, and what side of the door the player was standing at, but I was unable to determine which way the door would open
What model.cfg info tells you which way it would open?
The animation class's door animation values would, wouldn't it?
Not sure, maybe
minValue = 0;
maxValue = 1;
angle0 = 0;
angle1 = (rad 110);
yeah can't read these
buuuut
you can get the..... ah no thats 2.06
in 2.06 you can get the orientation of the door's bone via script command.
You can just test open it, and get the open orientation and then you know which direction it opens to
yeah I know, that's what I did for 100+ doors lol
Yeah I mean in 2.06 you can just automate it
ooh sorry I missed a line in your msg
Well I guess even in 2.04 you can.
open door, lineIntersectsSurfaces on both sides of the door, the side that hits the door after opening, is the side the door opens to
Hail jesus we have regex now
Which 2.06 command am I looking for? selectionVectorDirAndUp ??
Hi guys anyone knows how make AI Spawner to spawn only Covenant faction ( random units , vehicles, airvehicles ) ? any script that i have to put to make it auto spawn them?
i tried:
this setVariable[ "side", "West", true ];
this setVariable[ "faction", "OPTRE_FC_Covenant", true ];
but it says OPTRE_FC_Covenant cannot be found
or i have to put other script into AI spawner to spawn covenant faction?
I have this code and I'm trying to run it on a server but it doesn't seem to run.
My code sections are in SQFs and I prepare them like this
initServer.sqf
execVM "WAG\TEC\init.sqf";
WAG\TEC\init.sqf
WAG_fnc_addMenuActions=compileFinal preprocessFileLineNumbers"WAG\TEC\addMenuActions.sqf";
And in the init of an object I have
[this,"COMPOUND1"] execVM "WAG\TEC\setManager.sqf";
and in WAG\TEC\setManager.sqf I have this but it doesn't run the code in the called SQFs
_manager = _this select 0;
_compound = _this select 1;
sleep 3;
[_manager,_compound] call WAG_fnc_setBaseSettings;
[_manager] call WAG_fnc_addMenuActions;
Man looking for arma 3 tutorials are a pain
what do you want to do?
because object inits are run before file inits. check out the load order
https://community.bistudio.com/wiki/Initialization_Order
ohhhh. But does what I have above look right?
if that menu action function is only running on the server, then its only going to exist on the server. just make your functions in CfgFunctions to make it easy
So I am making an npc say a voiceline using a trigger, and the video I watched did so in a way apparently is outdated
using a .bikb and a .sqf
bikb
class Sentences { class r //Name to be used later to call the sound { text = "Easy 2-4, Get up and get ready for your first day on situational training!"; //Subtitles speech[] = {"\sound\r.ogg"}; //Path to the sound file actor = "man"; //unit that is speaking variant = ""; variantText = ""; class Arguments {}; };
sqf
`man KbAddTopic ["introduction","conv.bikb","",""];
man KbTell [gun,"introduction","r"]; //playerLine_1 - Class name of the line defined above
waitUntil {
man KbWasSaid [gun,"introduction","r",3]; //Search in 3 last seconds
};`
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
That's useful
very
I might have a very obvious mistake, but any idea why my object is not being created ingame?
treePos = ASLToAGL getPosASL randomizedTree;
deleteVehicle randomizedTree;
hintSilent str treeArray;
createSimpleObject [treeArray,treePos];```
//Just for reference. The reason of why createSimpleObject is not making the tree its because it takes ASL coordinates instead of AGL. Once the object is created you still need to position it AGL since the object is underground, converting the ASL position to AGL and then using setPos.
how did randomizedTree get assigned and do your variable's have to be global (missing _ at beginning)?
randomizedTree is an object in map, code is not global as it is intended to be executed in every object named randomizedTree, as Im creating a forest with variety while manually placing it.
now that I think of it, deleteVehicle would be more efficient than hideObject as I already have it position in map 🤔
if you just want a position returned from an asset in editor i'd recommend an empty or system marker and using getMarkerPos 'foobarMarker_0' to get the position
no need for deletVehicle hideObject
I know this, but i need the visual feedback to properly create a forest, would you imagine 13k markers instead of trees 😂
13k obviosuly being an exaggeration
just so i understand: you want to be able to toggle the visibility of a generated forest or manually placed forest?
manually placed forest
ah
okay well heres a better solution
put your trees in a single named layer in the editor and use hide/show object to loop through the objects in the 3den layer. theres a command i forget the name of that lets you return the objects in a layer
bonus you dont need to name every tree
ah, i think there is a misunderstanding, I do not want to hide and show, but to be able to randomly replace each of the manually placed trees
with a different class of tree?
so theres a field of tree objects somehwere and they're all currently the same. With your script, you want to change the class of it: deleteVic "tree"; createVic "newTree"?
ye
ah sitll id reccomend an 3den layer
no need to name them all and just use select random like you were
should look something like this:
I would assume using a simpleobject instead of a vehicle would be better, as trees have sim(?)
// PSUEDOCODE WILL NOT RUN
_trees = get3denLayerObjectsFoobar "myTrees";
_treeArray = ["class0","class1","class3", ...];
{
// processing for each tree: _x == current tree
_pos = getPos _x;
deleteVic _x;
createVic [(selectRandom _treeArray),_pos];
} forEach _trees;
probably
ah, a much better solution for a single run instead of 13k runs.
i mean technically the stuff in the forLoop will run 13k times XD
yeah, but in a single space instead of 13k spaces
:x
much better than in every init i agree
I keep getting an error regarding generic error for _pos while using _pos = ASLToAGL getPosASL _x;
check value of _x
it might be an array if you're using getMissionLayerEntities so perhaps _trees = _trees select 0; should be in line 2 outside of for loop so that _trees is an array of objects
ye, _x is returning an array, and ye, im using getMissionLayerEntities
okay than put that _trees = thing at line 2 after orginal _trees denfinition
so that we selct the array of objects we want
nice
Placed buildings that I have moved with alive logistics will cause damage to units when they walk into them. Anyone got any ideas on how to fix that?
Tried object enableSimulation false, didn't help
relating to my unprofessional post the error I get is
no entry
(arma path in pc) Training%20.fow_map_henderson\conv.bikb.Arguments'.
this makes no sense, why would this make placed objects cause damage to the player? sqf // Detach and reposition for a save placement detach _object; // Reposition to fit surface gradient _object setpos getpos _object; // Set height correctly _object setposATL [getposATL _object select 0, getposATL _object select 1, if !(isNull _container) then {getposATL _container select 2} else {getposATL _object select 2}];
Your bikb is wrong and incomplete.
Hello I was wondering if there's a way to get copytoclipboard to work on a server? I tried to make an admin menu that's suppose to copy their steam UID to clipboard so you can quickly ban but it only functions offline / local server.
I'm open to alternatives that don't use copytoclipboard but I don't know what to do.
copyToClipboard works on servers too
Hmm.. Is there any special trick?? Mine seems dead.. Could it be how I'm executing it?
_theplayertodisplay = nameforlist; //this is called via the prior page and is stored globally its basically player
_name = (name _theplayertodisplay);
_steamid = (getPlayerUID _theplayertodisplay);
copyToClipboard format ["%1",_steamid];
figured out a work around using rscedit thanks to connor for telling me about em.
it works on server machine only, i.e. isServer > true, that's what Leopard meant
I ended up setting the buttons to RscEdit and setting the text to their steam UID it seems to let me do what i had to do
Hello everyone, Is it possible to rotate an object using the mouse as in the video - https://youtu.be/HRYodomxd-E?t=199?
Maybe there is a similar function in arma as in unity like -
Input.GetAxis("Mouse X") ?
you can script it yeah
Anything specific to the scripting above?
Thank you, could you please give some advice?
I just don't quite understand how to implement this, I may have to use getMousePosition, but I'm not sure...
see https://community.bistudio.com/wiki/Conversations for proper bikb formatting examples 🙂
I cannot, I am not fond of such scripting sorry
finally thank you!
// Needed parameters.
class Arguments {};
class Special {};
startWithVocal[] = { hour };
startWithConsonant[] = { europe, university };```
My third eye has opened
getMousePosition is actually is the idea. You can check each frame and get delta
Thank you, I will try it
MouseMoving EH 
I did it! Hurrah! Thank you so much
Good day. Is there a way to tell if an object is in another object? For example: if table is in building? I come across "boundingBox" command, but I don't know how to implement it properly and if it is what I need at all?
that would be it - note that (real) bounding boxes can also be quite large for buildings, you could to a raytracing (lineIntersectSomething) to check if there is a roof above it
Actually, to think of it, I would need some objects to be on the roof of the building, so guess what I need is some 2D rectangular and checking if object XY coords are within it, any clue?
There's a 'createLocation' and I can check if the object is within it, but how to draw it precisely on a building? 
you can have 2D thingy with bounding box, using only X & Y data
see also inArea @cyan dust
math is cruel. Ok, I think I can do it, thanks a lot
Is there a way I can delay the execution but still have it come from the object?
"come from the object" makes no sense 🙂
[this] spawn {
params ["_object"];
sleep 1;
hint typeOf _object;
};
```have a _reference_ to it 😉
It's extremely simple 
not to people who don't like math
(yes, they exist)
I would try using one of the intersection commands to check if a line straight down to the ground from the object intersects with the building.
I hope. I do have objects offsets for placing and I guess I should just compare them with bounding box of the building
yes, that.
I was going to compare getPos and getPosATL z values lol, probably that would work too
_posRel = _obj worldToModel ASLtoAGL _posASL;
_bb = boundingBoxReal _obj;
_inBB = {
if !(_x >= _bb#0#_forEachIndex && _x <= _bb#1#_forEachIndex) exitWith {false};
true;
} forEach _posRel;
I barely call that math ^
breakWith 😠
geometry then
the scripting commands are doing all the math... 
The SQF gods have given you proper tools to break loops!
exitWith is proper too 
!(_x >= _bb#0#_forEachIndex && _x <= _bb#1#_forEachIndex) && {breakWith false}; 
🏃♂️
not sure if will error or not but should work in theory.
that works too yeah
@light pewter did you read what I answered earlier?
PS: don't crosspost
cant find it can you link it?
I am no OPTRE expert here, but isn't Covenant East (opfor)? i can spawn covenant faction only being in opfor blufor cannot have it so no idea how make AI spawner spawn them i have no idea about script i just know where to put it
i will try East maybe it will work
@winter rose after changing to East it says this: https://ibb.co/Wswfj3X
that's a scripting error, can't do anything about it if it's not your script
so i cant make ai spawner spawn them?
faction has no groups
you can spawn only 1 by 1
that might be the issue
@little raptor So, got any idea?
nope
probably uses one of these:
configFile >> "RscDisplayAttributesModuleObjectiveMove"
there's quite a lot of them:
Are you just looking for the class of that display?
It is RscDisplayAttributesModuleObjectiveCustom
That certainly helps but I was rather looking for a way to implement it in the mentioned code...
I have added an "displayEventHandler" for MouseButtonDown to the mission display, 46. However I can see this also fires when the map or inventory is open. I know I can add an if-check with isNull (findDisplay 602) to check if inventory is open. However that requires me to check any other UI, including modded, that could be open and also use the mouse button.
Is there any smarter way of doing this?
Also seems like the map, id: 12, always returns true, even if the map display is not open?
map, id: 12
visibleMap
that requires me to check any other UI, including modded
....doesn't the EH only fire for the topmost display only?
You can use the Rsc but you will need to write your own script to read data from that as the functions related to that are tied to curator itself, it may and will probably cause issues even if you recreate the same procedure (which I believe is what you want to avoid scripting its functionality?) But that will require you to understand entire curator interface which is a much longer process and imo would not be worth it. But if you really up for it, you can read the stuff in curator modules and curator functions pbos. The part you are interested in starts from the function called showCuratorAttributes.
ah Thanks. I had looked at wiki for map functions but must have missed that one.
From the testing I am doing it seems like it still fires for display 46, even if map or inventory is open. However if I go into zeus display it won't fire. I guess it might be something with display 46 is still "active" with map or inventory as they overlay? Like with map you can still run while map is open.
then just whitelist a few displays
use allDisplays, and find if the IDD of any of them is not whitelisted
off the top of my head, you should whitelist 0, 12, 46, and 313 at least
ahh ofc. Turn the check around instead of looking for what is not allowed. Makes sense. I'll try that approach. Thanks!
np. also be sure to include the left and right display panels too
yeah. Checking the wiki list of IDD. Gonna check what is needed
Anyone happen to know of a way to check if the spectrum devices "gui" is open? The window with signals you get when right-clicking. (In the limited base-game api of it).
Tried to check if it was a display with allDisplays and if it was a cutlayer with allCutLayers but none includes it.
ah nwm. I can check it with cameraView == "gunner"
does anyone know how to script a random chance for a unit to get a certain item in their init?
lets say i want a 10% chance of my unit having a document
how would i do this?
You can use the random function to generate random value. Like
private _randomVal = floor random 10;
// chance of it being less than 1 should be 10%, as there is 10 outcomes. (0-indexed)
if (_randomVal < 1) then {
// give item
};
I believe each outcome from 0 to 9, should be a 10% chance. So checking for a single of those outcomes should be 10%. Although I am tired and might have missed something with the percentages.
is there a way for me to retreive the value of a uinamespace
alright thanks a lot
gonna test it out tomorrow
just if (random 1 <= 0.1) // 10%, 0.2 would be 20% etc
The large hangar building in 2 parts on Livonia has animations for the doors, but you cannot open the small doors in the editor. This is annoying. I mean the Land_ServiceHangar_01_L_F building. Why is it like this?
how does one snap to nearest ATL position?
Im creating a simple object and setting its position using setVectorUp however the objects center is in terrain position.
When using createVehicle and stablishing Z as 0 it does contact the bounding box lower face to terrain.
How does one set the simpleObject Z like in createvehicle?
I can set the object properly using createVehicle, but since we are talking of A LOT of objects i think is better performance wise to do simple.
does anyone know a script or anything I can use to spawn loot around the map w a config?
https://community.bistudio.com/wiki/surfaceNormal if i understand correctly, that's what you want
there might be some on the internet, google is your friend
I look and I think I find something but its always outdated 😭
does anyone have a working argo vehicle script?
So I need some help with a mission i'm making, I need to access the police lightbar and siren for one of the cars, how would I enable that in scripting? It's in the action menu but I just need to be able to activate it from a trigger for example.
though not sure, if its scripted, i don't think it will work
I've had a look at that, I can't seem to figure out the correct syntax for it; e.g:
Basically I need to press the Siren On on the action bar, but spaces aren't allowed so i'm unsure as to how i'm supposed to word it?
It says Siren On (U) but unless theres another way it's called or something? I've tried something along the lines of:
driver1 action ["Siren On (U)", vehicle driver1] to no avail
How do I use the "lootbox random position?"
Is there a known issue with the "OnUserClientStateChanged" missionEventHandler? I'm getting a script error stating Error Foreign error: Unknown enum value: "OnUserClientStateChanged" when I client-host the mission as a test.
not quite sadly, im ditching setVectorup since it's not related to what im trying to do anyways 😦
it takes action class thing, not displayname. that looks like a scripted action, so i think that command is out of play
is there a way to identify what the action name is other than the displayname?
those are 2.06 from what i can see
but dont worry, firugred out what i was doing wrong. Thanks for the input tho.
I mean I'll try to recreate it if I have to (meaning I can code and have codes/reworked some functions before).
Thanks for the info.
UserActions in vehicle's config
but like i said, if its scripted(added via addAction), it won't work
but take a look, maybe it's not
hmm worth a shot, could you elaborate by useractions?
ohhh right cheers, ill take a look
not sure what that is
¯_(ツ)_/¯
Argo exclusive. No doc available, or you can read the function so you can guess what it is
thanks, i will try this out too
what A3 version?
@unique sundial 2.04 current main branch version
There is a cool Arma 3 icon with a number under it saying 2.06 near that EH, might be the reason... orrrrr just a coincidence. 
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#OnUserClientStateChanged
is selectRandom ok for MP/Dedi?
Would the same result would be displayed locally?
that command has nothing to do with MP and locality
it executes locally, obviously
so obviously, the result differs for each client, on each execution
hm
silentHint wat
I don't think you understand what locality means 
as for the code (except for all the wrong use of commands):
if (isDedicated or isServer) then
you could just sayisServer
and I don't even see any use of selectRandom so I don't know what you're trying to ask anyway
//create a simple object replacementTree using ASL position and selecting a random index from treeArray
I asked about selectrandom being local because i will execute that only in SP
if you execute only in SP, why would locality matter, in any part of your code?
ok, what is this supposed to mean?
//create a simple object replacementTree using ASL position and selecting a random index from treeArray
select a random what?
you were right, I had a different concept of locality and how it affects selectRandom and createSimpleObject, my check for server was indeed, redundant. Thanks for the answers tho.
I'm need to retrieve a particular variable that has been assigned for every vehicle spawned on the map at server start.
_allVehicles = entities "Car";
Returns:
[
1ac46194080# 1449898: quadbike_01_f.p3d,
1ac48644080# 1451073: quadbike_01_f.p3d,
1ac48990080# 1452669: van_01_box_f.p3d,
1ac47fc6040# 1451814: quadbike_01_f.p3d,
... etc.
]```
I'll be doing something like (this is just an example):
```sqf
_UID = "71254621541250000";
_count = 0;
_allVehicles = entities "Car";
{
_object = ??????
_objectUID = _object getVariable ['PersistentUID',1]
if (_objectUID isEqualTo _UID) then
{
_count = _count + 1
};
}; forEach _allVehicles
if (_count > 25) then
{ whatever...};```
Is `_allVehicles = entities "Car";` a good way to go about this? If so, how would I use the result? Is there a better way?
_object = ?????? wat, you don't need to assign anything, _x is the current element that's being iterated
Is _allVehicles = entities "Car"; a good way to go about this? If so, how would I use the result? Is there a better way?
just usevehicles?
That returns:
1ad75b84100# 1446568: wagon_flat.p3d,
1ad7ab57580# 1446752: a2_locomotive.p3d,
1ac01eaab00# 1447422: cargo20_idap_f.p3d,
1ac01ea8b80# 1447423: cargo20_idap_f.p3d,
1ac070a0100# 1448291: woodenbox_f.p3d,
1ac435f3580# 1449471: supplydrop.p3d,
1ac45991600# 1449717: supplydrop.p3d```
The same but with objects that I'm not interested in.
I need to know how to get the target variable on a pre-existing collection of vehicles.
you can't unless you make your own array with the vehicles you want
you can only target a class basically
also, just use count instead
Right, but it's not about counting how many vehicles are on the map or even counting how many of a particular type is. These are persistent vehicles that will populate the session from a database. Once they are spawned on the map, I need to get the owner's UID, which is stored as a variable in the vehicle object. I'm looking for a way to count how many vehicles currently spawned on the map have that specific value assigned to that variable. I can pull them in from the DB and go that way but I'd rather not make it a DB query.
yes so? use count
private _count = {_x getVariable ['PersistentUID',1] isEqualTo _UID} count vehicles
Ok, I guess I was assuming that I needed to "manually" extract the vehicle or network ID from that array and then ask for the variable.
group returns <No center>, does that mean its not present ?
🤔
https://community.bistudio.com/wiki/createCenter exists, think its that
In Arma 3, centers for all sides are all created by the engine.
Arma 2?
3 🙂
hmmmmmmmmm
show your code please?
in simple form
{
deleteGroup _x;
systemchat format ["Group [%1] was deleted? ",_x];
} forEach _groups;
returns Group [<No center>] was deleted?
it should be something like "<NULL-group>" but most likely it got deleted yes
because if you delete it then want to display it, well, it's deleted one line above 😄
^
isNull _x may work
Just put systemChat before deleteGroup
well its a debug to make sure the group is actually gone, can never trust the commands lol
assing _x to another variable used in the scope and use systemchat with that variable
actually, you can
that, or don't even trust systemChat 🙃
shit dont get me started things like setGroupOwner is still broke AF
broken in what way? 🤔
it doesn't have money apparently 🙃
https://community.bistudio.com/wiki/setGroupOwner
I don't know if you mean this serverExec aspect perhaps?
alright, the way i've been doing this is clearly not the best way to do it so let me post here to ask for a better idea
how would you guys write something so that when units not on the player side are killed, a cash variable is incremented or decremented depending on the type/side of the unit
what I was doing was having a logic type that I setvariable/getvariable out of, and adding an MPKilled MPEventHandler to all units
Anyone know of a way for force a specific time for certain players?
use case here is I want to force the time to be 0000 (i.e. night) when players are in a composition designed to feel underground, so everything is dark
unfortunately, BI fixed desynchronized time a while ago, so I don't know if I can do this anymore
not without risking seeing a blimp of server time from time to time
use an EntityKilled mission EH
@winter rose any reason to use that over mpkilled
oh also do I only want this triggering on the server or only where the unit is local
well, IDK your setup
well i wouldnt want the cash val being edited multiple times
Id suggest you to try and see if you can achieve what you want with ppEffects. If you really want desynced time, you can simply spam setDate command with a short pause to achieve what you want but that solution becomes complicated once host player goes underground (this time you gotta spam the time for people outside, plus you want the time to move forward like ordinary case etc etc) But play with ppEffects commands a bit and at worst case you can combine with setDate (such combination was more satisfying in my use case). If you dont wanna bother with ppEffects, you can also try using one of setAperture commands.
luckily, this'll be run off a dedicated server so I don't need to worry about the host seeing the wrong time
How do I make it so bots spawn with a weapon I config?
Hullo! I can't figure out how to rotate a 3D position around the origin based on a vectorDir. So say obj2 is at position [-1,2,3] compared to obj1 when obj1 is facing [0,1,0]. If obj1 rotates and now has a different vectorDir, how do I get the new position where obj2 should be? Does that make sense?
You can edit a unit's loadout in the editor to give it a gun, or use a script in its init field to removeWeapon and addWeapon (and same for magazines). Or in config, you could make a new soldier type with the relevant weapon and mags in weapons[] and magazines[].
do you think you could help me make an init script to have anyone specific to only have a pistol (any) with only 1 clip loaded
where would I put this "removeall weapons this;
removeallassigneditems this;
removeuniform this;
removevest this;
removebackpack this;"
P.S this is argo im doing not arma
Well, in the editor you'd double click on the unit and there's a box at the top for the init code. Argo I don't know about I'm afraid.. :)
At the end of it you can add: this addMagazine "mag_name"; this addWeapon "weapon_name", putting in the relevant classnames
ok ty, that works but as soon as I die it reverts back into the default loadout
i also spawn where I died even though I changed attributes
anyone got a working argo third person script? if not I have one but it doesnt toggle it, instead you have to hold it down and it spams it so it kinda works but maybe somebody could fix it?
why are you playing argo? arma 3 is so much better
How to make a mission free for all?
I guess you're looking for something like this:
https://sqfbin.com/kezanovebilufewumohi
You would call it like:
_vdir = vectordir obj1;
_phi = (_vdir select 0)atan2(_vdir select 1);
[_point,[obj2],_phi,"REL"] call FNC;
Edit it to your heart's content.
don't put a price on it
See addRating
or setFriend
So much maths 0_0 Thanks though, I think I can use that!
echo1ADAM distance slRAZOR <20 or
echo1ADAM distance slSPEAR <20 or
echo1ARON distance ocOMEGA <20 or
echo1ARON distance slRAZOR <20 or
echo1ARON distance slSPEAR <20 or
echo2APPE distance ocOMEGA <20 or
echo2APPE distance slRAZOR <20 or
echo2APPE distance slSPEAR <20 or
echo2HELL distance ocOMEGA <20 or
echo2HELL distance slRAZOR <20 or
echo2HELL distance slSPEAR <20 or
echo2SNIFTER distance ocOMEGA <20 or
echo2SNIFTER distance slRAZOR <20 or
echo2SNIFTER distance slSPEAR <20
Hi, will this work in multiplayer? It's supposed to be a condition for trigger that completes task when one of the conditions are met. All of the objects are playable units.
as long as they exist even if there are no players, yes
Sorry to ask since I know this is a total noob question but I am a total noob when it comes to scripting and trying what I can find on google isn't working out for me this time 😓
trying to make it so the suicide bombers I've got setup for KPliberation have a small chance to drop intel if killed before exploding.
I can get them to spawn the intel item on the position of their body 100% of the time but trying to get a random chance to work isn't turning out as easy. I tried looking up how other people have done similar stuff but can't seem to get it working. Any advice would be really appreciated
can you post your code
findIf
Will do, just at work atm but as soon as I'm at my PC I'll post what I've tried so far
[echo1ADAM, echo1ARON, echo2APPE, echo2HELL, echo2SNIFTER] findIf { _x distance slRAZOR < 20 } != -1 or
[echo1ADAM, echo1ARON, echo2APPE, echo2HELL, echo2SNIFTER] findIf { _x distance slSPEAR < 20 } != -1 or
[echo1ADAM, echo1ARON, echo2APPE, echo2HELL, echo2SNIFTER] findIf { _x distance ocOMEGA < 20 } != -1
``` @umbral comet
@past wagon Thanks very much! I'll try it right away
well that's not great either
It’s kind of better
Idk, can you do a double findIf?
wat?
Gimme a sec
[echo1ADAM, echo1ARON, echo2APPE, echo2HELL, echo2SNIFTER] findIf { _x distance slRAZOR < 20 || _x distance slSPEAR < 20 || _x distance ocOMEGA < 20 } != -1
Oh yeah that works
you can also put some lazy eval in there
[echo1ADAM, echo1ARON, echo2APPE, echo2HELL, echo2SNIFTER] findIf {
private _unit = _x;
[slRAZOR, slSPEAR, ocOMEGA] findIf { _unit distance _x < 20 } != -1
} != -1
```😄
you can also make circular areas and do inAreaArray... not sure if it's faster 
Wait... does that syntax work? Doesn't the statement in the { } evaluate to a boolean?
yes
Hello everyone! I need a little help. An ordinary player in game can spawn an object. That is done using create vehicle script. Now - i would like to give that player a chance to chose a skin from those that are saved inside the mission file and set it as a skin for the object that he has just spawned. Something like spawn an object and then give it a skin.
a little note - all of that is in multiplayer so the skin has to be set globally
Someone explain to me why this phenomenon is happening:
private _var0 = ["one", ["two","three"]];
private _var1 = _var0;
_var0 select 1 deleteAt (_var0 select 1 find "two");
[_var0, _var1];
I'm expecting _var1 to remain the value that it was back when I defined it... how do I make sure this is the case?
The above is obviously just a test case for a mod I'm working on, where I'm trying to save an array, call a bunch of stuff (where it will use deleteAt) and then retrieve that same array BEFORE the modifications were made.
I've tried calling the variable like below, since I guess it's being used in reference when I store it into _var1, but this doesn't work either:
private _var0 = ["one", ["two","three"]];
private _var1 = call {_var0};
_var0 select 1 deleteAt (_var0 select 1 find "two");
[_var0, _var1];
both _var0 and _var1 point to the same array reference
if you want to copy the array use +
private _var1 = +_var0
@hollow thistle hi, can you suggest a solution to my issue? Or you also have no idea? 😅
idk, setObjectTextureGlobal probably
not sure if it works with textures from mission.
Sure it works but i don't want players to do scripting
Use it in your script that spawns the vehicles.
So i just need something, where they'll type in the name
Yeah but there are about 5 vehicles and 258 skins
more likely some sort of UI. Or Action, something that will let them choose the skin.
Then you have to give them some sensible way to choose from 258 skins for 5 vehicles.
That's what i'm trying - they can spawn a vehicle and then give them a chance to select a skin for that
https://imgur.com/a/Aqs5UWC Does anyone know if this Roster script is public? Its often seen in Dyslexi's videos and I'm just wondering if its one of their internal projects or if anyone has seen it before. If its not public how hard would you guys think it would be to make?
That looks usefull, thanks
this addAction["<t color='#ff9900'>Teleport</t>",{{_x setPos getMarkerPos("teleport1")} forEach allPlayers}]; is there a way i can make this teleport WEST to teleport1 and EAST to teleport2
in one addaction?
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
yeah
blufor go teleport 1
opfor go teleport 2
inde go teleport 3
but all in just one add action
addAction["<t color='#ff9900'>Teleport</t>",{{_x setPos getMarkerPos("teleport1")} forEach allPlayers}];
this addAction["<t color='#ff9900'>Teleport</t>",{
{_x setPos getMarkerPos call {
if (side _x == blufor) exitWith {
"teleport1"
};
if (side _x == opfor) exitWith {
"teleport2"
};
if (side _x == independent) exitWith {
"teleport3"
};
}} forEach allPlayers;
}];```
Not tested
oh wait
umm i need a bit more in it
it works but i need it to teleport all players to those fixed locations
“fixed locations”?
just to those teleports
like all of blufor players or just blufor people go to teleport 1
is that possible
any idea why the server fps in the console says this: arma3_1 | 16:03:12 Server load: FPS 0, memory used: 1622 MB, out: 0 Kbps, in: 0 Kbps, NG:0, G:474, BE-NG:0, BE-G:0, Players: 1 (L:0, R:0, B:0, G:1, D:0)
but #monitor says my fps is 42 in the chat?
where does it say that?
math check.
setplayerrespawntime (_respawnDelay + _respawnDelay - (serverTime % _respawnDelay));
essentially is saying that the final respawn delay is going to be somewhere: _respawnDelay < x < 2*_respawnDelay?
yes
@little raptor server console when I run #monitor 1
anyone got any idea on how to actually dump 'https://community.bistudio.com/wiki/diag_dumpTerrainSynth'
_terrainSynth = diag_dumpTerrainSynth;
diag_log _terrainSynth
/
copyToClipboard _terrainSynth
even parsing it just gives back any.
are you on diagnostic exe?
yep
well it seems a simple diag_log (diag_dumpTerrainSynth) does it.. but not the other way, weird.
Huh, so I guess once you set a variable on an object, the variable is in allVariables regardless whether that value was nil. It was a bit unexpected, because I thought that perhaps the variable would be garbage collected from the object. But I guess that's not the case; it does, however, allow to get a default value from the object since the value was set to nil. Better to check isNil {_x getVariable 'var'}.
How does courage actually work?
I'm trying to make it so taking an objective isn't just a fight to the last man, and I'm not really sure how to do this
with scripting? maybe courage is the way to gauge that? wait for some threshold to be achieved, then instruct the units to flee?
units can lose will to fight by losing team members, losing the leader has a bigger impact, also iirc force imbalance too
see allowFleeing
yeah most of these units seem to have courage 0.5 but ive never seen a unit flee. i wonder why
they do, u just dont notice
Any movement away from known units is usually fleeing. But they do not permanently flee, they come back after a while.
They usually flee when left 1 or 2.
iirc it's only for objects
on uiNameSpace/missionNameSpace they don't get returned by allVariables
is there a way to get the class name of an object found by nearestTerrainObjects?
_objects = nearestTerrainObjects [_pos, [], 1000, false];
if ( count _objects < 1) exitWith {};
systemChat str typeOf (_objects select 0); // Retruns "" TypeOf cant find it
search config for its p3d
typeOf works for objects with a class; if they don't have one and are just p3d, use e.g getModelInfo
some do have a class though right? just that it's some map fancy special stuff(aka are different, but aren't 🤔 )
okay thanks,
do you guys know what's the fastest way to look for this modelpath / modelname
run through cfgvehicles, and look for model.p3d matches
only way iirc
benches and stuff will have a class, but trees etc won't
sharp_modelCache = createHashMap;
sharp_fnc_typeOf = {
params ["_object"];
private _type = typeOf _object;
if (_type isNotEqualTo "") exitWith { _type };
private _model = toLowerANSI (str _object splitString ": " select 1);
if (_model in sharp_modelCache) exitWith { sharp_modelCache get _model; };
private _configs = format ["private _modelPathArr = getText (_x >> 'model') splitString '\'; _modelPathArr isNotEqualTo [] && {toLowerANSI (_modelPathArr select count _modelPathArr - 1) isEqualTo '%1'}", _model] configClasses (configFile >> "cfgVehicles");
if (_configs isEqualTo []) exitWith { "" };
private _result = configName (_configs select 0);
sharp_modelCache set [_model, _result];
_result
};
written some time ago, though now that i saw that getModelInfo command, there is a much better alternative
you can edit if you like 🤣
okay thanks @copper raven this works with getModelInfo based on your script
sharp_modelCache = createHashMap;
sharp_fnc_typeOf = {
params ["_object"];
private _type = typeOf _object;
if (_type isNotEqualTo "") exitWith { _type };
private _model = toLowerANSI ((getModelInfo _object) select 1);
if (_model in sharp_modelCache) exitWith { sharp_modelCache get _model; };
private _configs = format["private _modelPathArr = getText (_x >> 'model'); _modelPathArr isNotEqualTo [] && {toLowerANSI (_modelPathArr) isEqualTo ('\'+'%1')}", _model] configClasses (configFile >> "cfgVehicles");
if (_configs isEqualTo []) exitWith { "" };
private _result = configName (_configs select 0);
sharp_modelCache set [_model, _result];
_result
};
this addAction["<t color='#ff9900'>RED V BLUE (LONG)[BRIDGE]</t>",{
{_x setPos getMarkerPos call {
if (side _x == blufor) exitWith {
"teleport8blue"
};
if (side _x == opfor) exitWith {
"teleport8red"
};
if (side _x == independent) exitWith {
"teleport1green"
};
}} forEach allPlayers;
}];
how do i turn this into a vertical teleport
or it includes the y axis
or can i set it to a 3d object instead of a marker?
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
Also you should follow this, plain text is hard to understand the code, although that's what I wrote
{_x setPos getMarkerPos call {
if (side _x == blufor) exitWith {
"teleport8blue"
};
if (side _x == opfor) exitWith {
"teleport8red"
};
if (side _x == independent) exitWith {
"teleport1green"
};
}} forEach allPlayers;
}];
No
oh what
Read what bot says carefully
oh wait
Pro tip: you can edit your post, like this
// your code here
this addAction["<t color='#ff9900'>RED V BLUE (LONG)[BRIDGE]</t>",{
{_x setPos getMarkerPos call {
if (side _x == blufor) exitWith {
"teleport8blue"
};
if (side _x == opfor) exitWith {
"teleport8red"
};
if (side _x == independent) exitWith {
"teleport1green"
};
}} forEach allPlayers;
}];
Comment doesn't matter. The first line of sqf is
I'm on the phone so can't see the highlight tho
how can i turn it into getobject or something
setPosATL getPosATL is the idea
do i replace this setPos getMarkerPos with setPosATL getPosATL
ill try anyways but just confirming
And replace those marker strings to objects
um so i have this
this addAction["<t color='#ff9900'>RED V BLUE (LONG)[BRIDGE]</t>",{
{_x setPosATL getPosATL call {
if (side _x == blufor) exitWith {
"teleport8blue"
};
if (side _x == opfor) exitWith {
"teleport8red"
};
if (side _x == independent) exitWith {
"teleport1green"
};
}} forEach allPlayers;
}];
when you meant marker string did you mean the actual marker because thats what i removed
"teleport8blue" etc
Replace to some object name so it will point the object's position
oh yeah i did change the variables of the object to teleport8blue teleport8red evct
ect*
it says type string expected object but i deleted all of the teleport8markers
and the teleport1green
and assigned the 3 teleports 1 to an arrow object 2 to a ai
just showing you that theres no string markers
What?
There is. In your code
oh okay
what have i done wrong
What?
Because you didn't followed what I say, replace strings to objects
how do i do that im like completely new to this
sorry
"teleport8blue" = objects you mean but idk how to change it because i suck at the code
No thats string
If there's an object named "obj1", put obj1 so this points the object
right
so i did change the variable names of the objects into teleport8red,teleport8blue,teleport8green
No. Markers cannot be pointed like that. You should to place objects in Eden Editor