#arma3_scripting

1 messages ยท Page 767 of 1

little raptor
#

Depends how you want to use them

#

If the indices matter you must be careful

#

You can just use the original array

elfin comet
#

oh yea, since yours turns it local.

little raptor
#

That's why I said be careful

#

Well no I didn't say it for that reason meowsweats
But yeah you should be careful so you don't overwrite the original array by reference

elfin comet
#

well, it copies it to a variable local to this specific script, right? thus not working with the original.

(Advice is heeded nonetheless.)

little raptor
#

It copies the reference (pointer)

elfin comet
#

Ah.

little raptor
#

What I wrote is correct because operator - makes a new array

#

But if you use deleteAt you'll end up modifying the global array

elfin comet
#

_localThing = originalThing; Still the original, just easier to reference.

little raptor
#

Yeah. But in my case I also wanted to copy it

#

When I used - it became a copy

elfin comet
#

I see

copper raven
#

there is some extdb setting that adds quotes properly, don't remember what exactly

little raptor
#

I guess indices do matter don't they?

elfin comet
# little raptor I guess indices do matter don't they?

My method is based on a mission I made previously (with quite a bit of assistance from you lads), where indicies did matter. This time they don't. The main requirement is that each point has one group spawn at it. Outside of that, I just have to keep the original array intact (all points are available per spawn wave).

little raptor
#

if so:

_point1 = floor random count pointPool;
_point2 = floor random (count pointPool - 1);
_point3 = floor random (count pointPool - 2);
if (_point3 >= _point2) then {
  if (_point3 >= _point1) then {_point3 = _point3 + 1;};
  _point3 = _point3 + 1;
};
if (_point2 >= _point1) then {_point2 = _point2 + 1;};
elfin comet
#

Wouldn't that be an out of index situation if point 1 or 2 are the last one in pointPool?

little raptor
#

idk what you mean

#

the algorithm itself is correct

#

as far as I see

elfin comet
#

I'm probably mis-reading it then.

little raptor
elfin comet
#

When I get around to working on it again, I'll still probably be sure to test that. But yea, the logic is sound AquaThumbUp

deep loom
#

So this is probably a stupid question but what's the purpose for putting an underscore at the beginning of your variables?

copper raven
winter rose
deep loom
tranquil jasper
#

That page could use some clarification maybe and update. private is now able to do same-line assignment, now making it merely as good as normal variable creation in any other programming language ๐Ÿ˜›

winter rose
#

the abovementioned Variables page has a lot of good information, take a look at it and tell us if something needs clarification, the channel is here for you

winter rose
winter rose
tranquil jasper
#

the underscore only denotes that the variable is a local variable, normally this would mean that a variable is only available in the current scope, but in sqf it is the current scope and any subsequent scope. In contrast to a global variable, which is available in any scope once defined, even "separate" scopes such as a spawn or isNil, addAction condition, etc

deep loom
tranquil jasper
#

somewhat yes to your first point, and no to the second that would generally be bad design necessitating that

winter rose
#

sounds like it yes! think of it as SCOPES ๐Ÿ™‚

#

global scope should be used scarcely, the least possible (it's less performant, also it always risks conflict of variable names if not properly prefixed)

#

you can use return values to pass them to other functions, depending on what you do

deep loom
#

So best practice is to handle variables locally at the function level?

tranquil jasper
#

basically use local variables as much as possible; and you might as well make them private too since you can now do same-line assignment it literally takes no extra lines, unless you realyl know what you're doing

little raptor
deep loom
#

Gotcha.

deep loom
#

Is there a way to fire off a trigger when a unit's animation changes? I'm trying to set off an ambush after a hostage is freed. Right now I have a janky area trigger set up but I think a trigger once the hostage animation ends would be more elegant.

winter rose
#

(add a delay if needed though)

#

otherwise, there is the animation event handler that could do

scarlet temple
#

Hope someone can help.
I am using nearentities to get an list of objects within my range, checking its side with an foreach loop and would love to dump every civilian entitie in an list / array. But i cannot append and object to an array.

Any ideas?

scarlet temple
#
  _entities = player nearEntities ["Man",_range]; 
 {
    if (side _x == civilian) then {
            //somehow add object _x to list or array _output
    };
 
 } foreach _entities;
#

i haven't done anything in arma 3 since ages and forgot it... prolly to dump to google

edgy halo
#

pushBack

scarlet temple
#

thank you very much

little raptor
scarlet temple
#

Later for optimisation.

real epoch
#

Why does !local _obj not work in a waitUntil?

Example:
waitUntil {!local _obj || time > _setOwner_time + 1.5};

How can I solve it?

little raptor
#

is your waitUntil scheduled?

#

also is that for Arma 3? or 2?

unique sundial
#

huh? this is Arma 3 discord

real epoch
little raptor
little raptor
real epoch
# little raptor you have to spawn. but I don't see why you're waiting for something to not becom...

The simulation is switched off for the crates so that they cannot move when they are slightly in the air or when they protrude into another base object (wasteland base building system). But when the simulation is turned off, some objects cannot be moved into the player inventory. So i want to make the crate local to the server and then turn on the simulation local. so that the crate doesn't move but the inventory works fine. Or do you have another idea, but according to my first test, this works quite well. thank you

ebon citrus
#

Text is the main class over all Text-type datatypes

#

but if i make my data-type Text -> TEXT, it wont add quotes

#

no matter what i do

#

have this in my init and it wont do:

"extDB3" callExtension "9:ADD_DATABASE_PROTOCOL:Database:SQL:SQL:TEXT";```
#

in my extdb3 log it says
extDB3: SQL: Initialized: Add Quotes around TEXT Datatypes mode: 1

#

but it wont wrap them

#

my text datatypes are naked

#

same for TEXT2

#

just changes mode to 2

#

Yeah, it wont add quotes to my TEXT datatypes

shy whale
#

does anyone have the script to hide hulls on vehicles by any chance?

#

(ping me as im a stupid person and will forget to look here)

open fractal
#

setting the hull texture to "" will make it invisible

shy whale
#

i see

#

ill one day figure this out lol

shadow sapphire
#

Could someone show me a script that guarantees the creation and control of subordinate high command units on a dedicated server with the high commander being a remote client? I need something that works to dissect and reverse engineer.

Locality seems to have wrecked me.

open fractal
#

the number is the index of the part of the vehicle being textured

#

usually for vehicles the options would be 0 through 4

#

so just try different numbers until you get the part you want

shy whale
#

ah

#

thanks ๐Ÿ™‚

#

many things i wana learn with arma so this is one ill figure out

open fractal
#

if you want to do it quick you can open the console in-game, look at the vehicle, and use cursorObject to get the vehicle you're pointing at instead of this in the init

shy whale
#

ya

#

i wanna learn how todo retextures

crude vigil
ebon citrus
#

Yeah, no. No matter how much

"extDB3" callExtension "9:ADD_DATABASE_PROTOCOL:Database:SQL:SQL:TEXT";```
i do, it wont add quotes around text
shadow sapphire
# crude vigil setGroupOwner didnt work I assume

Haha, no, it did not. Not on its own, anyway.

I set up an empty test environment on a dedicated server and just shit into the debug console from a remote client and nothing worked, nothing worked, nothing workedโ€ฆ. And then something did, but I didnโ€™t take a note, and by the time I got my real environment up, Iโ€™d completely forgotten what I did. Unreal.

Also there may be something on the main branch interfering with what I did.

I may just have to try and try again and take more immediate notes.

half hill
#

i need quick help, should be quick fix
i have trigger saying !alive civ
hint "Enemy Down"; marker = createMarker ["death",getpos civ];marker setmarkertype "mil_triangle";marker setmarkersize [1, 1]; marker setMarkerColor "ColorRed"; marker setMarkerText "Enemy Down";
made where marker put on map after their death
how can i reuse this over and over
i tried renaming variable name but it only shows 1 marker not both

tranquil jasper
#

Although I kinda have to agree with lou here that there are simpler ways of going about this

copper raven
elfin comet
#

I'm trying to put objects that have the same prefix in an array that I can reference later.

I was able to find an old line on a forum for the marks and that works

pointPool = allMapMarkers select {toUpper _x find "INF_" >= 0};```
But my attempt at something similar for objects doesn't seem to hold true.
```sqf
reconStuff = allMissionObjects select {toUpper _x find "REC_" >= 0};```
I assume this is just due to differences between markers and objects and if so, how should I go about fixing this so that it works for objects?
granite sky
#

markers are strings so you can do string operations on them.

#

I'm not sure what you're trying to do with the objects here, maybe name _x?

copper raven
#

also use in and not find, you don't need the index

copper raven
flat eagle
#

Right I thought phalanx was a group with players in it. The problem you were having with remote execute was that your not telling it the target

elfin comet
copper raven
#

or what

elfin comet
#

Yes.

copper raven
elfin comet
hallow mortar
#

That code doesn't seem to make sense

elfin comet
hallow mortar
#

You can't just replace different commands in-place. They have different syntax and work in different ways.

#

toUpper vehicleVarName _x is valid. in "REC_" means you're trying to find whether the result of that toUpper is contained in the string "REC_", which I doubt is what you're trying to do. The >= 0 just isn't doing anything except confusing the game.

hallow mortar
elfin comet
little raptor
#

not nular

hallow mortar
#

Yes, the type parameter for allMissionObjects is not optional

coarse dragon
#

How do I set the speed of a jet I spawn and then move to flight altitude.

desert palm
#

Help where do I put the "true" thing, ingame it says error and it should be indicated true or false, can someone help me on what part of this script should the "true" thing be putted in? Thanks in advance

waitUntil {goggles _player in CBRN_AVAIL_GASMASK} 
south swan
desert palm
#

I think so I just need to define the true of false thing, its a mod that is outdated I think

south swan
#

_smth in [array] already returns true or false. If you actually have thing on the left and array on the right.

#

also, do you actually have _player variable defines, or did you mean goggles player?
Because this works exactly as intended: waits for me to put on the respirator and fires the hint: sqf [] spawn { waitUntil {goggles player in ["G_AirPurifyingRespirator_01_F"]}; hint "It's on"; };

little raptor
#

setVelocity for giving it some initial speed

copper raven
coarse dragon
#

Maybe it only works for AI

coarse dragon
copper raven
#

yea ofc, that command will do nothing to players ๐Ÿ˜…

coarse dragon
#

Blah dang jets too fast lol oh well

raw meteor
#

Dose any one know why setting the mass of a heli to somthing lower then when it starts makes it less responsive & adding make it more?

open fractal
#

@coarse dragon

private _newAltitude = 500;
private _pos2D = (getPosASL _plane) select [0,2];
_plane setPosASL (_pos2D + [_newAltitude]);
winter rose
open fractal
winter rose
#

GNIIIIIIIII

open fractal
#

sorry this is bad code

#

_plane is not defined

winter rose
#

yeah, that

coarse dragon
#

I just changed to a A-10

ebon citrus
#

if im not wrong, ```sqf
vectorMagnitude velocityModelSpace player

#

but the number is way too small

#

and it doesnt match with speed player when moving forwards

little raptor
ebon citrus
#

right, you are right

#

so i just multiply by 3,6

#

nope

little raptor
ebon citrus
#

still doesnt match

ebon citrus
little raptor
#

running straight?

ebon citrus
#

yep

#

shift + w

#

nothing else

little raptor
#

well actually no abs

ebon citrus
#

i redid the test by multiplying by the difference

little raptor
#

since speed can also be negative

ebon citrus
#

and found out the difference is 3.6

#

so it's accurate

#

so i returned to multiply by 3.6

#

and now it works

#

strange

#

give me a second

#
3,6 * vectorMagnitude velocityModelSpace player```
is not 
```sqf
3.6 * vectorMagnitude velocityModelSpace player```
#

meowsweats ๐Ÿ”จ

warm coral
#

anyone got a idea of how i could possibly have a magazine that was added with addturretmagazine already loaded?

little raptor
#

no it was something else meowsweats

warm coral
little raptor
warm coral
#

i created a cruise missle shooting rhea anti air and it works fine lmao

#

just the reload time is ass

little raptor
#

idk know if there's a way

warm coral
#

thats a bit of a shame

#

oh well

#

they will have to wait then ig

ebon citrus
warm coral
#

tried that unfortunatly only does it once its been reloaded once

warm coral
#

nope

#

also tried that

ebon citrus
#

Uhhh

#

Works for me

#

Try a combo of laodmagazine and setammo

#

If i remember correctly, you could loadMagazine, setAmmo to 0, then setAmmo where you want it to skip reload

#

And have the magazine be selected in the vehicle weapon

#

Need to check what i did in my script tomorrow

#

I had a script for doing this

warm coral
#

so wait

#

setammo to 0 then setammo to 1 again? ๐Ÿค”

ebon citrus
#

LoadMagazine starts the reload timer

#

SetAmmo to 0 should stop it

#

SetAmmo to 1 should skip it

#

Though need to see what i did

#

I had a trick for this and i dont remember if it was this

#

Ill get back to it tomorrow

warm coral
#

ill try it out ill let you know if it doesnt work

#

sadly dont work

#

so i shall wait till tomorow just ping me if you find it please ^^

pulsar pewter
#

hey! So, this is going to be an easy question (I assume), but I'm trying to write a lil script for triggers; basically, if 6/8 infantry units in a group are dead, the trigger is activated and another QRF squad starts moving. So far, I've done alive checks on each individual infantry unit, then if all are dead, trigger activates.

#

How exactly would I go about saying, basically, If at least 6 dead in group, then activate, in scripting language? ๐Ÿ˜‚

tranquil jasper
#

{alive _x} count (units someUnit) < 3 or you can reverse it to count dead {!alive _x} count (units someUnit) > 5

tranquil jasper
granite sky
#

Counting dead doesn't tend to work because dead units get kicked out of groups after a short time.

#

So you'd want the live < 3 check instead.

tranquil jasper
#

Good catch, I always forget about dead going to civ side

ebon citrus
fleet sand
drifting portal
#

it showed the map when executed locally on every client

#

I used the example code

drifting portal
#

I'm trying to get the waypoints I have assigned to the groups I have placed in Eden editor using:

_Groups = get3DENSelected "group";

_WPs = [];
{
    _SelectedGroupWaypoints = waypoints _x;
    _WPs pushback _SelectedGroupWaypoints;

} forEach _Groups; 

//return:
_WPs;
#

but I'm getting
[[],[],[],[],[],[],[],[],[]]

#

basically each group is giving me an empty array of waypoints despite me already assigning waypoints to them, why is that?

south swan
#

i guess that's because they're not actual waypoints at this point. get3DENConnections _group select {_x isEqualType []} seems to produce the list of connected waypoints, though

drifting portal
#

but I'm wondering how to find the position of a waypoint now

#

because neither waypointPosition or getWPPos give a positions, they just return [0,0,0] for all waypoints

south swan
#

(get3DENSelected "waypoint" select 0) get3DENAttribute "position"?

drifting portal
#

and I ran into another problem,
(get3DENSelected "waypoint" select 0) get3DENAttribute "Type" returns [<null>]

cosmic lichen
#

Are you sure its type?

drifting portal
cosmic lichen
#

Check in config

#

Its either property or data in the attributes config

drifting portal
cosmic lichen
#

Or you check the biki

drifting portal
#

works

cosmic lichen
#

๐Ÿ‘

drifting portal
#

Is this the correct way to filter groups in vehicles from other groups that are selected in eden editor?


_Groups = get3DENSelected "group";
_Vehicles = [];
{
    _index = _foreachindex;
    {

        if (_x != vehicle _x) then {
            _Vehicles pushback (vehicle _x);
            _Groups deleteAt _index;
            break;
        };
        
    } forEach units _x;

} forEach _Groups;
lyric portal
#

Good day. I'm trying to remote exec say3d. An error pops up tho. What did I do wrong?

[m1, ["Turn speakers on", {]] remoteExec ['addAction', 0, m1];
[m1, ["sound",300,1]] remoteExec ['say3D', 0, m1];
}];

[m1, ["Turn speakers off", {]] remoteExec ['addAction', 0, m1];
m1 setDamage [1,false];
}];

[m1, ["Refresh", {]] remoteExec ['setDamage', 0, m1];
m1 setDAmage 0;
}];

little raptor
#

you have so many misplaced {s and I have no idea what you're trying to do here

lyric portal
#

Oh smokes. So basically I have this loudspeaker placed down on the map. I want it to play something. I accomplished it with this and it works

m1 addAction ["Turn speakers on", { 
m1 say3D ["sound",300,1];
}];

m1 addAction ["Turn speakers off", { 
m1 setDamage [1,false];
}];

m1 addAction["Refresh", {
m1 setDAmage 0;
}];

To stop the music I add in set damage 1 and to fix the thing I use set damage 0
So now I have "Turn speakers on" | "Turn speakers off" | "Refresh"

m1 (loudspeaker)
sound (is what I named my sound file)

Now I'm trying to add in remote exec

little raptor
#

e.g.

[m1, ["Turn speakers on", {[m1, ["sound",300,1]] remoteExec ['say3D', 0, m1];}]] remoteExec ['addAction', 0, m1];
#

see the pinned messages

lyric portal
#

Ahh! Thanks a lot Leopard20

drifting portal
#

Or what do I need to tweak?

copper raven
drifting portal
modern meteor
#

Is there a way to check in an IF clause if AUTOTARGET AI is enabled or disabled?

south swan
# drifting portal Anyone knows the correct way?

something like this, maybe ๐Ÿคทโ€โ™‚๏ธ sqf _groups = get3DENSelected "group"; _onFoot = _groups select {count units _x == count (units _x select {isNull objectParent _x})}; _inVehicle = _groups - _onFoot; _vehicles = _inVehicle apply {units _x apply {objectParent _x}}; _vehicles = flatten _vehicles; _vehicles = _vehicles arrayIntersect _vehicles; [_onFoot, _inVehicle, _vehicles]
Performance seems adequate in my limited testing of 5 groups and 1 truck

drifting portal
#

Ignore the performance, just need something working because I will just use this outside of the mission

south swan
#

well, _onFoot = groups that are 100% on foot, _inVehicle = every other group, _vehicles = all the vehicles used by _inVehicle ๐Ÿคทโ€โ™‚๏ธ

copper raven
drifting portal
#

Thanks everyone

modern meteor
#

Perfect, thank you Leopard

cyan dust
#

Why switch statement evaluates all the fall-through cases even if the first one completes the comparison? It's not an expected behaviour
Example: try this in console

_test = [];
switch (true) do {
case ((_test pushBack "1") > -1);
case ((_test pushBack "2") > -1);
case ((_test pushBack "3") > -1):
{_test pushBack "ended"};
};
_test

Expected result: ["1","ended"];
Actual result: ["1","2","3","ended"];

winter rose
#

because that's how switch works

cyan dust
winter rose
#
switch (1) do
{
  case 1:
  case 2:
  case 3:
  {
    Print("works");
  };
};
cyan dust
winter rose
#

"Print"

#

what I mean is that it's going through all, SQF does that, don't do operations in case values then

tranquil jasper
#

switch will fall through when there's no code block for a case

still forum
#

no lou, close but not on it ๐Ÿ˜„

#

: is a binary operator taking code on right, so yours is syntax error :bobcat:

winter rose
#

Iโ€ฆ know

#

there is no Print() in SQF

tranquil jasper
#

oh it needs to be ;

still forum
#

cookiedough, we need cookiedough

tranquil jasper
#

look at example 2 lou

winter rose
#

*ahem*

still forum
#

in SQF switch, the : operator does alot of work

#

If its left side condition is true (or one of the previous conditions was), it executes right side code and jumps out of switch

#

You don't have : operator, so the jumping out check never happens

cyan dust
#

And ; operator works as OR ?

tranquil jasper
#

; is a line terminator

still forum
#

it does literally nothing besides ending the line

cyan dust
#

In switch statement I mean

still forum
#

switch statement is just a SQF code block

#
switch (true) do {
call my_fnc_doStuff;
};
cyan dust
#

Ok, sorry, I can not explain what my problem is.

modern meteor
#

Can someone tell me what I did wrong? It only enables AUTOTARGET but I am not sure why?

  if (_x checkAIFeature "AUTOTARGET") then
  {
    _x disableAI "AUTOTARGET";
    hint "AutoTarget OFF";
  }
  else
  {
    _x enableAI "AUTOTARGET";
    hint "AutoTarget ON";
  }
} forEach (units player select { !isPlayer _x });```
cyan dust
#

Actually, not that it can be resolved, I was asking just in case I 'm missing something. Thank you.

still forum
tranquil jasper
#

oh

#

yeah what dedmen said

still forum
#

specifically executing code via the : operator that is

tranquil jasper
#
_test = [];
switch (true) do {
case ((_test pushBack "1") > -1): {};
case ((_test pushBack "2") > -1): {};
case ((_test pushBack "3") > -1): {};
{_test pushBack "ended"}; //???
};  //????
_test
still forum
#

missing semicolon after {}

tranquil jasper
#

thanks lol

cyan dust
tranquil jasper
#

because fall through........................

south swan
#

it executes every case statement. It's effectively a not-lazy OR,

still forum
#
_test = [];
switch (true) do {
case ((_test pushBack "1") > -1);
case ((_test pushBack "2") > -1);
case ((_test pushBack "3") > -1):
{_test pushBack "ended"};
};
_test

is essentially the same as

_test = [];
call {
if ((_test pushBack "1") > -1);
if ((_test pushBack "2") > -1);
if ((_test pushBack "3") > -1):
{_test pushBack "ended"};
};
_test
#

And now you can see why it executes the pushBacks

cyan dust
#

Got it, thank you

still forum
#

and

_test = [];
switch (true) do {
case ((_test pushBack "1") > -1):{};
case ((_test pushBack "2") > -1):{};
case ((_test pushBack "3") > -1):{}:
{_test pushBack "ended"};
};
_test

would be

_test = [];
call {
if ((_test pushBack "1") > -1) exitWith {};
if ((_test pushBack "2") > -1) exitWith {};
if ((_test pushBack "3") > -1) exitWith {}:
{_test pushBack "ended"};
};
_test
cyan dust
#

And is there an option to make it lazy-evaluation like we do in

if (condition1 || {condition2}) then
south swan
#

but still, don't do side effects in case statements ๐Ÿ˜›

still forum
south swan
little raptor
#

if you're judging from the hints, maybe you should consider using a more descriptive systemChat instead

tranquil jasper
#

systemChat gang shout out

little raptor
#

but still the hint should toggle too thonk

#

(for the last unit)

south swan
#

and it does on my machine. Switching on-off

modern meteor
#

that's weird

#

on mine it always shows ON

#

hm

little raptor
#

restart blobdoggoshruggoogly

modern meteor
#

forget what i said. seems there is a conflict with another addon

#

will remove it and restart

#

thanks guys

drowsy geyser
#

if i want to preloadTitleRsc many "ResourceTitles", would this be correct?

_preloadAllResourceTitles = ["all_ResourceTitles_are_here"];
{preloadTitleRsc [_x,"PLAIN"]}forEach _preloadAllResourceTitles;
winter rose
drifting portal
winter rose
#

I do not understand what you mean by "show them without loading them"

drifting portal
winter rose
#

tile?

#

anyway, it preloads them
so most likely preloads titles for them to be ready yeah

drowsy geyser
#

it can prevent them from flickering the first time you load them, afaik

drifting portal
#

Preload the scene in front of a camera

winter rose
#

yes

drifting portal
modern meteor
#

Quick amateur question. Do I have to use setComabtMode to order an AI unit to hold fire or is there another command I can use?

digital rover
little raptor
modern meteor
#

Thanks guys

modern meteor
#

Question regarding ```_x disableAI "RADIOPROTOCOL";

#

It seems that all the messages which haven't been issued while being "muted" are being played as soon as I enable the radio protocol again

#

It's basically a playback of all the messages which have been occurred while the Radioprotocol was disabled

#

Is there a way to avoid this?

#

Trying to create a "tactical" mode where units are using their laser (eg. being in combat mode) but not screaming all the time. For that purpose I am disabling the Radioprotocol.

drifting portal
#

you can remove radios from bots but I'm sure that will affect their coordination

hallow mortar
#

If you're only worried about the voice, not the text messages, you can use _x setSpeaker "NoVoice" (note: local effect)

tough abyss
#

is there a way to look for animations for the vanilla dogs?

little raptor
tough abyss
#

any specific subsection?

little raptor
tough abyss
#

๐Ÿคฆโ€โ™‚๏ธ thats a facepalm on my end

modern meteor
drifting portal
#

I'm trying to find a link between get3DENSelected "waypoint" and the group that the waypoint is synchronised to, but synchronizedObjects is not helping in this case, any ideas?

hallow mortar
#

get3DENConnections?

crude vigil
drifting portal
drifting portal
crude vigil
drifting portal
crude vigil
#

You want to find to which group the selected waypoint belongs to right?

drifting portal
#

yep

crude vigil
#

you check get3DENSelected "waypoint" select X select 0 --> Returns group

#

X being any, if you want 0th waypoint , put 0

drifting portal
#

that also works, but I find get3DENConnections easier to use, thanks for the method it will help in another script I will have to make

modern meteor
#

Does not work with laser as far as I am aware

#

So here is mu code so far:

  if (_x checkAIFeature "AUTOTARGET") then
  {
    _x disableAI "AUTOTARGET";
    _x disableAI "AUTOCOMBAT";
    _x setSpeaker "NoVoice";
    _x disableAI "COVER";
    _x setBehaviour "STEALTH";
    _x setUnitCombatMode "YELLOW";
    hint "Going Tactical";
  }
  else
  {
    _x enableAI "AUTOTARGET";
    _x setSpeaker "Voice";
    _x setUnitCombatMode "GREEN";
    _x setBehaviour "AWARE";
    hint "Going Green";
  }
} forEach (units player select { !isPlayer _x });```
drowsy geyser
#

has drawIcon3D GlobalEffect or does it need remoteExec?

modern meteor
#

My aim are three things

#
  1. Show Laser on AI units
#

2 They are quite

#

3 Thy only shoot at designated targets

#

It's fine to engage to get in position

#

Beside the problem with the voice message the AI is also only attacking the first enemy I assign to them. Afterwards they are just stuck. Not sure why though

alpine locust
#

Hey, im trying to get into coding/scripting in Arma 3. I got problems on how to check if a static object is out of place/moved. I tried to use the getPos and position command (didnt work obviously). Does anyone know how to do that?๐Ÿค”

drowsy geyser
shadow sapphire
#

In description.ext:

class CfgCommunicationMenu
{
    class takeCommandAlpha
    {
        text = "Take Command";        // Text displayed in the menu and in a notification
        submenu = "";                    // Submenu opened upon activation (expression is ignored when submenu is not empty.)
        expression = "execVM 'takeCommandAlpha.sqf'";    // Code executed upon activation
        icon = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\call_ca.paa";                // Icon displayed permanently next to the command menu
        cursor = "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa";                // Custom cursor displayed when the item is selected
        enable = "1";                    // Simple expression condition for enabling the item
        removeAfterExpressionCall = 0;    // 1 to remove the item after calling
    };
};```

In `initplayerlocal.sqf`:
```SQF
[player,"takeCommandAlpha"] call BIS_fnc_addCommMenuItem;```

In `takeCommandAlpha.sqf`:
```SQF
LogicSide = createGroup sideLogic;

//TakeCommand Function

BHCCA = LogicSide createUnit ["HighCommand",[0,0,0],[],0,"NONE"];
BHCSA = LogicSide createUnit ["HighCommandSubordinate",[0,0,0],[],0,"NONE"];
BHCSA SynchronizeObjectsAdd [BHCCA];
BHCCA SynchronizeObjectsAdd [_caller];

BA11 = [getPos Spawner, WEST, ["B_soldier_F","B_soldier_F","B_soldier_F","B_soldier_F"],[],[],[],[],[],0] call BIS_fnc_spawnGroup;

_caller HCSetGroup [BA11];```
#

How do I define the "caller" parameter for the comm menu actions?

little raptor
modern meteor
#

So I did more testing. Given that I disable COVER in my script it seems that the AI is repeating all skipped steps when the AI is enabled again. It almost feels like some actions are temporarily stored and then executed. Is there a way to reset the AI in some way so that this backlog is not being executed?

modern meteor
#

Thanks

#

Actually i think the error was that i did not enable the AI to take cover again

ebon citrus
drifting portal
#

it can't be remote controlled unit

#

is there a way to detect if a unit is stuck in an object/building ?

granite sky
#

Usually best to use a timeout.

drifting portal
granite sky
#

If a unit hasn't managed to travel 5m in 30 seconds it's probably stuck :P

drifting portal
#

also they are stuck at the start of the map only

#

so its not like they can get stuck at any point, only at the map start

#

or at the time when they are spawned

granite sky
#

Like you're spawning them randomly and they can't path out of some buildings?

drifting portal
#

some spawn inside the slab

#

now a player comes in

#

this bot kills the player

#

and the bot emerges from the slab

#

the player rage quits

granite sky
#

Apparently they haven't played a lot of Arma :P

drifting portal
#

lol

#

agents for some reason don't noclip

#

agents have the same collision as players

#

but in our scope we are speaking about createUnit

granite sky
#

There are various ways to improve spawning but it's difficult to make it perfect.

drifting portal
#

damn

granite sky
#

Using lineIntersects to check for nearby walls & ceilings can help

#

Also there are some building types that AIs specifically do not know how to path through, so you could maybe avoid those.

drifting portal
#

because I'm using LAMBS

#

it adds building path finding

granite sky
#

I thought it used what's already there.

#

Trouble is that some buildings just don't have paths, as far as I can tell.

#

There's a common one-room building on Altis that they can't leave.

drifting portal
#

but I don't really know how to use this

granite sky
#

Basically you make a box of lines and check each line with lineIntersectsXXX

#

More lines, more accuracy. Never perfect though.

drifting portal
#

so when I used lineIntersects

#

how can I be sure its not intersecting with say

#

a rock

#

next to the unit?

granite sky
#

It's begPos to endPos, right

drifting portal
#

yes?

granite sky
#

you only check a short distance.

drifting portal
#

10cm?

granite sky
#

Obviously it's not perfect. You get false positives and false negatives.

drifting portal
#

uh can't be asked really, I will just space out the AI units and their AI group leader should ask them to regroup

#

too much effort and performance just for something not perfect lol

granite sky
#

On what machine are you running this code?

shadow sapphire
#

Local hosted server.

It will be dedicated as soon as the various obstacles are overcome.

granite sky
#

Yeah, but client or server?

shadow sapphire
#

I don't know. Eventually on the server, I think.

modern meteor
#

There is something odd happening with the AI as soon as I put them in tactical mode. After issuing a move command they show much faster animation with their heads. Almost like being on speed ๐Ÿ˜‰ I don't know if the diasbleAI commands are triggering it. Here's the script:

  if (_x checkAIFeature "AUTOTARGET") then
  {
    doStop _x;
    _x disableAI "AUTOTARGET";
    _x disableAI "AUTOCOMBAT";
    //_x setSpeaker "NoVoice";
    _x disableAI "COVER";
    _x setBehaviour "AWARE";
    _x setUnitCombatMode "RED";
    hint "Going Tactical";
  }
  else
  {
    _x enableAI "AUTOTARGET";
    _x enableAI "COVER";
    doStop _x;
    //_x setSpeaker "Voice";
    _x setUnitCombatMode "GREEN";
    _x setBehaviour "AWARE";
    hint "Going Green";
  }
} forEach (units player select { !isPlayer _x });```
opal zephyr
#

Theres no ";" at the end of the else statement, idk if that maybe is causing issues?

granite sky
#

Nah, you don't need a semicolon if the next character is a close bracket.

fair drum
modern meteor
#

Tested it

#

_x disableAI "COVER";

#

is causing the issue

#

without this command it works fine

#

Seems that during a move this command is causing some issue

#

So as soon as thy stop i mean

#

But it's triggered by the move command

#

Could be just an animation issue

#

Not sure

hallow mortar
modern meteor
#

This is exactly the issue I am experiencing

#

Thought I do something wrong

#

But seems to be a bug

#

Thanks NikoJT

opal zephyr
#

For some reason _selectedGroup is not retaining its value outside of the area it was created. This systemchat is returning "any" but if I put the systemchat inside the if statement then it returns correctly... Anyone know what im doing wrong?

onEachFrame
        {
        
            _selectedIndex = lbCurSel 1500;
            
            //systemChat (format ["Index: %1",_selectedIndex]);    
            
            if (_selectedIndex != -1) then {
                _selectedGroup = RobotGroups select _selectedIndex;
                
            };
            systemChat (format ["Group: %1",_selectedGroup]);
};
modern meteor
#

Is there a way to show a hint persistent on screen until it gets disabled?

hallow mortar
#

A while {<condition>} do { hintSilent "text"; sleep 3} would do it, although the hint would do its usual wait-then-fade on its last cycle rather than disappearing immediately

open fractal
#

then it will be modified

opal zephyr
#

Oh wait I misunderstood you, sorry

open fractal
#
onEachFrame
        {
        
            _selectedIndex = lbCurSel 1500;
            
            //systemChat (format ["Index: %1",_selectedIndex]);    
            private "_selectedGroup"; 
            if (_selectedIndex != -1) then {
                _selectedGroup = RobotGroups select _selectedIndex;
                
            };
            systemChat (format ["Group: %1",_selectedGroup]);
};
#
private _selectedGroup = grpNull;
``` is probably faster
#

or maybe not

#

ยฏ_(ใƒ„)_/ยฏ

hallow mortar
#

Variables created inside an if scope are destroyed after the if scope is exited. This is normal behaviour, although it is a regular tripping point for people. However, if you're modifying an existing variable, the change persists. Doing what R.A.F. suggests will solve it.

opal zephyr
#

yup it did indeed solve it, thankyou so much the both of you!

hallow mortar
modern meteor
#

Great, I will try both options

#

Thank you!

modern meteor
#

while { _x checkAIFeature "AUTOTARGET" } do { hintsilent "Tactical Mode"};

#

so this checks if the condition is TRUE

#

can I also check if the condition is FALSE?

opal zephyr
#

put ! infront of _x in the while check

#

looks something like this

while { !(_x checkAIFeature "AUTOTARGET" )} do { hintsilent "Tactical Mode"};

#

! or not means the inverse of the result

modern meteor
#

somehow this does not work

#

something is wrong with the syntax

#

not sure what though

#

actually the syntax seems to be okay

#

but it seems that it always returns TRUE

#

i probably have it wrong

#
   if (_x checkAIFeature "AUTOTARGET") then
  {
    doStop _x;
    _x disableAI "AUTOTARGET";
    _x disableAI "AUTOCOMBAT";
    _x setBehaviour "AWARE";
    _x setUnitCombatMode "RED";
   // hint "Going Tactical";
  }
  else
  {
    doStop _x;
    _x enableAI "AUTOTARGET";
    _x setUnitCombatMode "GREEN";
    _x setBehaviour "AWARE";
    hint "Going Green";
  }
} forEach (units player select { !isPlayer _x });
 while { !(_x checkAIFeature "AUTOTARGET" )} do { hintsilent "Tactical Mode"};
hallow mortar
#

Well, you've used _x outside of the forEach, so it's not pointing to anything

modern meteor
#

the _x is probably causing it

#

yea

#

what would i need to use to check for the whole group excluding the player?

open fractal
modern meteor
#

tk u

brazen lagoon
#

any ideas on why using BIS_fnc_fadeEffect is muting audio?

modern meteor
#

this gives a syntax error

cosmic lichen
#

you are passing an array to checkAIFeature

modern meteor
#

hm

#

but what else can i do?

open fractal
#

you're looking for findIf

#

if you're evaluating a whole array to see if anything/nothing meets the condition

#

but if they're all going to have the same autotarget setting then just select one?

modern meteor
#

yea, that's probably a good solution

#

how would i select unit 4 in a group?

open fractal
#

(units player) select 3

#

arrays have a zero-based index

modern meteor
#

Tyvm!

open fractal
#

i meant to say 5
edit: what am i smoking it's 3

merry jewel
#

Not quite sure that this is the right channel, but I'm new to mission making and Ive spent the better part of today trying to figure this out.

I'm trying to make opfor tanks in a composition fire upon a fuel container with their main guns. The closest I've come is doSuppresiveFire but they just fire the coax. I've tried a Destroy waypoint (they dont think its a valid target) an invisible dummy tank (I guess they don't think its a valid target either), and lookAt + fire (I can't figure out how to get the string of the main muzzle on the turret). Any help would be appreciated

granite sky
#

allTurrets and weaponsTurret should give you vehicle weapons.

#

Automatically distinguishing the "main" weapon might be problematic so I hope you don't need to do that :P

#

It's probably gonna be the first weapon on turret [0].

shadow sapphire
#

Could someone explain to me or show me a template of parameters being applied in an addaction or command menu call?

hallow mortar
#

Example 5 on the addAction wiki page (https://community.bistudio.com/wiki/addAction):

this addAction
[
    "title",    // title
    {
        params ["_target", "_caller", "_actionId", "_arguments"]; // script
    },
    nil,        // arguments
    1.5,        // priority
    true,        // showWindow
    true,        // hideOnUse
    "",            // shortcut
    "true",     // condition
    50,            // radius
    false,        // unconscious
    "",            // selection
    ""            // memoryPoint
];```
This includes a use of the `params` command to define the available variables in the script (on activation) parameter. Those variables can then be used in the script that runs when the action is used.
merry jewel
granite sky
#

aimedAtTarget

shadow sapphire
hallow mortar
#

Well, I'm not completely sure which parts you don't understand. Do you not understand the parameters used to set up the addAction (e.g. the title, condition, radius)? Or is it that you don't understand how to use the parameters (arguments) passed to the script that runs when the action is used?

#

For the second case, the params command (look up its wiki page too) takes any arguments passed to the current script - such as the special arguments available in this case, or the arguments used in a function call - and assigns them to the given private variables. For example, if I call a function like this: ["aeiou",2] call njt_fnc_exampleFunction then inside the function I can do this select 0 to retrieve "aeiou" - or I can do params ["_textArgument","_numberArgument"], which automatically sets up a private variable referring to that argument, with a readable name and without me having to do a bunch of select commands if I have multiple arguments. It's the same for an addAction, except it comes with some special arguments that are automatically generated when the action is used.

tough abyss
#

whats the # command we can do to to detect steam ids again?

opal zephyr
#

I have a general question, on a server if I have a script that contains a global variable but I execute it from/on the client will that global variable still carry over to other clients who are running the same script?

opal zephyr
#

Hmm that link tells me how to broadcast a variable to other clients, that doesnt answer my question though

#

I think I found my answer on another page, that answer being that no, global variables values are not shared amongst machines if they were called on the individual machines

tranquil jasper
opal zephyr
#

ugh

open fractal
tranquil jasper
#

yeah global variable in that context refers to being accessible regardless of scope, not that it is broadcast

opal zephyr
#

Let me clarify what I meant by global, I need the variable's value to carry over between seperate sqf files but remain unique to the machine that it was called on

tranquil jasper
#

Then yes

open fractal
#

yes

#

it will be stored in missionNamespace which persists with the mission

opal zephyr
#

ok, while we are here and talking about it, whats the best way to call the code on every clients machine

tranquil jasper
#

remote exec with -2

open fractal
#

remoteExec generally

#

if the code will be used repeatedly create a CfgFunctions entry for it

tranquil jasper
#

keep in mind that the best possible practice would be to define the code locally on each client, by saving it in a global variable, or using functions library and just use remoteExec to execute it

opal zephyr
#

Does that work even if the variables in the code are changing often?

tranquil jasper
#

remoteExec will broadcast input during the time it was supplied

open fractal
#

you can also pass arguments through remoteExec

#

if you dont want to update global variables

opal zephyr
#

Hmm ok, ill have to do some digging into the functions library and stuff later down the line then. Thanks for the help again!

tranquil jasper
#

yes that's what I mean

#

don't worry functions library is ez

open fractal
#

set it up once and you're laughing

opal zephyr
#

End goal is to have the script run with a keybind on the clients machine, as performative as possible and allowing for changes in variables while the code is running

#

such as distances, etc

tranquil jasper
#

variables and stuff will work normally with remoteExec, it's just like running a script locally, all it does is tell another pc to run a script

open fractal
#

if you use global variables within a loop it'll update on every iteration

opal zephyr
#

does "setWaypointCompletionRadius" work with -1? Like to make it never complete?

#

If there was a way to ensure it never completed then that would be a much cleaner way to go about what im doing then using a global variable

granite sky
#

A Hold waypoint will never complete, IIRC

opal zephyr
#

Hmm Ill give that one a shot as well, thanks!

granite sky
#

They don't do a lot of holding there either, but that's Arma AI for you.

opal zephyr
#

Hold seems to work as you described, thanks!

modern meteor
#

Hi guys. I am not an expert on WHILE loops. Is it correct to assume that the while loop would not keep running if I execute the code once form the debug console?

while { !((units player) select 2 checkAIFeature "AUTOTARGET" )} do { hintsilent "Tactical Mode"};
   if (_x checkAIFeature "AUTOTARGET") then
  {
    doStop _x;
    _x disableAI "AUTOTARGET";
    _x disableAI "AUTOCOMBAT";
    _x setBehaviour "AWARE";
    _x setUnitCombatMode "RED";
  }
  else
  {
    doStop _x;
    _x enableAI "AUTOTARGET";
    _x setUnitCombatMode "GREEN";
    _x setBehaviour "AWARE";
    hint "Going Green";
  }
} forEach (units player select { !isPlayer _x });

I am looking to find a way to show the hint as long as the units are in "Tactical Mode".

open fractal
#

you only have a closing bracket for your forEach loop

#

what your code does is execute a hint on almost every frame until the ai exits combat mode, at which point it will set every unit to green and then

#

nothing?

modern meteor
#

I hear you

#

How would you recommend to fix it. I am not sure how to progress from here.

open fractal
#

my bad, the while loop checks for autotarget not combat mode

#

but uh

#

that while loop is strange

#

i don't quite understand what you're trying to do

open fractal
#

i found the {

#

and I wish I didn't

#

@modern meteor if you want to create a loop that runs without interrupting your current script you use spawn

#

because in sqf nothing will be executed until after the loop is complete

#

so you run another script concurrently

#

as a general rule you want to avoid while loops unless you absolutely need them, and if you do add sleep so that the engine isn't repeatedly checking the condition as fast as it can

#

I don't know how long hints are displayed but lets say a solid 15 seconds

#

there is no reason to put up the same hint many times a second

modern meteor
#

So basically my aim with this script is to switch the AI between two modes - "Tactical Mode" and "Green". Both modes enable/disable certain AI functions. This part of the script is fine. When switching between modes a hint is shown. For Green it is fine if the hint fades after some time but for Tactical Mode I would like to keep the hint on screen until I switch mode back to Green.

#

I am now struggling to find a solution to keep the hint "Tactical Mode" on screen

#

Not sure what the right approach is to implement this

open fractal
#
[] spawn {
  itx_tacticalMode = true;
  while {itx_tacticalMode} do { 
    hintSilent "Tactical Mode"; sleep 15; 
  } 
};
open fractal
modern meteor
#

right, thank you

#

and where would i need to place it in my code?

#

i also need to set the variable when switching to Tactical Mode, correct?

open fractal
#

it's already set in the expression i wrote

#

when you switch off of tactical mode you set it to false

#

however if you want to keep things neat and prevent it from being recycled once the variable is set to true again you may want to set a variable for the script so you can terminate it

#
itx_tacticalHint = [] spawn {
  while {true} do { 
    hintSilent "Tactical Mode"; sleep 15; 
  } 
};

then

terminate itx_tacticalHint;

to stop it

ebon citrus
#

You can put the sleep 15 inside the while condition

modern meteor
#

okay, this is very helpful. Thank you. Just trying to understand now where to fit his into my code.

open fractal
#

just make sure you aren't spawning the code inside a loop

#

I'm currently experiencing schrodinger's particle effect

#

It appears in some tests but not in others, I've controlled for wind but I don't know what else could cause this

#

Is it normal for there to be issues with particles appearing when they're being generated in front of a camera that's across the map from the player?

modern meteor
#

Still trying to figure this out

#

For my understanding

#

itx_tacticalHint is a Global Varaible?

open fractal
#

yes

#

itx is a tag, i invented it from your name

ebon citrus
#

PIP behaves differently and in mysterious ways

open fractal
#

thank god i thought i was losing it

drowsy geyser
modern meteor
#

I tried this but I guess I am doing it wrong with the variable:

  while {true} do { 
    hintSilent "Tactical Mode"; sleep 15; 
  } 
};

{
   if (_x checkAIFeature "AUTOTARGET") then
  {
    doStop _x;
    _x disableAI "AUTOTARGET";
    _x disableAI "AUTOCOMBAT";
    _x setBehaviour "AWARE";
    _x setUnitCombatMode "RED";
   hint "Tactical Mode";
  }
  else
  {
    doStop _x;
    _x enableAI "AUTOTARGET";
    _x setUnitCombatMode "GREEN";
    _x setBehaviour "AWARE";
    setVariable [itx_tacticalHint, "False"];    
    terminate itx_tacticalHint;
    hint "Going Green";
  }
} forEach (units player select { !isPlayer _x });
open fractal
#

is there a workaround for getting the particles to show up?

ebon citrus
#

If you want to try, attach a camera to your players head at eye position, PIP it to a screen size contorl and wlak around

open fractal
#

I'll have to experiment with it tomorrow

#

thank you for saving me potentially hours of staring at my particle effect code

ebon citrus
#

PIP in generla is very meh

#

Dont rely on it to be visually 1:1

#

As this would be incredibly taxing on the system

open fractal
#

i wonder if i can just teleport the players themselves, freeze them in place, and have them stare at the cool particles lmao

drowsy geyser
open fractal
#

oh shit

#
    private _camera = "camera" camCreate [2831.61,13137.5,21.7714];
    _camera setDir 103;
    private _pitch = 6.5;
    _camera setVectorUp [cos (getDir _camera), sin (getDir _camera), 1 / (tan _pitch)];
    _camera camPrepareFov 0.2;
    _camera camCommit 0;
    _camera cameraEffect ["internal", "BACK"];
#

this is what i have though

ebon citrus
#

Remember to switch camera

#

Also, cam commit after cameraeffect

modern meteor
open fractal
modern meteor
#

I thought it checks automatically for TRUE, ne?

open fractal
#

Does not need camCommit.

modern meteor
#

no?

#

The only thing which is mot working properly is to keep the hint on screen

open fractal
drowsy geyser
#

try this idk if it works

{
       if (_x checkAIFeature "AUTOTARGET") then {
        doStop _x;
        _x disableAI "AUTOTARGET";
        _x disableAI "AUTOCOMBAT";
        _x setBehaviour "AWARE";
        _x setUnitCombatMode "RED";
        itx_tacticalHint = [] spawn {
          while {true} do { 
            hintSilent "Tactical Mode";sleep 15;
        };
    };
  }
  else
  {
        doStop _x;
        _x enableAI "AUTOTARGET";
        _x setUnitCombatMode "GREEN";
        _x setBehaviour "AWARE";
        terminate itx_tacticalHint;
        hint "Going Green";
      };
} forEach (units player select { !isPlayer _x });
modern meteor
#

This code keeps Tactical Mode hint on the screen as intended. But when I switch back to "Green", it initially shows "Going Green" and then changes to "Tactical Mode" after some time

#

So I guess it doesn't stop the WHILE loop when switching to "Green"?

open fractal
#

you can put isNull itx_tacticalHint in the console to check

#

if it returns true the script is not active

#

either that or the variable was overwritten

#
        _x setUnitCombatMode "RED";
        terminate itx_tacticalHint;
        itx_tacticalHint = [] spawn {
#

if you throw this in it'll prevent multiple scripts from spawning

#

not sure about how efficient your script is overall but this will be a quick fix

modern meteor
#

trying this. 1 sec

#

No, this does not work

#

Overwrites "Going Green" with "Tactical Mode" after a few seconds

#

Even quicker than before

open fractal
#

can you please check isNull itx_tacticalHint

modern meteor
#

sorry, checking

#

It returns TRUE

#

While in Green Mode

#

And false while in Tactical Mode

open fractal
#

diag_activeSQFScripts will return active scripts that are running

#

if the hint is in there then you aren't terminating it

modern meteor
#

Returns an endless line

#

With addons etc

open fractal
#

?

#

then paste it somewhere else??

modern meteor
#

It does not show up in either mode

#

What is the command to change itx_tacticalHint to FALSE?

#

I think the problem is that "sleep 15" in the while loop is still pending although i already switched already back to Green.

#

Stopping the loop probably does not stop it to overwrite hint one more time

#

Although removig sleep 15 does not solve the problem

#

So maybe I am wrong

#

This is the code I am using:

       if (_x checkAIFeature "AUTOTARGET") then {
        doStop _x;
        _x disableAI "AUTOTARGET";
        _x disableAI "AUTOCOMBAT";
        _x setBehaviour "AWARE";
        _x setUnitCombatMode "RED";
        terminate itx_tacticalHint;
        itx_tacticalHint = [] spawn {
          while {true} do { 
            hintSilent "Tactical Mode";sleep 15;
        };
    };
  }
  else
  {
        doStop _x;
        _x enableAI "AUTOTARGET";
        _x setUnitCombatMode "GREEN";
        _x setBehaviour "AWARE";
        terminate itx_tacticalHint;
        hint "Going Green";
      };
} forEach (units player select { !isPlayer _x });```
copper raven
#

that will not work

#

you're potentially spawning for every unit, so your script handle will be overriden everytime

open fractal
#

eyess i didnt notice it was all in a loop

open fractal
modern meteor
#

Okay

#

So how would the correct code look like? It's still not clear to me.

copper raven
#

only spawn once

modern meteor
#

like this:

       if (_x checkAIFeature "AUTOTARGET") then {
        doStop _x;
        _x disableAI "AUTOTARGET";
        _x disableAI "AUTOCOMBAT";
        _x setBehaviour "AWARE";
        _x setUnitCombatMode "RED";
  }
  else
  {
        doStop _x;
        _x enableAI "AUTOTARGET";
        _x setUnitCombatMode "GREEN";
        _x setBehaviour "AWARE";
        terminate itx_tacticalHint;
        hint "Going Green";
      };
} forEach (units player select { !isPlayer _x });

itx_tacticalHint = [] spawn {
          while {true} do { 
            hintSilent "Tactical Mode";sleep 15;
        };
    };```?
#

@ sharp: Sorry, I don't know how to do this. My code is still not working.

#

The code above is still overwriting the hint when going Green

#

So same problem as before

modern meteor
#

Here is the code i am using:

#
          while {true} do { 
            hintSilent "Tactical Mode";sleep 15;
        };
    };
};

{
       if (_x checkAIFeature "AUTOTARGET") then {
        doStop _x;
        _x disableAI "AUTOTARGET";
        _x disableAI "AUTOCOMBAT";
        _x setBehaviour "AWARE";
        _x setUnitCombatMode "RED";
  }
  else
  {
        doStop _x;
        _x enableAI "AUTOTARGET";
        _x setUnitCombatMode "GREEN";
        _x setBehaviour "AWARE";
        terminate itx_tacticalHint;
        hint "Going Green";
      };
} forEach (units player select { !isPlayer _x });
south swan
#

do you need this to be per-unit, or should the entire team switch their behaviour?

modern meteor
#

The whole AI team is switching between Tactical and Green

#

(eg. enabling/disabling AI)

south swan
#

then maybe switch from checking every unit to only checking one and then setting the state for all? Something like sqf private _nonPlayer = units player select { !isPlayer _x}; if (_nonPlayer isEqualTo []) exitWith {}; if ((_nonPlayer select 0) checkAIFeature "AUTOTARGET") then { { doStop _x; _x disableAI "AUTOTARGET"; _x disableAI "AUTOCOMBAT"; _x setBehaviour "AWARE"; _x setUnitCombatMode "RED"; } forEach _nonPlayer; hintSilent "Tactical Mode"; } else { { doStop _x; _x enableAI "AUTOTARGET"; _x setUnitCombatMode "GREEN"; _x setBehaviour "AWARE"; } forEach _nonPlayer; hintSilent "Going Green"; };

#

also, setUnitCombatMode "RED" ("RED" : Fire at will, engage at will/loose formation) with disableAI "AUTOTARGET" sounds fun ๐Ÿ˜›

modern meteor
#

AI only fires at designated targets

#

Thatโ€™s the purpose of Tactical Mode

modern meteor
#

The problem is not the different modes

#

My initial version is fine

#

Only thing which is not working is to keep the hint on screen while in Tactical mode. And fade it in Green mode.

south swan
#

ah, sorry, looks like i'm mixing stuff up

modern meteor
#

This is my latest version:

          while {true} do { 
            hintSilent "Tactical Mode";sleep 15;
        };
    };
};

{
       if (_x checkAIFeature "AUTOTARGET") then {
        doStop _x;
        _x disableAI "AUTOTARGET";
        _x disableAI "AUTOCOMBAT";
        _x setBehaviour "AWARE";
        _x setUnitCombatMode "RED";
  }
  else
  {
        doStop _x;
        _x enableAI "AUTOTARGET";
        _x setUnitCombatMode "GREEN";
        _x setBehaviour "AWARE";
        terminate itx_tacticalHint;
        hint "Going Green";
      };
} forEach (units player select { !isPlayer _x });
#

It keeps the Tactical hint on screen but some the Going Green hint gets overwritten by the Tactical Mode hint

#

I don't know how to fix it

copper raven
#

{itx_tacticalHint = [] spawn { while {true} do { hintSilent "Tactical Mode";sleep 15; }; }; };
this will do literally nothing though?

#

it will just get cleaned off the stack afterwards

south swan
#

(group player) setCombatMode "RED" and loop like sqf while {combatMode group player isEqualTo "RED"} do { hintSilent "Tactical Mode"; sleep 15; };?

#

also what sharp says ๐Ÿคทโ€โ™‚๏ธ

modern meteor
south swan
#

make it your own variable then ๐Ÿคทโ€โ™‚๏ธ

modern meteor
#

In case it is not obvious yet, I am by no means an expert on scripting ๐Ÿ˜‰

#

How would i do this?

modern meteor
copper raven
#

It keeps the Tactical hint on screen
with the way you have right now, there should be no "Tactical Mode" hint showing at all

#

so either you're executing some other code elsewhere, or what you sent is not what you actually are using

modern meteor
#

sorry

#

Had a bracket wrong

#

This is what i am using:

#
          while {true} do { 
            hintSilent "Tactical Mode";sleep 15;
        };
    };


{
       if (_x checkAIFeature "AUTOTARGET") then {
        doStop _x;
        _x disableAI "AUTOTARGET";
        _x disableAI "AUTOCOMBAT";
        _x setBehaviour "AWARE";
        _x setUnitCombatMode "RED";
  }
  else
  {
        doStop _x;
        _x enableAI "AUTOTARGET";
        _x setUnitCombatMode "GREEN";
        _x setBehaviour "AWARE";
        terminate itx_tacticalHint;
        hint "Going Green";
      };
} forEach (units player select { !isPlayer _x });
#

Works except from Green hint gets overwritten by Tactical mode after a few seconds

copper raven
#

are you running this code only once?

modern meteor
#

yes

#

executing from debug console

copper raven
#

have you restarted the mission from previous executions?

#

because it will overwrite the script handle like i said, the code should work otherwise as is

south swan
#

ahhh

#

so you run this once and then run this again to go green, yes?

modern meteor
#

yes

modern meteor
#

same error

copper raven
south swan
#

sounds like you spawn two while loops and only kill the second one afte that. Something like this may be a fix then ```sqf
if (isNil "itx_tacticalHint" || {isNull itx_tacticalHint}) then {

itx_tacticalHint = [] spawn {
while {true} do {
hintSilent "Tactical Mode";sleep 15;
};
};
};

{
if (_x checkAIFeature "AUTOTARGET") then {
... and so on```

modern meteor
modern meteor
#

Have to admit this was much more complex than I thought

#

Could not have solved this myself

#

Thank you both for your help!

alpine locust
ebon citrus
#

position and getPosATL should definately work for those

alpine locust
ebon citrus
#

is there a way to limit regexReplace to only the first hit?

distant oyster
#

yes, leave out the global flag /g

ebon citrus
#

thank yoiu

winter rose
leaden ibex
winter rose
plush flax
#

I have a mission with custom music that plays from an object (radio), but I only want that music to start once they get close to that object. anyone know of a script (prob in relation to a trigger) that can make that happen?

elfin comet
#

So I have a script for spawning 3 groups at 3 unique points out of pointPool. While this does work, all of the points in that array of markers are scattered throughout Fallujah. I didn't really give much thought of how long it would take an AI squad on foot to traverse that distance if they spawn at one of the further markers.

Instead, I would like to have those 3 groups spawn at the 3 closest markers instead. I figure I should be able to do this with some combination of distance and selectMin, but I'm not sure what to start with or how to reference back to the marker as.

Perhaps get the distance to the marker relative to leader reconTeam and then just use a math comparison to find what marker I'm trying to spawn units at?

elfin comet
#

If you mean scripting, still use a trigger, just remoteExec along with playSound or playSound3D with the music that you want played. This does require you to use CfgSounds for that song rather than CfgMusic like you usually would for music.

hallow mortar
#

playSound3D uses a file path, not CfgSounds, and shouldn't be remoteExeced because it has global effect

elfin comet
#

^Listen to them, they know more than I do. I've only seen those pop up in autofill, haven't used them myself.

hallow mortar
#

*and you should definitely use playSound3D or say3D because playSound is not positional

elfin comet
#

I just figured they were similar to playMusic.

plush flax
#

I'm very unfamiliar with this stuff, and someone just gave it to me:
in description.ext:

class CfgSounds

{

    tracks[]={};

    class Track01
    {

        name = "Trackname";

        sound[] = {"\Trackname.wav", 100, 1.0};

        titles[] = {};
 
    };

};

and on the object:

this say3D ["Trackname",0,1];
#

So im not overly sure ๐Ÿ˜…

hallow mortar
hallow mortar
# plush flax I'm very unfamiliar with this stuff, and someone just gave it to me: in descript...

Well, obviously you should replace "Trackname" with whatever the actual name of the file is, to start with.
Secondly, that say3D is largely correct except for some reason the maximum distance is set to 0 metres.
What you would want to do is place a trigger on the area that you want (e.g. a 10 metre circle around the radio) and set its activation type to ANY PLAYER. Then place this in the trigger's On Activation code field:

obj_yourRadio say3D ["Trackname"];```
Then on your radio, remove the code from its init field, and set its variable name to `obj_yourRadio` (or whatever name you want but remember to change it in the trigger too).
What this does is, when the trigger is activated by any player entering it, it causes all clients to run that `say3D` command, which makes the radio play the sound. You can see I've removed the extra 2 parameters from `say3D` - this means that instead of being audible only at a range of 0 metres or less, the default value is used, so it can be heard at up to 100 metres once it starts playing.
plush flax
hallow mortar
#

That's a little weird since those are supposed to be optional ๐Ÿค” however, in the future you can definitely skip all optional parameters by omitting the [] (object say3D "trackname")

plush flax
hallow mortar
#

Yes, for say3D the sound must be defined in CfgSounds

plush flax
#

Cool, thanks a lot!

haughty bone
#

greetings. I am trying to make players have a loadout at mission start which is randomly taken from an array. Which is done like this: playerLoadout = selectRandom playerLoadoutArray; player setUnitLoadout = _playerLoadout; which is the initPlayerLocal.sqf and in my init.sqf i have all the loadouts:```// all the different player spawn loadouts:
_playerLoadout01 = [[],[],[],["U_C_IDAP_Man_Jeans_F",[["ACE_EarPlugs",1]]],[],[],"H_Cap_blk","",[],["ItemMap","","","ItemCompass","ItemWatch",""]];
_playerLoadout02 = [[],[],[],["U_C_ArtTShirt_01_v5_F",[["ACE_EarPlugs",1]]],[],[],"H_Hat_brown","",[],["ItemMap","","","ItemCompass","ItemWatch",""]];
_playerLoadout03 = [[],[],[],["U_C_Poloshirt_salmon",[["ACE_EarPlugs",1]]],[],[],"H_MilCap_gry","",[],["ItemMap","","","ItemCompass","ItemWatch",""]];

playerLoadoutArray = [_playerLoadout01, _playerLoadout02, _playerLoadout03];``` However when i try to set it i get an error stating: Error Invalid number in expression. I am not quite sure as to what is going wrong.

#

oh hold up found a typo

#

still causes the same error. Does anyone have any tips on how to set the loadout of a player on startup?

hallow mortar
#

In multiplayer, init.sqf is executed after initPlayerLocal.sqf, so you have a structural problem there. You may as well have the loadouts in initPlayerLocal.sqf as well.

#

In playerLoadout = selectRandom playerLoadoutArray, it should be _playerLoadout, but I'm guessing that's the typo you fixed.

haughty bone
#

ahh i didnt know that

#

yea that was the typo i saw and fixed

#

even after putting it all into the initPlayerLocal.sqf i still get the same errors

#

it's getting a bad result back from this bit: _playerLoadout = selectRandom playerLoadoutArray;

hallow mortar
#

Make sure that all the loadouts and the definition of playerLoadoutArray come before the selectRandom line in the file.
Also, this line is wrong: player setUnitLoadout = _playerLoadout - it should be player setUnitLoadout _playerLoadout.

haughty bone
#

changing the player setunitloadout line to what you mentioned was the thing that fixed it. Thank you !

#

that was the typo error i had

deep loom
#

How would you shuffle an array and then output the results as new variables? I'm trying to set a set a schedule for a hostage transport to appear at three random places throughout the day. I've got the way to shuffle the array with BIS_fnc_arrayShuffle but how do you output the result into new variables?

elfin comet
opal zephyr
#

_wp represents a waypoint, once I delete said waypoint shouldnt this if statement no longer trigger?

if (!isnil "_wp") then {
little raptor
#

not the variable

#

the var (and its value) still exists

#

so it's not nil

opal zephyr
#

hmm ok, I tried
_wp != [];
but that didnt work either. Is there a consistent way to check if a variable has no assigned value?

#

giving count a shot, maybe that'll work

#

_
count didnt work either, maybe there is something wrong with my statement script that deletes the waypoint?

_wp setWaypointStatements ["true", "deleteWaypoint [group this, currentWaypoint (group this)]"];
elfin comet
granite sky
#

@opal zephyr Your problem there is that deleteWaypoint doesn't touch _wp.

#

_wp is just a [group, index] array that's left untouched by waypoint commands.

#

Hell, because waypoints get reindexed when removed (and sometimes when added), it doesn't even necessarily refer to the same waypoint, or a valid waypoint. It just remains as [group, index].

opal zephyr
#

@granite sky Alright, so am I missing something major or is there really no good way to detect when a waypoint is completed apart from just checking the number of active waypoints?

granite sky
#

There is no good way to do anything with waypoints. Everything is terrible.

#

I'm just gonna point out again that setWaypointStatements runs globally so you can cause disasters with it if you're not careful.

#

If you have control over the waypoints then probably best to use currentWaypoint to figure where it's got to.

tranquil jasper
tranquil jasper
#

otherwise you're either just doing a check to the number of waypoints a group has

#

or if you need to know more about a waypoint you'll end up writing a helper script that basically just deserializes it using all the waypoint commands

#

and checking against that

#

would be nice to get a waypoint type

copper raven
elfin comet
#

@tranquil jasper @copper raven
Why not just do this?

_spawnPointDistance = [pointPool, [],{ (leader reconTeam) distance (getMarkerPos _x) },"ASCEND"] call BIS_fnc_sortBy;

if (((leader reconTeam) distance (getMarkerPos (_spawnPointDistance select 0))) < 100) then {
    _offset = 1;
};

_sp1 = _spawnPointDistance select (_offset);
_sp2 = _spawnPointDistance select (_offset + 1);
_sp3 = _spawnPointDistance select (_offset + 2);```
It would even allow me to shift down the array if they are too close to the first if needed.
crude vigil
#

There are surely other ways but if you want like the easiest easiest way... :)

opal zephyr
#

Thanks for letting me know!

hallow mortar
#

2.10's most recent officially estimated (estimated, not confirmed) release date is "late summer"

opal zephyr
#

Ill be forced to use something else then, maybe some combination of move will work. I only used waypoints originally because of things like set formation

#

When I did it originally I think my brain skipped over the fact that I could still modify formation and speeds even outside of a waypoint

grim wing
#

is there a way to sync an editor module to a trigger created by script?

open fractal
#

is it normal that fadeSound only works for a second on dedicated?

#

i run 0 fadeSound 0 locally and it goes silent for about a second and then undoes itself

#

odd, it keeps resetting to 1

brazen lagoon
#

anyone got any suggestions on how to remove respawn positions when a player is downed/unconscious?

#

essentially I am asking how BIS_fnc_showRespawnMenuDisableItem works

brazen lagoon
#

ok well I've figured that out, now I'm curious how to run something when the respawn menu has opened

shadow sapphire
#

If I run a generic execVM, itโ€™s executed globally, right?

brazen lagoon
#

do you mean a generic remoteExec

shadow sapphire
#

No, I am trying to figure out where execVM is firing. I couldnโ€™t get remoteExec to work as far as I can tell.

brazen lagoon
#

execVM doesn't execute remotely no

shadow sapphire
#

Itโ€™s not global at all? So if I *execute it from initplayerlocal, it only runs on that player?

That makes sense.

#

If I wanted to run [] execVM โ€œTakeCommand.sqfโ€ from a remoteexec, whatโ€™s the easiest way to do that for now to help me understand that locality.

shadow sapphire
#

The same file? The sqf Iโ€™m trying to run is in the mission file that the dedicated server is running, if Iโ€™m understanding the question.

brazen lagoon
#

is it in the mission

#

yeah it's in the mission

#

uhhhh

#

I believe you want [[], "TakeCommand.sqf"] remoteExec ["execVM", <number>];

crude vigil
#

then
[[], "TakeCommand.sqf"] remoteExec ["execVM", <whoever remote is>];
I guess...

brazen lagoon
#

not certain

#

yeah that

#

lmao

shadow sapphire
#

Okay! Thanks!

#

Iโ€™ll define it as a function and all to do it right once I get it working.

crude vigil
#

Actually even "TakeCommand.sqf" remoteExec ["execVM", <target>]; is enough I believe but u probably got some args...

shadow sapphire
#

Thanks! Both of those versions worked well!

open fractal
#

Is terrain damage local?

#

I'm looking at a radio tower that has both the alive and dead model

brazen lagoon
#

how do you select the effective group leader?

tranquil jasper
#

what is that lol

brazen lagoon
#

like, when a player is downed, someone takes command right?

#

how do I get that person?

open fractal
brazen lagoon
#

that doesn't work because that returns the dead unit that is technically the group leader

#

even though someone else has taken command

tranquil jasper
#

can you post some of your script

brazen lagoon
#

is it formationLeader?

tranquil jasper
#

does _player have player?

#

I'm willing to bet yes given that my test was successful

#

when player becomes unconscious, player is kicked from current group and put in a new group by itself

#

so do this instead:

[group _player] spawn {
    params ["_group"];
#

you need reference to the past group, not player current group

brazen lagoon
#

ah! i see

#

that makes perfect sense, thanks.

tranquil jasper
#

np

#

and not sure why you have alternate syntax for for since you're not doing anything that the regular syntax doesn't do, but since you do you should put private _i because it's not scope safe

brazen lagoon
#

@tranquil jasper are you sure about this?

#

I am testing this rn and group player (incapacitated) is R Alpha 1-1

#

and group bis_o2_17 (friend who is dead) is.. R Alpha 1-1

tranquil jasper
#

I tested it with a group I named in the editor

brazen lagoon
#

actually yknow what. let's actually ask the real question I'm trying to answer

#

how do you make the vanilla respawn system not let you respawn on an incapacitated squadmate?

#

because right now it'll let you and that sucks

shadow sapphire
#

This method of creating high command for units spawned during a mission works. I'll define this as a function eventually to do it the right way. This (apparently) allows players to join a server and be assigned command of subordinates when they are spawned via their script. A ton of time sank into figure out this problem. Now my supports aren't working. They can't be run in this script for some reason.

All of this works.

InitPlayerLocal.sqf:

If ((!isNil "BHA66") and {player == BHA66}) then { //Ensure unit exists and player is unit.
    "TakeCommandBA.sqf" remoteExec ["execVM", 2]; //Execute only on server.
};```

TakeCommand.sqf:
```SQF
WaitUntil {!isNil "BA4R"}; //Wait until support radio unit exists.
If (!isNil "BHA66HC") then {deleteVehicle BHA66HC}; //Fight redundancy.
If (!isNil "BHA66HCS") then {deleteVehicle BHA66HCS}; //Fight  redundancy.

//High command block.
BHA66HC = LogicSide createUnit ["HighCommand",[0,0,0],[],0,"NONE"]; //Create commander module.
BHA66HS = LogicSide createUnit ["HighCommandSubordinate",[0,0,0],[],0,"NONE"]; //Create subordinate module.
BHA66HS SynchronizeObjectsAdd [BHA66HC]; //Synchronize subordinate to commander module.
BHA66HC SynchronizeObjectsAdd [BHA66]; //Synchronize commander module to commander.
{BHA66 HCSetGroup [_x];} foreach [BA11, BA12, BA13, BA21, BA22, BA23, BA31, BA32, BA41, BA42]; //Assign commander to subordinate groups.
#

Meanwhile this block, if within the same script does not work:

BA4R = LogicSide createUnit ["SupportProvider_Artillery",[0,0,0],[],0,"NONE"]; //Create provider module.
BA4R setVariable ['BIS_fnc_initModules_disableAutoActivation', false]; //Enable manipulation of module initialization. 
BA6R = LogicSide createUnit ["SupportRequester",[0,0,0],[],0,"NONE"]; //Create requester module.
BA6R setVariable ['BIS_fnc_initModules_disableAutoActivation', false]; //Enable manipulation of module initialization. 
[BA6R, "Artillery", -1] call BIS_fnc_limitSupport; //Define support module traits. Throws error if omitted. 
[BA6R, "CAS_Bombing", -1] call BIS_fnc_limitSupport;
[BA6R, "CAS_Heli", -1] call BIS_fnc_limitSupport;
[BA6R, "Drop", -1] call BIS_fnc_limitSupport;
[BA6R, "Transport", -1] call BIS_fnc_limitSupport;
[BA6R, "UAV", -1] call BIS_fnc_limitSupport;
[BA4R, BA6R] call BIS_fnc_initModules; //Initialize module. Not required on local host. Doesn't fix dedicated host.
BA42MA synchronizeObjectsAdd [BA4R]; //Synchronize mortar to support (artillery/mortar)provider module.
BA4R synchronizeObjectsAdd [BA6R]; //Synchronize provider to requester.
BA6R synchronizeObjectsAdd [BHA66]; //Synchronize requester to caller.
[BHA66, BA6R, BA4R] call BIS_fnc_addSupportLink; //Assign commander fire support.```

I have not been able to solve why this doesn't work. This block works in nearly any context when hosted locally, but doesn't work in nearly any context when on a dedicated server.
pastel jewel
#

anyone know how to remove grass server side on DayZ?

winter rose
little raptor
#

With some other stuff that have a dedicated data type yes

#

E.g. when you delete an object, the value points to objNull
Or for groups, grpNull
etc.

somber radish
#

any eventhandler to do the same thing as "onPlayerKilled.sqf"?

hallow mortar
somber radish
#

Ok, so nothing player specific?

hallow mortar
#

You can pretty easily choose to only add the EH to players, or check whether the unit is a player when it fires

wary sandal
#

relevant code : ```sqf
[
establishmentShot,
"BLUFOR and OPFOR firefight",
25,
20,
30,
1,
[
//["\A3\ui_f\data\map\markers\nato\b_inf.paa",[0,0.3,0.6,1],group_1,1,1,0,"BLUFOR"],
//["\A3\ui_f\data\map\markers\nato\o_inf.paa",[0.5,0,0,1],group_2,1,1,0,"OPFOR"]
],
0,
true,
15
] spawn BIS_fnc_establishingShot;

hallow mortar
#

There doesn't appear to be anything wrong with that function call in itself. My suspicion is that it's trying to compete with another function that's also trying to do fade-in or fade-out. I do not know what other function you might be calling that's conflicting.

wary sandal
#

i doubt that it's conflicting since i literally have no code but init.sqf

#

which runs the code snippet i've sent

granite sky
hallow mortar
#

The Edit Terrain Object module is well-known to be fairly unreliable in multiplayer

#

e.g. setting door states doesn't work

hallow mortar
wary sandal
drowsy geyser
#

Is it possible to create a hud that shows the player's VON volume,
like a bar going up and down in the range from 0 to 1?

is the getPlayerVoNVolume command the correct command in this case?

granite sky
#

execVM "init.sqf" wat

#

You're running init.sqf twice. Once from the object init field and once automatically.

wary sandal
#

oh, i thought it was just a common name people used

#

makes sense now

rose osprey
#

I'm trying to recompile a single RHS pbo - I have it extracted successfully, modified successfully (?), and it builds successfully. All of the normal ArmA 3 functionality provided by the modified pbo file, except for the scripts in the scripts directory.

In the config.cpp file, it contains these lines:

        class turretBlow
        {
            file = "\rhsafrf\addons\rhs_c_t72\scripts\rhs_turretBlow.sqf";
            description = "T Tanks turret blowoff";
        };

I did not modify this at all.

When loading the unmodified pbo file, the turretBlow class in Functions Viewer is populated by the contents of the above referenced script.

However, using the modified pbo, the turretBlow class is referenced but it contains no data.

Any thoughts on this?

granite sky
#

What if you recompile the PBO without modifying anything?

rose osprey
#

i tried that as well - class contains no data

#

im assuming its some sort of path issue, maybe when creating the pbo with addon builder

granite sky
#

Well, you need the right -prefix

rose osprey
#

i played around with the directories, i wonder if i need to specify the addon path

#

hrm

#

let me give that a shot

granite sky
#

prefix for that one should be "rhsafrf\addons\rhs_c_t72"

rose osprey
#

just tried with "rhsafrf\addons\rhs_c_t72" and same - no data, hrmmmm

granite sky
#

shrugs

#

config viewer is really unreliable for me with mods loaded anyway

#

Like you click on something a few levels deep and it kicks you to something empty in the root.

young current
#

@rose osprey halt

granite sky
#

But config commands are fine.

rose osprey
#

ya let me try one more thing

young current
#

This is not correct way to do stuff

rose osprey
#

indeed

young current
#

RHS will burn you if you publish this kind of things

rose osprey
#

i have no interest in publishing anything

granite sky
#

patching is fine too :P

young current
#

If one wants to do a patch, one does it as separate addon, not repack of existing addon

rose osprey
#

indeed

young current
#

Better to do things right from the beginning instead of climbing ass front to a tree

rose osprey
#

i like trees

winter rose
leaden ibex
#

Hello there, again me.
I need to fire an event the moment player joins the game and loads into the briefing/game.
I need to have all his info available, name, uid, group, roleDescription and side.
Any ideas which event should I hook?

so far I tried OnUserSelectedPlayer, but the UID and roleDescription is null.

I need it to be run on the server, not on the player

#

The only idea I got rn is to remote exec an exec remoting back to server with the info

#

But that feels so wrong

leaden ibex
#

(We are trying to keep the mission framework itself independent from any mods and the mod from any mission frameworks)

leaden ibex
#

That might help me, I'll look into it, thank you

spiral temple
#

is it possible to get any return values when using remoteExecCall ?

crude vigil
spiral temple
#

I've a server side function which needs to be called via the client, but the client should have the return values of the calculation of the server side function

crude vigil
#

There is a nice example for your purpose in it as well.

fleet sand
#

Hi guys. I was messing around in Editor and i found this fnc:
[cursorObject,4,3,1,false] call BIN_fnc_deconShowerAnimLarge
i am executeing it via console in Singleplayer while looking at Large decon shower. But everytime i try to execute it my arma just crash and it says application hang. Is this like a bug or is it just crashing on my laptop ?

crude vigil
rose osprey
young current
#

proper way meaning separate new addon that does not repack RHS files, only contains your new files and configs that make config alterations?

rose osprey
#

correct

young current
#

๐Ÿ‘

brazen lagoon
#

asking again, how should I use BIS_fnc_showRespawnMenuDisableItem? if I pass it things it never seems to disable the correct position.

#

if I edit BIS_RscRespawnControls_positionDisabled directly it works but only after i click on a different respawn pos first

#

oh I see, it's because this expects the target object to be a string

#

๐Ÿคฆโ€โ™‚๏ธ

pastel jewel
brazen lagoon
#

any idea how to make the map disabled in the respawn screen first time through?

fleet sand
brazen lagoon
#

cool ty

#

also, can you disable tactical ping via script?

#

disableMapIndicators nvm

fleet sand
brazen lagoon
#

yes but i want to do it by script

cold flower
#

Why?

brazen lagoon
#

because I don't want to change global difficulty settings for one mission?

fleet sand
#

You can try this in InitPlayerLocal.sqf

(findDisplay 46) displayAddEventHandler
[
    "KeyDown",
    {
        _handled = false;
        if (_this select 1 == 20) then
        {
            _handled = true;
        };
        _handled;
    }
];``` Credit to GEORGE FLOROS GR
brazen lagoon
#

or do you mean I can set the difficulty for the mission specifically

cold flower
#

You can always set difficulty for mission...

#

Just need to specify the difficulty in description.ext if I remember correctly

open fractal
brazen lagoon
#

basically i want to disable 3d markers but only in this mission

open fractal
#

if someone has something else bound to that key it'll block that too

#

and if i'm reading it right it keeps you from using the T key altogether?

brazen lagoon
#

yeah that would

#

can you not set difficulty settings per mission?

open fractal
#

these are the only commands available for difficulty

#

otherwise if it's not in description.ext then you have to edit the server settings

wary sandal
open fractal
#

i thought there was a force difficuly in description.ext but i might be thinking of server config. regardless if you want custom settings you need to edit the profile

wary sandal
#
author            = "Test";
onLoadName        = "Test";
onLoadMission    = "Test";
loadScreen        = "images/loadingscreen.paa";
#

I remember having came across this problem but i don't know how to fix it anymore

open fractal
#

might be looking for backslash \?

#

description.ext formatting is different from sqf

wary sandal
open fractal
#

ยฏ_(ใƒ„)_/ยฏ

fleet sand
open fractal
#

eyup

wary sandal
#

another "nitpick" of arma

fleet sand
open fractal
#

yeah not an arma thing, it's an inconsistency between .sqf and cpp files

#

arma takes c++ for config and sqf for scripts

wary sandal
#

right

deep loom
open fractal
#

then you can just use the variables

deep loom
#

Brilliant. Thanks.

open fractal
#

yw

shadow sapphire
#

Does anyone know that little block of code that can be run in debug to dump a function to your clipboard? I lost it and it was amazing and my favorite.

shadow sapphire
#

Itโ€™s like โ€œBIS_FNC_Whateverโ€ Magic command that unpacks and sticks in clipboard to examine.

shadow sapphire
fair drum
#

oh you mean the function export function?