#arma3_scripting

1 messages · Page 715 of 1

low sierra
winter rose
#

wat

#

@low sierra that page is… blank

low sierra
#

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.

low sierra
misty osprey
#

does the "VEHICLEINVEHICLEGETIN" waypoint use waypointattachvehicle or waypointattachobject

little raptor
#

Neither

#

It uses ViV as the name says

misty osprey
#

Okay but how do I tell the waypoint which vehicle to Load into

little raptor
#

¯\_(ツ)_/¯

hallow mortar
#

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

misty osprey
#

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

hallow mortar
#

Is the target vehicle unlocked, and does the passenger vehicle fit into the target vehicle?

misty osprey
#

yes

hallow mortar
#

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

misty osprey
#

ok

#

ok

primal relic
#

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

knotty mantle
#

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

knotty mantle
#

oh and it is an Status_Access_Violation error btw.

winter rose
late parrot
#

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?

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
late parrot
#
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;
};
winter rose
#

🇼 🇹 🇭

late parrot
#

If you want I can post all relevant code into sqf bin lmao

winter rose
#

is it "sqf export" result?

late parrot
#

Yeah

winter rose
#

oh, mb then 😄

late parrot
#

I have a select that runs the sqf to load all saved obj but the params are being ignored while being loaded.

winter rose
#

theeen IDK, too many variables

try to isolate the one piece of code that fails

late parrot
#

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

winter rose
#

no, the best thing would be to identify the issue
otherwise you are attempting to fix in the dark, and that's never good

late parrot
#

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?

winter rose
#

what is the current order now?

late parrot
#

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]]

winter rose
#

dunno 😬
seems too complex / unclear / never dealt with SQF export too

fair drum
#

wiki down? not anymore

violet gull
#

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>"
unique sundial
proud carbon
fair drum
fair drum
#

is there a way to grab the dimensions of a .paa texture ingame?

warm hedge
#

Resolution?

fair drum
#

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

warm hedge
fair drum
#

ah poo not on dev atm 😦

warm hedge
#

But the 2.06 update is almost here I think

#

Anyways if theres a way that's the command

little raptor
fair drum
little raptor
fair drum
little raptor
#

it means the resolution of the image that you put into the diary

#

so the texture can be any res you want

fair drum
#

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

little raptor
#

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

fair drum
#

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

fair drum
#

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

little raptor
#

if 1080p and small, I think that's what R3vo used too

#

also I think it's the height

#

not width

fair drum
#

i'm 1080p and small

little raptor
#

like I said, it probably uses the max font size

little raptor
fair drum
#

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)

little raptor
#

all textures are squares

warm hedge
#

Not necessary?

little raptor
#

well textures have to be, but other images idk

fair drum
#

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

warm hedge
#

You shouldn't convert jpg into paa

#

jpg is already acceptable format for Arma 3

fair drum
#

i mean png

#

does arma convert it to .paa in the process? i though it was standard to make everything .paa for speed

warm hedge
#

No? Depends on the “in the process” you mean

still forum
#

jpg are less efficient for Arma.
But for a diary picture or loading screen its fine, but paa is always preferred

winter rose
#

jpg are used for Editor previews 👀

sage dawn
#

as long as each dimension is still power of two

#

at least for textures like you said

little raptor
#

¯_(ツ)_/¯

sage dawn
#

I've used 1024x512, 1024x256 as textures without issues

cyan dust
#

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?

little raptor
#

but the question is, why would it matter?

#

I don't think there's any command that can modify strings by reference

cyan dust
#

Thanks, got it.

cyan dust
#

And was curious too

little raptor
cyan dust
still forum
#

Only + and some other commands may copy

vague geode
little raptor
#

the Zeus "Edit Custom Objective"-screen
the what?

mellow scaffold
#

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?

still forum
#

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

mellow scaffold
#

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

mellow scaffold
#

Might be an Eden enhanced thing

cosmic lichen
#

These textboxes display what you have typed

#

You search the list by selecting it and typing

#

same for the properties list

proven charm
#

why some people do ```sqf
call {
// Code here
}

#

?

little raptor
#

to create a scope

proven charm
#

but why?

little raptor
#

reasons...notlikemeow

winter rose
proven charm
#

aah

#

i meant in general

winter rose
#

another reason is

call {
  if (reason1) exitWith { stuff };
  if (reason2) exitWith { stuff };
  if (reason3) exitWith { stuff };
};
#

there is no "in general"

#

it depends

little raptor
little raptor
#

to create a scope 🤣

winter rose
#

don't tempt me, I can go on for quite some time!

proven charm
#

ok thx, I was just curious

knotty mantle
#

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

spark sun
#
for "_" from 0 to 1 step 0 do{
knotty mantle
#

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.

spark sun
#

The new Commy tell you to not do that.

knotty mantle
#

sooo. back to while {true} ?

#

Weeeeell it ran longer but i still got a CTD 😦

cosmic lichen
# proven charm ok thx, I was just curious

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

copper raven
knotty mantle
#

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 😦

copper raven
brazen lagoon
#

yeah if you're running it in the debug console it'll be unscheduled right?

copper raven
#

nope, unless you declare a variable private in a scope before that

brazen lagoon
#

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

copper raven
#

would be easier if you showed an example

brazen lagoon
#

basically what sharp said, if the variable points to the code at the time of calling yes it will work

copper raven
#

yes it will work

#

yes

knotty mantle
copper raven
#

yes, aslong as the first if is true

knotty mantle
#

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 😦

knotty mantle
#

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)

noble flint
#

Is there a way to write an eject script if a vehicle is destroyed.

#

Tried a couple things and it didn't work

noble flint
#
_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

tacit tartan
#

_object isnt defined

noble flint
#

Is there a generic definition for helicopters?

#

do I have to name all my helicopters?

tacit tartan
#

you can just define your vehicle like you did

#

as long as they are in the vehicle

noble flint
#

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.

tacit tartan
#

just make a param

#

or just make a select for allDead

somber radish
#

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"

somber radish
noble flint
#

hmm

somber radish
#

I found it quite useful for categorizing weapons, Should be easy to do for vehicles as well

noble flint
#

Is there no way to use a Type name?

#

typeOf

#

or isKindOf

somber radish
#

Well u got ```sqf
_Object IsKindof "Air";

noble flint
#

would that work?

#
_Object IsKindof "Helicopter";
somber radish
#

It might 🤷

#

This one could be usefull as well

noble flint
#
[] spawn {
    while {true} do {
        sleep 5;
        if (_Object IsKindof "Helicopter") then {
            hint "yum";
        };
    };
};
#

This wont work because object isn't defined right?

past wagon
warm hedge
#

Why would you need to check if it is a helicopter for every 5 seconds? 🤔

hushed tendon
#

Is there a way to detect if a unit has been hit even when allowDamage is false for them?

warm hedge
#

Use HandleDamage EH instead. It can disable the damage while the unit can be hit

hushed tendon
warm hedge
#

...IDK

elder sail
#

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;};
warm hedge
#

True. The last two ifs won't recognize it

elder sail
#

Is there a specific way to use private variables in if then statements?

warm hedge
#
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
elder sail
#

ahh I see

little raptor
#

also use isNil "_var" if you want to check if a var is nil. it's faster

warm hedge
#

True true

little raptor
#

because you privated it before the expression

warm hedge
#

I've just tried to point out the direction without “breaking” it too much

#

But I know the idea

elder sail
#

No no I appreciate both

little raptor
#

I know. it was just a reminder for @elder sail

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

warm hedge
#

Ah, well

elder sail
#

Thank you both very much, I'll definitely be employing the select isNil idea too instead of my caveman method lmao

little raptor
#

e.g.:

[nearestObjects [...], nearestObjects [...]] select _blabla

is worse and slower than if

fair drum
#

[["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.

little raptor
#
_arr findIf {_x#0 isEqualTo "Hypoxic"}
fair drum
#

gotcha was gonna try that next if there wasn't a direct way

little raptor
#

(note: it is much slower than find/in)

elder sail
#

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?

fossil peak
#

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

little raptor
little raptor
fossil peak
#

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

little raptor
fossil peak
#

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

little raptor
little raptor
fossil peak
#

lmao hopefully I can write something well then

elder sail
# little raptor you can `#include` it but I don't recommend it

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

little raptor
#

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

fossil peak
#

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

little raptor
#

scripts can't write to file

fossil peak
#

Hmm

#

that makes sense lol

#

wouldn't wanna inject a virus from arma

elder sail
fossil peak
#

hmm

little raptor
#

and it can copy to clipboard, all of them at once

fossil peak
#

I am not that confident in scripting unfortunately

#

so that's a rip

#

I've actually found a reddit thread where they discuss this

still forum
still forum
torpid quartz
#

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"];
warm hedge
#
[_this#0, "Black"] call BIS_fnc_initVehicle;```perhaps, not tested
torpid quartz
#

yeah lol (_this select 0) setObjectTextureGlobal [0, "Black"]; gives me "picture "black" not found"

winter rose
#

BIS_fnc_initVehicle != setObjectTextureGlobal 😛

livid wraith
#
params ["_heli"];

if (local _heli) then {
    _heli setObjectTextureGlobal [0, "a3\air_f\heli_light_02\data\heli_light_02_ext_CO.paa"];
};
umbral comet
#
hint format ["Searching, %1!", name player];

Hi, how can I make this script show progression?

warm hedge
#

What progression?

winter rose
#

of the car script, obviously!

umbral comet
#

@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%...).

warm hedge
winter rose
#

or hintSilent the same message with different text 🙂

somber radish
#

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"

still forum
#

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

unique sundial
#

of course replace "MyExtensionName" by your real name

and your credit card number

knotty mantle
knotty mantle
copper raven
still forum
#

How do you optimize that out?

#

Can't change how the looping works internally?

winter rose
#

he does SQFCPP, of course

copper raven
#

ah you meant that way, i just replace the left of do

#

with the for stuff

still forum
#

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

hollow thistle
#

give us unary loop command, rust style 😄

#
loop {
    // ... do stuff
}
winter rose
#

and goto!

hollow thistle
astral meadow
#

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 🙂

little raptor
little raptor
#

How long does it even take to evaluate that in every iteration? 0.0004ms?! meowsweats

#

So 4ms after 10000 iterations... meowsweats
whatever you do in the while is gonna be slower anyway

tough abyss
#

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.

kindred zephyr
#

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}];```
cosmic lichen
#

@kindred zephyr
units east;

winter rose
kindred zephyr
kindred zephyr
winter rose
#

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)

kindred zephyr
#

Thanks Lou

somber radish
#

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?

winter rose
#

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

somber radish
#

uuh

#

yess

#

Compile

#

I'll do that lol

winter rose
#

Ctrl+Shift+B 😬

somber radish
#

Si señor, I saw the name in the example was .cs So I didn't compile

#

🥶

winter rose
#

ah well 😄 now you know!

somber radish
#

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

#

💔

winter rose
#

you need a simple Main, it should exist when creating a dll project in VS

somber radish
#

Yeah there*s this:

static void Main(string[] args)
#

Should I wrap the example in that?

robust tiger
#

put it somewhere else in the class

#

if debugging a dll directly works, that is

somber radish
#

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?

robust tiger
#

have you compiled it? (hit F5) does it still show the error? Which project type are you creating?

somber radish
#

No build error, but I am unable to call it ingame

wispy gorge
#

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

warm vapor
#

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!

hushed tendon
#

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)];
tough abyss
#

Hey im new to argo scripting how hard is it to convert an arma 3 mission into argo?

fair drum
tough abyss
#

Bc I don't have Arma 3??

fair drum
tough abyss
#

I'm well aware, and I would get it if I could but I can't anytime soon my family is rlly struggling

hushed tendon
# fair drum post the whole thing
_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;
}];
tough abyss
#

im trying to convert a zombie infection mission into argo from arma 3

fair drum
tough abyss
#

I just need to convert a couple assets but idk how

fair drum
#

that and if its a zombie mission, it probably has mods and those won't work with argo

tough abyss
#

yes, its just an error with 2 assets from arma 3

fair drum
#

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

tough abyss
#

un-binarizing???

fair drum
#

if the .sqm file is binarized (typically since it makes things load faster) then you can't open it in a text editor

tough abyss
#

how would i decode it?

fair drum
#

you'll need arma 3 tools for that or mikero's tools

tough abyss
#

ok ty

#

do you by any chance have any good missions for argo?

fair drum
#

no. people don't really play argo. i don't even think it has workshop support

tough abyss
#

nope 😦

tough abyss
hushed tendon
fair drum
#

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;
}];
fair drum
#

@hushed tendon also, thats a sleek choice of text and color

tough abyss
tough abyss
#

or any idea on ho0w to fix it?

fair drum
#

which contains respawn system information

tough abyss
fair drum
tough abyss
#

damn

#

any way to isolate assets and save them to put them into another mission?

fair drum
tough abyss
#

bc i also scuffed the vehicles so i wanted to borrow the assets from a working vehicle mission

#

ok

fair drum
#

you can only use what argo provides you

tough abyss
#

whats a "composition"?

tough abyss
warm hedge
#

Because that's how Argo worked

fair drum
#

next time arma goes for 5 bucks i'll just get it for you if you are struggling

tough abyss
warm hedge
#

You should've acknowledged how Argo and Arma work. Argo isn't meant to be a vehicle warfare game

little raptor
little raptor
tough abyss
#

So is there no way to use vehicles for free?

#

i do in other servers no problem

warm hedge
#

Without using some hacky solution. Still Argo is mainly an infantry only game

tough abyss
#

wdym hacky?

warm hedge
#

Whatever it is, fully scripted solution

tough abyss
#

how do I add "Installations" or is that only for arma?

#

How do you pull this UI up?

#

I can't send pic rip

sage heath
#

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?

little raptor
sage heath
#

sorry, im new

little raptor
#

anyway, the problem is (-719,-765,12)

sage heath
#

yep

#

uhhhh whats wrong with it exactly?

#

because i modified this from my flag teleport script

little raptor
sage heath
#

usually in that array would be another object

#

ok...so what do i need to use to get it to work with xyz coords?

little raptor
#

i.e. brackets []

sage heath
#

i see

little raptor
#

not ()

#

that's parentheses

sage heath
#

oh i see

#

hey thanks man

#

😄

sage heath
#

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

winter rose
#

magic

#

you are using setPos, don't

sage heath
#

obligatory arma 4 plez

winter rose
#

use setPosATL

sage heath
#

i see

tough abyss
sage heath
#

but anyways

#

uhmmmmm how would i use atl exactly?

winter rose
#

properly
the same as you are using setPos right now

sage heath
#

just add atl?

#

ait lets give it a shot

#

fell to the floor again, sadge :((

little raptor
winter rose
sage heath
#

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

little raptor
#

use getPosATL

sage heath
#

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,""];

little raptor
#

then use getPosATL player to get your ATL coord

#

then put the coordinate there

sage heath
#

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

little raptor
#

are you putting yourself offmap?

sage heath
#

its an out of map strcture

little raptor
#

oof. don't

sage heath
#

yeah i built a tunnel

#

everything's fixed, thanks guys love yall (no homo)

tough abyss
# little raptor the exact formulation is not documented the one for missiles (and any other self...

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?

little raptor
#

they're not functions afaik

little raptor
#

it's just a normal projectile motion

#

no drag

tough abyss
#

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

ornate oriole
#

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 ) ...

prime aspen
#

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

little raptor
prime aspen
#

It can be interesting, how to do it?

little raptor
#

then you can convert these positions back to model using ASLtoAGL and worldToModel

prime aspen
#

Well I suck, I don't see how to do it x)

astral meadow
little raptor
buoyant abyss
#

setGlobalTexture?

Sorry for bumping in I just wanted to suggest

little raptor
#

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

fair drum
#

anyone tried spreading around enemy AI locality between players if a non dedicated server is used? did you notice any performance gains?

little raptor
#

but I've never done that myself so I'm not sure

umbral comet
#

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
umbral comet
#

@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.

cosmic lichen
#

, 😮

umbral comet
#

Got it! Thanks!

hollow tinsel
#

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.

hollow tinsel
#

Thanks, any way to get just one I am looking near without using lods?

winter rose
#

the question would be: "why?"

little raptor
#

selectionPosition

#

and modelToWorldWorld

#

and vectorFromTo (or vectorDiff) + vectorCos

little raptor
hollow tinsel
#

Thanks, fixing a system that I made ontop of a already trash piece of code and rewriting would take ages.

livid kelp
#

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 🙂

little raptor
little raptor
hollow tinsel
#

Can you use the Memory lod in intersect?

little raptor
#

....afaik no

little raptor
livid kelp
little raptor
livid kelp
#

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

little raptor
#

but I guess your issue is that it's scheduled

#

run the code unscheduled

#

in other words, wrap it in an isNil { }

livid kelp
little raptor
livid kelp
#

yeah i do don't worry

#

nope still causing the same issue

modern topaz
#

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

kindred zephyr
agile pumice
#

There isn't by chance a scripting command to return values from a modelcfg of say, a building/structure is there?

still forum
#

no, what u need specifically?

agile pumice
#

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

still forum
#

What model.cfg info tells you which way it would open?

agile pumice
#

The animation class's door animation values would, wouldn't it?

still forum
#

Not sure, maybe

agile pumice
#
minValue        = 0;
maxValue        = 1;
angle0          = 0;
angle1          = (rad 110);
still forum
#

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

agile pumice
#

yeah I know, that's what I did for 100+ doors lol

still forum
#

Yeah I mean in 2.06 you can just automate it

agile pumice
#

ooh sorry I missed a line in your msg

still forum
#

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

agile pumice
#

Hail jesus we have regex now

#

Which 2.06 command am I looking for? selectionVectorDirAndUp ??

light pewter
#

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?

hushed tendon
#

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;
tired spear
#

Man looking for arma 3 tutorials are a pain

fair drum
fair drum
hushed tendon
fair drum
tired spear
#

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
};`

past wagon
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
tired spear
#

That's useful

coarse schooner
#

very

kindred zephyr
#

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.
coarse schooner
#

how did randomizedTree get assigned and do your variable's have to be global (missing _ at beginning)?

kindred zephyr
#

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 🤔

coarse schooner
#

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

kindred zephyr
#

13k obviosuly being an exaggeration

coarse schooner
#

just so i understand: you want to be able to toggle the visibility of a generated forest or manually placed forest?

kindred zephyr
#

manually placed forest

coarse schooner
#

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

kindred zephyr
#

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

coarse schooner
#

with a different class of tree?

kindred zephyr
#

treeArray

#

using eden objects mod

coarse schooner
#

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"?

kindred zephyr
#

ye

coarse schooner
#

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:

kindred zephyr
coarse schooner
#
// 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;
kindred zephyr
coarse schooner
#

i mean technically the stuff in the forLoop will run 13k times XD

kindred zephyr
#

:x

coarse schooner
#

much better than in every init i agree

kindred zephyr
coarse schooner
#

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

kindred zephyr
#

ye, _x is returning an array, and ye, im using getMissionLayerEntities

coarse schooner
#

okay than put that _trees = thing at line 2 after orginal _trees denfinition

#

so that we selct the array of objects we want

kindred zephyr
#

indeed, a start for the array for was missing

#

works great now

coarse schooner
#

nice

brazen lagoon
#

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

tired spear
#

relating to my unprofessional post the error I get is
no entry
(arma path in pc) Training%20.fow_map_henderson\conv.bikb.Arguments'.

brazen lagoon
#

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}];

little raptor
quaint oyster
#

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.

little raptor
quaint oyster
#

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];
quaint oyster
#

figured out a work around using rscedit thanks to connor for telling me about em.

copper raven
quaint oyster
#

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

dusky wedge
#

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") ?

winter rose
#

you can script it yeah

tired spear
dusky wedge
# winter rose you can script it yeah

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...

winter rose
winter rose
tired spear
#

finally thank you!

winter rose
# tired spear finally thank you!

// Needed parameters.
class Arguments {};
class Special {};
startWithVocal[] = { hour };
startWithConsonant[] = { europe, university };```
tired spear
#

My third eye has opened

warm hedge
tired spear
cyan dust
#

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?

winter rose
cyan dust
#

There's a 'createLocation' and I can check if the object is within it, but how to draw it precisely on a building? thonk

winter rose
#

you can have 2D thingy with bounding box, using only X & Y data

#

see also inArea @cyan dust

cyan dust
#

meowsweats math is cruel. Ok, I think I can do it, thanks a lot

hushed tendon
winter rose
winter rose
#

(yes, they exist)

willow hound
cyan dust
cyan dust
little raptor
#
_posRel = _obj worldToModel ASLtoAGL _posASL;
_bb = boundingBoxReal _obj;
_inBB = {
    if !(_x >= _bb#0#_forEachIndex && _x <= _bb#1#_forEachIndex) exitWith {false};
    true;
} forEach _posRel;
little raptor
willow hound
#

breakWith 😠

winter rose
little raptor
#

the scripting commands are doing all the math... meowsweats

little raptor
#

it's cleaner the way I wrote

willow hound
#

The SQF gods have given you proper tools to break loops!

little raptor
#

exitWith is proper too blobdoggoshruggoogly

hollow thistle
#

!(_x >= _bb#0#_forEachIndex && _x <= _bb#1#_forEachIndex) && {breakWith false}; thomp

#

🏃‍♂️

#

not sure if will error or not but should work in theory.

little raptor
#

that works too yeah

winter rose
#

@light pewter did you read what I answered earlier?
PS: don't crosspost

light pewter
light pewter
#

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

light pewter
winter rose
#

that's a scripting error, can't do anything about it if it's not your script

light pewter
#

so i cant make ai spawner spawn them?

#

faction has no groups

#

you can spawn only 1 by 1

winter rose
#

that might be the issue

vague geode
little raptor
little raptor
#

there's quite a lot of them:

crude vigil
vague geode
wicked fulcrum
#

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?

little raptor
crude vigil
# vague geode That certainly helps but I was rather looking for a way to implement it in the m...

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.

wicked fulcrum
little raptor
#

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

wicked fulcrum
#

ahh ofc. Turn the check around instead of looking for what is not allowed. Makes sense. I'll try that approach. Thanks!

little raptor
wicked fulcrum
#

yeah. Checking the wiki list of IDD. Gonna check what is needed

wicked fulcrum
#

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.

wicked fulcrum
#

ah nwm. I can check it with cameraView == "gunner"

warm coral
#

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?

wicked fulcrum
#

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.

graceful kelp
#

is there a way for me to retreive the value of a uinamespace

warm coral
#

gonna test it out tomorrow

copper raven
leaden haven
#

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?

kindred zephyr
#

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.

tough abyss
#

does anyone know a script or anything I can use to spawn loot around the map w a config?

copper raven
tough abyss
#

does anyone have a working argo vehicle script?

fringe parrot
#

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.

copper raven
#

though not sure, if its scripted, i don't think it will work

fringe parrot
#

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

tough abyss
#

How do I use the "lootbox random position?"

violet gull
#

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.

kindred zephyr
copper raven
fringe parrot
copper raven
kindred zephyr
vague geode
copper raven
#

but like i said, if its scripted(added via addAction), it won't work

#

but take a look, maybe it's not

fringe parrot
#

hmm worth a shot, could you elaborate by useractions?

copper raven
#

cfgVehicles >> vehicle >> userActions

#

in config

fringe parrot
#

ohhh right cheers, ill take a look

copper raven
tough abyss
copper raven
#

¯_(ツ)_/¯

warm hedge
#

Argo exclusive. No doc available, or you can read the function so you can guess what it is

warm coral
violet gull
#

@unique sundial 2.04 current main branch version

crude vigil
kindred zephyr
#

is selectRandom ok for MP/Dedi?

Would the same result would be displayed locally?

little raptor
#

it executes locally, obviously

#

so obviously, the result differs for each client, on each execution

kindred zephyr
#

hm

little raptor
#

your code won't execute anywhere meowsweats

#

it's wrong

#

wrong as in it won't even compile

winter rose
#

silentHint wat

little raptor
#

I don't think you understand what locality means nootlikethis

as for the code (except for all the wrong use of commands):

if (isDedicated or isServer) then
you could just say isServer

and I don't even see any use of selectRandom so I don't know what you're trying to ask anyway

winter rose
#

//create a simple object replacementTree using ASL position and selecting a random index from treeArray

little raptor
#

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?

kindred zephyr
grand idol
#

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?
copper raven
#

_object = ?????? wat, you don't need to assign anything, _x is the current element that's being iterated

copper raven
grand idol
#

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.

copper raven
#

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

grand idol
#

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.

copper raven
#

yes so? use count

#

private _count = {_x getVariable ['PersistentUID',1] isEqualTo _UID} count vehicles

grand idol
#

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.

high vigil
#

group returns <No center>, does that mean its not present ?

copper raven
#

🤔

#

In Arma 3, centers for all sides are all created by the engine.

high vigil
winter rose
#

hmmmmmmmmm
show your code please?

high vigil
#

in simple form

#
{
    deleteGroup _x;
    systemchat format ["Group [%1] was deleted? ",_x];
} forEach _groups;
#

returns Group [<No center>] was deleted?

winter rose
#

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 😄

kindred zephyr
#

^

fair pilot
high vigil
#

well its a debug to make sure the group is actually gone, can never trust the commands lol

kindred zephyr
#

assing _x to another variable used in the scope and use systemchat with that variable

winter rose
high vigil
#

shit dont get me started things like setGroupOwner is still broke AF

copper raven
#

broken in what way? 🤔

winter rose
#

it doesn't have money apparently 🙃

brazen lagoon
#

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

wintry grail
#

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

winter rose
winter rose
brazen lagoon
#

@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

winter rose
#

well, IDK your setup

brazen lagoon
#

well i wouldnt want the cash val being edited multiple times

crude vigil
# wintry grail use case here is I want to force the time to be 0000 (i.e. night) when players a...

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.

wintry grail
#

luckily, this'll be run off a dedicated server so I don't need to worry about the host seeing the wrong time

tough abyss
#

How do I make it so bots spawn with a weapon I config?

severe ore
#

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?

severe ore
tough abyss
tough abyss
#

P.S this is argo im doing not arma

severe ore
#

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

tough abyss
#

i also spawn where I died even though I changed attributes

tough abyss
#

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?

copper raven
#

why are you playing argo? arma 3 is so much better

tough abyss
#

How to make a mission free for all?

robust tiger
winter rose
little raptor
winter rose
#

or setFriend

severe ore
umbral comet
#
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.

winter rose
#

as long as they exist even if there are no players, yes

hazy flare
#

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

bitter jewel
#

can you post your code

hazy flare
#

Will do, just at work atm but as soon as I'm at my PC I'll post what I've tried so far

past wagon
#
[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
umbral comet
#

@past wagon Thanks very much! I'll try it right away

past wagon
#

np

#

your previous code wasnt wrong, but it can be shortened

little raptor
past wagon
#

It’s kind of better

past wagon
little raptor
#

wat?

past wagon
#

Gimme a sec

little raptor
past wagon
#

Oh yeah that works

little raptor
#

you can also put some lazy eval in there

past wagon
#

Ye

#

👌

#

@umbral comet the code Leopard20 posted is better

winter rose
#
[echo1ADAM, echo1ARON, echo2APPE, echo2HELL, echo2SNIFTER] findIf {
  private _unit = _x;
  [slRAZOR, slSPEAR, ocOMEGA] findIf { _unit distance _x < 20 } != -1
} != -1
```😄
little raptor
#

you can also make circular areas and do inAreaArray... not sure if it's faster think_turtle

severe ore
severe ore
#

😅

#

Oh, I think I get it. Neat!

limber panther
#

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

lapis jungle
#

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];
hollow thistle
#

both _var0 and _var1 point to the same array reference

#

if you want to copy the array use +

#

private _var1 = +_var0

lapis jungle
#

Thank Fuck

#

Thanks

limber panther
#

@hollow thistle hi, can you suggest a solution to my issue? Or you also have no idea? 😅

hollow thistle
#

idk, setObjectTextureGlobal probably

#

not sure if it works with textures from mission.

limber panther
#

Sure it works but i don't want players to do scripting

hollow thistle
#

Use it in your script that spawns the vehicles.

limber panther
#

So i just need something, where they'll type in the name

limber panther
hollow thistle
#

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.

limber panther
#

That's what i'm trying - they can spawn a vehicle and then give them a chance to select a skin for that

fossil peak
#

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?

limber panther
keen trout
#

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?

warm hedge
#

So BLUFOR players go teleport1 and so on?

#

Also

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
keen trout
#

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}];

warm hedge
#
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

keen trout
#

i will test now

#

thank you very much 🙂

keen trout
#

umm i need a bit more in it

#

it works but i need it to teleport all players to those fixed locations

warm hedge
#

“fixed locations”?

keen trout
#

just to those teleports

#

like all of blufor players or just blufor people go to teleport 1

keen trout
warm hedge
#

I don't get it

#

Isn't that what my code does?

keen trout
#

thanks alot

#

:)))

brazen lagoon
#

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?

little raptor
fair drum
#

math check.

setplayerrespawntime (_respawnDelay + _respawnDelay - (serverTime % _respawnDelay));

essentially is saying that the final respawn delay is going to be somewhere: _respawnDelay < x < 2*_respawnDelay?

brazen lagoon
#

@little raptor server console when I run #monitor 1

little raptor
#

¯_(ツ)_/¯

#

could be a bug

#

I'm not familiar with server stuff

urban tiger
hollow thistle
#

are you on diagnostic exe?

urban tiger
#

yep

#

well it seems a simple diag_log (diag_dumpTerrainSynth) does it.. but not the other way, weird.

dreamy kestrel
#

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'}.

brazen lagoon
#

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

dreamy kestrel
brazen lagoon
#

this isn't done already?

#

the wiki implies it is

winter rose
brazen lagoon
#

yeah most of these units seem to have courage 0.5 but ive never seen a unit flee. i wonder why

crude vigil
#

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.

copper raven
#

on uiNameSpace/missionNameSpace they don't get returned by allVariables

sonic linden
#

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
copper raven
#

search config for its p3d

winter rose
copper raven
#

some do have a class though right? just that it's some map fancy special stuff(aka are different, but aren't 🤔 )

sonic linden
#

okay thanks,
do you guys know what's the fastest way to look for this modelpath / modelname

copper raven
#

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 🤣

sonic linden
#

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
};
keen trout
#

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?

warm hedge
#

A marker can have a Z axis, but I'd say an (hidden) object is easier

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
warm hedge
#

Also you should follow this, plain text is hard to understand the code, although that's what I wrote

keen trout
#
    {_x setPos getMarkerPos call { 
        if (side _x == blufor) exitWith { 
            "teleport8blue" 
        }; 
        if (side _x == opfor) exitWith { 
            "teleport8red" 
        }; 
        if (side _x == independent) exitWith { 
            "teleport1green" 
        }; 
    }} forEach allPlayers; 
}];
warm hedge
#

No

keen trout
#

oh what

warm hedge
#

Read what bot says carefully

keen trout
#

oh wait

warm hedge
#

Pro tip: you can edit your post, like this

keen trout
#
// 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; 
}];
warm hedge
#

Comment doesn't matter. The first line of sqf is

#

I'm on the phone so can't see the highlight tho

keen trout
warm hedge
#

setPosATL getPosATL is the idea

keen trout
#

do i replace this setPos getMarkerPos with setPosATL getPosATL

#

ill try anyways but just confirming

warm hedge
#

And replace those marker strings to objects

keen trout
#

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

warm hedge
#

"teleport8blue" etc

#

Replace to some object name so it will point the object's position

keen trout
#

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

keen trout
#

just showing you that theres no string markers

warm hedge
#

What?

keen trout
#

thats all the markers in the game

#

but im getting that error i sent you

warm hedge
#

There is. In your code

keen trout
#

oh okay

keen trout
warm hedge
#

What?

keen trout
#

in the code to get the error

#

sorry if im not to clear

warm hedge
#

Because you didn't followed what I say, replace strings to objects

keen trout
#

sorry

#

"teleport8blue" = objects you mean but idk how to change it because i suck at the code

warm hedge
#

No thats string

#

If there's an object named "obj1", put obj1 so this points the object

keen trout
#

right

#

so i did change the variable names of the objects into teleport8red,teleport8blue,teleport8green

warm hedge
#

No. Markers cannot be pointed like that. You should to place objects in Eden Editor