#arma3_scripting

1 messages Β· Page 622 of 1

tough abyss
#

Just found this

#

might be what im looking for

#

nvm

#

rsctitles

#

@winter rose that still makes the dialog below invisible sadly

winter rose
#

ah well, then IDK. maybe it is not possible (though there are OK messageboxes in vanilla…? πŸ€”)
maybe someone else knows the trick - this is out of my field, sorry!

tough abyss
#

all good mate

#

if anyone knows that'd be great

exotic flax
#

BIS_fnc_guiMessage is what I use to display an "are you sure?" dialog.
Although it will still hide any other dialog (since only one can exist at a time)

winter rose
#

so every "are you sure you want to leave Eden?" are declared, but hidden controls/forms?

cunning crown
#

I think Eden is different

warm hedge
#

Yeah, it is different than guiMessage

exotic flax
#

BIS_fnc_guiMessage is just a function using a fixed control, so can be used for everything

#

and I'm sure 3den either uses the exact same function, or a modification of it

cosmic lichen
#

@exotic flax Eden uses a new function

ashen warren
#

@robust hollow I see what he ment. My typos snuck pass me when posting that source

obtuse sigil
#

is there a command to return the dimensions of a .paa file?

exotic flax
#

No, because (texture) files are not used in scripting

obtuse sigil
#

of course they are

exotic flax
#

You can set a string, but the file itself isn't touched

astral dawn
#

They are just referenced as path within pbo AFAIK, not more

obtuse sigil
#

you can use PAA files as elements in a dialog for example

astral dawn
#

doesn't mean that there should be a scripting command returning its size πŸ€”

obtuse sigil
#

unless youre trying to create UI stuff that dynamically depends on the size of images

#

but guess thats too advanced for bis..

#

back to the drawing board then it is

astral dawn
#

did you try it? shouldn't it rescale by using some relative size already?

#

didn't try myself

exotic flax
#

Why would you want that?
A bit annoying to display a 4k image on a 1080p screen...

obtuse sigil
#

what difference does it make when the element sizes would depend on the size of the images

#

a bit annoying trying to resize UI elements based on the image size when you cant get the image size

exotic flax
#

If you want to ensure the aspect ratio, than simply set that in the UI config

obtuse sigil
#

but like I said, time to design this thing differently then

exotic flax
#

And otherwise just have a transparent element and place the texture (any size) in there

obtuse sigil
#

no. you're not listening and making assumptions. it's about having UI elements reposition &/ change size depending on the image size I'm loading.. the image could be 128x128, it could be 512x128, it could be 512x256 etc etc...

#

depending on the image size, the elements need to be in different positions

#

trying to fit a 128x512 image to a.. lets say arbitrarily 256x256 will stretch the dimensions wrong in the image and thus make the other elements align wrong

astral dawn
#

Does it stretch the image to fit your control size by default or how does it work?

exotic flax
#

I'm not listening, I'm reading...
And you asked a question which we answered, without any additional info about what you want...

obtuse sigil
#

the point is trying to make a system that will work with ALL situations, where I dont have to have hardcoded sizes for 2000 different combinations that I have to manually add

exotic flax
#

Well, since you'll need a config entry for each texture anyway (to be used in scripting/GUI's), why not add the size in the config?

obtuse sigil
#

its using existing files from the game that dont have such data attached to them

astral dawn
#

I guess he preferred to automate it which makes sense. I still don't understand how it scales the image though.

obtuse sigil
#

to put it very simply, which is not what I'm doing here, but as an example.. UI elements like the box (frame + IGUIbackground) size would change based on the size of the image loaded and comboboxes would move to different locations depending of the size of the image

tough abyss
#

anyone got a good script for basic teleporting for a mission file

#

just need it for 4 different areas from a map at where you resapwn

exotic flax
#

@obtuse sigil that is not possible, since you can't get the size of random textures (unless defined somewhere).

#

@tough abyss my preferred method is to (an)use the respawn system.
Although a quick Google search will give you a lot of scripts and examples

tough abyss
#

iv had a look and either im blind

#

or just dumb

#

probably both

#

but it seems people like to over complicate it

amber lantern
#
waitUntil {_temp1 = _distanceToWaypoint; _temp2 = dropship1 distance target; _distanceToWaypoint = _temp2; _temp2 > _temp1};
#

What could be the issue with this? The error is "Generic error in expression" with the marked error at ...; _temp2 |#|> _temp1};

unique sundial
#

@obtuse sigil you can scale control maybe?

lucid junco
#

Does anybody know how to make break in description.ext onLoadMission = "text \n text"?

unique sundial
#

onLoadMission = __EVAL("text"+endl +"text");
If doesn’t work then dunno

lucid junco
#

will try. thx

little raptor
#

@tough abyss @winter rose

is there a way to create a subdialog of a dialog?
You can define the "second" display as a RscControlsGroup inside the first display. You get nearly the same features as you would with 2 displays. (note that control positions in RscControlsGroup are relative positions)
I've used this trick to show a "confirmation message" before, and it works fine.

winter rose
#

yep, I wondered if another solution existed

little raptor
#

@amber lantern Did you define _distanceToWaypoint before? Do both dropship1 and target have the correct type? (object or position)?
What error do you receive in the log before that message?

amber lantern
#

Yeah

#

And yeah

#

I changed it to a while loop and it works so ":D"

tough abyss
#

ty @little raptor

tough abyss
#

How can I check the start of each element of an array for a string?

exotic flax
#
_array = ["some_string", "other_string", "some_integer"];
_findPrefix = "some";
_stringOnly = _array select {
   (_x find _findPrefix) == 0
};
_stringOnly; // returns ["some_string", some_integer"]
robust hollow
#

^ you want select not apply?

#

apply would return [true,false,true]

exotic flax
#

true... I'm so used to using apply lately that I use it by default now 🀣

#

changed the code

tough abyss
#

thank you grez very cool!

amber lantern
#

hmm why aren't my units moving or doing absolutely anything

#

if I enable dynamic simulation they are just frozen, too

#

They aren't even patrolling even though I set their behaviour to patrol via 3den enhanced

amber lantern
#

Restarting helped, but still if I now enable dynamic simulation it breaks again

ashen warren
#

hi all,

I am trying to figure out why im getting a Bool

RTP

21:37:30 Error in expression <"duration");
currentTrack = (_dayTracks select _selecter);

if(debugging == 1) t>
21:37:30   Error position: <select _selecter);

if(debugging == 1) t>
21:37:30   Error select: Type String, expected Number,Bool,Array,code

Main SQF

//plays during no weather conditions during day.
_dayTracks = "'daytime' in getArray(_x >> 'parameters')" configClasses (configFile >> "CfgMusic");

_Selecter = 0;

if(isDay == 1) then
{
    //Normal music
                            
    _selecter = configName selectRandom _dayTracks;
    playMusic _selecter;
    duration =  getNumber (configFile >> "CfgMusic" >> _selecter >> "duration");
    currentTrack = (_dayTracks select _selecter);

                        
    if(debugging == 1) then
    {
        hint format ["Changed music to day Trackname: %1", (_dayTracks select _selecter)];
    };
};

any suggestion? I've checked for typos in variable names and it doesn't look like there is any.

exotic flax
#

First;

_Selector = 0    <-- missing ;

Second;
what is debugging and where is it defined?

ashen warren
#

debugging is defined in the loop that fires the script to detect isDay which is also defined in the loop that fires main.sqf

exotic flax
#

and third; I would use private variables (private _duration = ..., etc.) instead of global ones, because it will mess up scripts when using the same variable name

ashen warren
#

well good news is things work now.

muted zephyr
#

Any suggestions on a script for locking doors?

exotic flax
little raptor
#

@amber lantern

Restarting helped, but still if I now enable dynamic simulation it breaks again
If you're sure that's why it happens, then it's a bug. Report it on feedback tracker.
You can also try

_unit enableAI "ALL"
slim oyster
#

very strange behaviour when spawning AI in preInit inside a vehicle: when I spawn a unit and then use any of the moveIn* commands the unit becomes invisible and completely irresponsive. The units appear as AI, get counted, have variables, a side, etc... but seems like they are not properly initialized before being moved into the vehicle. Any examples of spawning a unit inside a vehicle in PreInit?

winter rose
#

spawn?

slim oyster
#

createUnit

#

last image shows behaviour when I delete veh

#

script works fine in postInit, both called

winter rose
#

yeah no I meant spawn πŸ˜… but of course it would defeat the preinit thing

slim oyster
#

oh yeah, i require unscheduled for this

winter rose
#

maybe create the units unscheduled, then spawn code that will create the vehicle then put them in?

distant oyster
#

is there any info about what happens when a game is loaded from a save? which variables and scripts are loaded and which are not? do we have a biki page for that?

tough abyss
#

how can I select the last part of a string if the first part varies? something like:
"foobarfoobar parttoselect"
"foobar parttoselect"

distant oyster
#

okay thats a start. but for example if i set a variable on a unit and save and load the game will it be there after the load? what about currently running scripts? are they terminated on save?

#

@tough abyss with the select command. it supports strings:

_string = "foobar parttoselect";
_find = "parttoselect";
_result = _string select [_string find _find, count _find];
``` (might need some adjusting on the find and count numbers)
tough abyss
#

@distant oyster thank you, how would I trim the last part then?

#

or better yet to ask this question properly, I want to only keep the first part of the string that varies and then remove the last part

#

the string is a function call turned into a string, so I just want to get rid of the call fnc_Function and keep the array at the start

distant oyster
#
_result = _string select [0, _string find _find];
tough abyss
#

that might be it, thank you

distant oyster
#
_string = "foobarxparttoselectpostpost";
_find = "parttoselect";
_result = _string select [0, (_string find _find) - 1];
``` just tested with sqfvm
tough abyss
#

ty, one more thing, i've seen select within a select is possible, how would I do that?

#

an array within an array select

distant oyster
#
_array = [0,1,2,3,4];
_range = _array select [1,3];
_range
``` returns: `[1,2,3]`. 1 is the starting index, 3 is the range to select
tough abyss
#

what I mean is

_array = [1,2,[2,3]];
#

and then select a value inside the nested array @distant oyster

distant oyster
#

ah okay. thats just selecting the array first and then selecting the element.

#

"nested arrays" is the term

tough abyss
#

is that possible within one line?

#

so i dont have to do this

_array1 = _array0 select 0;
_array2 = _array1 select 0;
winter rose
#

are you restricted in lines number? πŸ˜„

#

do you pay per line? :p

tough abyss
#

I like as much code within one line as possible πŸ˜„

#

and also the aformentioned looks ugly

distant oyster
#
[0, 1, [22, 33]] select 2 select 0; // 22
winter rose
#
_array2 = _array0 select 0 select 0; // ninja'd but I post it anyway
tough abyss
#

thats what i was looking for, thank you πŸ˜„

vague geode
#

I want to get NPCs to loop some animation in a multiplayer setting and used switchMove before to achieve that but it didn't work. Then someone told me that I need to combine it with playMoveNow for it to work so I put the following into the units init-field but that also doesn't work.

Anyone got any idea how I can get the unit to do the animation in a multiplayer environment?

if (local this) then {
    this spawn {
        {_this disableAI _x} forEach ["ANIM","AUTOTARGET","FSM","MOVE","TARGET"];
        sleep 60;
        _animationSet = ("SIT_AT_TABLE" call BIS_fnc_ambientAnimGetParams) select 0;
        _animation = _animationSet call BIS_fnc_selectRandom;
        _this switchMove _animation;
        sleep 0.33;
        _this playMoveNow _animation;
        [_this,"Jets_ID"] call BIS_fnc_setUnitInsignia;
    };

    this addEventHandler ["AnimDone", {
        params ["_unit", "_anim"];
        {_unit disableAI _x} forEach ["ANIM","AUTOTARGET","FSM","MOVE","TARGET"];
        _animationSet = ("SIT_AT_TABLE" call BIS_fnc_ambientAnimGetParams) select 0;
        if (count _animationSet > 1) then { _animationSet = _animationSet - [_anim]; };
        _animation = _animationSet call BIS_fnc_selectRandom;
        _unit switchMove _animation;
        sleep 0.33;
        _unit playMoveNow _animation;
    }];
};
distant oyster
#
_array2 = _array0 select 0 select 0; // ninja'd but I post it anyway

@winter rose trying to use select on a number, are we?

willow hound
#

@vague geode Have you tried without disableAI?

winter rose
#

if sqf _array1 = _array0 select 0; _array2 = _array1 select 0;worked, my code will as well

distant oyster
#

!false

winter rose
#

as long as it's not "false!" πŸ˜„

tough abyss
#

afaik you dont have to combine it with playmovenow

#

switchmove doesn't cause an animdone event either afaik

vague geode
#

@willow hound Not this particular code but yes, I have tried to use switchMove without disableAI but also without success.

tough abyss
#

From what I know you only combine them if you already have an animation going on and want to switch immediately then do playmovenow to get the event

#

Also I'm a complete scrub at locality but shouldn't this be executed on the server only?

willow hound
#

Should, but local this will only be true on the server.

tough abyss
#

ah ok

#

think i figured it out

#
{_this disableAI _x} forEach ["ANIM","AUTOTARGET","FSM","MOVE","TARGET"];
#

you disable ANIM here

#

@vague geode

vague geode
#

Also I'm a complete scrub at locality but shouldn't this be executed on the server only?

Yes, it will BUT the effect of both switchMove and playMoveNow is global.

#
{_this disableAI _x} forEach ["ANIM","AUTOTARGET","FSM","MOVE","TARGET"];

you disable ANIM here

@tough abyss Yes, but as far as I know it only disables to unit's ability to change animation itself.
That line of code is also used in the BIS_fnc_ambientAnim function (line 115):

/* [...] */

//surpress the unit "intelligence"
{_unit disableAI _x} forEach ["ANIM","AUTOTARGET","FSM","MOVE","TARGET"];

/* [...] */
tough abyss
#

Not sure then

vague geode
#

Yeah, me neither which is why I am asking...

#

(BTW just in case anyone is wondering why I am not just using BIS_fnc_ambientAnim, it's because I spawns a logic entity every time someone joins the server which quickly amount to dozens of useless logic entities reducing performance)

tough abyss
#

@vague geode remove the sleep 60; while debugging btw, that might be why the animation is not appearing

#

as youre not waiting 60 seconds

#

also might be the scheduler thats screwing you over

#

I tested it without the scheduler and the anim appears

#

Same with the locality check, although im not sure why

exotic flax
#

The spawn is needed due to the sleep(s), and that shouldn't cause any issues within a mission.
As for locality... this is still a black box for me...

Although if all you want is to prevent the mass-spam of Logic Objects; simply use

[_unit, "SIT_AT_TABLE", "NONE", objNull, false, false] call BIS_fnc_ambientAnim;
vague geode
#

@vague geode remove the sleep 60; while debugging btw, that might be why the animation is not appearing

as youre not waiting 60 seconds

@tough abyss The NPCs are located on an aircraft carrier which is seven klicks away from the spawn and to get there I am using a helicopter support which only becomes available two mikes (120 seconds) after mission start so the code should definitely be executed when I get there.

tough abyss
#

while debugging

#

that's just personal preference though

vague geode
#

The spawn is needed due to the sleep(s), and that shouldn't cause any issues within a mission.
As for locality... this is still a black box for me...

Although if all you want is to prevent the mass-spam of Logic Objects; simply use

[_unit, "SIT_AT_TABLE", "NONE", objNull, false, false] call BIS_fnc_ambientAnim;

@exotic flax I tried that as well but it did not appear to work. The logic entities still got spawned...

#

@exotic flax The responsable part of the BIS_fnc_ambientAnim-function is in line 417 to 466...

exotic flax
#

I see, it will create the logic, but don't attach the unit to it (meaning it can still float away)

jade abyss
#
_array2 = _array0 select 0 select 0; // ninja'd but I post it anyway

@winter rose
πŸ˜„

_array2 = _array0#0#0;
winter rose
#

YOU MONSTER!!

compact maple
#

xD

willow hound
#

I have not looked at the BIS_fnc_ambientAnim source code (can do that later if you want me to), but it might work without spawning game logic entities on every client if you just call it like so:

if (isServer) then {
  [...] call BIS_fnc_ambientAnim;
};
winter rose
#

it will synchronise their existence on the network though

#

I made my own BIS_fnc_ambientAnim with blackjack andβ€” with only one logic placed at [0,0,0]

vague geode
#

I have not looked at the BIS_fnc_ambientAnim source code (can do that later if you want me to), but it might work without spawning game logic entities on every client if you just call it like so:

if (isServer) then {
  [...] call BIS_fnc_ambientAnim;
};

@willow hound True, the only problem is, that the animation won't work. (I know that because I tried that as well.)

willow hound
#

@winter rose Are game logics local?

winter rose
#

nope, it's a "unit" like any other one. I tried createVehicleLocal and attachTo server-side, but it ended up having all units to disappear (I suppose to [0,0,0])

willow hound
#

Why in Miller's name does it create a new one for every client then?!

winter rose
#

not "one for every client"? 🀨

willow hound
#

?

winter rose
#

where did you see that?

#

one for every unit that is animated

willow hound
#

Oh my

#

That's free

#

That's no problem at all

winter rose
#

well maybe, yet some logic AI is enabled
I made my own because I didn't want one logic per soldier

they use a logic because if you were to attach to, say, a rock, the animations would stutter as they are tied to the simulation rate of the object to which they are attached

willow hound
#

Everyone else just uses a cute little helper object

#

Could probably use the chair itself right away, but I have not animated sitting people in a long while

winter rose
#

a chair will stutter the animation as well

willow hound
#

Will have a look after food

winter rose
#

no, now!1!

tough abyss
#

does parseSimpleArray have problems with single quotes?

#

because im getting a generic error for that

#

if so, how would I remove them from an string?

exotic flax
#

no, it doesn't care about single quotes, as long as the string has double quotes around them

#
_string = "[1, ""2"", ""3'4""]";
_array = parseSimpleArray _string;
_array; // returns [1, "2", "3'4"]
tough abyss
#

how would I give double quotes to every single entry of an array string then?

#

its made with a script not declared

#

what I have is "[foo, bar, 'foo', 'bar']"

exotic flax
#

but why?
If you create an array, why not make it an array instead of a string πŸ€”

tough abyss
#

because it goes through like 10 million hoops before the final result there

#

although i could probably cut it

warm hedge
#

Maybe just dosqf '[foo, bar, "foo", "bar"]'

exotic flax
#

not to mention that foo breaks, since it's not a string but a variable (which returns <null> is not defined)

tough abyss
#

I know

#

that's the broblem

#

although, I could probably end up with a better result

exotic flax
#

@warm hedge also doesn't work

warm hedge
#

Hmm

tough abyss
#

is there some sort of reverse format function?

#

where you take a part of a string and turn it into a variable value

exotic flax
#

but why not use pushBack to put (new) stuff in the array

tough abyss
#

exactly

#

thats what i mean

#

go from comma to comma, take the value and then pushback

#

into a new array

exotic flax
#
_array = [];
while {whatever} do {
   _array pushBack someValue;
};
_array;
tough abyss
#

I mean from what I currently have monke

exotic flax
#

because parseSimpleArray only makes sense when working with extensions (like ExtDB)

tough abyss
#

take this array string, go from starting [ to comma, then to comma, then to comma, etc. and inbetween those take the value and turn it into another string as a variable value

#

i.e a reverse format function

exotic flax
#

but where does that messed up string/array come from?

#

because that should be fixed, not the method to extract data from it

tough abyss
#

its values within a listbox row for a function call

#

specifically ace_medical_fnc_addDamageToUnit

#

working with the original values is fine as they come in a string, then i use format to turn them into one string, and then call compile when needed

#

now the problem is, I save these values into another string, and need them as an array

exotic flax
#

so don't save them as a string

tough abyss
#

im using namespace variables

#

thats why

exotic flax
#

setVariable accepts everything, also arrays

tough abyss
#

yes, but the values within that array are strings

exotic flax
#

so?

tough abyss
#

remember, I'm taking something like "[person, 0.6, 'Body', 'bite]"

exotic flax
#
_array = [123, "456", objNull, true];
uiNamespace setVariable ["mySecretArray", _array];

_mySecretArray uiNamespace getVariable ["mySecretArray", []];
tough abyss
#

as a listbox row only can store a string as data

exotic flax
#

in that case; have a "global" array with all the data, and only store the key of that array

tough abyss
#

gone when the mission restarts

#

i'll dm something to you hold on

willow hound
#

@vague geode Slightly modified your code and it worked in singleplayer and hosted server preview (Arma was not happy with sleep in the EH code - what was it used for?):

if (isServer) then {
    this spawn {
        {_this disableAI _x} forEach ["ANIM","AUTOTARGET","FSM","MOVE","TARGET"];
        sleep 0;
        _animationSet = ("SIT_AT_TABLE" call BIS_fnc_ambientAnimGetParams) # 0;
        _animation = _animationSet call BIS_fnc_selectRandom;
        _this switchMove _animation;
    };

    this addEventHandler ["AnimDone", {
        params ["_unit", "_anim"];
        {_unit disableAI _x} forEach ["ANIM","AUTOTARGET","FSM","MOVE","TARGET"];
        _animationSet = ("SIT_AT_TABLE" call BIS_fnc_ambientAnimGetParams) # 0;
        if (count _animationSet > 1) then { _animationSet = _animationSet - [_anim]; };
        _animation = _animationSet call BIS_fnc_selectRandom;
        _unit switchMove _animation;
    }];
};

If it still doesn't work for you, you might have to ask Lou for his LM_fnc_ambientAnim and try that.

tough abyss
#

This command will not cause an AnimChanged or AnimDone event. However, playMove will.
@willow hound

#

might want to use that instead of switchmove

vague geode
#

@willow hound The problem wasn't in singleplayer and hosted server in the 3Ditor but on a "real" server. It has worked on both before but it does not online for some reason.

carmine quail
#

Hey guys,
I have a script, and I want to run it when a certain ammo type impacts. How should I go about it? I tried to dig into ACE configs to see how frags and etc works, but couldn't figure it out. πŸ‘Ό πŸ˜”

faint oasis
#

someone know how to get the vehicle ammo ? example if the vehicle ammo is "1" it's full

little raptor
#

There's no such command. You have to go through all weapons and check their ammo against full mag ammo.

#

@carmine quail What kind of impact? If you want to change the impact effects, don't use scripts. Change the effect file.

faint oasis
#

@little raptor oh ok but which command to do that ? because i'm a little bit confused

little raptor
#

AFAIK you should use weaponsTurret

#

or maybe weapons too

#

Not sure

#

Then check the weapon ammo against mag count value in config

quartz pebble
#

Anyone can explain me the thing...

After the latest patch, In our multiplayer mission I started seeing lots of scuba divers at the lower-left corner of the map. The mission did not create them.

If I run the script in the debugger, I get

p = ((screenToWorld [0.5, 0.5] nearObjects ["Man", 100]) select 0); typeOf p
// "Mackerel_F"
p = ((screenToWorld [0.5, 0.5] nearObjects ["Man", 100]) select 0); allVariables p apply {[_x, p getVariable _x]}
// [["_thiscreated",1],["_totalrunning",14],["_task",<null>],["leader",any],["_totalcreated",988],["members",[]],["_thisrunning",0],["_tasktype","Animal Main Task"],["_this",Agent 0xd0c20180],["state","move"]]

And they are considered "agents" rather than "units". What's going on? What created them?

faint oasis
#

oh ok thx @little raptor

little raptor
#

@faint oasis Also, you must look up the magazines value for each weapon in the config, to make sure all mags are there

exotic flax
#

@quartz pebble sounds like the animal presence module (or similar)

winter rose
#

fish are automatically created as ambient animals

little raptor
#

Do you use any mods?

quartz pebble
#

but why they are scuba divers? and why are they visible in spectator as units?

#

(no mods - vanila game)

little raptor
#

Which version of the game?

#

I personally don't see anything on the latest DEV branch build

quartz pebble
#
Type: Public
Build: Stable
Version: 1.98.146728

I personally don't see anything on the latest DEV branch build
I could attach screenshots - I'm on the server right now and see it right now - but discord doesn't allow

little raptor
#

v2.01.146752 doesn't seem to have this problem

quartz pebble
#

(and those guys are not dummies - they're live - they swim here-there)

tough abyss
#

Anyone know if there's a way to make an AI unit tankier? (Using ACE medical)

astral dawn
#

Do variables on player object always reset when he respawns in MP?

winter rose
#

I believe not

little raptor
#

@quartz pebble Is that your mission? If not, maybe the mission maker uses them (if they're agents, maybe for path gen or something)

hollow crane
#

Hello y'all, Hopefully someone can help me or point me in the right direction. So I have a script that sends data that was entered by a player to my Database, it works. But I want to find out how to automatically log it to a channel in a discord I have setup.

quartz pebble
#

@little raptor it is mine. All the code was written by ourselves and nothing was taken from "untrusted sources".

little raptor
#

@quartz pebble After actually reading this:

p = ((screenToWorld [0.5, 0.5] nearObjects ["Man", 100]) select 0); typeOf p
// "Mackerel_F"
p = ((screenToWorld [0.5, 0.5] nearObjects ["Man", 100]) select 0); allVariables p apply {[_x, p getVariable _x]}
// [["_thiscreated",1],["_totalrunning",14],["_task",<null>],["leader",any],["_totalcreated",988],["members",[]],["_thisrunning",0],["_tasktype","Animal Main Task"],["_this",Agent 0xd0c20180],["state","move"]]

I noticed that it's actually an animal (Mackerel_F). You're just returning the fish in that area.

#

I'm not sure about the scuba divers or why they spawned there. This doesn't say anything

mellow condor
#

how do i go about finding the script for towing a car

dusk sage
#

Google?

mellow condor
#

already looked i was going to port into another game made bohemia if possible

dusk sage
#

So googling tow vehicle script arma 3 didn't give you any?

exotic flax
#

i was going to port into another game made bohemia if possible
wait... what?

mellow condor
#

i only see Arma 2

exotic flax
#

if I search for "Arma 3 tow script", the first like goes to the BI Forums with a mod/script for Arma 3

mellow condor
#

i dont see the BI Forums with the mod only steam

summer path
warm hedge
#

Yes

robust hollow
#

without looking into the mod, i imagine you want something like this

private _class = switch (getPlayerUID player) do {
    case "7656.....":{"CTRG15"};
    case "7656.....":{"MANW"};
    case "7656.....";
    case "7656.....":{"Curator"};
    default {"CombatPatrol"};
};

[player,_class] call BIS_fnc_setUnitInsignia;
harsh vine
#
"Break Box",                                        // Title of the action
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa",    // Idle icon shown on screen
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa",    // Progress icon shown on screen
"_this == side _caller", 😁 
"_caller distance _target < 3",        

_this == side _caller ...is there another way to get this to work ...i want the addaction to show up for the _caller teammates only

jagged elm
#

how would i make it so i cant leave a trigger?

robust hollow
#

@harsh vine there is a couple of things wrong with that but to fix them it may be useful to know the following first:
how are you adding that action? how does each individual player know who the caller is?

summer path
#

That seems like it, yes.
Would that go into the initPlayerLocal.sqf?

robust hollow
#

it should work there, sure. you may need to reapply it if a player dies though.

silk ravine
#

Hi there folks, I am stuck with something that is probably horribly obvious, but I just can not put my finger on it.
I am running this code, within a script that is local to the server (isServer) and on a popuptarget array that is defined and placed on the VR map.

_x addEventHandler [
            "Hit", {
                if ((_this select 0) getVariable "isHostage") then {
                    playSound3D ["a3\Ui_f\data\Sound\CfgNotifications\taskFailed.wss", _x];
                };
                (_this select 0) animate ["terc",1];
                (_this select 0) removeEventHandler ["Hit",0];
            }
        ];```
The script works, when I remove the if condition but stops working when it is added.
I am sort of blind to what the issue could be.
robust hollow
#

_x isnt defined in the event scope

silk ravine
#

So (_this select 0) should work? Cause I already experimented around with replacing _x with that one and it did not work either. isHostage btw is givin via setVariable in the object init

#

varspace issue?

robust hollow
#

yes (_this select 0) instead of _x in the playSound3D line should fix it, or at least remove that issue.
another thing you might want to do is provide a default value with getVariable, just to be safe.
(_this select 0) getVariable ["isHostage",false]

silk ravine
#

that is a very good point, will try it, brb

#

Okay... it seems to work now, sort of.

#

Might change the object its played on to one of the placed speakers

#

Thank you very much Connor!

faint oasis
#

how can i create an HUD Gui ?

#

because when i create a dialog with "createdialog" function i can't move

robust hollow
#

cutRsc or create your controls directly on display 46

#

cutRsc is usually the way to go

faint oasis
#

yes

#

because to create a controls on the display 46 i need to use the "sqf" with find display

#

so thx i will try cutRsc

#

@robust hollow the gui need to be in "RscTitle" ?

robust hollow
#

"RscTitles"* yes

faint oasis
#
class gui_teste {
    idd = 502;
    movingEnable = true;
    enableSimulation = true;
};
#

because i have that

robust hollow
#

you also need these in an rsctitle

duration=1e+011;  
fadeIn=0;  
fadeOut=0; 
#

the duration is how long you want it to stay open for, so there it is a generic big number which effectively means it wont close itself.

faint oasis
#

i want the gui "stay open"

#

always

#

i have that now

#
class RscTitles
{
    class gui_teste {
        idd = 502;
        duration=1e+011;  
        fadeIn=0;  
        fadeOut=0; 
        
        class Controls {
            class RscFrame_1800: RscFrame
            {
                idc = 1800;
                x = 0.834688 * safezoneW + safezoneX;
                y = 0.908 * safezoneH + safezoneY;
                w = 0.143437 * safezoneW;
                h = 0.051 * safezoneH;
            };
        };
    };
};
#

it's in .hpp

#

can i include it to a description.ext ?

robust hollow
#

yes

faint oasis
#

ok

#

@robust hollow i have added : cutRsc ["gui_teste", "PLAIN"]; and it work perfectly

#

but how can i close the rsctitle ?

robust hollow
#

if you use a layer name like
"myLayerName" cutRsc ["gui_teste", "PLAIN"];
you can then do this to close it
"myLayerName" cutFadeOut 0;

faint oasis
#

ok but the layer name

#

need to be specific ?

#

or i can put what i want

robust hollow
#

it can be what ever you want. it would be best if it is something unique though, the point of it is to avoid conflicts with other addons. personally I put my prefix in front
eg: "BIS_myLayerName"

faint oasis
#

oh ok

#

thx

#

i will try

#

@robust hollow yes it work perfectly so thx

jagged elm
#

how would i make it so i cant leave a trigger?

robust hollow
#

i dont have experience with triggers so cant give the best solution, but a hacky one would be to setPos the unit back into the trigger on deactivation (them leaving it?)

jagged elm
#

ok

faint oasis
#

@robust hollow i have added that

#
class RscTitles
{
    class Tickets_Gui {
        idd = 1954;
        duration=1e+011;  
        fadeIn=0;  
        fadeOut=0; 
        
        class Controls {
            class Tickets_Shower : RscText
            {
                idc = 1955;
                text = "German : 500 | USA : 500";
                x = 0.428281 * safezoneW + safezoneX;
                y = 0.00700002 * safezoneH + safezoneY;
                w = 0.151406 * safezoneW;
                h = 0.034 * safezoneH;
            };
        };
    };
};
#

it work

#

but

#

how can i find the display ?

#

because i use "finddisplay 1954" but the command return "no display"

robust hollow
#

onLoad="uiNamespace setVariable ['Tickets_Gui',_this select 0];"; instead of an idd. idd doesnt work with rsctitles, idc still does but you use the variable as a reference instead of finddisplay

faint oasis
#

oh ok

#

thx

robust hollow
#

you may still need to define idd because displays need them. just do idd=-1;

hollow crane
#

Hello y'all, Hopefully someone can help me or point me in the right direction. So I have a script that sends a log of the form that players filled out in a GUI to my Database, it works. But I want to find out how to automatically log it to a channel in a discord I have setup.

ebon citrus
#

There are some arma 3 discord bots you can take apart and research

jagged elm
#
player setPos (getPos player);
``` why isnt this working?
hallow mortar
#

It's trying to set the position of the player to...their current position. How would you tell if it's not working?

#

The two possible outcomes of the code functioning correctly are either "no noticeable effect" or "constant setpos freeze locks them in place with no way to escape". I suspect the first outcome is what's happening.

#

If you want to force return them to the playable area, you need to locate a position inside the playable area and send them there. There are probably a few ways you could do that.

neat fox
#

Good evening to you, I have a small problem with this script....
The two objects do not overlap ...
An idea of why and how?
Thank you in advance


_obj2 setPos (getPos _obj1);
_obj2 setVectorDir (vectorDir _obj1);
_obj2 setVectorUp (vectorUp _obj1);```
https://www.youtube.com/watch?v=LXEC0NjnlrA
winter rose
#

try setVectorDirAndUp?

neat fox
#

try setVectorDirAndUp?
@winter rose Well that's fixed, thank you.

unique sundial
#

use getPosWorld setPosWorld and setVectorDirAndUp

neat fox
#

Thank you this is perfect

cobalt leaf
#

I'm having a problem here with createSoundSource
I'm trying to make an alarm sound coming from a speaker. It works, BUT of course it does not for the exact alamr sound I wish to use. It is called "Alarm" and I have no clue why it wont read it

ionic orchid
#

I have a createSoundSource question too, is there any alternative that lets me have looping sounds created via script, but aren't global like CSS objects are?

unique sundial
cobalt leaf
#

Thanks

cobalt leaf
#

Hello, I have a question about using player to activate triggers :
In a multiplayer game, player reffers to any player controlled unit, or only the player designed unit ?
For exemple : I want a trigger that goes on whenever any player hops into a static MG .
Using :

player = vehicle _thatstaticmg

in the trigger condition means that any player entering the MG will trigger it, or all the players have to be in it ?
(I'm asking because I can not really try this since I don't have anybody else to try it with me)

robust hollow
#

you want == not =

#

player refers to the unit you control

cobalt leaf
#

Yeah I think I got the vehicle function wrong here

warm hedge
#

Also local variables aren't defined in your trigger

cobalt leaf
#

Okay but i'm wondering if it takes any player in a multiplayer game @robust hollow

robust hollow
#

player will be the unit of the person executing the condition

#

so for your condition you would want vehicle player == _thatstaticmg

#

to say if the vehicle the player is in matched _thatstaticmg

velvet merlin
#

is it known that copyToClipboard cant export non English locale? or is there some workaround to it?

velvet merlin
#

also when using structured text?

little raptor
#

I recommend using toArray to convert the string to UTF16:

toArray "ΠΏΡ€ΠΈΠ²Π΅Ρ‚"
#

Then convert it back to string using an external program. (if you want to use it inside Arma, you can use toString)

#

That's all I can think of

robust hollow
#

as far as a workaround goes you can open the data to copy in an edit ctrl (non-editable) and the user can manually select and copy it

uiNameSpace setVariable ["Display3DENCopy_data",["title?","content to copy"]];
findDisplay 46 createDisplay "Display3DENCopy";

(works outside of 3den)

#

probably worth mentioning: i suggest that because even if the character has issues with other commands or cant be displayed in the font, it does copy out when doing ctrl+c (in my experience)

little raptor
#

@velvet merlin This is something I wrote that can do this:

_chars = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];
_fnc_getHex =
{
    _code = "\u";
    for "_i" from 3 to 0 step -1 do {
        _quo = floor(_this/16^_i);
        
        _code = _code + _chars#_quo;
        
        _this = _this - _quo*16^_i;
    };
    _code
};

copyToClipboard (toArray "ΠΏΡ€ΠΈΠ²Π΅Ρ‚" apply {_x call _fnc_getHex} joinString "")

Use the Notepad++ plug-in "HTML Tag" -> Decode JS (ctrl+shift+J) to convert it back to Unicode text

harsh vine
#
_near = getPos Box_1 select 2 < 2; //attached object 
ropeUnwind [ropes heli_deposit_1 select 0, 5, _near, true]; //_near is the length if the rope;
//hehe i tried πŸ™ˆ 

does anyone knw how to make a heli unwind its rope until, the attached objects is x meter off the ground.

ebon citrus
#

Pseudo code:

wind rope
while until rope is desired length
stop wind

#

Or measure length from heli to ground - height of object from ground you desire

#

And you'll have your rope length

#

So if heli is 10m high and you want object to be 3m off the ground

#

10-3=7

#

So unwind rope to 7m

#

I recommed the latter option

#

@harsh vine ^

harsh vine
#

i knw how to do the measuring part, just that i have random locations for the heli to hover and each terrain is kind of different so thats why.

winter rose
#

measure length from heli to ground
getPosATL or getPos should do?

ebon citrus
#

@winter rose not when object is on a building or other surface

#

For this, use lineintersect

winter rose
#

getPos should work

ebon citrus
#

GetPos works on objects now? Sweet

winter rose
#

…always has?

ebon citrus
#

Thank you Lou

winter rose
#

also, getPosASL select 2 for both, subtract, ???, profit

ebon citrus
#

Great

#

Anyways, you have your solution, i dont know the problem anymore?

#

I'm a bit feverish atm due to ear infection so maybe i should drop

viral basin
#

Hey there - is there any possibility to set/get the marker height in the 3DEN Editor? Or does any mod exist to manage the height?

astral dawn
#

I think it should scale with your UI scale settings in video options?

winter rose
#

I think he means height as in Z-axis ^^

viral basin
#

yeah exactly πŸ˜„

winter rose
#

when double-clicking on it, there is no Z field I assume?

viral basin
#

No unfortunately not, this would be cool

warm hedge
#

Markers are only available in map, which is a 2D format, so Z is pointless

winter rose
#

nope, Z value can be used for respawn purpose

warm hedge
#

Ah

winter rose
#

otherwise they wouldn't have added it to createMarker 😁

warm hedge
#

Yeah, Z is stored IIRC but it's not available to edit easily

viral basin
#

Yeah we need it for spawning reasons and therefore it would be great to set the height via editor instead of exporting it and manipulating it afterwards :/

winter rose
#

in vanilla, you can either use createMarker, or setMarkerPos, or edit mission.sqm
it would be a nice thing to have in editor, you can create a feature request on the Feedback Tracker if it doesn't exist already

warm hedge
#

Sometimes I actually wish a way to show/edit markers in Eden Editor in 3D

finite sail
#

especially visibility zero markers

#

it's a whole game in itself finding the blighters

tight narwhal
#

Trying to get dedi server to push vehicle init to players but is unsuccessful. This is my current broken attempt, anyone care to take a look and assist in this pretty light scripting? https://pastebin.com/dXf84Bah

winter rose
#

sure, if you tell what the error is

tight narwhal
#

Error in "this". It doesn't fire off on the vehicles, so no addActions or ACE Inventory item for player in editor placed or Zeus placed vehicles of the type. Testing in editor local MP.

winter rose
#

use _this

tough abyss
#

does saving in namespaces turn the varname lowercase?

#

specifically profilenamespace

winter rose
#

I am tempted to ask "why do you care?" variables are not case-sensitive anyway

little raptor
#

case doesn't matter in variable names

tough abyss
#

because I'm doing a preset system so I'm asking to see if i should store the name inside the variable itself and not use its name

winter rose
#

bad thing, don't do that.

little raptor
#

the variable names are saved in lower case afaik. But yeah, dont

tough abyss
#

why so if i could ask?

#

just curious

winter rose
#

because the principle of the variable is to hold data, not to be one by itself πŸ™‚

#

exception made for a quick check of "has variable", nothing more

little raptor
#

it is also more optimal to save all of your variables in one array in the namespace

tough abyss
#

oki thank you

little raptor
#

it is also more optimal to save all of your variables in one array in the namespace
if you want to save some "names" like you mentioned. It generally depends on how you want to implement this

tight narwhal
#

Thanks @winter rose works as intended

wise frigate
#

Hey guys,
Is there a way for me to use the Fired eventhandler to remove a bullet that has been shot but still allow the unit to throw hand munitions?

#

Since just deleting the projectile deletes grenades aswell

exotic flax
#

Check the type of projectile inside the EH.
If it's a Throwable, don't delete it

little raptor
#

there's no need to check the projectile.
@wise frigate Simply check if the weapon is "throw"

#
this addEventHandler ["FiredMan", {
    params ["_unit", "_weapon"];
        if (_weapon == "throw") then {//hand weapon
        }
}];
wise frigate
#

That works, thanks

robust brook
#

Anyway to return subtype of a vehicle? ex: helicopter will return "Air"

#

or do I have to get hacky with isKindOf

winter rose
#

@robust brook would BIS_fnc_objectType do?

agile pumice
#

I posted a question last week but I got busy and wasn't able to follow up. I'd like to as it again if that's alright.

I'm trying to get a unit (M1) to fire on the location of a trigger (arty1) via a mortar but he won't fire off any rounds
I tried doing checking if the unit was in range but inRangeOfArtillery always returned false

winter rose
#

and are you sure it is within mortar range?

agile pumice
#

yes, the unit was roughly 800m from the target

#

I will double check again

agile pumice
#

Yeah, the unit is within 500-600m of the trigger which is named arty1. Do I have to instruct the unit to change to medium mode via the arty computer?

winter rose
#

should not - vanilla, no mods?

agile pumice
#

not vanilla

#

I use a script to spawn the mortar infront of the unit and force the unit to get in the gunner, but the unit doesn't aim at the position or fire any rounds

#
[M1] spawn {_pos = (_this select 0) modelToWorld [0,1,0]; 
(_this select 0) playMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon"; 
removebackpack (_this select 0); 
_mortar = "B_G_Mortar_01_F" createVehicle _pos; 
sleep 2; 
(_this select 0) moveInGunner _mortar;};```
The unit has a "fire mission" waypoint also
little raptor
#

no

#

Are you sure you specify the mag correctly?

agile pumice
#

not 100% let me verify

#

8Rnd_82mm_Mo_shells

winter rose
#

@agile pumice arty1 is a marker correct?

#

thereforesqf getMarkerPos "arty1"
please use the -showScriptErrors flag in the launcher, it will tell you the issue immediately

agile pumice
#

it is not a marker

surreal peak
#

have you been using the -showScriptErrors at all? If so make sure you check your RPT log

winter rose
#

nope nope, my bad - I did read "trigger" as "marker" @agile pumice, nevermind my message

agile pumice
#

(position arty1) inRangeOfArtillery [[M1], "8Rnd_82mm_Mo_shells"] returns true when the unit is on the mortar

#

I'm restarting my game with showscripterrors enabled via the launcher. I could have sworn I remembered script errors come across my screen previously

#

There currently aren't any script errors showing after I enabled it

#

I can place a manned OPFOR mk6 mortar and assign a fire mission waypoint and it works fine

#

I tried using an opfor unit now instead of a civilian unit and still nothing

night pollen
#

(screenToWorld[0.5,0.5]) basically is the center of your screen/cursor, right?

winter rose
#

screen centre yes

night pollen
#

ty

obtuse sigil
#

does anyone know of a way to detect which pylon on an aircraft is assigned to which turret? (usually but not always just related to helicopters with separate pilot and gunner)

digital plover
#

Hi all

obtuse sigil
#

since getPylonMagazines doesnt return the turret the pylon is assigned to

digital plover
#

Is it possible to call a image from the mod file?

#

Example: LoadingScreen.png

#

@MyOwnMod>Addons>server.pbo

exotic flax
#

it's the same path as on your P drive, just without the P:

#

eg. \MyOwnMod\addons\server\path\to\LoadingScreen.png

digital plover
#

ah ok. i try now

obtuse sigil
#

wouldnt it be without the addons though? \MyOwnMod\Server\path\to\LoadingScreen.png

winter rose
#

yep

exotic flax
#

again; depends on you P drive and setup

#

eg. I use the ACE/CBA method, which uses \x\NameOfMod\addons\NameOfAddon\path\to\files

digital plover
#

not work

#

loadScreen = "\RD\RD_Client\data\UI\rdexile_loadingscreen.jpg";

exotic flax
#

and without the first \ ?

#

not to mention

  • Must be in PAA file format.
  • 2:1 aspect ratio (different aspect are rendered correctly as well, but won't cover the whole area).
  • Ideally 1024x512 pixels.
digital plover
#

ok it worked now thank you

obtuse sigil
#

define create task module

#

createtask scripting command according to wiki should return the task that you can store in a variable

obtuse sigil
#

no I want you to explain what you mean with "create task module"

#

because saying create task module doesnt make any sense to me

#

I imagine if you use that system to create the task, you must use the same system to update the tasks

#

either use scripting for all parts of tasks, use that module for all parts, or use that task framework that leopard20 linked for all parts

#

because the variable returns an object and not a task

#

you have an Object on the map that you have named task1, not a variable for a task

#

dude, I've been out of the scripting and mission making scene for 10 years right now, no idea how you're supposed to use this new stuff.. just giving my 2cents about how it has always been with bis

#

you are not naming the task with the module, you are naming the object that creates the task

#

if you do task1 = createtask yadayada task1 is the variable with the task

#

variables work with every script

#

its the type of data that has to be correct for the scripting command to be able to work

#

you can use global variables, you can use private local variables, but there is always a danger of doing it one way or the other

#

there are many ways of doing that, and many ways to break everything doing that

#

if you are creating a multiplayer mission, it will be a nightmare for you until you learn and understand locality of.. well.. everything

#

scripts will work completely differently in singleplayer, hosted multiplayer and dedicated server multiplayer

#

so you will never upload the mission anywhere for anyone else to play?

#

well then there is a high chance your scripts wont work for other people, when they play on dedicated server..

#

always test on dedicated, hosted and SP

#

all 3 need to be tested

#

there is no simple way to say how to "fix" it.. your code needs to run the right way in the right place for everything to work

#

well, for example.. if you just use createvehicle to spawn a vehicle.. you test it on single player, it works great.. then you go on 20 player server, run the same script and you will create 20 vehicles because the code is run on everyones computer

#

there is a start

#

also JIP (join in progress) players (meaning players who join server while the mission is running) are 4th thing that will break every script

#

if you stop your script there, it will stop and not continue.. most of the time you need to make scripts that keep running even if there is a state where it can't do something...

#

I'd just tell you to learn to make single player missions first.. once you get things working there you can start learning MP missions, you will otherwise get very overwhelmed

#

but, for an MP mission one simple workaround for the createvehicle would be: if (isDedicated) then { createvehicle code }; and then you can still continue your script if you have to

#

then you can run the same script on both client and server, but the vehicle will only get created on the server

#

but of course, the isDedicated returns false when you test it on single player.. soo..

velvet spoke
#

Hey everyone, I want to add a script to a waypoint and pass two variables to that script. I know that it looks something like this: obj addWaypointScript β€žwaypoint.sqfβ€œ. How do I pass variables to the waypoint.sqf script?

winter rose
#

have you checked the wiki?

little raptor
#

If these variables are just constant variables (number or string), you can use the wiki syntax.
Otherwise, you can add the variables to the group itself (since waypoints are specific to each group)

#
[_grp, 2] setWaypointScript "somescript.sqf [1,2,3,4,5,6,7,8]";

Or:

_grp setVariable ["TAG_fnc_args", _args]
velvet spoke
#

@winter rose yes Iβ€˜ve checked the wiki but the variables I want to pass are not number or string. Thank you @little raptor

little raptor
#

BTW, a workaround to the first issue is to use global vars

#
[_grp, 2] setWaypointScript "somescript.sqf [VAR1, VAR2]";
#

or maybe vehicle var names

velvet spoke
#

And what is the better solution in your opinion?

little raptor
#

What kind of variables do you want to pass to the script?

#

array, object, string, number, etc.?

velvet spoke
#

An object resulting of createVehicle

little raptor
#

use:

object setVehicleVarName "SomeName";

and then:

[_grp, 2] setWaypointScript "somescript.sqf SomeName";
velvet spoke
#

Thank you @little raptor and if I may ask, what does the 2 mean in the brackets? [_grp, 2] ...?

little raptor
#

waypoint ID

#

It is the same as what you receive when you use addWaypoint

#

Waypoints are in format:
[grp, Index]

velvet spoke
#

Ahh I see, thank you πŸ™‚

little raptor
#

you could simply say:

_waypoint setWaypointScript "somescript.sqf SomeName";
velvet spoke
#

Thatβ€˜s more convenient

little raptor
#

also, if you use a vehicle var name, there's no need to pass it to the script anymore. You can simply use that variable inside the script.

_veh = SomeName;
#

you can also use a global variable instead

velvet spoke
#

So if I use object setVehicleVarName β€žSomeNameβ€œ, I can simply use _wp addWaypointScript β€žsomeScript.sqfβ€œ?

little raptor
#

yes. you can use the variable inside the script itself

#

this is true about all global vars

velvet spoke
#

I see, thank you @little raptor πŸ™‚

cold cloak
#

What script would make my AI Heli exfil leave once all units that are alive from the playable squad are in the chopper

little raptor
#
_units findIf {
!(_x in _chopper)
} == -1
cold cloak
#

Um

#

How do I exatly use that?

#

Im not really good at scripting

little raptor
#

is this a SP mission?

cold cloak
#

SP/COOP

#

either AI teammates or humans

little raptor
#

Something like:

_landPad = createVehicle ["Land_HelipadEmpty_F", _landPos];

_chopper land "GET OUT";

waitUntil {
sleep 1;
_units findIf {!(_x in _chopper)} == -1
};

_chopper land "NONE"; //take off

Depending on how this is set up, there are better alternatives tho

_units is the list of units. For example, for player's squad:

_units = units group player;
cold cloak
#

So if my group has 6 units, p1, p2 etc

#

and the group is named Razor

#

how would I input it into the script

little raptor
#

How do you want to set up the mission?

#

waypoints? triggers? How (and when) do you want to call in the chopper?

#

Did you try using supports? (heli transport module)

cold cloak
#

Triggers

#

@little raptor It should acticated when a task5d is triggered (move task)

little raptor
#

task5d is a trigger?

cold cloak
#

yes

little raptor
#

Assuming that the landing pos is the same as the trigger pos, you can put this in the trigger activation statement:

_WP = (group MY_HELI) addWaypoint [getPosASL thisTrigger, -1];

_WP setWaypointStatements ["true", "[] execVM 'land.sqf'"];

And create a file called "land.sqf" in the mission file. Put this in it:

_landPad = createVehicle ["Land_HelipadEmpty_F",  ASLtoAGL getPosASL task5d];

MY_HELI land "GET OUT";

waitUntil {
sleep 1;
units group player findIf {alive _x && !(_x in MY_HELI )} == -1
};
deleteVehicle _landPad;
MY_HELI land "NONE"; //take off

MY_HELI is the name of the heli.

cold cloak
#

aigh thanks

#

But what does the heli do in the background? Currently I got it only to stay landed for 30 s

#

when the trigger is activated it enables the simulation for the Hiey

little raptor
#

nothing

#

It doesn't do anything after takeoff either

#

It's up to you

cold cloak
#

ag

#

ah thanks

little raptor
#
  • updated the code
cold cloak
#

😎 πŸ‘

digital plover
#

Is it possible to call a "another.sqf" from the mod file?
Example: ExileTraderObjects.sqf
@MyOwnMod>Addons>server.pbo

#

P Drive Path: P:\RD\RD_Client\data\Traders\NPCs\ExileTraderObjects.sqf

exotic flax
#

Use the CfgFunctions, execVM, or any of the many other methods

digital plover
#

i use execVM code

#

but not show in the server

#

i use code:
0 execVM "RD\RD_Client\data\Traders\NPCs\ExileTraders.sqf";

#

Correct ?

#

initPlayerLocal.sqf:

// Static Objects
///////////////////////////////////////////////////////////////////////////////

// Taken away for now
//#include "initServer.sqf"

if (!hasInterface || isServer) exitWith {};
0 call compileFinal preprocessFileLineNumbers "MarXet\MarXet_Init.sqf";

// NPC Traders
0 execVM "RD\RD_Client\data\Traders\NPCs\Master.sqf";
0 execVM "RD\RD_Client\data\Traders\NPCs\ExileTraders.sqf";

//StatusBar
0 execVM "ClientCode\StatusBar\StatusBar.sqf";```
#

I did it that way. did not give an error.
However, the objects did not appear in the game

exotic flax
#
  1. no need to add 0 everywhere, since it won't do anything (unless you need to parse that value to the scripts)
  2. the file paths are relative, so add a \ in front of it
verbal rivet
#

Does anybody know if there's a way to get agents out of "panic" mode (playAction "Panic"), other than switchMove <idle animation>? playAction "" and playAction "Default" don't work

digital plover
#

tried both ways but the vendors didn't come

#

execVM "RD\RD_Client\data\Traders\NPCs\Master.sqf"; and execVM "\RD\RD_Client\data\Traders\NPCs\Master.sqf";

#

@exotic flax

tough abyss
#

I have a beginner's question: What is a way to terminate a globally executed function from debug console?
Eg:
globalvar = [ obj1,scalar1,scalar2 ] execVM "fn_script.sqf";
I figured that redefining the globalvar with incorrect arguments would stop it (and it did). But does the engine have a direct termination function of some sort?

willow hound
tough abyss
#

Thanks @willow hound

mighty cargo
#

So idk if I'd post it in here but I've been thinking about this for a while. The Crysis suit mod gives you the ability to become "invisible" by using the scroll wheel. Would it be possible to make the same thing happen but bind it to a keybind? I've been thinking about making my first mod be something like the Ghost Recon: Future Soldier Optical Camouflage system.

loud python
#

What's a good way to pad a string with 0s?

winter rose
#

toArray, set size, apply I guess?

summer path
#
private _class = switch (getPlayerUID player) do {
    case "7656.....":{"CTRG15"};
    case "7656.....":{"MANW"};
    case "7656.....";
    case "7656.....":{"Curator"};
    default {"CombatPatrol"};
};

[player,_class] call BIS_fnc_setUnitInsignia;

It seems like im not rlly getting it to work. Can somebody help me set up a script giving Insignias to players dependent on the ID , using the ranks from this modhttps://steamcommunity.com/sharedfiles/filedetails/?id=888902496

timid niche
#

Is there a weapon pullout/unholster player evh?

potent depot
#

Hey guys, bit of a complex question:
Got this error:

_prevCount = 0;
{
_curCount = _x;
if (_forEachIndex == 0 || _curCount >
 0:47:06   Error position: <_x;
if (_forEachIndex == 0 || _curCount >
 0:47:06   Error Undefined variable in expression: _x
 0:47:06 File m\mf7\addons\offload\fnc_emergencyDump.sqf..., line 59```

Code structure is as follows(parts omitted ofc):
```sqf
{
    _hcIndex = 0;
    _prevCount = 0;
    {
        _curCount = _x;
        if (_forEachIndex == 0 || _curCount < _prevCount) then {
            _hcIndex = _forEachIndex;
            _prevCount = _curCount;
        };
    } forEach GVAR(HeadlessLocalCounts);
} forEach _groupArray;

Im wondering here as since the code structure seems fine and _x is a magic variable, would this be an error that can be cause by the server struggling? (this is a serverside script)

winter rose
#

check your GVAR(HeadlessLocalCounts)

potent depot
#

how so?

winter rose
#

e.g systemChat

also, the forEach _groupArray doesn't do anything but run the same code multiple times

potent depot
#

this is a snippet ofc there is a lot more to it but I just provided the relevant sections.
Top of the _groupArray loop is as so:

    _groupMoving = _x;
    _lead = leader _groupMoving;
    _size = count (units _groupMoving);
    _leadOwner = owner _lead;
    _vehicle = vehicle _lead;```
winter rose
#

anyway

Error Undefined variable in expression: _x
means that you either have a nil in your array, or that your array is not defined at all

potent depot
#

Well that gives me a start on where my issue is

winter rose
#

debugging is half the fun, innit πŸ˜„

potent depot
#

damn right, now i gotta figure out how it gets a nil in there. I know its initialized so its likely something to do with the disconnect EH. This is a script that runs if a HC drops.

winter rose
#

you are not editing the array as you go through it?

potent depot
#

im using set to update the values in it as it stores one element per HC. The only instance where it changes the number of elements is if a HC connects or disconnects

#

GVAR(HeadlessLocalCounts) set [_hcIndex, (GVAR(HeadlessLocalCounts) select _hcIndex) + _size]; the update

tough abyss
#

Is someone german here?

worn forge
#

Any way to configure what gets output in the .rpt? I think this is an engine-level request. About 95% of my server .rpt is filled with
2020/10/05, 21:22:10 Server: Object 2:4133 not found (message Type_113)
... and if I could ask the server to restrict my .rpt to script errors that would make my life muuuch easier.

queen cargo
#

Only nil in array @winter rose
Foreach is iterating so the array is existing

#

@tough abyss plenty of people are german here

potent depot
#

I dont think you can configure the .rpt. Its only on/off I believe. Someone may know something I dont though.

winter rose
#

i iz tired oki? πŸ˜„

potent depot
#

lel, its all good. I know that

#

its just figuring out why its getting a nil in there

queen cargo
#

@worn forge there are Tools out there to Filter rpt log Files

worn forge
#

Yeah, I just run regex search/replace on a bunch of different stuff in the rpt

queen cargo
#

@potent depot you got the nil somewhere in the array
So you need to check the places where you mosfiy your array

worn forge
#

But I don't need the server to be spending the time to output stuff I don't care about, y'know?

queen cargo
#

Then the only way is to indeed Shut it off

#

Or, Mount that Part in some RAM disk, given that you got enough place
Rpt log though should not eat up that much of Performance
Maybe someone from bi will hear your call tho πŸ€·β€β™‚οΈπŸ€·β€β™‚οΈπŸ€ͺπŸ€ͺ

potent depot
#

I dont believe there is really any way for set to swap out a element for nil unless i specifically tell it to set nil right?

worn forge
#

array set [1, nil]

potent depot
#

exactly

ebon citrus
#

just asking out of bad memory, was it possible to display a control or control elements on a hiddenselection of an object, let's say a laptop?

potent depot
#

Nica, explain?

worn forge
#

Zulu why would you want to do it any other way?

ebon citrus
#

what do you mena explain?

#

πŸ˜…

potent depot
#

Ryko, I meant as unless i did set [1, nil] it wont set it to nil. Mine do not do so at any point

ebon citrus
#

was there an engine side way to display a control (dialog, UI-element, etc.) on a computer screen (which accepts setTexture)

queen cargo
#

@potent depot if your variable is nil, that you use in Set, then you do exactly that

potent depot
#

Nica, you want to display a ui control on a laptop?

queen cargo
#

Promise you that you did not found some edge case in which sqf fails here

ebon citrus
#

i dont know how that wasnt evident from the first question, but yes

queen cargo
#

If you render that object inside of the gui, yes

potent depot
#

@queen cargo yeah im not assuming so. Im just confirming that as my set is used as so:
GVAR(HeadlessLocalCounts) set [_forEachIndex, (count (allUnits select { owner _x == _HCid }))];
its likely not my use of set but somewhere else

queen cargo
#

If you render it in the game World, no

ebon citrus
#

ok, alright

worn forge
#

if you resize the array it will populate it with nil values

#
myArray resize 4;```  [nil, nil, nil, nil]
queen cargo
#

Another possible thing

#

Tldr: there are plenty spots this could have gone wrong

potent depot
#

yeah its why im diving into the only 2 portions of my code where it changes the number of elements in that array

ebon citrus
#

Hit EH triggers on the machine where the EH is defined in or on the machine where the target of the EH is local?

winter rose
#

Both

ebon citrus
#

gotcha

winter rose
#

Well, condition A and condition B

ebon citrus
#

True

#

XD

#

wouldve been a valid answer, but not so helpful

#

human language doesnt always match with programming

exotic flax
#

if statement then do this
can't make it easier πŸ€·β€β™‚οΈ

ebon citrus
#

in human language, what i asked would probably translate to a sort of switch-case

#

well, a switch case would suffice in this, since i foremost wanted to know if it executes on the client that defines it

potent depot
#

deleteAt removes an element and resizes the array correct?

robust hollow
#

yes

#
_a = [0,1,2,3];
_a deleteAt 1;
_a // [0,2,3]
potent depot
#

hmm, I have no idea how the hell im getting a nil value in my array

robust hollow
#

can you paste a code snippet to show what you're doing?

potent depot
#

Its an entire HC system so that isnt really possible as the code is spread across about 7 different file/functions. Its fine, I know what the issue is and have an idea on where the cause is. Though, atm I need to determine if the issue isnt due to something external from the code as it seems to be related to HCs disconnecting/connecting which can modify my array while its in the middle of a loop.

winter rose
#

Yes, you should have only one entry point for edition, ideally. That and/or make a copy when iterating, and/or doing _arr = _arr select { not isNil "_x" } or something (ugly)

robust hollow
#

_arr = _arr - [nil];

winter rose
#

every time you correct me, I feel that avatar πŸ˜„

robust hollow
#

😦 just tested, it doesnt work

#

now i feel the 🀦

winter rose
#

I'm in bed, I can blame exhaustion

potent depot
#

yeah this is an interesting issue for me though I have limited data to work with atm(still being funnelled to me). We had the HCs crash and disconnect/connect multiple times which is something that it seems the system cant handle very well. So gotta figure out how I can reinforce it against such an occurence

#

Its just gonna be a lot of going over all of it. The copying arrays idea isnt too bad I just gotta check and see if it could potentially cause problems.

#

Only place I could think it would is the disconnect failover

ebon citrus
#

What's the appropriate method of checking whether a cutrsc has already been initialised/is showing?

robust hollow
#

personally I'd have the display set itself to a uinamespace variable during onload and then check if that is null.

torpid quartz
#

Is there a way to boost a vechile's speed when they run over a trigger?

#

(Trying to make a loop da loop for a go-kart race)

#

Basically a Mario kart boost lol.

little raptor
#

Is there a way to boost a vechile's speed when they run over a trigger?
(Trying to make a loop da loop for a go-kart race)
No
personally I'd have the display set itself to a uinamespace variable during onload and then check if that is null.
Yeah this is the only way

torpid quartz
#

So slapping on setVelocity[50,0,0] doesn't just launch it forward a bunch?

little raptor
#

It does but you can't really apply it for too long to get a boost

#

Plus it you want the vehicle to move forward, it is;

_veh setVelocityModelSpace [0,50,0]
torpid quartz
#

Yeah it just needs like, to be thrown forward enough to get it to fly around a loop. Not a prolonged boost or anything.

#

Ill do some tests a bit later

#

It doesn't matter if the player has any control, or it flips over. I just need it to get pegged forward really hard.

#

It's more of a joke thing than a serious race.

little raptor
#

You can get an awkward boost if you do this:

onEachFrame {vehicle player setVelocityModelSpace [0,50,-5]}
#

But the vehicle isn't really controllable

torpid quartz
#

Hopefully the walls keep from flying out lol. Thanks ill give that a go.

little raptor
#

this is better:

onEachFrame {
_veh = vehicle player;
if (isTouchingGround _veh) then {
_v = _veh vectorModelToWorld [0,50,0];
_veh setVelocity (_v vectorAdd [0,0,-5])
}
}
torpid quartz
#

How would I get the name of the player that activated the trigger and print it into this?
endTime = time - startTime;
titleText [format ["Winner's lap time%1", endTime, ], "PLAIN"];

#

tried putting in _caller a few ways but I'm only getting errors

winter rose
#

_caller is not a thing 🀨

#

thislist returns the list of units at the check time, but mind there might be multiple results at the same moment

warm hedge
#

Also, if there's no data after a , will throw an error

torpid quartz
#

how about?
endTime = time - startTime; _playerCalling = name vehicle player; titleText [format ["_playerCalling Mission time%1", endTime], "PLAIN"];

#

just not sure how to make _playerCalling be read as the variable lol

#

ok yeah this works. just don't know how to get it to read both "mission time", endTime, and _playerCalling all in the same line.

endTime = time - startTime;
_playerCalling = name vehicle player;
titleText [format [" Mission time%1", _playerCalling], "PLAIN"];

warm hedge
#

format can take more than 1 argument and can be used as %1, %2, %3, ... %n

torpid quartz
#

ah right, i'll try that

torpid quartz
#

yup this worked

endTime = time - startTime; _playerCalling = name vehicle player; titleText [format ["Winner %2 %1 ",endTime, _playerCalling], "PLAIN"];

winter rose
#

sure, it will show all the players their own name

unique sundial
#

@torpid quartz trigger is checking its condition every 0.5 sec, hardly suitable for competitive timing

#

plus it doesn’t have an option to return first entity that triggered it

little raptor
#

Isn't the first element in thisList the one that triggered it first? (except if multiple entities triggered it at the same time)

winter rose
#

wat

little raptor
#

list trigger

winter rose
#

I believe the list doesn't list "who arrived first" as it is an instant check

#

it's just "who is in my area right now"

little raptor
#

I think it pushes the entities back to the list

#

As they get in

winter rose
#

and I think not. FIGHT!

little raptor
winter rose
#

a trigger doesn't "always check" then give its results every half second; it does a check every half second, and if there are units they are added to the result list, I think that's it

unique sundial
#

I think it pushes the entities back to the list
@little raptor no

little raptor
#

oknotlikemeowcry

unique sundial
#

it collects entities from global entity list which could have any order

torpid quartz
#

is there a better way of setting up something that will just tell me who entered a trigger first for a race?
I'd use the racing modules but there isn't any documentation and I haven't found a way to get them to work.

winter rose
#

inArea?

little raptor
#

or just plain distance

#

if it's circular

torpid quartz
#

it's just a small box trigger that's in-between the two poles of the finish line prop.

#

hmm

little raptor
#
_unit inArea trigger
torpid quartz
#

yeah i'm reading through it's wiki right now just figuring it out

little raptor
#

You can find the list of units that have triggered the trigger using:

_units inAreaArray trigger
unique sundial
#

you can create large trigger, set frequency interval on it higher than every 0.5s set it to trigger once then once it is triggered go through the list of entities provided and check which one is the closest to the center of the trigger

torpid quartz
#

I'll see what i can do

little raptor
#

larger trigger activation statement:

onEachFrame {
    _units = list largerTrigger inAreaArray smallerTrigger;
    if (count _units > 0) then {
        _units = _units apply {[_x distance smallerTrigger, _x]};
        _units sort true;
        _firstUnit = _units#0#1;
        onEachFrame "";
        //optionally disable/delete trigger afterwards
    }
}

deactivation:

onEachFrame ""
ebon citrus
#

is it intended behaviour that a shooting target is broken by small arms gunfire?

#

@little raptor i dont know, but i've been told...

Missioneventhandler is better for this

little raptor
#

Yes

#

This is for testing

ebon citrus
#

oh yeah

#

sorry, my bad

#

i just sort of dropped in here with my feverish ramblings

torpid quartz
#

you'd think there would be an easier way to set up a race when the game has a go-kart racing dlc lol.

little raptor
#

is it intended behaviour that a shooting target is broken by small arms gunfire?
What do you mean broken?

ebon citrus
#

as in dammage 1

little raptor
#

and which target?

ebon citrus
#

simple target

little raptor
#

I'm not sure, but isn't it possible to add a handleDamage event handler to it or something?

#

To make damages smaller

#

And make it survive longer?

ebon citrus
#

im just healing it once in a while now

#

but seems a bit silly

little raptor
#

if by "once in a while" you mean loop, why not just use the event handler instead?

#

It's faster

ebon citrus
#

i am

#

but it's "once in a while" in the sense that it's being healed every round it needs to be used

#

each round is about 5 shots

#

it's just that 60~ rounds from a 5.56 takes it down

torpid quartz
#

@little raptor So i make two triggers, smallerTrigger and largerTrigger, smaller trigger more towards the end of the finish area to so it's more likely to pick the person that end through first since they'll be the furthest in?

#

nvm found another way that looks good.

little raptor
#

For a karting car that moves at 20 m/s, given the trigger interval of 0.5s, the larger trigger radius must be larger than 10m for the trigger to activate in time.
The larger trigger centers around the smaller trigger.

#

The smaller trigger doesn't need any activation condition.

#

In fact, you only need its area.

torpid quartz
#

ah so yeah only the two triggers, and to get the winner I only need to put _firstUnit as thing variable which will have the winners name in it?

timid niche
#

Hey there anyone able to help me out with this?

#

Is there a weapon pullout/unholster player evh?

winter rose
timid niche
#

Wouldn't that be fairly bad performance wise

#

Not that I know of a better way

winter rose
#

the selected weapon not great
the animation event handler, not really

ebon citrus
#

some code-fu maybe, but not a direct EH as far as i see

#

2.0 PLZ

warm blaze
#

hot to disable bot movement order when simply left click on map and action menu is not showing ?

little raptor
#

Use the event handler variant

warm blaze
#

thanks

potent depot
#

Does sqf have any equivalent to say C's continue? (It just skips to next iteration of loop)

winter rose
#

nope, unfortunately. break, yes

#

so wrap with an if

potent depot
#

yeah seems thats waht Im gonna have to do

winter rose
#

that or (a bit ugly) call { if (condition) exitWith {} } additional scope ^^"

#

(seen done in some BIS functions)

potent depot
#

wouldnt that just put it right back to where it is in the greater scope?

#

as your exiting from the call?

little raptor
#

It is possible to do:

#define SKIP (_i = _i + 1)
for "_i" from _start to _end do {
if (_i == 5) then {SKIP}
}
#

Does essentially the same thing as continue

dire topaz
#

does anyone know how to force ai to fire during animation, forceweaponfire doesnt work and i need them to do full auto

potent depot
#

Thats what he told me and I was hoping to avoid doing a if statement around the entire thing

little raptor
#

You still need an if statement for continue in C don't you?

dire topaz
#

doesnt look like it will work

potent depot
#

Yes, its more for cleanlyness of code

little raptor
#

@dire topaz forceWeaponFire works in all states (even if weapon is on back)

dire topaz
#

you cant change any value tho

#

so its always semi auto

little raptor
#

Yes you can

dire topaz
#

ive literally just tried

little raptor
#

use fire instead

dire topaz
#

tried that too

little raptor
#

I know for a fact that fire works

dire topaz
#

just tried, doesnt

little raptor
#

So does forceWeaponFire

#

how do you use it

potent depot
#

do you have the correct muzzle?

dire topaz
#

yeah forceweaponfire works for semi auto

#

but nothing else

potent depot
#

show your code snippet

dire topaz
#

k gimme a sec

little raptor
#

For both you need to call the function every frame

#

That's why you can't do full auto

#

You're calling it only once aren't you?

#

That's like clicking on the mouse and letting go

dire topaz
#

e3 forceWeaponFire [weaponState e3 select 1, weaponState e3 select 2];

little raptor
#

You don't get full auto like that

dire topaz
#

only way i can get it to work

little raptor
#
onEachFrame {
AI forceWeaponFire ["muzzle", "mode"];
}
dire topaz
#

wait is that it?

#

like the code i need to use

little raptor
#

It is better to use the stacked version of onEachFrame

#

Other than that yes

dire topaz
#

ah ok i will try ty

potent depot
#

for you it would probably be:

onEachFrame {
  e3 forceWeaponFire [weaponState e3 select 1, "FullAuto"];
}```
#

that said, look at the documentation for the parameters

dire topaz
#

will do ty

potent depot
#

keep in mind that onEachFrame will keep them firing forever you will need to make it break out of it when you want it to stop

little raptor
#

Another alternative to onEachFrame is FiredMan event handler

dire topaz
#

yeah how do i do that? it works tho so ty

little raptor
#

just remove the event handler

#

or use a condition

dire topaz
#

i meant making the break as zulu said

little raptor
#

that's also what I said

dire topaz
#

oh ok

potent depot
dire topaz
#

ahh okay cheers guys

little raptor
#

At any rate, the firedman event handler is cleaner

#

And faster

potent depot
#

not familiar with that one. Got a link to it?

#

nvm got it

little raptor
#

You call the forceWeaponFire after the last bullet is fired

potent depot
#

true, but then how do you stop it?

little raptor
#

Remove it like before

#

Or use a condition in it:

if (_unitMustFire) then {}
potent depot
#

I wouldn't suggest the condition route as itll leave a constant check there that doesnt need to be. But yeah you can set it up in the same was as ive described the missionEventHandlers. Pick your poison.

little raptor
#

nvm

#

I think there should be more delay to fire the next shot

#

So this method won't work

potent depot
#

wouldnt that just be a case of writing in a delay?

#

EHs are spawned I believe

little raptor
#

no

#

They are unscheduled

astral dawn
#

scheduled EH would make no sense because some EHs return a value to engine, and engine needs this value now

smoky verge
#

can you disable the roadway like you do with collision?

little raptor
#

no

smoky verge
#

: (
thanks

still forum
#

Rpt log though should not eat up that much of Performance
it does, WIP tho

Does sqf have any equivalent to say C's continue? (It just skips to next iteration of loop)
Stop reading my mind while I'm not even online @potent depot ...

winter rose
#

:3

little raptor
potent depot
#

@still forum as per usual, you've already got something in the works ❀️

queen cargo
#

So apply etc. Now get a default scopename finally?

still forum
#

had the idea how to solve it last week. Just started implementing a couple hours ago

queen cargo
#

I guess you stopping writing means no

#

And the actual solution was more complex πŸ€”πŸ˜‚

still forum
#

no?

#

why scopename?

#

I'll probably implement a forEachIndex kinda command too, that works in every loop type. So you can get your index in apply/count/findIf too

queen cargo
#

Existing System
Already Was emulatable using break to and breakout

still forum
#

doing it with a scopeName and breakTo would've been way more complex

#

me stopping writing is because I have 5KB/s internet speed and discord is taking its time

queen cargo
#

Okay πŸ€”πŸ€·β€β™‚οΈ

#

Hyped to implement it into sqc

#

Thoooo
Breakwith reads kinda weird πŸ˜…πŸ˜‚

ebon citrus
#

it seems Hit EH is only executed on the machine where the target unit is local

near talon
#

Hello

#

How can I fix
Error Undefined variable in expression: _civclasses

winter rose
#

define the variable ^^

near talon
#

Well I'm new to that, basically I use alive to generate missions and whenever I enter town where civilians should be and some suicide bombers it prompts me with that

#

So what should I do or google?

winter rose
#

ah well, I don't know Alive sorry

cold mica
#

Hello again, wonderful people.

I got a simple one: I have a broadcast message I am playing using the playSound3D command. Is there a way to add echo to the sound?

winter rose
#

nope, beside editing the sound

cold mica
#

Affirmative, good thing I got a sound designer on the case.

winter rose
#

Audacity, Reverb, ??, profit :p

cold mica
#

that's probably what they will do anyways, lol.

fair drum
#

doStop still lets units receive targeting and attack commands from the leader correct? it just ignores movement commands?

digital plover
#

Hi.. I want my own image on this blank sign. http://prntscr.com/uudf57 and I want to put this in my own mod file. I want to make the classname Methlow_Sign. How can i do it?

ebon citrus
#

define a class Methlow_Sign that inherits Land_Billboard_F and set the INIT eventhandler to set the texture to your picture. Alternatively, you can set the texture using hiddenselections in the config. This is preferred whenever possible.

for more information, ask on #arma3_config @digital plover

#

but you dont need a mod for this if you dont really have to

#

simply setObjectTexture/SetObjectTextureGlobal will do

sharp grotto
exotic flax
#

you could remove the vehicle, and respawn it (somewhere far away from water)

sharp grotto
#

thats not an option for our mission type

exotic flax
#

the moment a vehicle drowned it will stay like that, afaik it's not reversible since it's engine based, not scripted

sharp grotto
#

What a bummer. Thanks for the info πŸ‘Œ

#

in the case of the boat the engine is still working. just impossible to control it

thorn cape
#

Hi! I tried to synchronize CreateTask module with the player in MP.

[player, [task]] remoteExec ["synchronizeObjectsAdd", 0, true];

But it wouldn't work (I test a game like a host, not dedicated server). Anybody know - It would work and I've to try this on a dedicated server or it's impossible to synchronize task module with the player during MP game?

little raptor
#

Why don't you just use the task functions?

cold cloak
#

@little raptor About the script you helped me with, how do I reverse it so heli takes off once everyone is out

little raptor
#

reverse the condition

cold cloak
#

And wich is?

#

wait

little raptor
#

what was the script?

cold cloak
#

Wait

#

Assuming that the landing pos is the same as the trigger pos, you can put this in the trigger activation statement:

_WP = (group MY_HELI) addWaypoint [getPosASL thisTrigger, -1];

_WP setWaypointStatements ["true", "[] execVM 'land.sqf'"];

And create a file called "land.sqf" in the mission file. Put this in it:

_landPad = createVehicle ["Land_HelipadEmpty_F",  ASLtoAGL getPosASL task5d];

MY_HELI land "GET OUT";

waitUntil {
sleep 1;
units group player findIf {alive _x && !(_x in MY_HELI )} == -1
};
deleteVehicle _landPad;
MY_HELI land "NONE"; //take off

MY_HELI is the name of the heli.
@little raptor

little raptor
#
units group player findIf {alive _x && (_x in MY_HELI )} == -1
cold cloak
#

Yeah?

#

so what do i change with that

thorn cape
#

@little raptor It's works, I create and assign task by function, thank you. )

vague geode
#

Is there any way to find out whether a player disconnected "normally" or got kicked/lost connection etc. e.g. with the HandleDisconnect or PlayerDisconnected-event handler?

robust hollow
#

i used to have a script that kind of achieved that. i dont remember exactly, but i think it did a setvariable to the server with a players info when they clicked abort, and then a handledisconnect eh would check for that variable.

vague geode
#

Does anyone know how the numbers get on the UCAV Sentinel ("B_UAV_05_F")? I was looking at the textures (hiddenSelectionsTextures) but there were no numbers on it but in the game files is a folder with numbers for the UCAV but I could also not find the path to them anywhere in the CfgVehicles...

winter rose
#

tried to set license plate number?

vague geode
#

I wasn't aware that that was even an option. How would I do that?

#

Ah, ok. Found the setPlateNumber command. I will try that.

round scroll
#

just updated to RC 200 - https://forums.bohemia.net/forums/topic/183855-release-candidate-branch-announcements/?do=findComment&comment=3418714 mentions Added: Many new script commands Is there any chance to see those on the wiki?

little raptor
#

That's about all of them

austere granite
#

@still forum pls

compact wyvern
#

how can i check if player enters water?

#

im trying to write a script to spawn in sharks in the water near a player

still forum
#

@austere granite why ping

#

@compact wyvern quite sure there is a isSwimming command or similar

compact wyvern
#

oh sweet

#

lemme check the script list

#

only related swim i found is

#

swimInDepth

#

theres

#

this

#

_isWater = surfaceIsWater position player;

still forum
#

but thats expensive. I thought there's an easier way

compact wyvern
#

i cant find an easier way

#

is water would work but a constant check of surface would kill xD

still forum
queen cargo
#

Um Wut?

austere granite
#

makes sense

queen cargo
#

Ohh
It is actually an equal sign

#

Looks heavily like - on my Android phone

simple hemlock
#

Hey all! quick question - I've been trying to get an object in one mission to launch another mission using the serverCommand script

to the object i've done a simple addAction that fires a sqf
the sqf simply has

#mission mission.malden "Custom";

#

actually - belay that

#

I might have solved it! Would welcome any insight in the meantime

robust hollow
winter rose
#

I've been trying to get an object in one mission to launch another mission using the serverCommand script
? ^^

simple hemlock
#

ah, hold up I posed it wrong the sqf is

serverCommand "#mission mission.malden Custom";

robust hollow
#

is there a log in the rpt when you attempt this to say why it hasnt worked?

simple hemlock
#

just having a browse

robust hollow
#

im not 100% sure, but you may need to use the alt syntax where it executes on the server with password serverCommand command

simple hemlock
#

i have put my server password (in ""s) in, and not having any luck

robust hollow
#

are you the host or is the mission running on a dedicated server?

simple hemlock
#

running on dedicated

#

haha gotta upload the pbo each time πŸ˜… thought i'd sanity check on here in case I was doing something drastically wrong

winter rose
#

that or maybe use filepatching

robust hollow
#

serverCommand with a password needs to execute on the server. addaction would be executing on your client. so you need to remoteexec to the server before executing it.

simple hemlock
#

ohh, that makes a lot of sense

#

thank you

obtuse sigil
#

anyone know of a way to reliably detect which pylon is assigned to which turret on a vehicle? ie. which pylons are assigned for pilot and which are for gunner

obtuse sigil
#

that's not 100% reliable though.. if all pylons have the same weapon, it cannot determine which pylon is on which turret

#

already tried that

cold glacier
#

@obtuse sigil - Have you tried checking CfgVehicles >> [Vehicle name] >> Components >> TransportPylonsComponent >> Pylons >> [Pylon name] >> turret?

#

I believe that handles pylon assignment.

obtuse sigil
#

you are correct.. but what if the turrets have changed dynamically in a mission?

cold glacier
#

Can you clarify what you mean @obtuse sigil? I can't think of a way turrets can change dynamically.

exotic flax
#

afaik you can't change the turret (pilot, co-pilot, crew, passenger), but you can change which weapons are available for a turret.
However the pylons only define which weapons/ammo are available, not to which turret they belong.

obtuse sigil
#

in the dynamic loadout section if you have a gunner and a pilot (mostly just helicopters) you can choose which pylon is assigned to which turret (technically pilot or gunner, but there can be more turrets) so yes, I can use that config entry to read the default setting of the pylons, but the turret can change either by scripting inside a mission or by just making a custom loadout in the editor.. and after that it's anybodys guess which pylon is part of which turret.

#

and especially if the pylons change inside a mission with scripting, with for example a loadout manager

exotic flax
#

setPylonLoadout is how it is set (pylon, magazine and turret), but there is no getPylonLoadout or similar.
So unless those scripts store it somewhere themselves you can't know for sure

obtuse sigil
#

I did make a feature request in the feedback tracker to possibly expand the getPylonMagazines command with an optional extra boolean to return the turret each magazine is assigned to or get a new command for the turret readouts..

hollow thistle
#

The ace function is as good as you can get it right now. There should be a getter.

#

But there's none right row.

digital plover
#

I've been trying to call an sqf file from @MyOwnServerMod file for two days. However, I was not successful.
I am adding these codes into the initServer.sqf.

execVM "RD\RD_Client\data\Traders\NPCs\BMCapeZefyrisTraderObjects.sqf"```
I tried both ways but again it doesn't deol.
obtuse sigil
#

the path is the same as on your P: drive with @MyOwnServerMod

#

on my P-drive I have P:\MyMod\Flags\flagtexture.paa to use that ingame the path is "\MyMod\Flags\flagtexture.paa"

digital plover
obtuse sigil
#

and that is the version you pack and use in the server? have you checked your server .rpt if there are any errors in running the script itself?

#

are trying to run this on a local machine, because initServer wont run if you run it in singleplayer

digital plover
obtuse sigil
#

too much stuff in your RPT and something is broken badly

#

simplify your stuff first

#

make a mission where the only thing you do is run that script, dont matter if the script doesnt work, just make sure if it runs first at all

#

it is likely that either your script is horribly broken and doesnt produce desired result because of that, or things break before you even get there

#

when you're doing scripting, it's easier to make sure almost one line at a time that things work, not write 1000 line script and hope it will work straight out of the box

#

especially when you're making very complicated stuff

grave torrent
#

@digital plover head over to the exile discord and get help with your create vehicle errors.

digital plover
#

Any other serious errors with my RPT file?

#

Please review

obtuse sigil
#

you are assuming you're not successful in running your script, but your script might start to run, but have for instance logic errors in it that don't work, even when there is no syntax errors in it

#

to track if your script is working, add a bunch of diag_log entries inside your loops or if-statements to see your script is actually doing what you want it to do

#

n e v e r assume your code works, if you cant verify it with diag_logs or hints or whatever indicators, your only assumption should be that it's not doing what you think it should do

#

assumption is the mother of all f ups

digital plover
#

I guess I don't know that much. I guess I'm a little confused πŸ™‚

obtuse sigil
#

for instance, put diag_log "METHLOW: SCRIPT STARTED"; in the first line of BMCapeZefyrisTraderObjects.sqf

digital plover
#

ah ok. i try now

obtuse sigil
#

remember to re-pack your addon, put it on your server, run your server and check if it says METHLOW: SCRIPT STARTED anywhere in your RPT

digital plover
#

ok i try

obtuse sigil
#

if your script runs, but it doesnt do what you think it should do, your problem lies elsewhere

grave torrent
#

just copy the objects into the initserver.cfg in private vehicles

#

or include the file path in that section

digital plover
#

I discovered something strange