#arma3_scripting

1 messages · Page 577 of 1

blissful snow
#

Hi guys, can I run this command "setVariable ["tf_receivingDistanceMultiplicator", 10]" for every player that joins the server without editing the mission? Is this possible with server sided scripting? (I want to increase the TFAR range on a dedicated Antistasi Server)

crisp cairn
#

I have a 2 part question regarding ACE Framework. Part 1 - Can I execute a FNC within a condition statement? Part 2 - If so, how can I get an answer from the FNC to show the action.

winter rose
#

@blissful snow ```sqf
// server-side
{ _x setVariable ["tf_receivingDistanceMultiplicator", 10, true] } forEach (call BIS_fnc_listPlayers);

blissful snow
#

wow thanks! Do I understand right, that I can put this code snippet into "onUserConnected" in my server.cfg?

still forum
#

no

#

but you can put it into a mod

#

Just get TFAR 1.0, set the global range coefficient in the server settings. and done

blissful snow
#

Thanks for that suggestion! I found your mod in the Workshop - I'll give it a try!

#

didn't even knew a V1.0 existed - may I suggest to include this on the official website?

still forum
#

it is on the official website

blissful snow
#

ah the beta link I apologize

ebon ridge
#

Hi, is there any command I can give that will tell armor to face a certain direction (other than setDir)?

smoky verge
#

@ebon ridge try with
this lookAt _target;

winter rose
#

setFormDir @ebon ridge

ebon ridge
#

ah nice

#

thanks

smoky verge
#

I'd trust the blue guy

ebon ridge
#

Also related to formation actually, is there a way to make a custom formation? I would like standard parade pattern like leader at the front and then a grid behind them.

still forum
#

Blue means trust yes. But Lou means distrust. So.. what do

ebon ridge
#

I think maybe I can use subgroups and doFollow commands ?

#

But ideally just set relative formation positions for a single formation would be ideal

#

well i see it, there is cfgFormations

#

appears to be completely undocumented? :/

vague geode
#

@Dedmen Can you tell me how i can script an eventhandler for an "targeted sector changed" or "fast travel requested" event? Also is it possible to get a list of all sectors and just go though all of them one by one to check whether they are targeted or not?

bright flume
#

is there a fnc to get the real world lat/long of a terrain just for reference to where its at sworn it was stored with them....

winter rose
#

it must be in the config yes, given the terrain location is shown before entering Eden

bright flume
#

ah... was hoping for a fnc to pull it up still avoiding cfg stuff like the plague for now

winter rose
#

need that now?

#
private _worldsCfg = configFile >> "CfgWorlds";
private _stratisCfg = _worldsCfg >> "Stratis";
private _latitude = getNumber (_stratisCfg >> "latitude");
private _longitude = getNumber (_stratisCfg >> "longitude");
```@bright flume
surreal peak
#

This is mainly out of my curiosity, are the lat/long the coordinates which are returned by getPos?

winter rose
#

not at all no

#

getPos* x and y are based on bottom-left of the terrain ([0,0,0])

surreal peak
#

what can they be used for in terms of scripting?

winter rose
#

nothing besides displaying the terrain location on a world map, as is done in Eden on new scenario terrain selection interface

surreal peak
#

ahhh I see

winter rose
#

language

#

you can check in which hemisphere you are though; can be useful for seasons and stuffz

surreal peak
#

thats pretty cool

bright flume
#

Thanks Lou!

#

That was a totally why I was looking for it wanna look up where it is based on RL and check sunrise vs if but it's actually legit re #livonia_feedback

winter rose
#

note that latitude is inverted*, so × -1

#

indeed

surreal peak
#

indubilately

bright flume
#

this is exactly why I say the square root of a negative is not (x)i sorry in polar coords I can root a negative still gonna be negative... stop making up imaginary numbers.. 😛

halcyon hornet
#

In a script how can you check if an value is input by an end user? I have a check if a user puts in a number less than 0 but if they put in a positive like 10 it keeps it. Some smart kid put in "10-10", then takes away the first 10 and it lets them keep it

#

I just want to get it to remove any - as soon as it appears

#

This is A2 so can't just use IN

winter rose
#

@halcyon hornet not clear; which use case are we talking about here?

halcyon hornet
#

We have a shop a user can use resources to create other items to sell at profit.

#

We have a check if the value is <0, but if they put something >0 in first then remove it after so the data is say -1 it doesn't realise

#

The result is they can make free money

bright flume
#

oooh here is a hard question is there a fnc to run like cursor target that will give the info on the position and part of a object itself not the whole object but referenced to the objects center point for like 'attachTo' or a means to do such.

winter rose
#

@halcyon hornet then either save the first input and don't deal the next ones, or check on each input, or block the field once it is filled

#

@bright flume I… didn't get any of that

sturdy cape
#

hello fellow armaholics,today i have a question regarding marker creation.i call this here ```sqf
params ["_text","_markerPos"];

_marker = createMarker [_text,_markerPos];
_marker setMarkerShape "ELLIPSE";
_marker setMarkerSize [80,80];
_marker setMarkerColor "ColorGreen";
_marker setMarkerAlpha 0.5;
_marker setMarkerBrush "Solid";
_StringText = (format ["%1 ",_text]);
_marker setMarkerText _StringText;

diag_log format ["created marker,name : (%1), position (%2), with string text (%3)",_text,_markerPos,_StringText];```with params ["text(string)",[po,si,tion]]call that_fnc_function.but it doesnt print the markertest when looking at the map,any ideas?

halcyon hornet
#

Lines 28-35 have some checks, what is the easiest way to build on that with a check for a - anywhere in the values input?

bright flume
#

lemme look up the fnc Im refering to

cosmic lichen
#

@sturdy cape The script works fine, but marker text is not supported when type ELLIPSE is used.

bright flume
#

cursorTarget, while looking at something get the objects 'refernce' of a position on it. like if Im looking at the wingtip get the 'attachTo' point for where my cursor is looking.

sturdy cape
#

@cosmic lichen thanks.who wouldve thought that^^

#

so this basically solves my problem```sqf
params ["_text","_markerPos"];

_marker = createMarker [_text,_markerPos];
_marker setMarkerShape "ELLIPSE";
_marker setMarkerSize [80,80];
_marker setMarkerColor "ColorGreen";
_marker setMarkerAlpha 0.5;
_marker setMarkerBrush "Solid";

_marker2 = createMarker [_text,_markerPos];
_marker2 setMarkerShape "ICON";
_marker2 setMarkerSize [80,80];
_marker2 setMarkerColor "ColorBlack";
_marker2 setMarkerAlpha 0.8;
_StringText = (format ["%1 ",_text]);
_marker2 setMarkerText _StringText;

diag_log format ["created marker,name : (%1), position (%2), with string text (%3)",_text,_markerPos,_StringText];```

shadow sapphire
#

How does one keep modules synchronized through a respawn or a join in progress?

I've got both high command and support modules that need to remain synchronized, or be resynchronized after a respawn.

winter rose
#

@halcyon hornet these checks, while redundants, seem ok

#

but I don't know what parse_number is ¯_(ツ)_/¯

bright flume
#

Lou did you understand what I meant now? think its maybe the 'offset' for attachTo? not sure..

winter rose
#

not an easy way (you could do a center screen /selection distance check but…)
what are you trying to do?

bright flume
#

know simply exactly where to attach 'anything' by maybe running small console script so can then code like an init/addaction attachTo

#

like eg look at the top of a plane wing and know exactly what data I need to attach at that spot Im looking at..

winter rose
#

oh, then perhaps

#

an intersection with the lod could maybe do

bright flume
#

hmmmm maybe take object, then use surfacenormal... for the offset 🤔

#

surfaceNormal - a normal to the intersected surface

mortal wigeon
#

is detecting # of frames spent to perform a scheduled function with diag_frameNo a reasonable way to performance-test scheduled code?

winter rose
#

(or diag_codePerformance)

mortal wigeon
#

Are the results from that more accurate or is there some other reason?

#

Looks like diag_codePerformance is unscheduled, and I want to test scheduled code in-game

#

I basically want to know how much I'm actually saturating the scheduler

gilded rover
#

Hi guys , i'm probably just over tired , but I am getting this error and I do not know why

_wp1 = _groupAlpha1 |*|addwaypoint ["marker_2",-1];

Error 0 elements provided, 3 expected

_arrAlpha = [eA1_0,eA1_1,eA1_2,eA1_3,eA1_4,eA1_5,eA1_6,eA1_7];
_arrBravo = [eB1_0,eB1_1,eB1_2,eB1_3,eB1_4,eB1_5,eB1_6,eB1_7];
_arrCharlie = [eC1_0,eC1_1,eC1_2,eC1_3,eC1_4,eC1_5,eC1_6,eC1_7];

_groupAlpha1 = createGroup east;
_groupBravo1 = createGroup east;
_groupCharlie1 = createGroup east;

{_groupAlpha1 createUnit ["O_SoldierU_F",_x, [], 0, "FORM"]} forEach _arrAlpha;
{_groupBravo1 createUnit ["O_Soldier_F",_x, [], 0, "FORM"]} forEach _arrBravo;
{_groupCharlie1 createUnit ["O_SoldierU_F",_x, [], 0, "FORM"]} forEach _arrCharlie;

_wp1 = _groupAlpha1 addwaypoint ["marker_2",-1];
_wp2 = _groupBravo1 addwaypoint ["wpBravo",-1];
_wp3 = _groupCharlie1 addwaypoint ["wpCharlie",-1];

_wp1 setwaypointtype "MOVE";
_wp1 setWaypointCompletionRadius 10;
_wp1 setWaypointSpeed "FULL";
_wp1 setWaypointBehaviour "AWARE";

_wp2 setwaypointtype "MOVE";
_wp2 setWaypointCompletionRadius 10;
_wp2 setWaypointSpeed "FULL";
_wp2 setWaypointBehaviour "AWARE";

_wp3 setwaypointtype "MOVE";
_wp3 setWaypointCompletionRadius 10;
_wp3 setWaypointSpeed "FULL";
_wp3 setWaypointBehaviour "AWARE";

and this is the full script , can anyone please help

unreal scroll
#

If you're using markers, use the getMarkerPos command to retrieve marker position.

normal abyss
#

Hi, I'm looking to have a marker move over the map directly to it's given destination, I've been looking into using Bresenhams line algorithm however haven't been able to properly implement it, I currently am using this setup but whilst updating my framework to allow markers to be generated it's broken. I was wondering if anyone could take a look at it, possibly suggest a solution or alternative?

Assume _targetpos is [100,100,0] and _unit to be the name of the marker.

 _targetY = round (_targetpos select 1);      
 _currentX = [getMarkerPos _unit] select 0;        
 _currentX = round (_currentX select 0);      
 _currentY = [getMarkerPos _unit] select 0;         
_currentY = round (_currenty select 1);       
 _tX = ( _targetX - _currentX );      
 _tY = ( _targetY -_currentY );      
 _dist = sqrt (_tX*_tx+_ty*_ty);      
 if (_dist >= 1) then {    
_velX = (_tX/_dist)*_speed;     
_velY = (_tY/_dist)*_speed;      
_unit setMarkerPos [_currentX+_velX,_currentY+_velY];  
uisleep (0.3/timescale);};```
still forum
#

@normal abyss please use
```sqf
code
```
for code, for one your snippet is hard to read, second colored highlighting can show syntax errors, third your code doesn't even display correctly and some characters disappeared

#

@vague geode

Can you tell my how i can script an eventhandler for an "targeted sector changed" or "fast travel requested" event?
I would expect warlords itself to already have such a eventhandler. But I don't know its name, and I don't have time to look either.
@winter rose
use https://community.bistudio.com/wiki/BIS_fnc_codePerformance instead
Doesn't work with scheduled, its unscheduled.
@mortal wigeon
is detecting # of frames spent to perform a scheduled function with diag_frameNo a reasonable way to performance-test scheduled code?
There is no reasonable way at all to performance test scheduled code. The execution speed of your code literally depends on everything else thats going on.

@gilded rover

_groupAlpha1 addwaypoint ["marker_2",-1];
That syntax doesn't exist, addWaypoint doesn't take a marker name as argument.
See
https://community.bistudio.com/wiki/addWaypoint

winter rose
#

@still forum (double post)

still forum
#

Discord double post :U

winter rose
#

no u

still forum
#

😢

winter rose
#

(I noticed this issue happen mostly on mobile with bad network… but I suppose you use desktop here)

still forum
#

Discord just had a API outage

bright flume
#

Derp a La Net Burp'n

halcyon hornet
#

@winter rose the checks are not redundant, because people used to exploit by putting in a value less than 0 e.g. -1 which would give them money for free. We fixed with a <0 check but they still can work around it

#

If they type in "10-10" then before pressing ok take out the first 10 so it just reads as "-10" ArmA doesn't detect this as a negative number if it's actively listening

winter rose
#

Arma*

then your "parse_number" function is wrong

#

you can also remove "-" from _amount_str by string operation

#

or use abs

vague geode
#

@Dedmen Can you tell me where I can look up whether or not warlords already has such an eventhandler?

still forum
#

inside the warlords scripts

gilded rover
#

@still forum fixed the syntax , but still get the _wp1 = _groupAlpha1 |*|addWaypoint ["wpAlpha",-1]; Error 0 elements provided, 3 expected
wpAlpha is a gameLogic

still forum
#

no you didn't fix the syntax

gilded rover
#

okay? how must I write it then?🙈

still forum
#

if its a game logic then I assume you want
_groupAlpha1 addWaypoint [getPos wpAlpha, -1]

gilded rover
#

🤦 right , I should probably go back to bed , thank you kind sir

real tartan
#

@winter rose is there some way to check what effect (Local / Global) have BIS function in wiki ?

lapis ivy
#

Hi.
How do I add a weapon with an item without skipping the animation?

_unit addWeaponItem ["rhs_weap_hk416d10", ["rhs_mag_30Rnd_556x45_M855A1_Stanag", 1, "RH_cmore"]];
This command does not add weapons. I can't understand how it works.

still forum
#

you can read the code inside the function and assume if its local or global

#

This command does not add weapons. I can't understand how it works.
correct, it adds attachments to the weapon

#

add the weapon with addWeapon first, then add the attachments

winter rose
#

@real tartan ^
check locality of function-used commands

lapis ivy
#

I couldn't do it.

_unit addWeaponItem ["rhs_weap_hk416d10", ["rhs_mag_30Rnd_556x45_M855A1_Stanag", 1, "RH_cmore"]];```
#

The weapon adds, but the item does not.

still forum
#

"RH_cmore" that doesn't look like a muzzle

#

that looks like a scope, thats not correct

lapis ivy
#

Yes, it's scope

still forum
#

just use the addWeaponItem main syntax, and add the mag and scope seperately

atomic oar
#

Heyyy all. I found these scripts written for an 'energy shield' thing online. They're all declaring "Player" as the variable to build the script around. I'm really not great at scripting at all. I actually got some sounds and particle effects to work in the script if I want, but I think that the logic isn't really salvageable to run it on an object that isn't the player. It was that person's very first script, but the hunger I have to get this working is real af.

Especially since I built some great VSTs for the soundFXs

#

There's another script that works on vehs I found that puts up some alright particle effects as well. I would just need to implement a timer into that one to recharge. I'm just outta step in parsing arma syntax

young current
atomic oar
#

yaaaa the scripting commands in the wiki is bookmarked right now

#

i'm going between learning dotnet and arma scripting right now XD

#

and ya i'll deff run some tutorials

young current
#

those helped me to come in terms with the basic stuff

lapis ivy
#
_unit addWeaponItem "RH_cmore";```
Right?
atomic oar
young current
#

links dont work

#

but in general you have to understand quite a lot in order to use/modify scripts made by others

atomic oar
#

ya it seems so. I have a lot of syntax work to do with Arma before I'll get there. Too many grammars i don't know

#

I turned them to text files. Just to share what I was talkin about. I'm gonna just build my own tho either way.

last rain
#

It is possible have script conversion mission when I play in mission.sqm and after I edit this?

still forum
#

explain?

last rain
#

I play maybe Zeus and I wish save this, and export in editor.

sage dawn
#

You mean like, place stuff in Zeus and turn that into a mission?

still forum
#

Ah you want to save a zeus mission as actual mission

#

thats somewhat possible, you can save it as a sqf script

molten roost
#

Ares or mcc sandbox (don't remember which one) have an export to sqm function. You can copy it over to a notepad, import it later when your out of the mission

last rain
#

thats somewhat possible, you can save it as a sqf script yes I wish this
Ares or mcc sandbox (don't remember which one) have an export to sqm function. You can copy it over to a notepad, import it later when your out of the mission it i not wish use Ares or mcc it is possible do in script?

still forum
#

Afaik Arma itself has a script function to do it

jade abyss
#

You mean copyToClipboard?

#

(iirc disabled in MP)

last rain
#

You mean copyToClipboard? yes

exotic flax
#

I only know of BIS_fnc_3DENExportSQF, but that works in 3den only

jade abyss
winter rose
#

one (very) raw implementation:

private _data = (allMissionObjects "All") apply { [typeOf _x, getPosATL _x, [vectorDir _x, vectorUp _x]] };
copyToClipboard str _data;
jade abyss
#

or just use diag_log and have it in the .rpt?

winter rose
#

even better!

jade abyss
#

Yeah, no hustle with the clipboard needed

winter rose
#

restoration:

{
  params ["_type", "_posATL", "_vectors"];
  private _object = createVehicle [_type, _posATL];
  _object setPosATL _posATL;
  _object setVectorDirAndUp _vectors;
} forEach _data;
last rain
#

Okey if it hard. If I use Ares, it is possible activation modules zeus in script if I not zeus?

#

@winter rose restoration i can edit this after in 3DEN?

winter rose
#

no

#

as I said, it is a very raw implementation, and would grab all items in the game, including dropped weapons, tyre tracks etc

it is not a working code

round scroll
#

I'm trying to create a RWR like interface for the F-18 backseater which shall allow jamming of AA radars at first. The placement of the AA however fails, I would like to place it where it is in relation to the plane. I tried to get the vector from jammer(F-18) to AA via: (getPos _jammer) vectorFromTo (getPos _x); and then use that to place a text for the AA on a dialog. Code for the function is here: https://pastebin.ubuntu.com/p/Nmqj47GhTj/

#

while the AA text moves around the screen, it is not in relation to the heading of the plane

#

something I seem to miss with grabbing the vector and applying it to the text position

winter rose
#

@round scroll you are grabbing the vector from plane to AA in a world reference, you also have to "subtract" the current plane vector

#

maybe vectorDiff but I am not good in 3D calculations, I try'n'error

round scroll
#

something like ((getPos _jammer) vectorFromTo (getPos _x)) vectorDiff (getPos _jammer) I guess

#

thanks, I try that

ornate marsh
#

I'm trying to detect if a grenade of a certain type is near an object, but the problem is that when the grenade is thrown, it has a different set of numbers before it (2900272: ka_m814_ammo.p3d, for example). I'm using this code to check for it in the debug console at the moment: doubletap nearObjects ["GrenadeHand", 5], but I'm struggling to execute code when it detects it. Here's what i've come up with ```sqf
checkDoubletap == "true";
while {checkDoubletap == "true"} do {
{
if (_x == "ka_m814_ammo.p3d") then
{
[doubletap, false] remoteExec ["hideObjectGlobal", 2];
checkDoubletap = "false";
};
} forEach doubletap nearObjects ["GrenadeHand", 5];
};

if anyone knows how to fix this or has any suggestions please let me know
still forum
#

"false" do you know that we have real booleans true and false too?

ornate marsh
#

yea, my mistake

still forum
#

_x == nearObjects returns objects, not strings. Comparing an object with a string always returns false as they are different types

#

I think you'd want to check the classname typeOf of the object _x

ornate marsh
#

typeOf 2900234: ka_m814_ammo.p3d this is getting a "missing ;" i presume it's the : causing the problem?

cosmic lichen
#

2900234: ka_m814_ammo.p3d This is a reference to an object. Did you store that as string?

#

oh yeah, you did.

ornate marsh
#

here's the code I have now

#
checkDoubletap == "true"; 
while {checkDoubletap == "true"} do { 
 {checkType = typeOf _x;
 if (checkType == "ka_m814_ammo.p3d") then  
  { 
  [doubletap, false] remoteExec ["hideObjectGlobal", 2]; 
  checkDoubletap = "false"; 
  }; 
 } forEach doubletap nearObjects ["GrenadeHand", 5]; 
};
cosmic lichen
#

First line is wrong

ornate marsh
#

oh yeah 😂

#

never even noticed that

cosmic lichen
#
TAG_checkDoubletap = true;
while {TAG_checkDoubletap} do
{ 
    {
        TAG_checkType = typeOf _x;
        if (TAG_checkType == SOMECLASSNAME) then  
        { 
            [TAG_doubletap, false] remoteExec ["hideObjectGlobal", 2]; 
            TAG_checkDoubletap = false;
        }; 
    } forEach (TAG_doubletap nearObjects ["GrenadeHand", 5]);
    sleep 0.01;//Might want to add some sleep here, depending on what you wanna do
};```
#

replace the SOMECLASSNAME with an actual vehicle class.

#

and replace TAG with a unique tag like BFTTG

ornate marsh
#

so how would i find the classname of this 2900272: ka_m814_ammo.p3d, as typeOf wasn't working

cosmic lichen
#

What does typeOf return?

ornate marsh
#

typeOf 2900234: ka_m814_ammo.p3d returns a missing ;

cosmic lichen
#

Was does TAG_checkType return?

ornate marsh
#

lemme check, one sec

#

doesn't return anything

still forum
#

Are you sure that TAG_doubletap nearObjects ["GrenadeHand", 5]; actually returns stuff?

cosmic lichen
#

Would have been my next question.

ornate marsh
#

says there's a generic error in expression there

#

changed it to just doubletap for the object name

#

doubletap nearObjects ["GrenadeHand", 5]; this however in the debug console returns the grenade

cosmic lichen
#

Yeah

#

Put that in brackets

#
forEach (doubletap nearObjects ["GrenadeHand", 5]);```
ornate marsh
#

no errors, but the code isn't doing what it's supposed to (reveal the object)

#

i cant find the classname of the grenade though. Would it be in the CfgVehicles file?

winter rose
#

more of a CfgAmmo

ornate marsh
#

ok, i'll have a look

cosmic lichen
#

Is hideObjectGlobal supposed to show TAG_doubletap ?

#

I guess it should show what's stored in _x

ornate marsh
#

yea

#

basically, you throw a the grenade, and the object should appear

cosmic lichen
#

Ic

ornate marsh
#

this is the current code:

BEN_checkDoubletap = true; 
while {BEN_checkDoubletap} do 
{  
    { 
        BEN_checkType = typeOf _x; 
        if (BEN_checkType == "KA_M814") then   
        {  
            [doubletap, false] remoteExec ["hideObjectGlobal", 2];  
            BEN_checkDoubletap = false; 
        };  
    } forEach (doubletap nearObjects ["GrenadeHand", 5]);
    };
#

the object is not appearing

cosmic lichen
#

Missing quotes in line 6

ornate marsh
#

still not appearing

cosmic lichen
#

Guess nearObjects is not returning the right thing, or typeOf doesn't return the class name.

ornate marsh
#

BEN_checkType is not returning anything

cosmic lichen
#

What does sqf doubletap nearObjects ["GrenadeHand", 5]return?

ornate marsh
#

nearObects returns this 2900272: ka_m814_ammo.p3d the numbers at the start are always different

cosmic lichen
#

So it returns the right object, but typeOf can't find the class name.

ornate marsh
#

correct

#

is it something to do with the : ?

cosmic lichen
#

No

#

That's all fine

ornate marsh
#

according to the wiki, the things after forEach shouldn't be in brackets?

#

should the while loop be inside the forEach? i dunno, just gonna throw things out there

cosmic lichen
#

So I just tested your code and it returns the grenades fine

#

I guess something is wrong with that modded grenade.

ornate marsh
#

what code did you use, as in classnames and grenades

cosmic lichen
#

"mini_Grenade"

ornate marsh
#

i just tested with replacing the classname with yours, and doesn't appear for me

tough abyss
#

What would be the best solution to combine these array numbers in the following way: SQF _array = [["string",5],["another",1],["another",2],["string",2]] ---> [["string",7],["another",3]]

queen cargo
#

iterate through all and add them up @tough abyss

winter rose
#

isn't there a BIS fnc that does that though?

tough abyss
#

What would be the FASTEST way?

queen cargo
#

depends on how many of those you have

#

do not optimize premature btw.
no need to make things complicated for no reason

tough abyss
#

I guess sort them first and check if next string is the the next in order

#

It could be over 100 elements

distant oyster
queen cargo
#

Will not help him much

distant oyster
#

YES that was what I was also searching for but couldnt remember the name of 😆

winter rose
#

@distant oyster I went through the Array Functions group after you posted yours, so thanks ^^

tough abyss
#

Thanks!

ornate marsh
#

@cosmic lichen any ideas of the problem?

cosmic lichen
#

@ornate marsh sqf BEN_checkDoubletap = true; [] spawn { while {BEN_checkDoubletap} do { hintSilent "Loop Started"; { systemChat format ["Detected Grenade: %1",typeOf _x]; if (typeOf _x == "mini_Grenade") exitWith { [BEN_doubletap, false] remoteExec ["hideObjectGlobal", 2]; BEN_checkDoubletap = false; hintSilent "Loop exited. Object is visible now."; }; } forEach (BEN_doubletap nearObjects ["GrenadeHand", 50]); }; };
Works now

#

Not sure what the issue was.

ornate marsh
#

i'll test it with the modded grenade

cosmic lichen
#

Sure

ornate marsh
#

works, thank you for your help

ebon ridge
#

So lookAt doesn't work to make a tracked vehicle face a certain direction, any other ideas?

#

I can't even find a way to give turn left/right command to driver

winter rose
#

ebon ridge
#

Looks like I can't execute input actions on AI like driver cursorObject action ["CommandLeft", cursorObject]

#

it doesn't recognize enum for any of the turn input actions

#

oh when I say face a certain direction I mean turn the vehicle not the turret

winter rose
#

setFormDir does not work.

ebon ridge
#

Oh I forgot about it, are you saying it doesn't, or asking if I tried it?

#

anyway i will try it

halcyon hornet
#

parse_number = { private ["_number"]; _number = _this select 0; if (isNil "_number") exitWith {0}; if (typeName _number == "SCALAR") exitWith {_number}; if (typeName _number != "STRING") exitWith {0}; _number = parseNumber(_number); if (isNil "_number") exitWith {0}; if (typeName _number != "SCALAR") exitWith {0}; _number };

#

What would I need to add to this to check for a - in the input?

winter rose
#

@ebon ridge tried, it does not

ebon ridge
#

ah damn thanks for checking it

winter rose
#

@halcyon hornet just parseNumber

#

also,

```sqf
/* your code */
```

#

@halcyon hornet

parseNumber "10-10" // returns 10

so what is your issue with it?

winter rose
#

@ebon ridge is setDir + setFormDir out of question?

ebon ridge
#

nah not out of the question just not preferred

#

i will use it if i can't find another way

still forum
#

@halcyon hornet

  1. don't use private array, use the private keyword like private _number =
  2. use params to get values from _this
  3. use isEqualType instead of typeName
  4. use in to check if string contains -?
ebon ridge
#

it seems something pretty damn important to not be scriptable via standard commands, armor difference on vehicle is very big on different sides

winter rose
#
private _originalDir = getDir _tank;
for "_i" from 0 to 44 do {
  sleep 0.1;
  _tank setDir (_originalDir + _i);
};
``` 😋 😅
distant egret
#

Is there an bis/CBA function of getDir, which works similar to getPos from CBA and works with (almost) all types of input?

winter rose
#

"getPos from CBA" 🤔
@distant egret what do you need?

distant egret
#

Something that works for markers and objects at the same time mainly.

#

Like getPos

#

From CBA

winter rose
#

I don't know "getPos from CBA"

you can cook something yourself that covers getMarkerDir/getDir

distant egret
#

Oh getPos from CBA basically does all types of getPos in one function.

#

So marker, location, object ect.

halcyon hornet
#

@still forum how does in work? Would this work?

if ( "-" in _number) exitWith {0};
still forum
winter rose
#
_getStuffDir = {
  params [["_stuff", "", ["", objNull]]];
  if (_stuff == "") exitWith {};
  if (_stuff isEqualType "") exitWith { markerDir _stuff; };
  getDir _stuff;
};
``` @distant egret
distant egret
#

Was only checking if CBA made one before reinventing the wheel.

#

Looks like I need to invent the wheel here. 😅

ebon ridge
#

if (_stuff == "") exitWith {}; doesn't that give type mismatch error if _stuff isn't a string?

#

should be isEqualTo instead

faint fossil
#

hello beautiful people >_>

#

how do i clear all the pylons on a plane and replace it with something?

#
this removeWeaponGlobal "weapon_AGM_65Launcher";
this removeWeaponGlobal "missiles_ASRAAM";
this removeWeaponGlobal "GBU12BombLauncher";
this removeWeaponGlobal "GBU12BombLauncher";
this removeWeaponGlobal "Bomb_04_Plane_CAS_01_F";
this removeWeaponGlobal "missiles_SCALPEL";

doesnt seem to do much

ebon ridge
#

So what about scan horizon? Is there an sqf command for that? Seems like there isn't...

faint fossil
#

thank you @surreal peak

#

sorry i was flying just now didnt check discord

surreal peak
#

all good, glad to help

old adder
#

Using playSound3D in a script, if I'm using a sound file located in an addon file (pbo) do I need to set up any configs or sound files in description.ext?

still forum
#

if the sound doesn't already have a CfgSounds entry, you need to create one in description.ext

spark rose
#

Banging my head against the wall here - subtasks do not appear in the right order, no matter what task ID i give them

#

any advice?

old adder
#

got you, and I'm curious, when I set the sound volume in description.ext, will using playsound3d still allow me to change the volume?

winter rose
#

@spark rose iirc, they appear in the order they are created

#

and task id doesn't have anything with order, it is only used as an identifier.

#

@old adder yes

old adder
#

ty @still forum @winter rose

spark rose
#

they appear in the order they're created...i have them all created at mission start so...i'm not sure how to fix that

winter rose
#

how do you create them? scripting or modules?

spark rose
#

modules

halcyon hornet
#

So I'm getting this error in A2 at the moment

#
is_prone = {
    private ["_unit", "_return", "_check"];

    _unit = _this select 0;
    _return = false;
    _check = (_unit selectionPosition "neck" select 2);

    if (_check <= 0.5) then { _return = true; } else { _return = false; };
    _return;
};


is_facing = {
    private ["_unit1", "_unit2", "_return"];

    _unit1 = _this select 0;
    _unit2 = _this select 1;

    _return = [getpos _unit1, getdir _unit1, 45, getpos _unit2] call BIS_fnc_inAngleSector;
    _return;
};


is_frontback = {
    private ["_unit1", "_unit2", "_return", "_check"];

    _unit1 = _this select 0;
    _unit2 = _this select 1;
    _return = "";

    _check = [getpos _unit2, getdir _unit2, 180, getpos _unit1] call BIS_fnc_inAngleSector;
    if (_check) then {
            _return = "front";
        } else {
            _return = "back";
        };

    _return;
};

#

Can't see where it's giving up?

surreal peak
#

@halcyon hornet can u show code where you are calling is_frontback

old adder
#

@halcyon hornet I don't know too much but is BIS_fnc_inAngleSector not an arma 3 function? I didn't see it on the arma 2 bis functions list

halcyon hornet
#

Oh that's a RIP

gilded rover
#

So I have respawn on custom positions enabled , and respawn menu (to choose where to spawn) , but when i spawn in (just chose my unit and clicked continue on the briefing) MP I get dropped in the bottom left corner of the map.
any ideas?

myRespawn1 = [west,"res1"] call BIS_fnc_addRespawnPosition;
squadRespawnGroup = [west,"grp_lead"] call BIS_fnc_addRespawnPosition;
squadRespawnMedic = [west,"grpMedic"] call BIS_fnc_addRespawnPosition;
halcyon hornet
#

Thanks 🤦‍♂️

surreal peak
#

np, gl

gilded rover
#

also is this missionNamespace just a fancy name for global variable?

halcyon hornet
#

Is there an A2 equivalent for the function?

winter rose
#

@spark rose theeen maybe the order of module insertion in Eden, I don't know 😐

spark rose
#

haha

#

it's okay, i'm coming up with an alternate way of doing it.

winter rose
surreal peak
#

?

old adder
#

@halcyon hornet BIS_fnc_sceneGetPositionByAngle could work if you make your own check to compare to the returned coordinates from the function

old adder
#

Hey, I'm currently working on a script to create some flashing lightpoints, the current method I'm using is setting the brightness to 0, using uiSleep, then setting brightness back up. Anyone know if theres a more resourceful method?

#

`private _flashes = 20;

while {_flashes > 0} do
{
_light setLightBrightness 0;
uiSleep 0.5;
_light setLightBrightness 0.8;
uiSleep 0.5;
_flashes = _flashes - 1;
};
`

unreal scroll
#

There are several flashlights in 3rd party mods, like ACE/6PDP etc, which made as handguns, and can be turned on by hitting "L". Is there any way to switch it via a script, and check if it is on? I tried stock commands like isFlashlightOn, but it didn't work.

surreal peak
old adder
#

@surreal peak ohh did not realize you could use increment/decrement steps in for loops in arma. That'll probably make the script a bit better. Thanks

acoustic abyss
#

@spark rose I second what Lou says. The last created Diary module entry is added as the first briefing entry. You can fudge it by setting the module to "synchronized units only" and then synchronizing them in the desired order to the player units. But that might cause a repetitive strain injury.. I recommend you look up a guide on writing out a briefing script and starting it from init.sqf or initplayerlocal.sqf . Physiotherapists are hard to come by (!)

shadow sapphire
#

How do I get a named object's ownerID?

I have a headless client named HC1. Is there a way to just page it using that variable name and get its ownerID?

spark kiln
#

I am sure you have been asked this before, but how simple would it be to use this setObjectTexture [1, "\pboname\texture2.paa"];
To turn a static object completely silver

#

Specifically the tanoa castle towers

#

Using this setObjectTextureGlobal [1, "#(rgb,192,192,192)color(1,1,1,1)"]; didnt really do anything

smoky verge
#

about never
the tanoa castle towers have no hiddenselections which is a way to mark textures that can be edited and retextured either by a mod or the code above
thats what that first 1 means, its the number for the object selection based on the amount it has (starting from 0)
but to put it shortly
no you can't do that with the tanoa castle

spark kiln
#

I will go ahead and guess that same applies to most static objects? like rock formations

young current
#

yes

smoky verge
#

correct
to know which object has an hiddenselecion open it in config viewer and search for the hiddenselection
if it has something like camo1, camo2 etc it means it has them

#

but for rocks I wouldn't bother to look

spark kiln
#

Alright, thank you for the help

smoky verge
#

hopefully one day BI will release samples

faint fossil
#

hello folks i'm back with dumb questions

#

so uh

#

i'd like to make a prop that when you walk up to it, will give you action to spawn a jet of your choice in the air and automatically put you in the pilot seat

#

preferably with pylon loadouts that i can config before hand

#

how should i go about this?

mortal wigeon
#

Is there a way via script to detect a string in a chat channel? e.g. if a player types "ELEV 84.5" in chat, I could elevate a gun to 84.5

real tartan
#

is there a reverse function to BIS_fnc_colorRGBtoHTML ? Or maybe some convertor color to RGB values for color of particles ? Searching for common colors of BIS smoke grenades.

robust hollow
flat elbow
#

let's say i want to delete a bullet so if someone shoot it will not hit or kill anyone/anything, what is the best path?

unreal scroll
flat elbow
#

ok i figured this out but this will only tell me he shot, how do i prevent the bullet to do any damage?

#

just assign nil to the projectile object?

verbal saddle
#

_projectile is the bullet object, so you can either change its velocity or delete it outright to stop it dealing damage.

unreal scroll
#

deletevehicle _projectile;

flat elbow
#

mmh i see, the "vehicle" part of the command is misleading

#

as it deletes objects in general, not just vehicles

vague geode
#

Is it possible to use the real time in a mission's init.sgf to set the mission start time to the real time?

harsh vine
#

@gilded rover remove the quotation marks ""

flat elbow
#

@robust hollow if it's not in the CBA i'd suggest to make a push request to add it as it seems both useful and generic enough for the project consideration

gilded rover
#

@gilded rover remove the quotation marks ""
@harsh vine was more complex than that , quotation marks need to stay , but this idiot (me) forgot respawn delay , and that's why it didn't work. but thanks for replying

harsh vine
#

hehe sometimes we forget the most basic stuff ...

unreal scroll
#

@flat elbow Vehicles for game engine is not equalto vehicles in common sense. I.e., in BF2 a ladder is the vehicle, etc. So often it's all that can move, but not a player 🙂

winter rose
#

@vague geode only in MP with missionStart (I think)

vague geode
#

I know that you can change the mission start time but is it possible to somehow get the real time to set the mission start time to said realtime?

winter rose
#

see my message above

only in MP with missionStart (I think)

loud python
#

uh... so I'm pretty sure there was a neat way to get the parent class of some object and I can't remember how

#

say I have typeOf cursorTarget and that's some quadbike or something

#

all I can find is inheritsFrom, but that wants an actual config class, not just the class name

loud python
#

nah

#

that also takes the config class as a parameter, doesn't it?

winter rose
#

oh, true

loud python
#

I'm 99% sure there was some command to do this with just the class name

#

without having to do configFile >> "cfgVehicles" >> (typeOf ...)

#

which is a pain to type

winter rose
#

doesn't ring a bell, unfortunately

winter rose
#

@vague geode figured it out?

molten roost
#

Hey friends. Working on scripting a task using MPEventHandler and a global variable. Running into some issues.
InitServer: deadassets = 0; publicVariable "deadassets"; Object init:this addMPEventHandler ["MPKilled", {if (isServer) exitwith{deadassets = deadassets + 1; publicVariable "deadassets"};}]; Trigger (server only) condition:deadassets >= 6 I have found that the eventhandler is triggering multiple times on dedicated, adding 1 for each client. What am i missing?

unique sundial
#

Event handler is added for every client joining the mission because object init is executed for every client joining the mission

halcyon hornet
#

So on A2 I have the following code:

check_supporter_items = {
    private["_pWeps", "_supWepArray", "_vipWepArray"]; 
_vipWepArray = ["AKS_74_GOSHAWK", "BAF_L85A2_RIS_CWS", "FN_FAL_ANPVS4", "m107", "m8_tws", "m8_tws_sd", "MetisLauncher", "STRELA", "Javelin"];
_supWepArray = ["Pecheneg","MG36","MG36_camo","ksvk","SVD_NSPU_EP1", "M110_NVG_EP1", "BAF_AS50_scoped", "AKS_74_NSPU","bizon_silenced", "Igla", "Stinger"];
    
    
    _pWeps = currentWeapon player;
    if(!isVip) then {
        if(_x == _pWeps) then {
                    [player, 10] call jail_player_punish;
        }; count _vipWepArray;
    };
    if(!isSup) then {
        {
            
            if(_x == _pWeps) then {
                [player, 5] call jail_player_punish;
            };
        } count _supWepArray;
    };
};
#

With output error it's saying undefined variable in there

#

But unless I'm blind there isnt?

surreal peak
#

which line is it complaining about?

halcyon hornet
surreal peak
#

where are you defining isVIP and isSup

halcyon hornet
#

From database

#
if (_uid in supportersVIP_list) then {
    supportersVIP = true;
    ["SERVER",[player,player,"supportersVIP",true],"s_whitelist_add",false,false]call network_MPExec;
    player sideChat "WhiteList Set VIP";
};

isSup = (supporters1 || supporters2 || supporters3 || supporters4 || supportersVIP);
isVip = supportersVIP;
flat elbow
#

how can I know if an object is going to collide to another object?

surreal peak
#

are the databases full Caster?

winter rose
#

it goes "bump" @flat elbow

flat elbow
#

bump?

surreal peak
#

@flat elbow you gonna have to elaborate on that one

flat elbow
#

ok so basically i have a training field, AIs will shoot at people that must move inside a pathway

#

i want the shots to land near them to scare them but not to kill them so i will attach an event handler and i have the projectile object

vague geode
#

@winter rose Yeah, I think I misunderstood you at first. Thanks for the help.

flat elbow
#

i want to delete the projectile object if it's going to hit the player, otherwise not

winter rose
#

why? you can use handleDamage EH to avoid player damage from specific units?

surreal peak
#

and if you dont wana do that, you will have to do math

winter rose
#

(and I don't like math)

surreal peak
#

Also Lou do you have a solution for casper? I cant think what the problem is

winter rose
#

(well, math doesn't like me)

flat elbow
#

wait handleDamage will only tell me if the person was damaged right?

surreal peak
#

@halcyon hornet are the databases full? if none of them have anything the variable wont be a thing IIRC

molten roost
#

@unique sundial ah idk how I missed that. Fixxed it with a simple server check wrapped around the init. Ty

winter rose
#

@halcyon hornet

if (_uid in supportersVIP_list) then {
    supportersVIP = true; // <- not set to false anywhere!
    (...)
}
halcyon hornet
#

@winter rose just saw that a min ago 🤦‍♂️ , adding an else check now 🙂

flat elbow
#

oh i can return the damage amount

winter rose
#

yes, set to "same amount" if shooter is x or y, or let it process for normal damage

flat elbow
#

mmh sounds like a good solution, but now i want to know about the other way to personal knowledge, how do you get the bullet vector?

winter rose
#

velocity _bullet from Fired EH

flat elbow
#

oh so velocity is actually a vector returning

winter rose
#

yup, in world coordinates

flat elbow
halcyon hornet
#

So i've updated the whitelist to this:

if (_uid in supportersVIP_list) then {
    supportersVIP = true;
    ["SERVER",[player,player,"supportersVIP",true],"s_whitelist_add",false,false]call network_MPExec;
    player sideChat "WhiteList Set VIP";

    else{
        supportersVIP = false;
    };

};
#

But it's still giving the same error

surreal peak
#
if (_uid in supportersVIP_list) then {
    supportersVIP = true;
    ["SERVER",[player,player,"supportersVIP",true],"s_whitelist_add",false,false]call network_MPExec;
    player sideChat "WhiteList Set VIP";

    } else{
        supportersVIP = false;
    };

you saw nothing

#

try that

winter rose
#

missing } yep

surreal peak
#
if () then 
{
//something
} else {
//something else
};
halcyon hornet
#

🤦‍♂️

unreal scroll
#

Use editor with highllighting parentheses :)@surreal peak

winter rose
#

@Caseter*?

surreal peak
#

@unreal scroll I was correcting him 😄

winter rose
#

yet you had one } too much too :3

unreal scroll
#

Yes, but there is an extra } at the end

surreal peak
#

did I? Freck

#

I just copied what caster put and adding in the parathesis

#

fixed it

halcyon hornet
#

Still giving the same error

#

@unreal scroll Visual Studio Code does, I'm just blind apparently

surreal peak
#

visual studio works with sqf?

halcyon hornet
#

There is an extension for it

surreal peak
#

ah nice, ty

unreal scroll
#

In your case it highlights it ok, there is a just syntax error.

halcyon hornet
#

Armitxes made the extension for Visual Studio, it's quite nice

halcyon hornet
surreal peak
#

what does your whole code look like?

halcyon hornet
#
if (_uid in supportersVIP_list) then {
    supportersVIP = true;
    ["SERVER",[player,player,"supportersVIP",true],"s_whitelist_add",false,false]call network_MPExec;
    player sideChat "WhiteList Set VIP";

    } else {
        supportersVIP = false;
};

isSup = (supporters1 || supporters2 || supporters3 || supporters4 || supportersVIP);

if (supporterVIP = true) then {
    isVIP = true;
    } else {
    isVIP = false;
};
#

That's the whitelist check

#

This is the supporter check with the issue:

#
check_supporter_items = {
    private["_pWeps", "_supWepArray", "_vipWepArray"]; 
_vipWepArray = ["AKS_74_GOSHAWK", "BAF_L85A2_RIS_CWS", "FN_FAL_ANPVS4", "m107", "m8_tws", "m8_tws_sd", "MetisLauncher", "STRELA", "Javelin"];
_supWepArray = ["Pecheneg","MG36","MG36_camo","ksvk","SVD_NSPU_EP1", "M110_NVG_EP1", "BAF_AS50_scoped", "AKS_74_NSPU","bizon_silenced", "Igla", "Stinger"];
    
    
    _pWeps = currentWeapon player;
    if(!isVip) then {
        if(["_TWS", _pWeps] call KK_fnc_inString) then {
            [player, 10] call jail_player_punish;
        }
        else{
            {
                if(_x == _pWeps) then {
                    [player, 10] call jail_player_punish;
                };
            } count _vipWepArray;
        };
    };
    if(!isSup) then {
        {
            
            if(_x == _pWeps) then {
                [player, 5] call jail_player_punish;
            };
        } count _supWepArray;
    };
};
unreal scroll
#

Did you published the isVip global variable?

#
        if(["_TWS", _pWeps] call KK_fnc_inString) then {
            [player, 10] call jail_player_punish;
        }
        else{```
What is that syntax? Bring it to the readable view.
halcyon hornet
#

Which syntax?

unreal scroll
#
    if (["_TWS", _pWeps] call KK_fnc_inString) then {
        [player, 10] call jail_player_punish;
    } else {
        {
            if (_x isEqualTo _pWeps) then {
                [player, 10] call jail_player_punish;
            };
        } count _vipWepArray;
    };
};
if (!isSup) then {
    {
        if (_x isEqualTo _pWeps) then {
            [player, 5] call jail_player_punish;
        };
    } count _supWepArray;
};

What are you counting that values for? What your function should return?
Or the return value for check_supporter_items should be boolean?

#

Also I don't see defining _TWS variable.

halcyon hornet
#

That is using KK's script, it's checking _pWeps for any guns that are TWS. It's futher up in code but is there

unreal scroll
#

If the _TWS variable not defined, then you should get an error, of course. It is the local variable.
Then, define the isVip veriable, and publish it.
Then, what the jail_player_punish function returns? My intuition says that it should do something, and not count anything - but in else you count the array elements. Then, you count another array elements again.
So, your check_supporter_items functions will return something that jail_player_punish returns in the last part, or int (array count).

halcyon hornet
#

The TWS part is exactly how it should be based off KK's blog

#

How to use:
_found = ["needle", "Needle in Haystack"] call KK_fnc_inString;
*/

#

We're searching for "_TWS" in a gun class

#

And isVIP is defined:

if (_uid in supportersVIP_list) then {
    supportersVIP = true;
    ["SERVER",[player,player,"supportersVIP",true],"s_whitelist_add",false,false]call network_MPExec;
    player sideChat "WhiteList Set VIP";

    } else {
        supportersVIP = false;
};
unreal scroll
#

Ah, ok, it is just a parameter.
network_MPExec - is this a standard A2 library function?

winter rose
#

nope

halcyon hornet
#

This is my trying to fix loads of bugs on an old A2 mission, so lots of stuff wrong in it

ebon ridge
#

Any ideas why the AI driving almost always takes a weird route when first starting driving? They never just go in a straight line but swerve around invisible objects before setting off straight. I can provide video but hopefully this is common knowledge.

winter rose
#

they need to find a "connection" to normal road driving I suppose.

ebon ridge
#

ah yeah okay makes sense

#

Also I noticed they seems to serve to hit objects more often than avoid them, not sure if its confirmation bias, but really some cases are ridiculous. Pedestrian standing still on side walk, car drives by and swerves off the road to hit them, then carries on. Its extra hilarious when they hit them, drive forward, and then reverse back and forward a few times to really make sure they are dead 😄

winter rose
#

if you placed civilians on both sides, they try to take extra distance from one and go hit the other
any way, they are confused when there are (some) obstacles near the road

#

(but maybe they hated that guy, too)

silver mauve
#

Need abit of help, im trying to make an intro where the player has cinematic bars and cannot have an input until the bars have gone does anyone have a know how?

winter rose
silver mauve
#

_camera = "camera" camCreate [0, 0, 0];
_camera camPrepareTarget player;
_camera camPrepareRelPos [0, -5, 10];
_camera cameraEffect ["internal", "back"];
_camera camCommitPrepared 0;
waitUntil { camCommitted _camera };

_camera camPrepareRelPos [90, 25, 8];
_camera camCommitPrepared 5;
waitUntil { camCommitted _camera };

_camera camPrepareRelPos [-90, -5, 5];
_camera camCommitPrepared 3;
waitUntil { camCommitted _camera };

sleep 3;
_camera cameraEffect ["terminate", "back"];
camDestroy _camera;

#

so i would just put this in a trigger? @winter rose

#

I was gonna forget about the no input and just have black bars and make the unit have no ammo. Like this


[1, 2, true, true ] call BIS_fnc_cinemaBorder;

#

but i want the border to not fade out and to fade out at a different trigger

hollow cloak
#

Hello Im trying to add an action where you hold enter or some other button and it makes an ai move ive got this but an error message comes up can anyone help me out?

silver mauve
hollow cloak
#

Ok will do now 🙂

silver mauve
#

then download the SQF extension for it to work

#

@hollow cloak ^

hollow cloak
#

What is the SQF extension @silver mauve

#

Oh I think ive found it @silver mauve

#

Does anyone know what I have done wrong

exotic flax
#

no comma at [] // Arguments passed to the script
exactly as the error says...

#

"error at line 12" so it's either there or in front of it

hollow cloak
#

Oh thank you my bad Did miss that thanks 🙂

summer void
#

Is their any way to make a mission script compatible with Zeus ? Like when the mission spawn the ia i can interact with them ? Or if it's not possible to make an existing one compatible, how can I make it myself or if they are existing one

#

Ty 😁

astral tendon
bright flume
#

test it, compare it against getDLCs << does tell ya could just use that...

cosmic lichen
bright flume
cosmic lichen
#

@bright flume You are right, not all of them are supported. I need my coffee first 😄 I delete the ticket from #arma3_feedback_tracker

bright flume
#

nah it is broken and def freezes your arma up. if its not valid then its broken in that sense its even allowing it

#

the wiki page for ctrlCreate only has a partial list why I was asking if there a complete one somewhere.

winter rose
#

@silver mauve no

cosmic lichen
#

@bright flume I believe that list is complete. KK updated it a while ago IIRC

bright flume
#

well not sure... cuz Some of the common controls defined in main config that can be used with this command:

#

I just think the ticket valid because it seems like a bug either way you look at it. which is basically what I commented saying on it. I think you were right to bring it up. #wiki could even maybe be needing some touchup on that too depending...

#

if anything something to easily and intentionally crash arma is bad.. 😦

round scroll
#

is there a way to see which vehicles have a radar that can be turned on and off via setVehicleRadar?

#

or do I best create a 'radar' module and sync the units that have one against it manually or via script?

#

which would probably not work for Zeus

bright flume
#

believe there something in the cfgvehicle if it has a radar or not.

round scroll
#

Components->SensorsManagerComponent->Components->ActiveRadarSensorComponent->AirTarget?

#

but isn't the class naming a bit arbitrary

winter rose
#

@round scroll ^

round scroll
#

awesome! there's even isVehicleRadarOn, which I looked for already and couldn't find

winter rose
#

yes, the reason for that is the radars were introduced in 1.70, I jumped to 1.72 to see additional commands added after patch

round scroll
#

@winter rose thanks for your help with the vectors the other day, but I could not get it to work. In the end I used: ```sqf
// need a -90 degree offset due to orientation of screen coordinates
private _dir = ((_jammer getRelDir _x) - 90) % 360;

                            private _xcoord = 0.5 + _dist * ( cos _dir );
                            private _ycoord = 0.5 + _dist * ( sin _dir );

                            _txt ctrlSetPosition [_xcoord, _ycoord];
winter rose
#

(This is worth a Category:Radar btw, I might do that)

#

if you only needed direction, that's the best way then ^^

round scroll
#

yeah, the distance is determined by the state of the radar soon

winter rose
#

if you don't mind the upside down plane not reporting "relative" direction 🙃

round scroll
#

if you do silly things during your jamming mission, your fail 😄

bright flume
#

oh I love doing inverted lockon shots

round scroll
#

something I never got a good hold off, how bad is it to check with nearEntities every 5 seconds or so to detect potential radars in the area of my plane? ```sqf
private _listPossibleRadarObjects = _jammer nearEntities [["Air", "Land", "Ship"], js_jc_fa18_jammingDistance];

winter rose
#

it is 'that' bad.

#

about ' ' bad

#

yep

round scroll
#

or do I better add a stacked init event handler on Air, Land, Ship and add the vehicle to some array I later consume?

#

for the Nimitz I converted the former to the latter, and it works mostly

winter rose
#

if there are no spawns/respawns, grab them all once and use a distance check on said array

round scroll
#

the stacked init eh should take care of spawns, or?

#

in the init eh, I'd check for listVehicleSensors and ActiveRadarSensorComponent and only add those

#

works unless the vehicle is modded and overwrites the whole init eh's

loud python
#

...was I a fool for thinking anything in the altis life codebase could maybe possibly be even remotely transactional?

winter rose
#

yes.

loud python
#

I thought so

bronze lotus
#

How am I getting this error @winter rose? "File RealRecoil\config.cpp, line 35: /cfgRecoils/:'.' encountered instead of '{'".

#
class CfgPatches
{
    class RealRecoil
    {
        // Meta information for editor
        name = "Real Recoil";
        author = "Isaacdevil";
        url = "";

        // Minimum compatible version. When the game's version is lower, pop-up warning will appear when launching the game.
        requiredVersion = 1.60; 
        // Required addons, used for setting load order.
        // When any of the addons is missing, pop-up warning will appear when launching the game.
        requiredAddons[] = { "A3_Functions_F", };
        // List of objects (CfgVehicles classes) contained in the addon. Important also for Zeus content (units and groups) unlocking.
        units[] = {};
        // List of weapons (CfgWeapons classes) contained in the addon.
        weapons[] = {};
    };
};

class cfgRecoils
{
///PARAMETERS            SYNTAX
// muzzleOuter[]   =     {    Rightwards recoil limit,    upwards recoil limit,    horizontal recoil spread,    vertical recoil spread    };
// kickback[]       =    {    Minimum backwards recoil,    maximum backwards recoil    };
// temporary       =        Amount of recoil being random    ;
// permanent       =        Amount of recoil being permanent    ;

///   NOTES
// 1) Multiply muzzleOuter values by 16 except for upwards recoil limit, multiply that by 32.
// 2) Replace temporary with permanent and then multiply it by 16.
// 3) For a version of a firearm with a different barrel length of its derivative, divide its velocity with the original gun's velocity and then multiply it by the new permanent value and the kickback values.
// 4) Determine permanent recoil for folded firearms by doubling permanent recoil compared to non-folded derivatives along with multiplying kickback values by 1 1/2
// THIS IS LINE 35
    class 7.62x39MM AKM/74M FAMILY;
    {        
        muzzleOuter[]        = {4.8, 38.4, 4.8, 4.8};
        kickBack[]            = {0.03, 0.06};
        permanent            = 0.24;
    }
#

Line 35 is on the bottom of this.

#

I should mention that the CfgPatches nor CfgRecoils classes have end brackets, its that my code is too long to be posted.

cosmic lichen
#

class 7.62x39MM AKM/74M FAMILY; there is the error

bronze lotus
#

Is the semicolon the error? If it is, I found a couple of other mistakes for the {} brackets being mismatched and I think I fixed that too. I'll try it again @cosmic lichen.

#

Also, is it safe to overwrite a PBO with the same thing to replace it for fixing mistakes?

#

Talking about addon builder also.

#

I'm not sure if its better to delete the PBO and BIKEY to replace the config in it or not.

#

Actually @cosmic lichen, its not the error still. Not sure why.

cosmic lichen
#

You can safely overwrite it

#

It's an error, maybe not the only one

bronze lotus
#

Oh okay.

#

However, can I privately send you all the code because of it being too big on here (its not super big)?

#

Before I do that though, I'll proof-read it again.

cosmic lichen
#

Also, move this over to #arma3_config since it's not scripting related

bright flume
bronze lotus
#

Oh okay, and sorry. All good.

bright flume
#

I only suggest hastebin because it dont need any form of info/data on ya and is as plaintext pasting as one can get.

bronze lotus
#

Ah okay.

bright flume
#

site dont even got ads.. lol I mean its plain jane.

winter rose
#

am I the official SQF script support now 😅

bright flume
#

gratz?

cosmic lichen
#

You are what ? 😄

winter rose
#

IDK, everyone pings me for "hey @ Lou Montana do you have an idea for xx_otherguy_xx's problem?" or "yo @ Lou Montana, will this work?"

still forum
#

you are just our dad

cosmic lichen
#

Because Dedboomer isn't available anymore.

winter rose
#

I want the SQFDad role!!

bronze lotus
#

Yeah sorry Lou lol, I remembered you helping me and saw that you recently helped another lol

#

And that I didn't realise that the C++ language for configs was different to scripting in Arma haha

winter rose
#

not that I mind helping, just that getting directly pinged is a recent trend apparently 😄

bronze lotus
#

Ah I see lol

#

does (at)everyone

cosmic lichen
#

@everyone

bronze lotus
#

Oh no xD

cosmic lichen
#

Should be disabled so far I know

bronze lotus
#

I don't think it is xD

cosmic lichen
#

If not I am screwed

bronze lotus
#

Oof

#

Actually never mind, yeah it should be since I didn't get pinned lol

#

I thought it worked because the tag was blue.

winter rose
#

! purge ban 60y @cosmic lichen spam

cosmic lichen
#

😛

#

Enough offtopic I guess

tough abyss
#

How i can prevent players from accessing action menu?

verbal knoll
#

hey , i try running this getArray (configfile >> "CfgMagazines" >> "30Rnd_556x45_Stanag") and somehow it returns me []. it used to work for me but now it doesn't, why is that?

winter rose
#

*magic*

#

it's not an array, it's a class. what do you expect it to bring up?

verbal knoll
#

it has to return me an array with the magazine name

#

i mean

winter rose
#

no.

verbal knoll
#

more info inside

#

so how do i get the name

winter rose
#
getText (configFile >> "CfgMagazines" >> "30Rnd_556x45_Stanag" >> "displayName");
verbal knoll
#

lol this is what i wrote right now

#

and it worked

#

anyways ty

shadow sapphire
#

How do I change the icon that a high command subordinate displays to the high command module user?

I don't understand either addGroupIcon or MARTA.

winter rose
#

didn't you ask that earlier? I thought this was solved

shadow sapphire
#

Did I? Let me search. Sorry.

surreal peak
#

oh they wont auto show

#

well that joke was ruined D:<

winter rose
#

I liked it anyway @surreal peak

surreal peak
#

thank you

shadow sapphire
#

I have that page open already, I just don't understand it. It seems overly complex.

I'm not finding when I asked that question in the search history.

#

I liked it, too.

winter rose
#

what don't you understand; setVariable?

shadow sapphire
#

How it all fits together. I have lots of trouble with syntax.

#

Which parts are essential, which can be ignored, where I put the code, etc.

winter rose
#

the module and setGroupIconsVisible should be enough?

shadow sapphire
#

AH! Okay, so I place the module and put the code inside the module?

Makes perfect sense.

tough abyss
#

@winter rose i've already add inGameUISetEventHandler but some players can use action of scroll bar.

winter rose
#

disable the keys then

tough abyss
#

There is no way to close it with a loop?

winter rose
#

no.

#

that's dirty.

tough abyss
#

Will try to disalbe key thanks for ur help.

ebon ridge
#

Is there any way to 100% safely create or move vehicles without them sometimes blowing up? In the past I have attached to the physics collision handler, and doing this I can at least save the object that is being moved, but it can't save the object it collides with.

exotic flax
#

_veh = createVehicle ["2S6M_Tunguska", [0,0,0], [], 0, "NONE"];
Especially the last parameter "NONE":

will look for suitable empty position near given position (subject to other placement params) before placing vehicle there.

ebon ridge
#

Sorry I should specify I want to tell it where to spawn exactly, and if it can't then be notified rather than having it blow up

#

basically I want to do the collision query for its exact spawn position without having to spawn it

exotic flax
#

in that case you might want to take a look at findEmptyPosition with radius set to 0

ebon ridge
#

This command ignores moving objects present within search area.

exotic flax
#

well... if you want to spawn a vehicle on locations where moving objects are, then you're doing something wrong 😛

ebon ridge
#

i could do some check for this myself with the result though

#

no i am spawning lots of stuff at the same time

#

that stuff will start moving

#

its annoying, there is lineIntersectsSurfaces but no bbox equivalent :/

exotic flax
#

You could spawn a vehicle at a "safe" location (eg. outside of map), turn simulation off, then check if the preferred location is safe, use setPos to move the vehicle and then turn simulation on again.

smoky verge
#

anyone knows how to damage nearby buildings without the module?
considering the module is just a packed quick script

#

whenever I try to damage the terminal on altis it crashes my game

ebon ridge
#

how do you try to damage it?

smoky verge
#

with the edit building module

ebon ridge
#

hmm well i can do setDamage 1 on a building

polar anchor
#

hi, im new to arma scripting and im trying to allow players open veichle inventory only once. if they want to open it again they have to get out and get in again. i put this:

_inventoryOpened = false;
_insideVeichle = false;

this addEventHandler ["GetIn", {
    _insideVeichle = true;
}];

this addEventHandler ["GetOut", {
    _insideVeichle = false;
    if (_inventoryOpened == true) then { _inventoryOpened = false; };
}];

this addEventHandler ["InventoryOpened", {
    if (_inventoryOpened == true && _insideVeichle == true) then {
        hint "You already opened the inventory. Get out and get in again";
        player removeAllEventHandlers "InventoryOpened";
    } else {
        _inventoryOpened = true
    }
}];

this addEventHandler ["InventoryClosed", {
    if (_inventoryOpened == true && _insideVeichle == true) then { _inventoryOpened = false; };
}];``` into init.sqf but i got this error: `Error undefined variable in expression this`. I probably got it all wrong but im just testing stuff
ebon ridge
#

it plays explode or collapsed behavior tho

smoky verge
#

@ebon ridge what was the way to select nearby terrain objects?

ebon ridge
#

i just used cursorObject, but you can use terrainObjects i think

#

however the destruction anim causes damage, it killed me from range when i destroyed a hanger

smoky verge
#

I just need enough damage to break the window glass

halcyon hornet
round scroll
#

on my quest on jamming for the F/A-18, I intend to use the following eventhandler and code, not tested yet, but wonder if the approach is ok: ```sqf
js_jc_fa18_fnc_ewInit = {
params [["_veh", ObjNull]];
if (isNull _veh) exitWith { diag_log "FA18 EW: _veh is Null in ewInit"; };
if (!local _veh) exitWith { diag_log "FA18 EW: _veh is not local"; };
private _sensors = listVehicleSensors _veh;
if (["ActiveRadarSensorComponent","ActiveRadarSensorComponent"] in _sensors) then {
private _radars = missionNamespace getVariable ["js_jc_fa18_ew_radars", []];
_radars pushBackUnique _veh;
missionNamespace setVariable ["js_jc_fa18_ew_radars", _radars];
};
_veh;
};

class AllVehicles: All {
class EventHandlers
{
class js_jc_ew_init
{
init = "(_this # 0) spawn js_jc_fa18_fnc_ewInit;";
};
};
};

winter rose
#

@round scroll I strongly recommend you declare a CfgFunctions for that and not a global variable though

round scroll
#

@winter rose thanks, very good idea and I intended to do so 😄

winter rose
#

good :p you got me worried here for a second

round scroll
#

for testing and development I'm used to declare it as global variable, easier to adjust

spark rose
#

can somebody tell me what's wrong with this? //make a marker at the crash site// waitUntil {visiblePosition fishy = 0}; createMarker ["Crash Site", getPos fishy]; "Crash Site" setMarkerType "mil_triangle"; "Crash Site" setMarkerText "Crash Site"; "Crash Site" setMarkerColor "ColorOrange";

#

trying to mark the location of a crashed aircraft

#

but not until it's crashed of course

exotic flax
#

waitUntil {visiblePosition fishy = 0}; this looks "fishy"

#

because you now retrieve the position of a variable (which should be an object) and set it to 0...

#

that alone should already show errors

spark rose
#

i want to wait until the visiblePosition is equal to zero, ie the aircraft is on the ground

#

the variable "fishy" is indeed the aircraft 🙂

winter rose
#

==
use the show script errors launcher option 😉

exotic flax
#

but visiblePosition returns an array with the full position (including X and Y)

spark rose
#

ahhh. i thought it only returned Z above surface

#

wiki is incorrect?

exotic flax
#

wiki says:

Return Value:
Array - format PositionAGLS

#

you can use (visiblePosition select 2) though to only get Z value

spark rose
#

okay so {visiblePosition select 2 fishy = 0}

exotic flax
#

((visiblePosition fishy) select 2) == 0

spark rose
#

hmm. no errors now but no marker is created

exotic flax
#

try

_markerName = createMarker ["markername", player];
_markerName setMarkerType "hd_dot";
#

and make sure the marker name doesn't contain spaces

winter rose
#

isTouchingGround, nah?

exotic flax
#

^^ I was looking for that command 🤔

winter rose
#

or```sqf
(visiblePosition fishy) select 2 < 1

sometimes altitude when touching ground is 0.084531 stuff
spark rose
#

haha. Lou, that's the command i was looking for! didn't know it existed, lol

winter rose
#

be sure to read the wiki page for "limitations"

spark rose
#

Lou, i think the second is better, sometimes it hits a building. <1 for visiblePosition works

#

considering <5 as sometimes it gets hung up

#

but this is working. Thanks Grez, thanks Lou

#

Grez thanks for showing me "select"

#

I learn something new every day

flat elbow
#

mmh it looks like you'd have to check the posAGL

#

as you are looking for the crash site i'd check if the engine torque is 0 and the velocity is 0 too, as the helicopter can crash also on buildings

#

(note you need to enable the advanced flight mode)

winter rose
#

or use canMove.

flat elbow
#

and you will have the position of the helicopter that was destroyed 10.000 meters high instead of the crash site i guess

#

i think that returns true as soon as it's destroyed

winter rose
#

yes, which is why he checks the altitude

flat elbow
#

is it possible that a helicopter crash but is still able to move?

winter rose
#

clearly not.

#

I believe destruction or even only tail rotor triggers a !canMove

flat elbow
#

like, if you destroy the back engine (i don't know the name in english) it can still technically move

lapis ivy
#

Hey. How do I call a function? There is no error, but a unit without inventory.

init:

this addeventhandler ["respawn", { [this,"Opfor","opfor_squadleader"] call SerP_unitprocessor; }];```

At the start of the mission, inventory is issued, but after respawn there is no.
winter rose
#

because this doesn't exist in the event handler. check the wiki for respawn EH arguments

lapis ivy
#

So I can’t call the function after the death of the player?

winter rose
#

you can

#

you are using the wrong arguments

lapis ivy
#

I use a platform, this platform issues an inventory using a command, and it works.
[this,"Opfor","opfor_squadleader"] call SerP_unitprocessor;

winter rose
#

yes.

lapis ivy
#

But I want him to perform the same action when the character respawns.

winter rose
#

yes.

lapis ivy
#

But I don’t understand how to do it right.

winter rose
lapis ivy
#

Yes, I looked. Thanks.

It's right?
this addeventhandler ["respawn", { [_this,"Opfor","opfor_squadleader"] call SerP_unitprocessor; }];

winter rose
#

no.

#

did you see the following code?

this addEventHandler ["Respawn", {
    params ["_unit", "_corpse"];
}];
lapis ivy
#

Yes, but I probably don't quite understand.

winter rose
#

params takes the _this argument provided to the EH and "splits" it into the two arguments.

_unit is the new unit, _corpse is the "old" unit

#

replace this with _unit and you should be good to go

flat elbow
#
this addEventHandler ["Respawn", {
  params ["_unit", "_corpse"];
  [_unit, "Opfor", "opfor_squadleader"] call SerP_unitprocessor;
}];
#

i think this do what you think your code will do

lapis ivy
#

Thank you so much, I get it. I did not quite understand what _corpse is, I have very bad English ...

winter rose
#

a corpse is a dead body

lapis ivy
#

Now I realized, I was trying to call a function not on a new unit.

winter rose
flat elbow
#

yep i was supposing some weirdness like that

#

the example should also use a more code-like syntax

#

if (!canMove _tank) then
{
player sideChat "He's nailed on the ground! Now hurry!";
};

winter rose
#

what do you mean, ! instead of not?

flat elbow
#

yep

winter rose
#

both work

flat elbow
#

yes but one is more "code-like" than the other

winter rose
#

I don't know what to say ¯_(ツ)_/¯

flat elbow
#

the not feels more 80's

winter rose
#

the 80s were lit

#

I mean, Beverly Hills Cop, Lethal Weapon, etc

flat elbow
#

we should however promote a modern approach

#

my eyes bleed every time i see not

winter rose
#

mines don't, as it sometimes is more readable than ! with parenthesis all around it

flat elbow
#

programmer's eyes are trained to find ! anywhere

winter rose
#

I actually changed the previous example from ! to not so people get it on first glance (and don't miss it)

flat elbow
#

it's also weird in english

#

"not can"

winter rose
#

unable to can

#

anyway, my example, my rules :p

flat elbow
#

you made that example?

winter rose
#

I updated it, the example was already there

ebon ridge
#

Arma automatically adds waypoints such that its impossible to have 0 waypoints. This is constantly annoying because I am trying to add my own, and it isn't at all clear when it will do it. What is the minimal robust recipe to programmatically specify a set of waypoints? Or clear all waypoints?

winter rose
#

addWaypoint?

ebon ridge
#

Okay so if I delete all waypoints what happens?

#

Do I have 0 waypoints?

winter rose
#

Perhaps try and thy shall see, I don't know.
I know that one waypoint gets created on start, that's it

ebon ridge
#

I have been adding and deleting waypoints for months now, I have tried plenty of hacking to try and get consistent behavior

#

Thats why I started my question with the conclusion of this which is that Arma automatically adds a waypoint at some point after you try and delete them all.

#

You can't have 0 waypoints

winter rose
#

how did you come to this conclusion? try ```sqf
hint str waypoints player

ebon ridge
#

Of course I have tried this

#

well I didn't try exactly this because I don't care about player, I am trying to control AI

flat elbow
#

name your waypoints with something consistent then delete everything else?

#

like _wpX and then subtract the array with those from the array with the "waypoints unit" and run a foreach delete on every of them?

winter rose
#

an example exists on the deleteWaypoint page…

flat elbow
#

so

{_x deleteWaypoint} foreach (waypoints unit - myWaypointsArray);
winter rose
#

nope

#

waypoints get re-indexed on the deletion of one, so you would miss one every two waypoints

flat elbow
#

huh?

ebon ridge
#

waypoint format is [group, index] and if you delete index n all >n are decremented

flat elbow
#

i guess as long as the unit have one waypoint the engine will not add its owns?

winter rose
#

read the page please, it explains it

private _group = group _unit;
for "_i" from count waypoints _group - 1 to 0 step -1 do
{
    deleteWaypoint [_group, _i];
};
ebon ridge
#

I have read it

winter rose
#

I meant @flat elbow ^^

ebon ridge
#

kk

flat elbow
#

uhm i am failing to grasp what it means, why are you not using a simple foreach? also that code deletes all waypoints i guess?

winter rose
#

again, no

#

as soon as you delete waypoint 1, waypoint 2 becomes waypoint 1

#

so you will ask to delete waypoint 2 which was waypoint 3, and waypoint 1 (old 2) remains

#

waypoints are not "objects", they are arrays of [group, number]

flat elbow
#

and i guess you can't just set a custom array with the waypoints?

winter rose
#

nope, no can do. delete from last to first so they don't get re-indexed

flat elbow
#

so there's no [[x,y], [z,w], [a,b]] setWaypoints unit ?

ebon ridge
#

Anyway sorry I think I have a bug in my code. I read the documentation comments about non-deleteable waypoints and thought that I was experiencing this. I think its a bug though as I can delete to 0 waypoints if I do it on units added via zeus

burnt cobalt
#

keep in mind that arma creates one waypoint for the group when it comes into existance - on the initial position of the group leader I believe

ebon ridge
#

Ah that must be it.

#

But it won't do it later on in the group life time?

#

Hmm that is annoying though, why not just not do that :/

burnt cobalt
#

i think it relates to currentWaypoint but not sure

winter rose
#

I suppose it is (or at least was) some AI initialisation, but I can only guess

flat elbow
#

i think it probably adds a hold waypoints when there's no waypoints left?

burnt cobalt
#

when a group has no waypoint (meaning only that one 'initial waypoint) the group returns a currentWaypoint of 1 - if you then add a waypoint, the currentwaypoint will still return 1

ebon ridge
#

oh god

#

so the initial waypoint doesn't show up in the waypoints or does?

burnt cobalt
#

it does

ebon ridge
#

ah yeah okay that makes sense, I added unit from zeus and it had one waypoint, I was able to delete waypoint 0 and then i had 0 waypoints

burnt cobalt
#

but you can most likely disregard the first entry, allthough you technically can delete all waypoints

ebon ridge
#

i didn't test what currentWaypoint returns hto

burnt cobalt
#

why do you want to delete all waypoints exactly?

ebon ridge
#

well I tried ignoring first entry in waypoint list and it led to groups getting stuck, where setting their current waypoint to 0 would free them again

#

i jsut want 100% control over what is specified not having to fight with arma

#

so i can remove doubt

burnt cobalt
#

using currentWaypoint and the waypoints _group array you can get it done for sure

queen cargo
#

wait wait wait ... so that was the reason my whole bloody gigantic group in my insurgency mode tended to run around?
some magical waypoint? .... arma 🤷‍♂️

burnt cobalt
#

i don't think so

ebon ridge
#

well it sounds like the extra waypoint would be a hold one at groups initial position

burnt cobalt
#

it's just the first waypoint in the array it does not really do anythng

#

it's a "MOVE" waypoint

ebon ridge
#

(other than complicate all code that has to reason about waypoints)

#

but i guess it doesn't auto complete?

#

so weird

queen cargo
#

should test my insugency with latest patch anyways ... last time i fired it up was 4 years ago

#

though .. nobody is using it afaik
soooo ...

burnt cobalt
#

throwing a wild question out there - i guess it's not possible to return what code is currently being held in the onMapSingleClick command?

winter rose
#

I think nope, why?

burnt cobalt
#

Kind of a specific problem - I have an AI mod that uses map planning and there's two cases where I'd like to avoid the default mapclick behavior: 1. Clicking on certain dialog controls and 2. preventing the movement order for drivers when you are the effectiveCommander of a vehicle. I can not find a different way to do this than onmapsingleclick , but that might interfere with any mission etc using that code as well

#

onMapSingleClick {true} would fix all my problems but then again, it broke a lot of missions. So I'm trying to find a workaround

winter rose
#

also, note that it might be an eventhandler

#

but I am afraid there is no way to get the code.

flat elbow
#

"Since Arma 3 v1.57 a stackable MissionEventHandler is available and should be used instead: MapSingleClick.
Before that, the functions BIS_fnc_addStackedEventHandler and BIS_fnc_removeStackedEventHandler should be used instead in order to keep compatibility between official and community content."

burnt cobalt
#

okay - I had that hunch but thought I'd give it a shot 🙂

flat elbow
#

perhaps that's why it broke your mission?

burnt cobalt
#

Exactly - if everybody would use stacked EH's, that would be fine

#

but people use onMapSingleClick all over the place and you can not use a stacked EH to prevent the default Arma behaviours like markers etc

#

i guess I'll have to brutally take charge of that EH and refer complaints to that official statement 😉

#

still would be so cool if you could add and remove code to that initial game EH so that multiple addons could have their conditions to prevent markers etc

silver mauve
#

Need help again.. How do i make the AI text appear in vehicleChat e.g Pilot: Check the fuel? co-pilot: We are good. I also want the player text to appear here. All using triggers, can anyone help?

winter rose
#

vehicleChat @silver mauve

silver mauve
#

i tried that but it didnt appear?

winter rose
#

then maybe you are using a server-only trigger, and vehicleChat has a local effect only

#

you could use remoteExec to solve this.

silver mauve
#

pilot vehicleChat "Check the fuel";

#

thats what i did and its for a single player mission

winter rose
#

argument must be a vehicle, not a person (weird, I know)

silver mauve
#

can you give me an example this is baffling my head

winter rose
#

give your vehicle a variable name, then use it with vehicleChat

#

or use ```sqf
vehicle pilot vehicleChat "Check the fuel";

silver mauve
#

helo1 pilot vehicleChat "Check the fuel";

winter rose
#

no, no

helo1 vehicleChat "stuff";
#

(vehicle is a command)

silver mauve
#

okay let me give it a go

#

@winter rose No joy? I'm not sure whats going wrong?

burnt cobalt
#

are you in the vehicle?

silver mauve
#

yes it's for the fly in before the mission

#

i fly in and as im flying there talking about the helicopter and other stuff

burnt cobalt
#

hmm then Lou's example is the one - working fine here

silver mauve
#

im not sure whats going wrong

winter rose
#

if the helicopter's name is helo1, of course

silver mauve
#

Miss spelt the helo 🤦‍♂️

#

Ahhh still doesn't work

#

finally got it to work for some reason i had to make the trigger wider so that the whole helicopter passes through and not part of it. Never knew this was the case. Thank you for your help @winter rose

winter rose
#

it should not be the case, but maybe the helicopter centre did not go through the trigger

silver mauve
#

the whole heli went through just not as a whole so the front went through and left before the tail rotor

silver mauve
#

i was testing my mission and the vehicleChat works but now only displays the Pilot callsign?

vehicle pilot vehicleChat "How is the fuel?"
vehicle co_pilot vehicleChat "Readings are fine sir."

#

but for some reason it only displays Pilot and im not sure why

exotic flax
#

The text will be visible only on the PC where command was executed. If you need the message to show on all computers, you have to execute it globally (see remoteExec)

burnt cobalt
#

i believe the effectivecommander of the vehicle will 'say' the line

exotic flax
#

so you will need to use vehicleChat on each unit which should receive it

burnt cobalt
#

vehicle pilot and vehicle copilot is the same thing

exotic flax
#

^^ and that

burnt cobalt
#

you can not create a 'in the vehicle conversation' with vehicleChat - imagine it as the channel where the commander of the vehicle speaks

#

you'd need to use groupChat, sideChat or a kb-conversation for that

silver mauve
#

ahh okay it's just the pilots are not in the group of the player

#

is there a way i make them part of the group and then when i land the player leaves the group

winter rose
#

@silver mauve no, it's not the reason
the fact is that you cannot get "driver <vehicle> says:", "gunner <vehicle> says:" or "commander <vehicle> says:"
this command does not do as you think (and I think) it should behave, e.g unit using the vehicle chat.

it is actually a "message in the vehicle said by the vehicle leader", and nothing more.

quaint pulsar
#

I'd like to get into scripting, I don't suppose anyone could help me?

#

Reccomend software and things.

winter rose
#

oh, there is a wiki page for that 😉

quaint pulsar
#

Ty.

still forum
#

But that page doesn't recommend VSCode with SQF extensions 😢

winter rose
#

and of course, we can help here.

this page does not link to "unofficial tools", this is true @still forum !

quaint pulsar
#

That doesn't necessarily give the key points.

#

🤣

#

I just read over it, I took it in.

winter rose
quaint pulsar
#

Ty.

#

Actually, Lou.

cosmic lichen
#

Too bad the VS Code SQF plugin is not up to date.

quaint pulsar
#

Can we DM for a sec?

winter rose
#

I don't mind, but "only" if it doesn't fit here? shoot

quaint pulsar
#

Theres a question I'd like to ask without seeming like a noob even though I have 2k hours in Arma.

cosmic lichen
#

Lol

#

Just ask

quaint pulsar
#

Cos, alot of people like to take the piss out of me.

#

🤣

cosmic lichen
#

No one's going to laugh at you

winter rose
#

there are no stupid questions (only stupid people)

and better ask and look dumb 5 minutes than not asking and being dumb for the rest of one's life 😉

quaint pulsar
#

Remember the Debug console? I am aware quite a few people have been banned for scripting within the PUB Zeus community are scripts such a Jwolf and others allowed to be used?

#

I played a 9 hour PUB Zeus mission which was scripted.

#

And, I'd like to help more players out.

winter rose
#

(but more seriously, even if it is a "naive" question, if you want to know and learn it is not going to be mocked. we try to encourage knowledge sharing here)

quaint pulsar
#

Give them the opportunity.

#

The debut console was removed.

#

And now people find open source injectors.

#

(The mission was amazing, it made me cry at one point and then also made me laugh and it was also really emotional.)

still forum
#

Billw's script debugger is missing on the "Code Edition" (shouldn't that be Code Editing?) thing 🙃

winter rose
#

add it

still forum
#

😿

quaint pulsar
#

I asked my question.

winter rose
#

public ZEUS are not "allowed" to be modified by debug console or injection.

quaint pulsar
#

Ok.

#

Not even a custom game?

random loom
#

Well if it custom then it isn't public in that sense

#

public more means the official servers

quaint pulsar
#

Ah.

#

Considered.

#

Thank you.

random loom
#

You can do whatever you want on your own servers, though you might not get as many people playing.

still forum
#

Armitxes is still alive tho (atleast on github), maybe he'll update his extension someday
One could always fork it.

random loom
#

Anyhow, question, is there any way to get all script handles currently running?

still forum
#

no

winter rose
#

diag?

random loom
#

Only returns strings

#

If you're talking about diag_activeSQFScripts

winter rose
#

with a diag_ you can not get the handles, but the count of them

#

yep

#

@still forum what/where is billw script debugger?

random loom
#

So once a script is executed, it cannot be terminated unless you've saved the handle as a variable?

winter rose
#

yep

random loom
#

wonderful

winter rose
#

for safety reasons, so you don't terminate someone else's code

#

terminating your code with terminate is not a good practice anyway. what is your use case @random loom ?

random loom
#

Trying to make a mission using the Vanguard modules

#

Want to disable the script creating map markers

#

The alternative would be to somehow find the "draw" eventhandler it creates, and delete it

#

But I guess the situation is similar when it comes to identifying eventhandlers?

still forum
#

you can remoteAllEventHandlers

random loom
#

I tried that but it would appear it just breaks everything when it comes to the map

still forum
#

correct

random loom
#

So, do you happen to have any ideas how to get around this?

#
[
    {diag_activeSQFScripts findIf {"a3\Missions_F_Tank\MPTypes\Vanguard\scripts\drawMapIcons.sqf" in _x} != -1},
    {
        [
            {findDisplay 12 displayCtrl 51 ctrlRemoveEventHandler ["Draw",6]},
            [],
            15
        ] call CBA_fnc_waitAndExecute;
    },
    []
] call CBA_fnc_waitUntilAndExecute;
#

that will have to do

brave jungle
#

Hi guys, trying to have a GUI combo box update when another is changed. When the side changes, it adds all factions of that side into the listbox. However i'm not getting an error reported and checked my .rpt too. I don't think my event is firing.

_fnc_factionChanged = {
  _indx = lbCurSel 2100;
  _curselected = lbText [2100, _indx];
  systemChat _curselected;
  _selectindex = _sidesstr find _curselected;
  _curSelFac = [(_sides select 0)] call BIS_fnc_getFactions;
  { lbadd [2101, str _x]; } forEach _curSelFac;

  _groups = [];
  _configgroups = "true" configClasses (configfile >> "CfgGroups" >> str _curSelFac >> lbText [2101, lbCurSel 2101] >> "Infantry");
  {
    _groups pushBackUnique ([_x, "", true] call BIS_fnc_configPath);
  } forEach _configgroups;

  {    lbadd [2102, _x]    } forEach _groups;
};

((findDisplay 348567) displayCtrl 2102) ctrlSetEventHandler ["LBSelChanged","['ListChange', _this] call _fnc_factionChanged"];

Is the section of the code not working. https://imgur.com/a/oWsxPlv is the gui - Been away from arma development for a while so bare with me if i've done a simple error ha 😄

round bane
#

Anyone have a scrollwheel menu item for full ace advanced heal?

#

Sort've a "Walk-up-to-medic-scroll-and-heal" thing

brave jungle
#

what a full heal??

#

make you're own literally one line

real tartan
#

_agent moveTo _position; will start agent running to position. Is there a way to force agent to walk instead of running to destination ?

cosmic lichen
#

Guess you tried forceWalk?

real tartan
#

@cosmic lichen seems to be working also for agents

eager stump
#

I have a mission (which works nicely), but would like to structure the directory a bit nicer. Files like init.sqf, onPlayerRespawn.sqf and description.ext are in the mission root. Is it possible move these files to subfolder?

winter rose
#

nope, they are used by the engine

eager stump
#

Thanks, that was fast.

winter rose
#

they all say that 👩 😿

#

you're welcome 😄

fair lava
#

is there an event hook to detect incoming missiles?

#

both guided and unguided

winter rose
fair lava
#

does it work for unguided shot by AI?

#

oh

#

reads

#

perfect

#

second question, is it possible to intercept this, i.e destroy the missile

#

the function doesnt return some kind of object for the missile itself

#

i.e the one inflight

#

unless "ammo" is unique? that sounds like just the class of weapon fired not the actual projectile in flight

winter rose
#

strangely enough, it does not return the missile itself so you would have to do a nearestObject something…

fair lava
#

yeah

#

what is a missile?

winter rose
#

nearest to the instigator, though

fair lava
#

is it a vehicle?

#

or is there an actual "Projectile" class?

winter rose
#

it is a CfgAmmo

fair lava
#

i cannot for the life of me remember what the system was called, but in MW2 the IFV's had this RPG shield

#

i'm trying to recreate that

#

with some kind of recharge and failure rate ofc

winter rose
#

you can check triggerAmmo then 😉

fair lava
#

perfect!

#

ty

winter rose
#

*boom*

#

the EH description states that unguided missiles shot by players are indeed considered 🤔 great…!

fair lava
#

another event i've just found going through the wonderful rabbit hole that is the "also consider" box of the wiki: "FiredNear"

#

Triggered when a weapon is fired somewhere near the unit or vehicle

winter rose
#

"max 50m"

fair lava
#

but this would probably get-oh

#

back to incoming missile lol

winter rose
#

(max. distance ~69m)
my bad.

fair lava
#

..i hope there is some strange coincidence for that and the engine devs arn't just trolling

winter rose
#

…we may never know

fair lava
#
IFV addEventHandler ["IncomingMissile", {
    params ["_target", "_ammo", "_vehicle", "_instigator"];
    hint _ammo;
    [_ammo] spawn {params ["_a"]; sleep 0.5; _rpg = nearestObject[IFV, _a]; hint str _rpg;};
}];
#

so I've tried putting it into a spawn and adding a sleep, maybe nearest object was happening too soon, but i get null object

#

the event handler is working, ammo is "R_PG7_F"

#

is nearestObject the wrong call here? I see a function called nearestEntity

winter rose
#

half a second may be too big, as it is using its hardcoded limit of 50m

fair lava
#

near objects is?

#

im not using that fired event thing

winter rose
#

try only 0.01 to be sure it doesn't happen

fair lava
#

oh interesting

#

i was going to try nearEntities

#

unsure if ammo counts as an entity

winter rose
#

nope, alive or dead bodies (depending on nearEntities or nearestEntities)

#

not vehicles, ammo, etc

fair lava
#

ahh

#

the vr map grid squares are 16m x 16m right?

#

in that case my rpg dude is 32m away, i've got delay at 0.01, and still null object

winter rose
#

I will give a try in 10 min

fair lava
#

oh cool, TY

#

im gonna try messing with the Fired event

#

which actually gives me the projectile object

winter rose
#

works for me

#

oooh I get it

#
nearestObject[IFV, _a]; // nope
```You should check around the shooter, not the target ^^
#

@fair lava ^

#
this addEventHandler ["IncomingMissile", {
  params ["_target", "_ammo", "_vehicle", "_instigator"];
  private _missile = nearestObject [_vehicle, _ammo];
  _missile spawn { sleep 3; triggerAmmo _this; };
}];
fair lava
#

ooooh

#

ty

quasi rover
#

//player setVariable ["attackHeli", false]; //for hosted (single) player.

I want to set every connected client player to have a variable, like:

[player, ["attackHeli", false]] remoteExec ["setVariable"];

but it doesn't work. how to fix it?

still forum
#

player is different for every player

#

You could remoteExec call. But I don't understand why you need to store the variable on player? Why not just use a global variable?

quasi rover
#

Each player has to different variable value: 'true' or 'false' on "attackHeli" variable.

winter rose
#

you can set it from the server?

still forum
#

remoteExec "call" it is then

quasi rover
#

it is called from the dedi-server. you mean use remoteExecCall?

still forum
#

No

#

I mean to remoteExec the call command

#

With script code as argument

winter rose
#

why not setVariable ["varName", value, true] to publicVar it?

still forum
#

Because it's set on player object

quasi rover
#

Sorry, I mean, Every connected player could have a different value: false or true on "attackHeli" during operation, but after the operation I want to reset every player have "false" value on "attackHeli" variable.

hollow thistle
#
{
    _x setVariable ["attackHeli", false, true];
} forEach allPlayers;
quasi rover
#

thx, I'll give it a try.

quasi rover
#

@hollow thistle it works! thx again.