#arma3_scripting

1 messages ยท Page 740 of 1

neon swift
#

Worked!

#

sir I owe u a drink

#

been having this problem for a long time and you just helped me ton. i tred using remoteExec but I was using it wrong from what I see. TY so much!

little raptor
#

np

little raptor
#

maybe you can understand them better than the wiki

neon swift
#

will keep that in mind for the future

quasi condor
quasi condor
#

So.. I should use remoteExecCall?

little raptor
# quasi condor https://sqfbin.com/pegomalitohiyiwahazo this is my code, and the result is in th...

as for how to call a code unscheduled, use isNil

isNil { //this block of code will always run unschd
  _veh1 = createVehicle ["Blabla", [0,0,0], 0, [], "CAN_COLLID"]; 
  _veh2 = createVehicle ["Blabla", [0,0,0], 0, [], "CAN_COLLID"]; //spawning two vehicles into each other?! wtf?!!!!
  //but it's unschd, so don't worry
  _veh1 setPosASL _newPos1; //no explosion
  _veh2 setPosASL _newPos2; //no explosion
};
little raptor
#

@past wagon that code is relevant to you too. ๐Ÿ‘†

quasi condor
#

oh

#

isNil gets other scope?

little raptor
#

wdym?

quasi condor
#

error occured

#

_vehicle undefined

little raptor
quasi condor
#

ok

#
params ["_taskN", "_missionArea"];

_aaList = [
    "min_rf_sa_22",
    "min_rf_sa_22_desert",
    "O_APC_Tracked_02_AA_F",
    "O_T_APC_Tracked_02_AA_ghex_F"
];

_aaVehicle = _aaList call BIS_fnc_selectRandom;
_rdPosition = [_missionArea, _aaVehicle] call AS_fnc_getRandomPos;
_vehicleRaw = nil;
_vehicle = nil;
isNil {
    _vehicleRaw = [[0,0,0], 0, _aaVehicle, EAST] call BIS_fnc_spawnVehicle;
    _vehicle = _vehicleRaw select 0;
    _vehicle setPos _rdPosition;
};
(allPlayers select 0) setPos (getPos _vehicle);
_taskName = format ["task%1", _taskN];
_vehicle setVariable ["task", _taskName];
_vehicleName = getText (configFile >> "CfgVehicles" >> _aaVehicle >> "displayName");
[
    BLUFOR,
    _taskName,
    ["asdf", format ["asdf %1", _vehicleName], "asdf"],
    getPos _vehicle,
    "CREATED",
    _taskN,
    true,
    "destroy",
    true
] call BIS_fnc_taskCreate;
// _MNtasks = missionNamespace getVariable "tasks";

// missionNamespace setVariable ["tasks", _MNtasks append [_taskName]];

_vehicle addEventHandler ["Killed", {
    _vehicle = _this # 0;
    _taskName = _vehicle getVariable "task";
    [_taskName, "SUCCEEDED"] call BIS_fnc_taskSetState;
}]
#

it's my code now

#

and the same problem happens

little raptor
quasi condor
little raptor
#

i.e are you sure _vehicleRaw is not empty?

amber lantern
#

Best way to move an item from a container/inventory to ground?

little raptor
quasi condor
amber lantern
#

So spawning then

little raptor
#

there's only 1 way

#

remove the item, create a weapon holder, and add a new item to the weapon holder

little raptor
little raptor
#

there's no other way that code could generate an error

quasi condor
#

there's no error

little raptor
#

wat? then what's the problem?

quasi condor
#

it just blows up as soon as it's created

little raptor
#

I told you not to use setPos

quasi condor
#

setPosASL is not working either

little raptor
#

are you just using it randomly?

#

or are you actually providing an ASL pos?

quasi condor
#
params ["_missionArea", "_vehicleName"];

_missionPos = getPosATL _missionArea;
_emptyPositions = _missionPos findEmptyPosition [0,150,_vehicleName];
_emptyPositions```
#

this is _rdPosition

little raptor
#

that's an AGL pos

quasi condor
#

oh

quasi condor
little raptor
#

no

quasi condor
#

ASLW?

little raptor
#

I meant AGL

quasi condor
#

there's no setPosAGL

#

should I use AGLToASL?

little raptor
#

I'm not sure what that function uses

quasi condor
little raptor
#

you can just try with:

 _vehicleRaw = [_rdPosition, 0, _aaVehicle, EAST] call BIS_fnc_spawnVehicle;
#

and no setPosXXX

little raptor
quasi condor
little raptor
quasi condor
#
private ["_vehicleRaw", "_vehicle"];
isNil {
    _vehicleRaw = [_rdPosition, 0, _radarVehicle, EAST] call BIS_fnc_spawnVehicle;
    _vehicle = _vehicleRaw select 0;
};```
#

not working

little raptor
#

just use createVehicle then

#

like I said I don't know what that function uses

#
_vehicle = createVehicle [_radarVehicle, _rdPosition];
createVehicleCrew _vehicle;
quasi condor
#

use isNil?

little raptor
#

won't make a difference

#

you're not moving the vehicle anymore

quasi condor
#

It didn't make error, but the same problem is being repeated

#
13:52:53 [ACE] (repair) INFO: O_T_APC_Tracked_02_AA_ghex_F: hitcomturret no selection: using armorComponent hit_com_turret
13:52:53 [ACE] (repair) WARNING: [O_T_APC_Tracked_02_AA_ghex_F: hitcomturret: hit_com_turret] armorComponent does not exist?
13:52:53 [ACE] (repair) INFO: O_T_APC_Tracked_02_AA_ghex_F: hitcomgun no selection: using armorComponent hit_com_gun
13:52:53 [ACE] (repair) WARNING: [O_T_APC_Tracked_02_AA_ghex_F: hitcomgun: hit_com_gun] armorComponent does not exist?
13:52:53 soldier[rhs_msv_driver]:Some of magazines weren't stored in soldier Vest or Uniform?
13:52:54 [ACE] (repair) INFO: O_APC_Tracked_02_AA_F: hitcomturret no selection: using armorComponent hit_com_turret
13:52:54 [ACE] (repair) WARNING: [O_APC_Tracked_02_AA_F: hitcomturret: hit_com_turret] armorComponent does not exist?
13:52:54 [ACE] (repair) INFO: O_APC_Tracked_02_AA_F: hitcomgun no selection: using armorComponent hit_com_gun
13:52:54 [ACE] (repair) WARNING: [O_APC_Tracked_02_AA_F: hitcomgun: hit_com_gun] armorComponent does not exist?```
little raptor
quasi condor
#

hmmm

quasi condor
little raptor
little raptor
#

it allows you to draw icons very easily

quasi condor
#

well

#

it's in house

little raptor
#

then it's not surprising that it explodes

quasi condor
#

but I used findEmptyPosition

#

why is it spawning in house?

little raptor
#

because the object orientation and stuff are not accounted for

quasi condor
#

hmm

#

then what can I use for this?

little raptor
#

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

#

you can try this:

#
isNil {
  _vehicleRaw = [[0,0,0], 0, _aaVehicle, EAST] call BIS_fnc_spawnVehicle;
  _vehicle = _vehicleRaw select 0;
  _rdPosition = [_missionArea, _vehicle] call AS_fnc_getRandomPos;
  _vehicle setVehiclePosition [_rdPosition, [], 0, "NONE"];
};
#

@quasi condor fixed the error in the code

#

actually nvm

quasi condor
#

uh

little raptor
#

I just looked at wiki and findEmptyPos doesn't accept objects

#

try this instead

quasi condor
#

two vehicles are alive

#

but the rest is not

little raptor
#

change that function to:

params ["_missionArea", "_vehicle"];

_missionPos = getPosATL _missionArea;
_emptyPositions = _missionPos findEmptyPosition [sizeof _vehicle * 0.6, 150, typeOf _vehicle];
_emptyPositions
#

and this is the spawn code:

isNil {
  _vehicleRaw = [[0,0,0], 0, _aaVehicle, EAST] call BIS_fnc_spawnVehicle;
  _vehicle = _vehicleRaw select 0;
  _rdPosition = [_missionArea, _vehicle] call AS_fnc_getRandomPos;
  _vehicle setVehiclePosition [_rdPosition, [], 0, "NONE"];
};
little raptor
#

nvm that's not what radius was anyway... ๐Ÿ˜“

radius: Number - Start searching no closer than radius from the center
I thought that's the safe distance

#

just use the old one

#

oh this was interesting:

switch (tolower _sim) do {
    case "soldier": {
        _veh = _grp createunit [_type,_pos,[],0,"none"];
    };
    case "airplanex";
    case "helicopterrtd";
    case "helicopterx": {
        //Make sure aircraft start at a reasonable height.
        if (count _pos == 2) then {_pos set [2,0];};
        _pos set [2,(_pos select 2) max 50];
        _veh = createVehicle [_type,_pos,[],0,"FLY"];
    };
    default {
        _veh = createvehicle [_type,_pos,[],0,"none"];
    };
};

didn't know you can have fallthrough in SQF

quasi condor
little raptor
#

why do you calculate _rdPosition twice? meowsweats

quasi condor
#

oh

#

my bad

#

hmmm

#

nothing diffrent

little raptor
little raptor
#

which as I said was wrong

quasi condor
#

so I didn't change anything in getRandomPos

quasi condor
cyan dust
#

Good day. Can someone share, how do you check if object is indeed a building? I get lots of false-positive checks with

_obj isKindOf 'Building'

And I though it would work to additionally check

(count (_obj buildingPos -1)) > 0

But quickly found out that bag bunkers have zero buildingPos'es =_=

little raptor
cyan dust
little raptor
#

tho it only works if the object has a config

little raptor
#

from the config

little raptor
cyan dust
little raptor
#

afaik they're either thing or thingX

cyan dust
#

I can not send a screenshot here, but they are both 'Buildings' according to Arma (=

#

All -> Static -> Building -> NonStrategic -> Land_Razorwire_F

little raptor
#

what are you trying to do with it anyway?

cyan dust
cyan dust
little raptor
#

I don't see how you managed to get "decorations" working but have trouble with buildings blobdoggoshruggoogly

#

but in any case, the only thing that separates different object types is their simulation

cyan dust
little raptor
#

it's still unreliable but at least it's mostly "correct" if it exists (since it involves UX, unlike classes and simulations)

cyan dust
#

๐Ÿค” Sounds promising, also I could combine both checks. So.. how do I get that?

little raptor
#

config

#

it's called editorSubCat iirc

cyan dust
#

Aha, found it. Thanks ๐Ÿ‘

#
getText(configOf _obj >> "editorCategory")
warm coral
#

is there a way i can add diffrent magazines to infantry? i was hoping to make a bolt action into a grenade launcher etc

little raptor
#

just remove the projectile and create your own instead

warm coral
warm coral
sonic sleet
#

Hello, I'm very new at Mission making and trying to setup a shop for a Mission with some mates.
I found a very cool way of Showing the Price of the shop by using "Draw3D"

addMissionEventHandler ["Draw3D", {
drawIcon3D ["", [1,0,0,1], ASLToAGL getPosASLVisual cursorObject, 0, 0, 0, "Pistol Mag:5$", 1, 0.05, "PuristaMedium"];
}];

Is there anyway I can bind this to only show if Object found = Type of container? And or only run in Trigger Location.
So Once in "Shop" It checks to see if you're looking at a Shop Container then Pops the Text up?

still knoll
# sonic sleet Hello, I'm very new at Mission making and trying to setup a shop for a Mission w...

you can run a process to check if the player is within the defined area and add or remove the draw3d missioneventhandler accordingly

If the shop area is a circle:

G_ShopCenter = [100,100];
G_ShopRadius = 50;

[] spawn{
private _ID = -1;

waitUntil{

waitUntil{((player distance2d G_ShopCenter) <= G_ShopRadius)};
_ID = addMissionEventHandler ["Draw3D", { 
  if(cursorObject isKindOf "WeaponHolder") then{
    drawIcon3D ["", [1,0,0,1], ASLToAGL getPosASLVisual cursorObject, 0, 0, 0, "Pistol Mag:5$", 1, 0.05, "PuristaMedium"]; 
  };
}];

waitUntil{((player distance2d G_ShopCenter) > G_ShopRadius)};
removeMissionEventHandler ["Draw3D", _ID];

FALSE
};

};

if it's a polygon:


G_ShopVertices = [
[100, 100, 0],
[100, 150, 0],
[150, 100, 0],
[150, 150, 0]
];

[] spawn{
private _ID = -1;
private _Pos = [];

waitUntil{

_Pos = getPosWorld player;
_Pos set [2, 0];

waitUntil{(_Pos inPolygon G_ShopVertices)};
_ID = addMissionEventHandler ["Draw3D", { 
  if(cursorObject isKindOf "WeaponHolder") then{
    drawIcon3D ["", [1,0,0,1], ASLToAGL getPosASLVisual cursorObject, 0, 0, 0, "Pistol Mag:5$", 1, 0.05, "PuristaMedium"]; 
  };
}];

waitUntil{not (_Pos inPolygon G_ShopVertices)};
removeMissionEventHandler ["Draw3D", _ID];

FALSE
};

};

to have the text only show up when pointing at a weapon holder, make use of the cursorobject and iskindof commands

sonic sleet
#

Wow this amazing, how exactly do I plug this in? Do I need it in a file or?

still knoll
#

well that code is client side, so just paste it in the initPlayerLocal.sqf

sonic sleet
#

Sweet man thanks

sacred slate
#

this script should keep the ai on place, stance and watch dir, and makes the next unit after teamswitch the squad leader. while it does what it should, i am not able to get around the watch direction thing. those lines are commented https://pastebin.com/xJ8AfY3y

barren sonnet
#

this disableAI "Move";

#

got an error

#

type group expected object?

#

Error disableai: Type group, expected object

still knoll
still knoll
barren sonnet
#

I figured it out

#

In a group

sacred slate
#

@still knoll cause i like to keep the ai that i switch from to recive the stop command

#

so the only thing left i need is: keep the unit i switch from away in its watch direction.

#

they stand as they should but mostly they just watch random directions

#

ha. i need the direction from the last controlled unit and give it back to the last controlled unit, after team switch

#

i guess thats precise.

opal sand
#
private _player = cameraOn;

waitUntil {
    uiSleep 0.5;
    cameraOn != _player;
};

[missionNamespace, "mn_PlayerChanged", [cameraOn]] call BIS_fnc_callScriptedEventHandler;

[] spawn mn_fnc_generic_handlePlayerChange;

is there any errors here?

still knoll
still knoll
distant oyster
barren sonnet
#

How do I make the AI not have eagle vision?

barren sonnet
#

hey @distant oyster how did you find that "ACE_isUnconscious" thing?

#

is there a list of ace stuffs somewhere?

#

I want to add blood to my player

distant oyster
#

i went through the ace functions

barren sonnet
#

where

distant oyster
barren sonnet
#

thanks

oblique bolt
#

This is my first time meddling with anything like this

#

I'm trying to make custom pylons for a plane and I've managed to currently change one of the pylons I want but I do not know how to add multiple of them to be changed

#

_this setPylonLoadout ["pylons7" , "FIR_GBU12_P_2rnd_M" , true] <---- this works so far but I want to add
["pylons4" , "FIR_GBU12_P_2rnd_M" , true] ; as well and I am too stupid to understand how to do it

cosmic lichen
#

Just use setPylonLoadout again?

sonic sleet
#

Is there a way to have a Trigger Constantly Running the Command whilst someone is inside.
I have it as Repeatable. But for someone to Repeat they must Leave the Trigger, and Re-enter.
Is there a Way to keep repeating it every second?

quasi condor
#

hi, this is my code: https://sqfbin.com/garejozijinoduyebeme
when I run this code, it makes error. the error content is "_tasks, _taskNames are undefined".
I spent 3 hours. but I couldn't fix this. how to fix this problem?

tough abyss
#

can someone help me i keep getting this error resource MyDialog.hpp not found

tough abyss
#

my description.ext is fine i think this is what i got in there

#

#include "MyDialog.hpp"

fair drum
#

i want to see the whole file structure you have atm

#

where its located, etc

willow hound
sonic sleet
#

Trying to get Specific Text to show IF I target a Certain Item. I.e One Gun will show "100$" Another might show "25$"

addMissionEventHandler ["Draw3D", 
{
    if("Weapon_AM_VarmintRifleOld" == typeOf cursorObject } > -1) then{
        drawIcon3D ["", [1,0,0,1], ASLToAGL getPosASLVisual cursorObject, 0, 0, 0, "Varmint 100$", 1, 0.05, "PuristaMedium"];
    }
    {
    if("AM_M1911" == typeOf cursorObject } > -1) then{
        drawIcon3D ["", [1,0,0,1], ASLToAGL getPosASLVisual cursorObject, 0, 0, 0, "M1911 25$", 1, 0.05, "PuristaMedium"];
    }

Thats as close as I can get after hours

drifting sky
#

what do '_vehicle emptyPositions "driver"' and 'driver _vehicle' return if the driver is dead?

willow hound
sonic sleet
#

Doesnt seem to work, no Error but not showing

sonic sleet
#

Also I'd love to Simplify it, I have Zero experience with coding.

#

Oh I see, theres no Loop, once I ran it while looking at the rifle it Showed. But only for a Split Second

#
while {true} do {
if ("Weapon_AM_VarmintRifleOld" == typeOf cursorObject) then {
  drawIcon3D ["", [1,0,0,1], ASLToAGL getPosASLVisual cursorObject, 0, 0, 0, "Varmint 100$", 1, 0.05, "PuristaMedium"];
  };
}; 

#

That works perfectly, How do I clean it up?

willow hound
#

Do you know how to use the Debug Console?

sonic sleet
#

Huh if what you mean is Type in the "Extended Debug Console" and then hit "Local Exec" and hope it works yes

willow hound
#

Can you look at one of your weapons and run typeOf cursorObject in the Debug Console? I have a suspicion that the result will be "GroundWeaponHolder" instead of "Weapon_AM_VarmintRifleOld".

sonic sleet
#

Says - "Weapon_AM_VarmintRifleOld"

#

I got it to work with the While statement. But I when I tried to add another IF for another weapon, it bugged out

#
while {true} do {
if ("Weapon_AM_VarmintRifleOld" == typeOf cursorObject) then {
  drawIcon3D ["", [1,0,0,1], ASLToAGL getPosASLVisual cursorObject, 0, 0, 0, "Varmint 100$", 1, 0.05, "PuristaMedium"];
  }

  if ("FOW_WG_US_M1911" == typeOf cursorObject) then {
  drawIcon3D ["", [1,0,0,1], ASLToAGL getPosASLVisual cursorObject, 0, 0, 0, "M1911 25$", 1, 0.05, "PuristaMedium"];
  };
};
#

I assume theres a better method than running 10+ If statements but Im not sure what other there is

willow hound
sonic sleet
#

It does and doesnt, It just doesnt Repeat.

#

If I run it Looking at it, it'll Flicker infront of me for a split second.

#

But never Re-checks if Im looking at it

willow hound
sonic sleet
#

huh, well it doesnt keep looping without it, so im confused

#

It loops fine without the If statement

#

But with it, it just stops

willow hound
#

Which loop do you mean?

sonic sleet
#
drawIcon3D ["", [1,0,0,1], ASLToAGL getPosASLVisual cursorObject, 0, 0, 0, "M1911 25$", 1, 0.05, "PuristaMedium"];
#

That alone keeps going in its own loop

#

But if I put an IF statement on it, It just goes once, And then stops

willow hound
#

Can you post the whole code?

sonic sleet
#
while {true} do {
if ("Weapon_AM_VarmintRifleOld" == typeOf cursorObject) then {
  drawIcon3D ["", [1,0,0,1], ASLToAGL getPosASLVisual cursorObject, 0, 0, 0, "Varmint 100$", 1, 0.05, "PuristaMedium"];
  }
};
willow hound
#

Ahhhh

sonic sleet
#

oooo Thats cool, So basically a bunch of IFs but instead a Switch nice

tough parrot
#

draw instructions should be in onEachFrame if not EH

willow hound
# sonic sleet ```sqf while {true} do { if ("Weapon_AM_VarmintRifleOld" == typeOf cursorObject)...

What I meant was adjust the if-statements as shown in my example, not replace the whole code ๐Ÿ™ƒ So it should be like this:

addMissionEventHandler ["Draw3D", {
  if ("Weapon_AM_VarmintRifleOld" == typeOf cursorObject) then {
    drawIcon3D ["", [1,0,0,1], ASLToAGL getPosASLVisual cursorObject, 0, 0, 0, "Varmint 100$", 1, 0.05, "PuristaMedium"];
  };
  if ("AM_M1911" == typeOf cursorObject) then {
    ...
  };
}];
sonic sleet
#

Oh yes it works

#

Had to clean it up, but awesome. SO my concern is. How do I limit it to an Area. Like a Shop.
Also would running 10-20 Ifs be laggy?

tough parrot
#

probably should would be cleaner to use table of #define instead of all that repeated code.

#

or pull from config

willow hound
#

Do you want to look into the area limit or the simplification first?

sonic sleet
#

is there a way to list like [("Weapon_AM_VarmintRifleOld","100$"),("AM_M1911","25$")]
and if 1st matches then show the second?

#

Whatever is the correct workflow XD

tough parrot
#

if you are pulling from a particular config entry only one draw is needed, using variables with the data

#

e.g. _aspect1 = getText (configFile > ...); drawIcon3D[...,_aspect1,...]

sonic sleet
#

Huh, that looks very confusing

#

So we are comparing the Active cursorObject with a Config and if it matches it pulls a String??

tough parrot
#

what is "Varmint 100$"

sonic sleet
#

That is a Description of how much the "Weapon_AM_VarmintRifleOld" Rifle should cost

#

So when you look at it "Varmint 100$" Comes up as thats how much that Item is

tough parrot
#

where is it stored?

sonic sleet
#

The Gun?

#

On a table infront of you

tough parrot
#

that value

sonic sleet
#

init file

willow hound
tough parrot
#

yeah hashmap is good

sonic sleet
#

oh yessssssss thats awesome

#

ahah1!! It works!! Yesss

#

Okay so how do we Limit its range near a "shop". Cause I ASSUME having this running all the time. Bad

willow hound
#

Once the player enters the shop area, you add the Draw3D EH, and once the player leaves the shop area, you remove the EH again.

sonic sleet
#

EH?

#

Is that Event Handler?

willow hound
#

Yes.

sonic sleet
#

So I make a Trigger zone and attach that to it? How exactly do I turn on EH and OFF?

tough parrot
willow hound
willow hound
tough parrot
#

tbh i think it is easiest to use onEachFrame { if (_isPlayerInArea) then { call drawStuff } } instead of EH

sonic sleet
#

So regarding to the InArea

#

the Example shows this

_playerIsInside = player inArea _myTrigger

what part is actually linked to the Init file? cause im confused how it gets back to the Config

#

From what I read '_example' is a Local variable

willow hound
tough parrot
#

The trigger is checking each second anyway

#

well 0.5

sonic sleet
#

Im gonna up the trigger, I dont need 0.5 at all

#

so
Condition
player in thisList
On Activation
ShopPricesEH = addMissionEventHandler [...];
On Deactivation
removeMissionEventHandler ["Draw3D", ShopPricesEH];?

tough parrot
#

however you can also use a divisor in onEachFrame to do it manually

drifting sky
#

A2OA. Is there a way to get a driver to quickly switch to the gunner seat?

willow hound
tough parrot
#

btw the trigger timer itself is still checked each frame

sonic sleet
#

Okay I messed up somewhere

#

I made a new sheet called "AddShopPricesEH.SQF" Like you suggested it contains

addMissionEventHandler ["Draw3D", {
  private _targetClass = typeOf cursorObject;
  private _price = WeaponPrices getOrDefault [_targetClass, ""];
  drawIcon3D ["", [1,0,1,5], ASLToAGL getPosASLVisual cursorObject, 0, 0, 0, _price, 1, 0.05, "PuristaMedium"];
}];```
the init.SQF Contains
```sqf
if _playerIsInside == true then {
WeaponPrices = createHashMapFromArray [
  ["Weapon_AM_VarmintRifleOld", "100$"],
  ["FOW_WG_US_M1911", "25$"]
];
}

Condition
player in thisList
On Activation
execVM "addShopPricesEH.sqf";
On Deactivation
removeMissionEventHandler ["Draw3D", ShopPricesEH];

willow hound
#

The code in addShopPrices.sqf is missing the ShopPricesEH =.
The code in init.sqf is broken by the if-statement, all you need there is WeaponPrices = createHashMapFromArray [...];.

sonic sleet
#

Fixed the Init file, What do you mean by its Missing ShopPricesEH=

willow hound
#

It needs to be ShopPricesEH = addMissionEventHandler [...];.

sonic sleet
#

ooooh

#

OOOH

#

Omg

#

It works

#

โค๏ธ

#

Ive been at this for over 8 hours

#

its 11 am and I havent slept

#

Thank you so much

tough parrot
#

Let me try to stump everyone. What lod does ai use for visibility in network play?

#

Objects have graphic replacements at greater distance, so either visibility always uses specific one for each object or there is a mystery.

open fractal
#

isn't lod just a rendering thing?

#

why would that affect the ai?

tough parrot
#

In my test AI visibility is very close to the rendered model.

#

But the model changes at distance, so what happens then...

open fractal
#

looks like im wrong about arma 3 lod looking at the wiki

#

it is in fact used for calculations

#

looks like which LOD is visible to the ai is configured by the model's author

#

im sure there are modders here who can share how ai spotting works

drifting sky
#

A2OA. Can anybody explain why the following only sometimes works? About half the time the unit gets in as gunner, but then immediately gets out again, and goes back to the driver's seat. dostop _vehicle; _vehicle forcespeed 0; player sideChat "wiating for vehicle to stop"; waituntil{ sleep 1; (!alive _vehicle) || { ((abs(velocity _vehicle select 0)) < 0.01) && {(abs(velocity _vehicle select 1)) < 0.01} } }; player sideChat "driver getting out"; _vehicle setVehicleLock "UNLOCKED"; doGetOut _unit; unassignVehicle _unit; _unit setVariable ["AM_BUSY", true]; _unit disableAI "AUTOTARGET"; sleep 3; player sideChat "getting back in as gunner"; _unit action ["getInTurret", _vehicle, _turret_path]; _unit assignasgunner _vehicle; sleep 5; _unit enableAI "AUTOTARGET"; _unit setVariable ["AM_BUSY", false]; _vehicle forcespeed -1; _vehicle stop false; };

little raptor
little raptor
tough parrot
#

So there is one model selected for that in config. Makes the most sense.

little raptor
tough parrot
#

I guess smoke is a particle.

little raptor
#

yes

open fractal
#

can ai still see through vanilla colored smoke

#

kind of tangential

tough parrot
#

no

#

i tested that a few days ago

#

the visibility is non zero, but extremely low

#

0.0005 approx

#

the smoke works very accurately to the graphic

little raptor
drifting sky
#

IS there a way to make the ai instantly switch seats?

little raptor
#

moveOut/moveInXXX

drifting sky
#

if I do that pair inside of an unscheduled environment, will they function correctly?

#

also, is it necessary to assign as gunner?

little raptor
#

in A3 it does at least

little raptor
drifting sky
#

does the vehicle need to be stopped ?

little raptor
#

no

drifting sky
#

I've switched to this code, but the same problem remains. About a second after entering the gunner seat, he is booted out, and tries to get back in as the driver. isNil { _vehicle setVehicleLock "UNLOCKED"; moveOut _unit; unassignVehicle _unit; _unit moveInTurret [_vehicle,_turret_path]; _vehicle setVehicleLock "LOCKED"; };

tough parrot
#

SL must be assigning him to that seat.

drifting sky
#

Is there a way to prevent that?

tough parrot
#

You tried assigning each crew to specific seat?

drifting sky
#

The scenario is the gunner is killed in combat, and the driver is to take his place.

#

so that a truck with a .50 call isn't uselessly driving around without a gunner

little raptor
#

what about this?

drifting sky
#

I'll test, just a minute

tough parrot
#

maybe unassign the dead guy first

#

I should have said SL i ordering himto get in to the seat he is assigned, not assigning him

drifting sky
#

One other question though, about "leavevehicle", is the vehicle reassigned to the group when group members get back in it? And if not, will it still follow the leader if ordered to do so?

#

I mean if there were a driver in it.

little raptor
#

will it still follow the leader if ordered to do so?
not 100% sure. you should test it

tough parrot
#

It seems groups store orders for each unit, so e.g. leader barks at you to get in if you leave.

patent lava
#

any way to get the players camera?

stuck rivet
#

is it possible to run multiple countdowns at the same time?

#

i notice that the BIS_fnc_countdown function doesn't refer to the variable when calling for the leftover time

little raptor
little raptor
patent lava
#

unfortunate, was hoping i could change the fov that way like the zoom in and out, but i guess thats why no one has made a mod for it yet ๐Ÿ˜ฆ

warm swallow
#

I am trying to spawn a vehicle on an Editor placed object. When I spawn it in, it is inside the object and so it explodes. How would I make it so that the vehicle spawns above any objects

little raptor
#

what kind of object is the bottom object?

warm swallow
#

a pier

#

and im spawning a drivable vehicle thats supposed to set on top of the pier

little raptor
graceful kelp
#

im back again

#

how would i vector this from true bearing to realative bearing of the vehicle

#
fza_ah64_lwr_array = nearestObjects [vehicle player, ["lasertarget"], 20, false, true] apply {
  _laserdir = vectorDir _x;
  (((_laserDir#0 * -1) atan2 (_laserDir#1 * -1)) + 360) % 360;
};
#

i figured it would be laser true bearing - heli bearing

#

but im not sure

little raptor
warm swallow
#

ill try it out @little raptor thanks

graceful kelp
#
_laserTrueBearing = nearestObjects [vehicle player, ["lasertarget"], 20, false, true] apply {
  _laserdir = vectorDir _x;
  (((_laserDir#0 * -1) atan2 (_laserDir#1 * -1)) + 360) % 360;
};
fza_ah64_lwr_array = _laserTrueBearing apply {
    _heliv = vectordir vehicle player;
    _helib = (((_heliv#0 * -1) atan2 (_heliv#1 * -1)) + 360) % 360;
    ((_x - _helib) + 360) % 360;
};
hintSilent str fza_ah64_lwr_array;
#

im stuggling with the math a bit

#

wait

#

the -

#

isint meant to be there becuase i dont need it inverted

#
_laserTrueBearing = nearestObjects [vehicle player, ["lasertarget"], 20, false, true] apply {
  _laserdir = vectorDir _x;
  (((_laserDir#0 * -1) atan2 (_laserDir#1 * -1)) + 360) % 360;
};
fza_ah64_lwr_array = _laserTrueBearing apply {
    _heliv = vectordir vehicle player;
    _helib = (((_heliv#0 * 1) atan2 (_heliv#1 * 1)) + 360) % 360;
    ((_x - _helib) + 360) % 360;
};
hintSilent str fza_ah64_lwr_array;
#

so it works

#

but is there a simplified way of writing this

little raptor
graceful kelp
#
fza_ah64_lwr_array = nearestObjects [vehicle player, ["lasertarget"], 15, false, true] apply {
    _laserdir = vectorDir _x;
    _laserB = (((_laserDir#0 * -1) atan2 (_laserDir#1 * -1)) + 360) % 360;
    _heliv = vectordir vehicle player;
    _helib = (((_heliv#0 * 1) atan2 (_heliv#1 * 1)) + 360) % 360;
    ((_laserB - _helib) + 360) % 360;
};
hintSilent str fza_ah64_lwr_array;
#

better?

noble zealot
#

When I use the "switchCamera _anotherPlayer" command and the _anotherPlayer player activates its night vision, do I see it too?

little raptor
#

second of all, you said it yourself:

laser true bearing - heli bearing
I don't know what on earth is all that needless math for

_laserBearing = (((_laserDir#0 * -1) atan2 (_laserDir#1 * -1)) + 360) % 360;
_heliBearing = getDir _heli;

(_laserBearing - _heliBearing + 360) % 360
#

nvm it was correct

graceful kelp
#
_heli = vehicle player;
_heliBearing = getDir _heli;
fza_ah64_lwr_array = nearestObjects [_heli, ["lasertarget"], 15, false, true] apply {
    _laserdir = vectorDir _x;
    _laserBearing = (((_laserDir#0 * -1) atan2 (_laserDir#1 * -1)) + 360) % 360;
    (_laserBearing - _heliBearing + 360) % 360;
};
hintSilent str fza_ah64_lwr_array;
#

sorted

little raptor
#

_heliBearing = getDir _heli;
you can put this outside the loop

graceful kelp
#

hmm yes

vapid drift
#

So I'm working on map centered around ravage... the hordes I manually spawn in via script are being deleted once all players are roughly 500m away... is there anyway to stop this behavior? Units placed in 3den are not effected... only those spawned in via script

#

Is there a default distance that agents will be despawned?

vapid drift
#

Well I just confirmed it's an issue with agents... not sure how to prevent the default despawn behavior though

sacred slate
#

i like to add a action to a cargo hq created by BIS_fnc_ObjectsMapper and a composition.sqf. i miss the google syntax lol

distant oyster
#

or find the index via classname:

private _hq = _objects select (_mapperInput findIf {_x select 0 == "hq_classname"});
sacred slate
#

thx. the last i can understand, but what comes into [...]? the sqf file name?

distant oyster
barren sonnet
#

How can I make a sort of kill count?
You kill a guy, it ticks a variable

#

I can figure out how to display it, but I'm not sure how to make the count part

distant oyster
barren sonnet
#

Won't that count for any entity killed though?

#

by anybody

distant oyster
#

if you want to track a specific unit then a Killed EH should work

barren sonnet
#

No I want to make it so when you kill a person or knock him unconscious through ace it will tick a number

#

is there a global count of units?

#

like total amount of AI

distant oyster
barren sonnet
#

okay I'll just do an original count of how many units there are

#

then kills = original - (current alive and not unconscious)

#

yes?

distant oyster
#

technically yes but units may get deleted or otherwise removed from allUnits

barren sonnet
#

{alive _x && !(_x getVariable ["ACE_isUnconscious", false])} is the filter

distant oyster
#
array select {alive _x && !(_x getVariable ["ACE_isUnconscious", false])}
barren sonnet
#

the filter goes before

#

weird language.

distant oyster
barren sonnet
#

{!isPlayer _x && alive _x && !(_x getVariable ["ACE_isUnconscious", false])} count allUnits

#

this works for counting it

barren sonnet
#

Also I'm not sure how to make one variable that evaluates once and another that evaluates ever second or something

#

for the original count, and the other for the updated one

distant oyster
distant oyster
barren sonnet
#

okay

#

and for the other?

#
originalUnits = {!isPlayer _x && alive _x && !(_x getVariable ["ACE_isUnconscious", false])} count allUnits;
while {true} do { 
  hint str originalUnits; 
  sleep 30; 
};``` this is causing a generic error in expression
distant oyster
distant oyster
distant oyster
#

in that case wrap it in a spawn block

sacred slate
distant oyster
sacred slate
sacred slate
#

how can i send another group into this arrary? _units = units _group; like _units = units group1, group2;

drifting sky
#

A2OA. Is there any way to make AI groups plot a more direct path? I have fighting between adjacent bases. And the AI tend to go way around each other in a big circle. And worse, they seem to always travel on opposite sides, so that they hardly engage each other.

sacred slate
#

i miss basic syntax, like: _units = units [Base + Heli];

#

ok i managed that now, but i guess thats wrong: _units1 = units Base; _units2 = units Heli; _units = _units1 + _units2;

drifting sky
#

I'm looking for a way to make ai take more direct paths between points, hopefully that doesn't involve creating a bunch of extra waypoints. Preferably a scripting solution. But I also wonder if there's a sub-skill that influences how much they try to go around.

little raptor
#

it mostly depends on the group behavior

drifting sky
#

I'm using "aware" to get them between objectives. However, they go as much as a km to the left or right of the center line between the objectives. They move in a clockwise fashion so that blue and opfor don't engage each other very much.

little raptor
#

AI pathing depends on a lot of factors. behavior, terrain elevation, roads, buildings, etc. can affect it

drifting sky
#

does the "general" sub-skill influence the directness of their pathfinding?

little raptor
#

afaik it affects how frequently the leader commands the units, and how it assigns targets

#

not sure about path finding

#

but it shouldn't affect it

drifting sky
#

While I'm talking about skills, has anybody explored what happens setting skills greater than one? I notice that doing that with aimingaccuracy seems to make AI reluctant to use certain weapons at all.

little raptor
#

make AI reluctant to use certain weapons at all
it causes them to want to be "over-accurate"

#

AI only open fire when they "think" their shot will be accurate enough

drifting sky
#

Ah. That's unfortunate. I wonder if pairing that with a really high aimingshake skill would counteract that problem.

sonic sleet
#
WeaponPrices = createHashMapFromArray [
  ["Weapon_AM_VarmintRifleOld", composeText ["Varmint Rifle 100$",lineBreak,"Mag 10$"]],
  ["5Rnd_556x45_Mag","10$"], 
];

The sqf ["5Rnd_556x45_Mag","10$"],
Having problems with

composeText ["Varmint Rifle 100$",lineBreak,"Mag 10$"]

Any Ideas?

little raptor
#

not string

#

why do you even create a structured text anyway?

#

from what I can see you just need a normal string

sonic sleet
#

Huh Extremely new to Coding saw on the Wiki that Linebreak is Linked to it

#

Just need something that allows me to Linebreak within DrawIcon3D

little raptor
#

can't afaik

#

drawIcon3D limitation

sonic sleet
#

ah, so cant linebreak inside it?

little raptor
#

no

sonic sleet
#

Rip Cheers

little raptor
#

you could also put endl instead of toString [10]

sonic sleet
#

So Interesting no Error but shows all in one Line

little raptor
#

yeah told you

#

if you just do copyToClipboard format ["Varmint Rifle 100$%1Mag 10$", toString[10]] in debug console

#

and paste it into a text editor you'll see it's correct

sonic sleet
#

Ah I see

#

Interesting Figured it would show a Error but I guess not

little raptor
#

no it just doesn't work in drawIcon3D

sonic sleet
#

Good to know

#

Cheers man

drifting sky
#

Hmm. No matter what aimingaccuracy I choose, they universally aim too low by a meter or two past 600m, hitting pretty much only by ricochet. Is there any way to influence how ai compensate for bullet drop?

astral carbon
#

Hey, I am trying to make an AI look at a player with doWatch, & so it will get the position of the player (getPos), but it seems to be looking toward the player but at the ground. I remember there was something useful that allowed the ability for an ai look at the player's head, but I completely forget what it was. I was searching through the wiki and couldn't find anything so it left me in some confusion. Thought maybe it was "eyePos" but it rotates the ai head way too high (toward the sky a lil bit)

still knoll
#

also eyePos returns position ASL, maybe that explains your offset?

astral carbon
#

hmm, I don't think it was that. I went ahead and tried it but it seems to rotate about 180 degrees away from the player

still knoll
#

note that selectionPosition returns relative position

astral carbon
#

ahh gotcha

still knoll
#

use modelToWorld to get it in AGL format

astral carbon
#
_pos = player selectionPosition "head";
_pos1 = altian_soldier1 modelToWorld _pos;

altian_soldier1 doWatch _pos1``` Like that?
still knoll
opal sand
#

How does one/can anyone send one the link for how to override a default keybind with a custom keybind, and transfer that overriden keybind to a new keybind please

quasi condor
#

Hello. I'm making a helicopter that can sling players with a rope. I tried to use ropeAttachTo, but it did not work properly. The rope was connected successfully, but when the helicopter raised the altitude, the player did not move and the rope was cut off. How can we make this feature?

flint topaz
#

Hello anyone here know how to disable ace medical damage for a certain unit while still allowing myself to detect it being hit (this is so I can make my own damage system for a certain unit)

graceful kelp
#

in its ability to move stuff

graceful kelp
sacred slate
#

i like to command a unit to watch a direction, like you could do it in the command menu. but if i use doWatch or commandWatch, the unit starts swinging around alot. looks stupid

tepid vigil
#

Hey, can someone explain the difference between
(condition1 && { condition2 && { condition3 } }) and
(condition1 && { condition2 } && { condition3 } ), if there even is any?

graceful kelp
#

i think there the same but the bottom one is the less confusing one

brave jungle
#

iirc ๐Ÿ˜„

#

If I read correctly

brave jungle
willow hound
tepid vigil
winter rose
#

I'd say the first is better, otherwise the && is evaluated still

#

buuut it's not the big uber performance issue either

quasi condor
versed widget
#
switch (!IsNull objectparent player) do {
    case (vehicle player iskindof 'wheeled') :{ hint "Is car"}; 
    case (vehicle player iskindof 'Tank')    :{ hint "Is Tank"};
    case (vehicle player iskindof 'Air')     :{ hint "Is Air"};       
};

does anyone knows why switch command isnt working ? im not receiving any output

tepid vigil
distant oyster
#

nope. iskindof has no right hand argument

graceful kelp
#

right well

#

no idea then

distant oyster
#

i would debug each variable. so:

systemchat str [!isNull objectParent player, vehicle player isKindOf "wheeled", ...]
willow hound
versed widget
winter rose
tepid vigil
#

SQF-VM confirms (if I got the input right...)
1 false && {false || {true}} // False
2 false && {false} || {true} // True

winter rose
#

from left to right yep

willow hound
#

If you can confirm this using A3 then I'll put it on the wiki (I don't want to base the documentation on the wiki on SQF-VM results).

quasi condor
#

I keep trying to sling people with helicopters using ropeAttachTo. However, when the helicopter takes off, the rope cuts off. Is there really no way to sling a person?

graceful kelp
#

attach the rope to somehting small & invisible then use attachto to attach the person the the object

tepid vigil
copper raven
vestal radish
#

anybody maybe have a script handy that will make an opfor blow up when they get into a certain range of a blufor?

dusk shadow
#

Interesting question lads, are HashMaps serialized and meant to be saved/restored during the SP save/load process?

willow hound
#

Yes.

dusk shadow
#

Thx

tough abyss
#

can someone help me i keep getting this error resource MyDialog.hpp not found

dusk shadow
# willow hound Yes.

A follow up to that.
If you have
someArray = [someInitalizedGroupVar];
and you save and load
someArray should still contain a non-null group after the load, correct?

And the same ought to be true for HashMaps as well?

#

Cause it isn't true for HashMaps... Please correct me if I'm wrong but this seems like a bug, yeah?

//init.sqf
TEST_D = [group player];
TEST_E = createHashMapFromArray [["test", TEST_D]];

//After running the mission in SP, saving and loading
str TEST_D ==  "[B Alpha 1-1]"
str TEST_E == "[[""test"",[<NULL-group>]]]"
dusk knot
#

Im quite new to SQF Scripting and the entire scripting language is quite confusing to me.. I've been looking around for if its possible to toggle an action, The Action is in "Infantry Movement" called "TactToggle"

graceful kelp
#

you want to trigger a player action normaly done through keybind X right

dusk knot
#

You toggle it by pressing 2x C

graceful kelp
#

right well unfortunately

#

not

dusk knot
#

:(

graceful kelp
#

you cant script player input

#

i wish you could there is stuff i would do if i could

dusk knot
#

Rip, thanks anyways though!

tough abyss
#

how to i add a keybind to a dialog for example if i press F1 it opens a menu which i made

dusk shadow
#

I've put a ticket on the tracker for it, if it isn't just close T162726 plz ๐Ÿ™‚

cunning oriole
dusk shadow
amber lantern
#

I'd like to disable thermals and of course there's the simple

addMissionEventHandler ["Draw3D",
{
    if (currentVisionMode player isEqualTo 2) then
    {
        if (isNil "A3W_thermalOffline") then
        {
            "A3W_thermalOffline" cutText ["THERMAL IMAGING OFFLINE", "BLACK", 0.001, false];
            A3W_thermalOffline = true;
        };
    }
    else
    {
        if (!isNil "A3W_thermalOffline") then
        {
            "A3W_thermalOffline" cutText ["", "PLAIN", 0.001, false];
            A3W_thermalOffline = nil;
        };
    };
}];
#

Does this need to be executed globally, or is it enough to execute on server only?

#

Ie how do addMissionEventHandlers scope and propagate (if they propagate)

brazen lagoon
#

you're using player so it should be executed on all players

distant oyster
#

addMissionEventHandler has local effect

amber lantern
#

Is it possible to create a (server)mod purely on linux, or do I always need windows?

#

I suppose it comes down to being able to pack a .pbo?

echo smelt
#

Hey y'all, recently got a server up and running, I load into the server just fine, I get passed the database and spawn in. I shut down the server, go look in the database and my name or UID is not there. Anyone know a possible cause or issue for that?

#

Most likely something to do with my @life_server correct?

tough abyss
#

anyone knows a script that toggles on and off invisibillaty neeed it it for my admin menu

amber lantern
#

Does arma shortcircuit boolean tests?

#

It does

amber lantern
#

hmm, though I suppose it's more efficient

tough abyss
#

can someone help me i keep getting this message Resource MyDialog.hpp not found

distant oyster
tough abyss
#

i did i put in description.ext #include "MyDialog.hpp"

distant oyster
distant oyster
tough abyss
#

what do you mean reload the config my bad i am a bit new to this stuff

amber lantern
#

When is the magic variable "hasInterface" set?

#

Ie when I check the value, can I count on it not changing in the future?

distant oyster
#

it should be always there and should also be constant

amber lantern
#

Just to make sure, there's no else if?

distant oyster
#

but there is switch do case

copper raven
amber lantern
#

If in a script I define some function like NAMESPACE_fnc_KillPlayer = { player setDamage 1; }; on the server, and I intend to transmit this function to players via remoteExec, there's no reason to compileFinal the variable as it's precompiled by the script engine?

#

Also, how are variables handled when remotexec'd?

#

I assume that any function referenced by client must also have been broadcasted to the client

winter rose
amber lantern
#

Nah, I specifically don't want to create clientmods

little raptor
little raptor
amber lantern
little raptor
amber lantern
#

Compile expression and makes it final, preventing it from:
repeated compile or compileFinal
removal by nil
remote rewrite using publicVariable, publicVariableClient and publicVariableServer

little raptor
#

I'm saying if you broadcast it it won't be final for others (afaik)

amber lantern
#

Hmm, so you mean it needs to be compilefinal'd on client machines?

#

I see

copper raven
little raptor
#

Have you tried it?

copper raven
#

i think i saw something somewhere on the wiki mentioning it

#

https://community.bistudio.com/wiki/compileFinal

When broadcasting a compileFinal'ed variable using publicVariable or its variants, the variable also becomes final on the other client(s) and/or the server. Also, compileFinal does not prevent event handlers from being removed or overwritten.

amber lantern
#

Ah well there it is

#

if player exists once, will it exist always?

#

If I'm executing code on a client that hasInterface, can I check once for the existence of player ?

#

Or do I need to keep continuously checking for it before executing code that requires player?

#

Hmm, I suppose I could wrap the code in a try catch

#

If I define a function like NAMESPACE_fnc_Stuff = { ... }; and then I
addMissionEventHandler [event, expression, arguments];

is NAMESPACE_fnc_Stuff here a variable that I can directly put into expression, like addMissionEventHandler [event, NAMESPACE_fnc_Stuff, arguments]; or do I need to wrap the name in quotation marks?

#

Like addMissionEventHandler [event, "NAMESPACE_fnc_Stuff", arguments];

vapid drift
#

What am I missing here? This doesn't generate an ellipse marker:

_hordeArea = createMarker [format["horde_%1_area", _hordeCount], _zone];
_hordeArea setMarkerShape "ELLIPSE";
_hordeArea setMarkerAlpha 1;
_hordeArea setMarkerColor "colorOPFOR";
_hordeArea setMarkerSize [500,500];
_hordeArea setMarkerBrush "FDiagonal";

But this generates the opfor infantry marker:

_hordeMarker = createMarker [format["horde_%1", _hordeCount], _zone];
_hordeMarker setMarkerType "o_inf";
_hordeMarker setMarkerAlpha 1;
_hordeMarker setMarkerColor "colorOPFOR";
_hordeMarker setMarkerSize [1,1];
vapid drift
#

welp, this one is driving me nuts... I have no doubt I'm missing something simple again

shut carbon
#

The marker will be visible only once at least markerType has been defined:
_marker = createMarker ["markername", player]; // Not visible yet.
_marker setMarkerType "hd_dot"; // Visible.

#

hmm, maybe not.

vapid drift
#

Yeah, pretty sure that doesn't apply when making an ellipse or rectangle

shut carbon
#

add a private? private _hordearea = createMarker [format["horde_%1_area", _hordeCount], _zone];

vapid drift
#

already defined as private

shut carbon
#

๐Ÿ˜•

vapid drift
#

private ["_hordeLogic", "_hordeMarker", "_hordeCount", "_zedTypes", "_zeds", "_hordeSize", "_hordeSpawns", "_hordeArea"];

shut carbon
#

that's old style though.

vapid drift
#

No change

#

It's just weird because the code for _hordeMarker is immeidately following and it works fine

little raptor
shut carbon
#

idk thought it could help...

vapid drift
#

I assumed I was missing some necessary line to make the marker work but even using the basic example is not working

#

must be something somewhere else in my code

shut carbon
#

yup, do systemChat str _zone and systemChat str _hordecount and see if they're defined properly.

vapid drift
#

well I mean like I said, I use them for _hordeMarker and it shows up just fine

shut carbon
#

hmm yes.

little raptor
#

@vapid drift I don't see anything wrong with that code. but try changing the color and maybe brush

#

use colorRed for color

#

and if that still doesn't work use DiagGrid for brush

#

see if it makes any difference

vapid drift
#

The ellipse should be at the exact same spot

#

There's no conflict putting markers at exactly the same spot is there?

#

Also, no dice on the recommended changes

little raptor
shut carbon
vapid drift
#

No, the name is not the same

shut carbon
#

you're just overwritting the 1st one.

little raptor
shut carbon
#

yes it is, the variable is different, but the marker name is the same: [format["horde_%1_area", _hordeCount], _zone];

little raptor
#

duplicate marker names will just fail

little raptor
#

it's not the same

#

horde_%1_area and horde_%1 are the same?

shut carbon
#

createMarker [name, position, channel, creator]. Name is the same

vapid drift
#

As far as I can tell, the name is unique... if the naming scheme is working for the "o_inf" marker, it SHOULD be working for this? I mean _hordeCount increases everytime a horde is placed

shut carbon
#

second is overwriting 1st

little raptor
shut carbon
#

ah horde_area shit, im blind.

little raptor
#

if it's "" your marker was not created

vapid drift
#

ah yeah, good call

shut carbon
#

where did you see ""?

little raptor
#

there's no marker type. markers are strings

#

and failed markers are ""

shut carbon
#

oh ok

vapid drift
#

Forgive my ignorance but do I have to load all the way in to see the systemChat?

#

It should show at the briefing screen right?

little raptor
#

also why are you testing like that?

#

just use the debug console ๐Ÿ™„

vapid drift
#

... yes I knew that I was just seeing if you did

#

All joking aside, how would I test that in the console if it's a private and, for all intents and purposes, temporary variable?

little raptor
#

you just have to confirm if it works

vapid drift
#

I don't have access to _hordeArea outside of that code... but that's ok, I can confirm it another way

#

the marker name is stored on the _zone

shut carbon
#

ye, he's saying Debug Console doesn't accept _underscore variables.

little raptor
shut carbon
#

i think...

little raptor
#

but only in its own scope

shut carbon
#

with spawn?

little raptor
#

every code you execute has its own scope

vapid drift
little raptor
#

doesn't matter if it's call or spawn or ...

vapid drift
#

The code DOES work though

#

after I create the _hordeArea and _hordeMarker they're stored on the _zone itself:

_zone setVariable ["STY_RVG_zedNest_hordeArea", _hordeArea, true];
#

checking that after I spawn in returns null though

shut carbon
vapid drift
#

a placed logic

#

runs this in it's init:

["initZone", [this, 500]] call STY_RVG_fnc_zedNest;
little raptor
vapid drift
#

Every placed zone runs this in it's init

little raptor
#

create a temp logic

#

name it temp

#

check this in debug console:

#
temp setVariable ["blabla", 1];
temp getVariable ["blabla", -1];
#

if it returns -1 it doesn't have a var space

vapid drift
#

I can run that if you'd like but I can assure you they do... virtually my entire system depends on this

shut carbon
#

lol

#

i think they do though, you can set variables on logics

vapid drift
shut carbon
#

but check it anyway

vapid drift
#

ah crap... wrong part

little raptor
amber lantern
#

wait

vapid drift
amber lantern
#

If I remoteExec with jip enabled

little raptor
vapid drift
#

You sure you want the whole thing?

little raptor
amber lantern
#

I don't need the server mission event handler for player connected if I were to do the same thing anyways?

vapid drift
#

like you've said before... rip the bandaid off

amber lantern
#

Ie I can just remoteExec with jip enabled, nice

shut carbon
#

there's no defined _zone there yet ๐Ÿ˜„

vapid drift
little raptor
#

there

#

problem solved

shut carbon
#

lol

vapid drift
#

?

little raptor
#

you're using _arguments

#

that's not a valid variable

vapid drift
#

what do you mean?

shut carbon
#

nice

little raptor
#

where did you even get it from?

vapid drift
#

argh yes standby

little raptor
#
params [
        ["_zone", objNull, []],
        ["_radius", 0, [0]],
        ["_zero", false, [true]]
    ];
vapid drift
#

lol dude, no

little raptor
#

either pass an actual default value, or just don't give it a default value

vapid drift
little raptor
#

this is nonsense

#

like I said, either give it the correct default value

#

or nothing at all

#

i.e either:

params [["_args", [], ...]]

or

params ["_args"];
vapid drift
#

Relax, I've got to learn someway... rest assured I won't make that mistake again

#

I'm pretty sure I thought in order to define default values for the others, I had to define them for all

#

but that's a simple fix

little raptor
#

in order to define default values for the others, I had to define them for all
no

amber lantern
#

Do I understand correctly: by default arma servers allow clients to remoteExec anything on the server?

#

how do I disable clients being able to remotexec on server?

#

What's the preferred way to execute on all players?

#

looping through them?

amber lantern
#

Yes I have that open

shut carbon
#

i think they're blocked by default

little raptor
shut carbon
#

wouldn't it be -2?

#

-2 means every client but not the server,

amber lantern
shut carbon
#

0 then?

vapid drift
#

oh... my gosh

amber lantern
shut carbon
#

hmm... so both host and dedicated use?

little raptor
vapid drift
#

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

#

I changed the location of the function files on the description.ext... but was still editing a file in an old location

#

disregard the last 30 minutes but thank you for the criticism (seriously)

amber lantern
little raptor
#

sqf arguments always go on the right first (if unary/binary)

#

then on the left (if binary)

amber lantern
#

Is this relying on the default [] being interpreted as 0?

little raptor
#

wat?

#

no

#

[0, -2] is array

#

select selects index

#

isDedicated is bool

#

false = 0

amber lantern
#

array select expression returns an array. isDedicated always returns either true or false

little raptor
#

true = 1

amber lantern
#

No, it doesn't.

little raptor
#

not an array

amber lantern
#

Syntax 6
Syntax:
array select expression
Parameters:
array: Array
expression: Code - expression that is expected to return Boolean or Nothing. If true is returned, the original array value of currently tested element _x will be added to the output array
Return Value:
Array - a new array of all elements from the original array that satisfied expression condition

little raptor
#

it's a bool

#

expression: Code

amber lantern
#

gah

little raptor
#

that code is correct

copper raven
#

look at syntax 2

amber lantern
#

My distaste for sqf is always increasingly monotonic

boreal parcel
#

heyo, im trying to use a script I found but it doesnt seem to be working out. Im getting an error Undefined variable in expression: _this
Could anyone explain why its doing that?

Im calling it like so: 0 = [] execVM "lights.sqf";

_onoff = [_this, 0, 0.95, [0]] call BIS_fnc_param;
_distance = [_this, 1, 1000, [0]] call BIS_fnc_param;
_marker = [_this, 2, getMarkerPos "lightsmarker", ["",[],objNull]] call BIS_fnc_param;

_types = ["Lamps_Base_F", "PowerLines_base_F","Land_LampDecor_F","Land_LampHalogen_F","Land_LampHarbour_F","Land_LampShabby_F","Land_NavigLight","Land_runway_edgelight","Land_PowerPoleWooden_L_F"];

for [{_i=0},{_i < (count _types)},{_i=_i+1}] do
{
   _lamps = _marker nearObjects [_types select _i, _distance];
   sleep 0.1;
   {_x setDamage _onoff} forEach _lamps;
};

little raptor
#

but as far as I can see you are ([] execVM "lights.sqf")

#

so that error makes no sense

boreal parcel
little raptor
boreal parcel
#

really? I know of a flashlight module but lemme look

little raptor
#

I'm not sure. I'm not a mission maker so I don't mess with Eden a lot

#

but I seem to recall there was one

#

anyway, if there's none, here's a slightly modified version of that script:

params [
  ["_onoff", false, [false, 1]],
  ["_distance", 1000, [0]],
  ["_marker", getMarkerPos "lightsmarker", ["",[],objNull]]
];

_types = ["Lamps_base_F", "PowerLines_base_F", "PowerLines_Small_base_F"];

_dmg = [0.97, 0] select _onoff;
_lamps = nearestObjects [_marker, _types, _distance, true];
{
  for "_i" from 0 to count getAllHitPointsDamage _x -1 do
  {
    _x setHitIndex [_i, _dmg];
  };
} forEach _lamps;
untold copper
boreal parcel
#

yeah im not seeing a module with that specific purpose in mind however ill try out this script real quick

little raptor
#

also you need a marker named lightsmarker

#

(you can also pass a position or object)

dusk gust
little raptor
shut carbon
#

damage 1 destroys the entire pole, needs 0.95

tough abyss
#

Hello, how can I add a logo for my mod instead of the puzzle piece? ๐Ÿงฉ

little raptor
#

btw, KK has posted another script right under it that does this

tough abyss
#

Is that just a text file?

#

I'm new to this

little raptor
dusk gust
#

If you didnt already have it

boreal parcel
little raptor
#

I don't think there's a config property that says "this object has a lightpoint" think_turtle

boreal parcel
#

yeah I understand that lol, I mean where would I even go to find the needed class name? or would it just be fine to throw in the building class name the light is on?

little raptor
#

just in case

#

try it again with the changes

#

see if it fixes your problem

boreal parcel
#

gotcha

untold copper
little raptor
#

that'll give you its classname

amber lantern
#

So

dusk gust
#

Could technically check for a config property like spotableNightLightsOn = 4;, though I'm not sure if it's ALWAYS going to be in the config of lights

amber lantern
#

Opinions on this?

dusk gust
amber lantern
untold copper
boreal parcel
shut carbon
#

spotableNightLightsOn is if AI can see it or not, IMO

amber lantern
#

I'd like feedback on: what should I do better or differently

dusk gust
amber lantern
#

and of course if there are issues about it not working

shut carbon
#

EMIL_fnc_ServerMissionEventHandlerForPlayerConnectedToManagePlayerThermals that seems big meowhuh

dusk gust
little raptor
amber lantern
#

I've been created it from almost scratch/ that code for the past 6 hours lol

dusk gust
#

Not entirely sure, I don't know many buildings with lights

#

Can check if you have a class

little raptor
#

just try a few you know meowsweats

dusk gust
#

Lmao alright I'll poke around

little raptor
#

like those Altis two story ones

amber lantern
#

Oh, interesting, s/stuff/etc/ works straight from the messageline

#

@little raptor could you give a quick feedback on the code? Anything that you think is bad or should be done differently I would really appreciate

#

ah I seem to have cut a line

boreal parcel
little raptor
untold copper
little raptor
amber lantern
#

Messy?

#

How should I structure it then, imho that's pretty clean

shut carbon
#

long variables are not good for net code (and memory?)

little raptor
amber lantern
#

Easily

untold copper
#

I thought that was a joke variable? ๐Ÿคท

amber lantern
shut carbon
#

nah ๐Ÿ˜„

little raptor
#

a good variable name is one where you can read it easily, fast, and descriptive

amber lantern
#

It's all that

dusk gust
little raptor
dusk gust
#

Could be faster/more detailed if its needed, but the concept is there

little raptor
#

maybe you should use those?

#

because it's not necessarily named "light_1"

dusk gust
#

Basically it's listed in "Reflectors". If it has spawned lights, "Light_1" will always exist

little raptor
#

an alternative is count (configFile >> "CfgVehicles" >> typeOf _x >> "Reflectors") != 0

dusk gust
#

That works too

#

Probably more foolproof

little raptor
#

but again that has false positives

dusk gust
#

Oh does it?

little raptor
#

"Reflectors" are used on vehicles too, no?

shut carbon
#

yes!

#

and flashlights just vehicles, sorry.

dusk gust
#

I thought he said all lights, my bad then lmao

little raptor
amber lantern
little raptor
dusk gust
amber lantern
shut carbon
#

Emil, add an hasInterface somewhere

amber lantern
amber lantern
#

So in the end Leopard's answer is pretty good ; )

dusk gust
amber lantern
#

Wot?

#

Yes? That's exactly the context?

#

Anycase, unless this info is exposed directly, perhaps via the BIS function to list all players (after mapping to netids), it has to be queried

#

Anycase anycase, thanks for helping out, I know we noobs are annoying ๐Ÿ˜ฉ

#

Good night

shut carbon
#

gn

open fractal
#

if you moveInCargo a bunch of units to a vehicle with simulation disabled, do the units also have their simulation disabled until vehicle simulation is enabled?

fair drum
#

try it ๐Ÿ˜‰

narrow haven
#

Anyone know how to change the voice/language of a faction or side in a mission?

sand summit
#

hello. i am new to scripting, could someone help me with something?

violet gull
#

Is there an easy way to collect all items in a weapon holder? (Including container items in the weaponholder & the items in them, such as vests and weapons)

untold copper
violet gull
#

@untold copper nearSupplies returns the weaponholders but does not collect all items in it. Before I go through the asspain of writing a function to do all that, it'd be nice to know if there's a BIS_fnc or something that does it lol

sand summit
#

i have this running after an IF statement:

(currentWeapon _unit) setObjectTextureGlobal [0, _rifleTexturePath];

i have verified that this is the only place that the issue occurs, and by all metrics it appears that the currentWeapon is simply not what i should be using here. what should i be doing instead? i have also tried primaryWeapon but that did not work either.

untold copper
little raptor
untold copper
sand summit
#

oof

#

time for plan b then lmao

untold copper
sand summit
#

thank you very much

untold copper
sand summit
#

item swap, copying magazine and capacity, scope, muzzle, and flashlight

#

it's for a modular camo system within the optre unit i run

untold copper
#

Ah. Complete weapon swap... With smart magazine and attachment check?

sand summit
#

yeah

#

thankfully i won't be the one writing that, as i have no idea how i would do it

#

this was just my attempt at lobotomising something we used for backpacks

#

am i allowed to post videos in here?

untold copper
#

I've no idea. I've never seen videos here.

sand summit
#

well i can't post them here so i would assume not lol

#

we've gotten the rest of the scripting sorted for helmet, backpack, vest, and uniform

#

rifles were a stretch goal, and we've already rolled the script out to the unit

untold copper
#

Is this PVP? Or PVE?

sand summit
#

pve

#

the camo is for immersion

#

and the cool factor of it

untold copper
#

The AI still sees all right? ๐Ÿ˜†

sand summit
#

until i get the active camoflage script working on our stealth armour Evilsmirk

#

thankfully that's only accessible to special forces

#

or else it would be quite the overpowered tool

stuck rivet
#

I can't seem to use setCombatBehavior, even with copy and pasted snippets from the wiki, it always complains about missing ;

stuck rivet
#

nope :/

winter rose
#

code plz

brave jungle
#

need the edit on the unit(s) too

stuck rivet
#

yeah i did that

brave jungle
#

this setCombatBehaviour "SAFE"; will work on a units init for sure.

brave jungle
#

๐Ÿ˜„

stuck rivet
#
{
   enemyU1 = enemyG1 createunit ["rhsgref_ins_specialist_aa",[2682.64,7306.46,0], [], 0, "NONE"];
}]```
#

trying to get respawning enemies but I notice they only respawn once

winter rose
#

yes, because that created unit does not have the event handler

#

also, I see no setCombatBehaviour

stuck rivet
#

obviously because the eventhandler isn't added to the respawned unit

winter rose
stuck rivet
#

oh yeah right

#
{
   enemyU1 = enemyG1 createunit ["rhsgref_ins_specialist_aa",[2682.64,7306.46,0], [], 0, "NONE"];
enemyU1 setCombatBehavior "CARELESS";
}]```
winter rose
#

setCombatBehavior โ† add a u

#

no u

stuck rivet
#

still doesn't work

#

"Error missing ;"

winter rose
#

if you delete/comment the line, does it still pop up?

brave jungle
#

does the enemyG1 group exist?

stuck rivet
#

it should as that's the variable name of the group the guy is in

winter rose
#

the unit wouldn't spawn otherwise

stuck rivet
#

well i guess then the group exists then

#

ok it appears setBehaviourStrong works

little raptor
#

what's your game version?

graceful kelp
#
_list = position player nearObjects ["missileBase", 2000];
hintsilent str _list;
returns this
[300: vorona_missile_he_fly.p3d,299: vorona_missile_he_fly.p3d]
#

im getting this as an output but im not sure how i would turn these into objects i can check stuff for

#

so im wanting to get an object or class name from this to check the cfg for manual control

copper raven
#

you need to look in cfg ammo

graceful kelp
#
_list = position player nearObjects ["missileBase", 2000] apply {
    _config = typeOf _x;
    _config;
};
hintsilent str _list;
copyToClipboard str _list;
#
["ace_metis_HEAT","ace_metis_HEAT","ace_metis_HEAT"]```
#

evan better

copper raven
#

well you said "check the cfg for manual control"

#

configOf gives you the config, you can then use stuff like getText getNumber etc, to differentiate

#

or you can use typeOf and check classnames instead

graceful kelp
#

iv managed to get that far now but iv now run into the issuie of ace overriding the guidance

#

and i cant find it

copper raven
graceful kelp
#

it dosent change the fact ace override the cfg

#

and manual control dont exist anymore

digital hollow
#

isClass (_cfgAmmo >> "ace_missileguidance")

graceful kelp
#

sorted

#

how do i find a direction to something from a position

vapid drift
#

I asked on the Slack chat for ACE Medical but not sure if that's going to be the price place... anyone know if you can identify when a player is carrying a wounded unit or when a unit is being carried?

graceful kelp
#

get relative bearing of incoming bearm/laser riding weapons

#

still need to work the conditions and try optimise

copper raven
#
    _config = typeOf _x;
    _manualControl = getText (configFile >> "CfgAmmo" >> _config

but just use configOf like i told you previously?

acoustic abyss
#

Or even an existing script/mod that uses it extensively, so that I can learn by example.

somber radish
#

Anyone got a method for accessing the Voice Over Net used in A3? What I would like to do is to get access to the audio somehow and send that to Discord

little raptor
little raptor
vapid drift
little raptor
little raptor
graceful kelp
little raptor
#

Event handlers

acoustic abyss
#

Thank you :). I'm trying to (re)create the CAS fire support system. Here's to nothing..

brazen lagoon
#

Any suggestions on how to remoteexec a function on a player after they've loaded in?

#

like, it creates displays and such, so it has to wait until after they've loaded

little raptor
brazen lagoon
#

@little raptor initPlayerLocal.sqf also fires too soon

little raptor
#
  • waitUntil
brazen lagoon
#

it fires before the mission starts, in the briefing screen

#

you can't make controls there, as far as I can tell

little raptor
#

you can

brazen lagoon
#

nvm, figured out I can just create the controls in the map screen, that works. Is there a way to disable closing it by hitting escape?

little raptor
#

keyDown EH? blobdoggoshruggoogly

brazen lagoon
#

oh, probably use an eh for when its closed

#

could I do it with the onDestroy EH? just recreate the control again?

#

looks like onUnload is what I want

#

awesome. done!

sacred slate
#

i create a uav via BIS_fnc_spawnGroup. how can i reach the vehice of this group? the group name is the only variable i have.

brazen lagoon
#

units _group?

sacred slate
#

this returns also objects like vehicles?

brazen lagoon
#

well it will return the UAV crew

#

then you can get the vehicle with vehicle _crew