#arma3_scripting

1 messages Β· Page 515 of 1

tough abyss
#

Maybe you want entities command but dont know it yet

knotty sun
#

that would skip Zeus placed boxes, wouldn't it?

tough abyss
#

maybe

#

try it

knotty sun
#

will do

tough abyss
#

ammo boxes you can return with nearSupplies

west grove
#

got another question. :> is it possible to have a function that gets called automatically without me having to write it into my mission?

#

calling event handlers, etc

tough abyss
#

explain

knotty sun
#

if you're using it in the form of a PBO, yes

west grove
#

as pbo / addon, yes

#

basically the function works in every mission i play in, without me having to put it into mission scripts first

knotty sun
#

in config.cpp cpp class yourScript {postInit = 1;};

tough abyss
#

cfgfunctions preinit=1

#

will run every time

#

on its on

west grove
#

nice.

#

ok, but before i start working on it: it's not possible to have event handlers on item objects, no?

#

because that would also solve my problem

knotty sun
#

if you can reference them , ues

tough abyss
#

i dont understand the question

west grove
#

i have a new item (based on gps), and i want something to happen once the player picks it up

knotty sun
#

ooooh like that

tough abyss
#

you can add EH "Take"

west grove
#

in config?

#

like this? class EventHandlers: EventHandlers
{
Take = "hint 'taken!; ";
};

tough abyss
#

yeah for player not for item

west grove
#

ok ,let me try

#

if this works, i dont need the postinit

tough abyss
#

you can add EH Deleted to the item if item gets deleted when you pick it up

#

But if your item is in weaponholder then you need Take EH for player

#

Take wont fire if item has a Rearm action and you press that instead of taking it

west grove
#

is this correct?

#

picking up the item from crate does not trigger the hint

tough abyss
#

no it has to be added to the unit class like whatever class you are playing

#

B_soldier_something

#

it is player EH not item

west grove
#

ah, alright. so i actually do need the postinit stuff then

tough abyss
#

Try this in debug console player addeventhandler ["Take", {hint str _this}];

west grove
#

yes, this works, that's not a problem

#

my idea is to have a new item that i can just throw into any mission and then it will work

#

easier said than done

tough abyss
#

you can make a special weaponholder that holds only 1 item and when you pick up the item this weaponholder is deleted naturally, then you can add "Deleted" EH in config to the weaponholder

#

why do you need event when player picks up item?

west grove
#

i actually don't. if we break it down even further, i just have to check if the assignedItems == true

#

if ("testItem" in (assignedItems player) ) then ...

#

so i actually just have to use the inventory related EHs

#

now that i'm thinking about it..

#

and now that i'm thinking about it even more... is it possible to make a new item that is not the GPS but that can be placed into the GPS slot?

tough abyss
#

yeah, you just need to fake its type I think

#

@west grove Yep it works, Deleted EH added to weaponholder

west grove
#

what about items in containers, etc? these aren't weaponholders?

tough abyss
#

Yeah you need Take

west grove
#

ok. i'll toy around with it some more.

#

thanks for the help

west grove
#

hmm got a new problem

#

can i remove a layer from allcutlayers?

#

with ""myStuff" cutRsc ["RscTitleDisplayEmpty", "PLAIN"];" i'm just overwriting it - makes sense.

#

but what about removing it completely?

west grove
#

ok, i just workarounded it with a variable for now. not as clean as i'd like to, but ok for now

tough abyss
#

Overwriting is deleting. You could fade it when it has opacity 0 it is removed, allCutLayers will still have reference to it because this is how it works

astral dawn
#

do extra brackets ()slow down SQF actually?

still forum
#

🀦

#

SQF is compiled

#

Yes they slow down compile times, same as whitespace and linebreaks do

astral dawn
#

No but after it's compiled, what happens to the brackets?

still forum
#

Same as with anything else that's not useful

#

thrown away

#

The order of the compiled instructions is the order of execution

#

brackets make no sense there

#

you can calculate like.. one or two nanoseconds per bracket, at compiletime

astral dawn
#

Allright, so it figures out precedence at compilation, and throws brackets away

#

Thanks πŸ‘

tough abyss
#

I found how to spawn a flare on command but how do you get it to launch into the air like flares normally do?

_flrObj = "F_40mm_yellow" createvehicle startingpos;
_flrObj setVelocity [0,0,10];
hoary stratus
#

hey guys, how can i convert folders in pbo with cli (console)? which tool should i use?

tough abyss
#

I keep getting errors on this since adding in this parameter, and ideas?

//create array of all zone markers
    _maxsize = paramsarray select 7
    zoneMarkers = [];
    {    
        if((_x select [0, 6] == "mrkAct") and ((getMarkerSize _x) <= _maxsize)) then {
            zoneMarkers append [_x];};
        x setMarkerAlpha 0;
    } foreach allMapMarkers;

and the parameter is

class mapsize
     {
        title = "Arena max radius";
        texts[] = {"Any","150","100","75"};
        values[] = {1000,150,100,75};
        default = 100;
     };
robust hollow
#

whats the error?

tough abyss
#
_maxsize = paramsarray select 7
zoneMarkers = [];
{    
if((_x select [0>
15:55:51   Error position: <zoneMarkers = [];
{    
if((_x select [0>
15:55:51   Error Missing ;
15:55:51 File C:\Users\Owner\Documents\Arma 3 - Other Profiles\Axebeard\mpmissions\ACTION_Arma_CMedition(Altis).Altis\initServer.sqf, line 13
15:55:51 Error in expression <";
_maxsize = paramsarray select 7
zoneMarkers = [];
{    
if((_x select [0>
15:55:51   Error position: <zoneMarkers = [];
{    
if((_x select [0>
15:55:51   Error Missing ;```
robust hollow
#
    _maxsize = paramsarray select 7 // <-- missing semicolon, like the error says
    zoneMarkers = [];
#

also x setMarkerAlpha 0; missing _ for _x

tough abyss
#

weird, must have hit del randomly. thanks

robust hollow
#

(getMarkerSize _x) <= _maxsize wont work because getMarkerSize returns an array, not a number

tough abyss
#

Just about to ask that, I need the radius, so I guess getMarkerSize _x select 0'''?

robust hollow
#

I'd probably do (selectMax getMarkerSize _x) <= _maxsize

tough abyss
#

Longest side?

robust hollow
#

yea

tough abyss
#

Neat

#

How do you get a weapon's display name?

robust hollow
#
getText(configFile >> "CfgWeapons" >> _weaponClassName >> "displayName")```
tough abyss
#

Will getText return a string?

robust hollow
#

yes

tough abyss
#

Ok, wasn't sure if "text" was different somehow (like it is in UE4)

#

Is there a way to pull a random Primary Weapon from all loaded mods?

#

Go through CfgWeapons I take it?

robust hollow
#
selectRandom(allUnits select {!isPlayer _x && primaryWeapon _x != ""} apply {primaryWeapon _x})
```?
#

eww thats not as good

#

wait 1

tough abyss
#

More importantly, how would you get a magazine for that weapon? I guess select the first one in the list?

robust hollow
#

more like this, dont know wtf i was thinking

primaryWeapon selectRandom(allUnits select {!isPlayer _x && primaryWeapon _x != ""})
#

any magazine or the one loaded?

tough abyss
#

No I meant pull a random weapon from the current modlist to give to the player, then give them ammo

robust hollow
#

i read mods as mobs 😒

tough abyss
#

oh lol

robust hollow
#

yea cycle through cfgweapons but it isnt just primary weapons, pretty sure there is a way to filter out everythign else but i cant think of it rn

tough abyss
#

ehhh, I actually did want secondaries mixed in there too, just not particularly launchers

#

I'm not sure how'd you select from there anyway though, like _randWeapon = selectRandom (configFile >> "CfgWeapons" >>);

robust hollow
#

something like this perhaps

configname selectrandom("(configname _x call BIS_fnc_itemType)#1 in ['AssaultRifle','MachineGun','SniperRifle','Shotgun','Rifle','SubmachineGun','Handgun']" configClasses (configFile >> "CfgWeapons"))
tough abyss
#

holy shit that worked

#

well, it gave the display name anyway

#

didn't give the item

robust hollow
#

well yea... you gotta do that urself.

tough abyss
#

the _randWeapon is supposed to be a string of the weapon's name

#

For giving out to players

#

I have it set up for predefined weapons already, the "get all possible random weapons" is the thing I'm having trouble with

robust hollow
#

yea that returns a weapon classname... what do u want, a list of all weapons?

tough abyss
#

What does the return look like exactly?

robust hollow
#

that snippet as is would return something like "arifle_weapon_class_whatever"

tough abyss
#

like "hgun_Pistol_heavy_02_F";?

robust hollow
#

if thats the random gun it lands on yes

tough abyss
#

Yeah, weird that it doesn't give me the weapon though... I must have missed something else then

robust hollow
#

send a snippet of how ur using it

tough abyss
#
_SelectedWeapon = (paramsArray select 3);

if (_SelectedWeapon == 0) then {
weaponToAdd = configname selectrandom("(configname _x call BIS_fnc_itemType)#1 in ['AssaultRifle','MachineGun','SniperRifle','Shotgun','Rifle','SubmachineGun','Handgun']" configClasses (configFile >> "CfgWeapons"));
//magazineToAdd = "hlc_10rnd_12g_buck_S12";
};

if (_SelectedWeapon == 1) then {
_SelectedWeapon = (floor(random 9)) + 2;};

diag_log format["%1 %2",__LINE__,__FILE__];
switch (_SelectedWeapon) do {
    case 2: {
        magazineToAdd = "16Rnd_9x21_Mag";
        weaponToAdd = "hgun_P07_F";
        };
    case 3: {
        magazineToAdd = "6Rnd_45ACP_Cylinder";
        weaponToAdd = "hgun_Pistol_heavy_02_F";
        };
};

weaponSelect = getText(configFile >> "CfgWeapons" >> weaponToAdd >> "displayName");
publicVariable "magazineToAdd";
publicVariable "weaponToAdd";
publicVariable "weaponSelect";
#

It show shows the display name just fine

#

Nothing showing up in the rpt either

robust hollow
#

log what the variable returns when u try to add it.

#

also, just reading that i feel like when _SelectedWeapon equals 1 there is a chance no weapon gets set?

tough abyss
#

I cut out all the other cases on SelectedWeapon

robust hollow
#

ohhhh, fair enough πŸ‘

tough abyss
#

Yeah, I must have my paramater numbers messed up or something

#

Ohhhhh I know the problem

#

I have my script to assign loadouts set to waitUntil !isNil magazineToAdd, but I never added in the mags

molten pulsar
#

Hey does anyone know what the locality is for a projectile fired by a unit on a dedicated server?

tough abyss
#

How do I just pull the first magazine that's compatible with the random weapon?

robust hollow
#
getArray(configfile >> "CfgWeapons" >> _weapon >> "magazines")#0```
tough abyss
#

ahhhhh I had just found something close to that on Reddit I was trying to parse out

high marsh
#

@robust hollow That's fine for weapons that don't use magazine wells.

tough abyss
#

you mean internal mags?

robust hollow
#

@molten pulsar i think the projectile is a local object, not a network object. I'm not 100% sure though, havent really look into it before, just did a quick test.

// FiredMan EVH

 9:49:03 "SERVER - 13: tracer_green.p3d"
 9:49:03 "SERVER - local: true"
 9:49:03 "SERVER - netid: 0:0"

 9:49:03 "CLIENT - 21: tracer_green.p3d"
 9:49:03 "CLIENT - local: true"
 9:49:03 "CLIENT - netid: 0:0"
molten pulsar
#

alright, so its essentially local everywhere then?

robust hollow
#

yea cause it would seem its a different object for each client

molten pulsar
#

Thanks for the help man

tough abyss
#

Small projectiles are local everywhere

#

Grenades are not

tough abyss
#

@robust hollow testing in vanilla, this pulls a lot of mounted weapons that bug out. Any way to avoid those?

if (_SelectedWeapon == 0) then {
weaponToAdd = configname selectrandom("(configname _x call BIS_fnc_itemType)#1 in ['AssaultRifle','MachineGun','SniperRifle','Shotgun','Rifle','SubmachineGun','Handgun']" configClasses (configFile >> "CfgWeapons"));
magazineToAdd = getArray(configfile >> "CfgWeapons" >> weaponToAdd >> "magazines")#0;
};
#

Ditch the MGs?

#

swapped MachineGun for LightMachineGun seems to do the trick, I think MachineGun is for mounted

robust hollow
#

🀷 i looked at arsenal to see how it sorted weapons

tough abyss
#

I checked the wiki, Machineguns weren't even listed just LMGs,. Makes senes (to Arma)

#

Any obvious reason this trigger doesn't work in multi?

0 = [] spawn {     
_rad = triggerArea boundaryTrigger select 0;    
    damagePlayer = true;  
    for [ {_i=10} , {_i>=0} , {_i=_i-1} ] do {    
  _str = str (format ["WARNING: %1", _i]); 
    
  titleText [_str,"PLAIN"];    
  titleFadeOut 0.5;    
        sleep 1;  
        if (player distance boundaryTrigger < _rad) exitWith {damagePlayer=false};     
    };     
    if (damagePlayer) then {player setDamage 1; 
 [player] execVM "ACEdeath.sqf"; 
 }; 
};
#

I wonder if boundaryTrigger needs to be public

#

wait no, this is the boundaryTrigger

tough abyss
#

Trying a different way but my exitWith is messing it up

_unit = _this select 0;

waitUntil {(_unit distance startingpos) > (zonesize select 0) + 10};

for [ {_i=10} , {_i>=0} , {_i=_i-1} ] do {    
  _str = str (format ["WARNING: %1", _i]); 
  titleText [_str,"PLAIN"];    
  titleFadeOut 0.5;    
  sleep 1;
  if ((_unit distance startingpos) < (zonesize select 0)) then {exitWith {};};
};
  if ((_unit distance startingpos) < (zonesize select 0)) then {exitWith {};};
  else {
    _unit setDamage 1; 
    [_unit] execVM "ACEdeath.sqf"; 
};
robust hollow
#

then {exitWith {};}; -> exitWith {};

tough abyss
#

so scratch the whole "then" part?

robust hollow
#

yea, but keep in mind you cant do exitWith {} else {}

tough abyss
#

Right, I want the countdown to stop if they get back into the zone

robust hollow
#

yea, so do

if ((_unit distance startingpos) < (zonesize select 0)) exitWith {};
_unit setDamage 1;
[_unit] execVM "ACEdeath.sqf";```
tough abyss
#

Oh I see what you're saying

#

Is there a way to restart the script inside of itself? Because if you leave the zone, come back before you're killed, and leave again, the script doesn't check to see if you're leaving the zone again

robust hollow
#

i thought u said it was in a trigger, wont it start a new thread for u?

tough abyss
#

It was in a trigger, but I couldn't get it to work on MP so I just made it a "check distance" script triggered by initPlayerLocal

robust hollow
#

you can either put it in a loop or if its in its own file/function, spawn it at the end of itself

tough abyss
#

can I put the entire code into a while player alive?

robust hollow
#

yea, as long as you do alive player not player alive

tough abyss
#

that didn't seem to work, I put the while encompassing the whole script and it's self contained

#

_unit = _this select 0;

while {alive _unit} do {
waitUntil {(_unit distance startingpos) > (zonesize select 0) + 10};

for [ {_i=10} , {_i>=0} , {_i=_i-1} ] do {    
  _str = str (format ["WARNING: %1", _i]); 
  titleText [_str,"PLAIN"];    
  titleFadeOut 0.5;    
  sleep 1;
  if ((_unit distance startingpos) < (zonesize select 0)) exitWith {};
};
  if ((_unit distance startingpos) < (zonesize select 0)) exitWith {};
_unit setDamage 1;
[_unit] execVM "ACEdeath.sqf";
};```
robust hollow
#

oh, well yea... you killed the unit/exited the loop

#
if ((_unit distance startingpos) >=(zonesize select 0)) then{
    _unit setDamage 1;
    [_unit] execVM "ACEdeath.sqf";
};
#

use that instead

#

though itl still exit the while loop so perhaps use a different condition or redefine _unit after the player respawns

tough abyss
#

they don't respawn, it's a one life mode

robust hollow
#

oh, well thats fine then

tough abyss
#

that one didn't seem to trigger at all

#

oh I see why

#

=

robust hollow
#

yea, if outside the zone, die

tough abyss
#

not triggering the countdown even

robust hollow
#

did u put it in the for loop or after it. it is meant to be after it

tough abyss
#

missed a bracket at the very least

#

alright, yeah that did the trick, seems to be good now

still forum
#

@hoary stratus the Arma 3 tools also work in console, mikeros tools too, and armake too.
@tough abyss Ok, wasn't sure if "text" was different somehow (like it is in UE4) It is. But getText returns string, not text. parseText for example returns text. You have to read the wiki to know such things ^^
@molten pulsar projectile is local to firer. So... Dedicated server. Atleast the bullet that causes actual damage is. I think players simulate their own bullets for impact effects.

tough abyss
#

You have to read the wiki to know such things You can lead a horse to water but you can't make him drink

spark turret
#

Anyone have a recommendation where to start with a script thats low performance impact and replaces a projectile of a tank

queen cargo
#

creating a new file would be a start @spark turret

spark turret
#

...

#

thanks x39 i dont know what a file is, anyone have a youtube video explaining it?

queen cargo
#

i am not sure what you expected when asking that question other than that @spark turret
a fully done script?

spark turret
#

no lol ideas

#

and comments like "yeah i did that before its easy with this command:"

#

or "no its not possible it fucks up the ballistisc etc"

queen cargo
#

you have no conrete idea and just ask randomly "anybody knows how to do this? i do not"

#

for beginners:

#
  • find out how to grab a projectile (you can create a proper question with this)
#
  • find out how to manipulate some objects velocity (depending on complexity, either per frame or just once)
#
  • find out how to pack all that into something that automatically attaches to everything
#

there you got three ideas

#

create questions with em and you will find your glory

#

for the first, there is an eventhandler you can use

#

the second, simple google of per frame eventhandler and setvelocity will guide you

#

for the third, cba extended event handlers

still forum
#

You want to replace the projectile?
You can use a Fired eventhandler to find out when a projectile was fired. Then you'll take the velocity and direction of the old projectile. and delete it using deleteVehicle. Then you'll spawn a new projectile (I think createVehicle command for that, not sure) then apply velocity and direction to the new projectile, and it will fly of.

That's what you wanna do right?

tough abyss
#

10:08:42 Error in expression <"_classname" ]; [ _classname , { [ ( _x select 0 ) ] call F_checkClass } ] call> 10:08:42 Error position: <select 0 ) ] call F_checkClass } ] call> 10:08:42 Error Generic error in expression

#

what causes that?

still forum
#

_x is probably not what you expect it to be

tough abyss
#

I am doing a KP liberation mission set in ww2. And everything is ready. but keep sending me this error, that make me not able to play

#

I am getting frustrated because I spend almost 30 hours (counting only the time in computer) working on it

#

and now that everything is ready I can't even play it. No "Grammar" errors. nothing just a expression error

still forum
#

I think they come from the preset

tough abyss
#

Oh thanks now I have somewhere to begin the fix

#

at least a "north"

#

thank you

tough abyss
#

How do I calculate the unload position of a cargo object?

winter rose
tough abyss
#

na

#

i already solved it

#

with the attachTo

#

tool

#

easy to learn

#

I learned in like 10 minutes

winter rose
#

out of curiosity, what was it for? πŸ™‚

tough abyss
#

check it with your own eyes

#

how cool is that!

winter rose
#

I mean why did you need the cargo's unload position ^^

tough abyss
#

Attachto != VehicleInVehicle, if you ask question make sure you ask the correct one

#

?!

#

whatever, that thing's crazy

#

for me

#

Attachto won’t behave in MP the same way

tough abyss
#

I want to determine which target an AI has fired at. I am thinking I can do this with the Fired event and then check its knowAbouts list and determine which is closest to its facing direction. Is there a better way to determine what an AI is aiming and shooting at?

#

Maybe assignedTarget would work?

#

Not sure that gets set unless something script wise sets it.

#

I can certainly try it in a fired event handler and log if there is anything in it to test it but I was confident that wasn't how it worked from the wiki.

#

It gets assigned but not sure how or even if it will match current target

unborn ether
#

@prime horizon

tough abyss
#

Where did you see that you need to prefix sound with @?

#

You do it only for mission config sounds and only if you want to use sound file from addon.

#

Do you realise that you are making an addon?

crystal wolf
#

22:44:18 Warning Message: Addon 'A3_Air_F' requires addon 'A3_Characters_F'

#

where do i find this file

robust hollow
#

comes with arma 3
A3\addons\characters_f.pbo

crystal wolf
#

ok but how do i get it back

robust hollow
#

verify game files in steam

crystal wolf
#

what about for my server tho ?

robust hollow
#
verify game files in steam```
#

the server may not need it though, there is usually a a3_characters_f error when a dedicated server loads up

still forum
#

A different error. Not this

robust hollow
#

yea, just found the normal one.

west grove
#

hey fellas. quick question again. has anyone had any experience with [] call BIS_fnc_groupIndicator; ?

crystal wolf
#

see thats my rpt im not sure whats wrong connor

robust hollow
#

did you verify ur game files?

crystal wolf
#

its not my game rho

#

its in my ftp

robust hollow
#

is it a slot based server you can run steam update on or do you only have ftp access?

crystal wolf
#

i have full access but not sure how to do what ur saying

robust hollow
#

update the server with steam so it can redownload missing or damaged game files

crystal wolf
#

it auto does it tho

#

its done by nitrado

robust hollow
#

theres no button to do it?

still forum
#

So you do NOT have full access then

#

contact nitrado support

crystal wolf
#

ok how do i upodate with steam tho ?

robust hollow
#

on slot based servers u usually just click a button but if you dont have one u will need to contact nitrado

still forum
#

last I used nitrado they didn't

crystal wolf
#

but why cant i just download that one file

robust hollow
#

you can when you verify through steam πŸ™‚

crystal wolf
#

but how !

robust hollow
#

apparently you cant verify without contacting nitrado, so contact nitrado

crystal wolf
#
22:50:10 Cannot register unknown string STR_DIFF_SCENE_ONLY
22:50:10 Cannot register unknown string STR_DIFF_SCENE_AND_MAP
22:50:12 Item str_a3_to_c01_m02_036_ta_mechanized_briefing_SOLDIERC_0 listed twice
#

i also got these which i gotta fix

#

not sure where they are located

still forum
#

no you don't gotta fix them

crystal wolf
#

yy

tough abyss
#

@west grove
I've made a function that checks if any (known to me) 3rd party group indicator exists and runs [] call BIS_fnc_groupIndicator if not.

wanton swallow
#

Hi all. How to check is player hands free or with weapon?

robust hollow
#

currentWeapon player == ""; <-- not wielding a weapon

wanton swallow
#

Thank you

tough abyss
#

I want to track how many shots each player fired, I figure the easiest way is to store the info in an array with each players ProfileName and the # of shots fired, or is there a more efficient/easier way?

#

Would it make more sense to store the info locally somehow, like in initPlayerLocal and then report it later? Is that even possible?

robust hollow
#

i would have thought something like this would do just fine

tag_shotCounter = 0;
player addEventHandler ["FiredMan", {
    tag_shotCounter = tag_shotCounter + 1;
}];
tough abyss
#

My initServer has this

playerNames = [];
roundsFired = [];

{
_name = name player;
if !(playerNames in _name) then {
    _newElement = (count playerNames) + 1;
    playerNames set [_newElement,_name]; 
    };
} forEach allPlayers;
publicVariable "playerName";
publicVariable "roundsFired";

and then I have this in initPlayerLocal

_unit = _this select 0;
_name = name _this;

//if player isn't in array, add them in
if !(playerNames in _name) then {
    _newElement = (count playerNames) + 1;
    playerNames set [_newElement,_name]; 
};

//get player's position in array, retrieve shots fired, add 1 to it
if (playerNames find _name != -1) then {
    _element = playerNames find _name;
    _roundsFired = roundsFired select _element;
    _round_counter = _roundsFired + 1;
    roundsFired set [_element, _round_counter];
};
robust hollow
#
_unit = _this select 0;
_name = name _this;

what

#

i assume that snippet is in a fired event?

tough abyss
#

Yep

#

I got !(playerNames in _name) backwards I see

robust hollow
#

i was more pointing out you do _name = name [_unit]

tough abyss
#

Ohh derp

robust hollow
#

doing it by name is a bad idea.
_name = name player; will be an empty string on a dedicated server.
what is the point of publicvariable arrays? you never rebroadcast them?

#

and if you did, that would be some bad network spam

tough abyss
#

The idea is to track the shots fired then report it at the end in the debrief or something

#

name player is supposed to return their ProfileName

robust hollow
#

yea, so what happens when two people use the same name?

tough abyss
#

They don't lol

robust hollow
#

what if they did

tough abyss
#

I don't know, what if?

robust hollow
#

why not use something that you know will be unique?

tough abyss
#

It would look like someone was blowing off a shitton of rounds

#

As far as we're concerned, names are unique, but what else is there?

robust hollow
#

player uid

tough abyss
#

UID?

tough abyss
#

how do I set a public variable in initServer from the players?

#

do I have to use missionNameSpace?

robust hollow
#

what?

tough abyss
#

if I declare a public variable in initServer, can any script just alter it?

robust hollow
#

yea but the change wont broadcast unless you tell it to

tough abyss
#

that's what I mean, how do I broadcast that?

robust hollow
#

publicVariable again, but if this is for the shots fired stat i would strongly advise against broadcasting on every shot

tough abyss
#

so what would be a non-retarded way to go about this?

robust hollow
#

record shots locally and then send the result to the server when the round ends

#

or, i think u can use FiredMan on anyunit from server, removing the need for any broadcasting

tough abyss
#

FiredMan doesn't look any different from Fired except it counts mounted weapons

#

So you're saying record the round count and just have it send the info over at the ending trigger

robust hollow
#

i did say that, but then decided you could probably do the whole thing serverside

tough abyss
#

And is this the right syntax, can't tell if it's doing anything ```sqf
this addEventHandler ["Fired", {[_this] execVM "roundTracker.sqf";}];

robust hollow
#

dont need to put _this in an array

tough abyss
#

starting over, so my event handler is still firing roundTracker, and this is roundTracker:

_unit = _this select 0;
_name = getPlayerUID player;
roundsFired = ;

_round_counter = roundsFired + 1;
roundsFired = _round_counter;
#

How do I define roundsFired though? Setting it to 0 of course resets it every time

robust hollow
#

if (isNil 'roundsFired') then {roundsFired = 0}; or define it elsewhere, perhaps before adding the event like in my example.

also you might as well do this in one line roundsFired = roundsFired + 1;. how you have it is unnecessary.

tough abyss
#

yeah I realized that

#

If I wanted to track the ammo types used (mainly just UGL grenades and regular magazines), would it be best to use arrays for those? My original plan was to make an array of the ammotype fired, then just track the amounts in a separate array

#
roundTypes = ["bullets", "grenades", "M203s"];
roundsFired = [x,y,z];
robust hollow
#

I'd probably do it in a single array like [["bullets",0],["grenades",....] but that works too

tough abyss
#

that's an array of arrays, no?

#

looks like it makes more sense though

#

Looking at the eventhandler, ```sqf
this addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
}];

Do I need to pass the _ammo when firing the event? Like how do I pass the _ammo from the event to the script?
robust hollow
#

that does it for u just like that ^

tough abyss
#

I don't follow

#

I don't understand how to GET the info from the event

robust hollow
#
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];

// is the same as 

private _unit = _this select 0;
private _weapon = _this select 1;
private _muzzle = _this select 2;
private _mode = _this select 3;
private _ammo = _this select 4;
private _magazine = _this select 5;
private _projectile = _this select 6;
private _gunner = _this select 7;
tough abyss
#

So it automatically passes that stuff into the script then?

robust hollow
#

yes

tough abyss
#

Ok, so if I use _ammo, it will pull the ammo that was fired

#

MAkes sense

robust hollow
#

as long as you define _ammo, yes

tough abyss
#

Okkkkkay so I have to add _ammo = _this select 4;

robust hollow
#

yea

tough abyss
#

Ok cool

violet gull
#

Is there a limit to how many FSMs that can run at one time?

tough abyss
#

I got a Zero Divisor error on the _ammo = _this select 4; do I need to pass that FROM the unit firing the script?

robust hollow
#

did you change ur execvm argument from [_this] to _this?

tough abyss
#

sqf this addEventHandler ["Fired", {[] execVM "roundTracker.sqf";}];

#

now I need to add _this?

robust hollow
#

i said before, _this doesnt need to be in an array

#

_this is an array itself

tough abyss
#

yeah it's not in there

#

or do you mean the _ammo _this

robust hollow
#

change [] execVM to _this execVM

tough abyss
#

No errors, but doesn't seem to be working

_unit = _this select 0;
_playerID = getPlayerUID player;
_ammo = _this select 4;
playerName = name player;
roundTypes = [];
roundsFired = [];

if !(_ammo in roundTypes) then {
    _newElement = count roundTypes + 1;
    set roundTypes [_newElement, _ammo];
    set roundsFired [_newElement, 0];
};

_element = roundTypes find _ammo;
set roundsFired [_element, _element + 1];
robust hollow
#

thats not how set works

tough abyss
#

That I understand....

robust hollow
#

but you didnt do it?

tough abyss
#

_newElement is supposed to be the index, the value is _ammo

robust hollow
#

ok, and you do set roundTypes [_newElement, _ammo];

tough abyss
#

Yes

robust hollow
#

the syntax is array set [index, value] and youve done set array [index, value]

tough abyss
#

Ohhh shit

#

"you got it backwards" would've been a quicker way to say that lol

#

So it still isn't updating the arrays

robust hollow
#

cause u set the array empty every time the event fires?/

tough abyss
#

Hmmm

#

sqf if (isNil 'roundTypes') then {roundTypes = []};

#

Need one of those don't I

robust hollow
#

mmhm, or define the array before adding then event, then you dont need to check if it exists every time the event fires

tough abyss
#

I'm not sure where I would define the array beforehand, in initPlayerLocal?

robust hollow
#

where do u add the event?

tough abyss
#

I did it in the unit's init

robust hollow
#

i would move that to initPlayerLocal, where you would do ```sqf
roundTypes = [];
roundsFired = [];
player addEventhandler ...

tough abyss
#

Ohhh ok

#

It tracks the initial ammo fine but it's not picking up anything after that like pistol fire, UGLs, or launchres

#
_unit = _this select 0;
_ammo = _this select 4;

if !(_ammo in roundTypes) then {
    _newElement = (count roundTypes) + 1;
    roundTypes set [_newElement, _ammo];
    roundsFired set [_newElement, 0];
};

_element = roundTypes find _ammo;
roundsFired set [_element, (roundsFired select _element) + 1];
robust hollow
#

aside from this

_newElement = (count roundTypes) + 1;

which should be

_newElement = count roundTypes;

it works for me

tough abyss
#

YEah I just realized it's skipping numbers because the array is 0 based

#

Oh sweet, it even counts grenades!

#

Now how would I get the arrays from each player? Since they're stored locally, would I need the roundTracker script to report back to another script, or can I do something like ```sqf
{
roundTypes = display round types....
roundsFired = display rounds fired....
} forEach AllPlayers;

#

@violet gull FSMs are added to scheduler just like execVM/spawn scripts so the limit depends on how powerful is your PC

violet gull
#

4500 FSMs running that just looped generating random numbers between 0 and 100 caused my FPS to drop/average around 45 to 62 FPS. So yeah, good to know.

#

On the VR map

#

Nearly no impact around 200-600 running

#

Had about 142 FPS

tough abyss
#

At some point you are going to clog scheduler with high number of scripts added and no script will get simulated apart from unscheduled until you restart mission

violet gull
#

Yeah, true.

tough abyss
#

Would I need to get like the Object Namespace or something to retrieve the arrays from each player?

wanton swallow
#

How to cancel HandGunOn animation?
If i do HandGunOn with a playActionNow and before it's end call playActionNow for another animation or gesture, another action didn't execute.
First call of HandGunOn has override all next calls.
But if i use switchAction "amovpercmstpsnonwnondnon" it can to cancel HandGunOn in early state, but cant cancel on later stage...

slim oyster
#

@tough abyss FSMs are added to scheduler for when state condition change is calculated but completes activation expression of states like unscheduled, correct?

#

or can it suspend state expression just like a script?

tough abyss
#

Why don’t you test it with canSuspend and report back?

slim oyster
#

it doesnt report correctly for FSM i thought

#

I was under the impression that the process of checking the condition blocks is added to the scheduler, with the actual condition check being unscheduled, and if met the resulting state expression is ran in unscheduled... Having the state conditions be checked on a frame/tick balance is the whole point of the CBA statemachine right?

tough abyss
#

So I had some mess like this I was going to try, but I'm sure it's probably the worst way to do this, right? I'm trying to get arrays stored on players and make arrays of those arrays to print the data from

allPlayersNames = [];
allRoundTypeArrays = [];
allRoundsFiredArrays = [];

//store player's arrays in here
{
    if !(_unitName in allPlayersNames) then {
        _newElement = count roundTypes;
        if (count allPlayersNames == 0) then {_newElement = 0};
        allPlayersNames set [_newElement, _unitName];
        allRoundTypeArrays set [_newElement, roundTypes];
        allRoundsFiredArrays set [_newElement, roundsFired];
    };
} forEach AllPlayers;

{
    _name = allPlayersNames select _x;
{
    {
        hint format ["Hello %1",player ]
    } forEach _x select _x;
} forEach allRoundTypeArrays select _x;
} forEach allPlayersNames;
tough abyss
#

Or is there some way to save the variables out as strings in a text file?

#

@slim oyster Are you asking me about CBA? I think you should ask @still forum as I am unfamiliar with CBA

radiant needle
#

Why does it seem like doArtilleryFire does not work?

high marsh
#

@radiant needle give sample code and it might reveal errors

radiant needle
#

Arty1 doArtilleryFire [(position targ1), "32Rnd_155mm_Mo_shells", 1];

#

Arty1 and Targ1 are named in editor

#

Arty is NATO self-propelled

#

targ1 is game logic

high marsh
#

Are you sure the type is correct?

velvet merlin
#

is there a way to stop AI firing besides removing all magazine, or constant forgetTarget?

tough abyss
winter rose
#

@velvet merlin setBehaviour "CARELESS", set CombatMode "BLUE" ?

#

"CARELESS" alone doesn't always work with vehicles iirc

still forum
#

@slim oyster afaik cba statemachine is fully unscheduled

grizzled spindle
#

Does anyone know a way to check if a classname is a vest item?

still forum
#

BIS_fnc_itemType

grizzled spindle
#

amazing

#

Thank you

tough abyss
#

@tough abyss Assigned To None went unnoticed

#

Isn't that how it goes with all bugs and feature requests? The feature tracker has IMO just been a place to go to waste time raising something, nothing I have raised or participated in since release has been even been triaged let alone assigned and done. BI does what it wants and if your bug aligns with what they are doing then it'll get fixed, that is the only process I have any confidence is at work when it comes to the tracker

#

Ideally what I really want is a combination of an event handler and a command I can call. That way I can get told when an AI selects a target and run a background process to check that and do stuff and then once it becomes unassigned again I can stop that process. That is the most performant approach to what I want to do but the event system is a little anaemic given the amount of actual events that could happen in the game.

#

So I am thinking I can at least use the Fired event and treat that as a proxy for targeting, they ought to be fairly similar. But because I can't get the current target I either have to do something expensive (like work out the most likely target) or just keep using the Fired events and do some sort of fudge thing that isn't really what I want but will hopefully look quite similar.

#

bugs != feature requests. bugs get higher priority, game breaking bugs even more.

#

lol if only.

winter rose
#

@tough abyss that you know of

tough abyss
#

why

#

it is true, but high priority != will be fixed no matter what

winter rose
#

How many game breaking bugs have been fixed without being mentioned in the SPOTreps, too

tough abyss
#

^ this

#

Which is the point, BI does what BI wants and the feedback tracker isn't of value. The bugs associated with AI are all in there, many of them are game breaking and pretty high priority for a lot of people and they are now years old, without triage. Just doesn't align with BI's schedule.

#

Feedback tracker is monitored because community is very good at breaking the game

#

Anyway I have zero confidence this engine available but not exposed command will get done so I am going to have to waste a bunch of CPU cycles and hope I can make it run well enough.

#

Bohemia Interactive is an independent game development studio, so BI does what BI wants

velvet merlin
#

@winter rose as those are per group, its not viable in this case

unborn ether
#

<- setBehaviour "CARELESS", when BI talks about taking care of bugs in SPOTs, because I'm pretty sure 75% of bugs and other issues were "fixed" and spreaded to BI by people from community, like in this channel, forums whatever.

#

If they would care, things like CBA would probably never exist.

tough abyss
#

They do fix stuff, they quite clearly ask for details of crashing bugs or specific bugs. But no one looks at bugs put into the tracker, most of the stuff in there hasn't had the basic pass of "wont fix" or prioritised. There isn't a lot of point having a bug tracking system that they don't appear to actually use. The prior system they happily just turned it off and replaced it without migrating the data, that says a lot about how much their cared for its contents.

winter rose
#

@velvet merlin it's a pain, but I believe you can "unjoin" them, apply the settings to the one unit then rejoin them to the group

velvet merlin
#
        _muzzles = getArray(configFile >> "cfgWeapons" >> _weapon >> "muzzles");

        {
            _done = _unit setWeaponReloadingTime [_gunner,_x,1];
        } forEach _muzzles;

        sleep _reloadTime;

        if ((count _muzzles) > 1) then // 1 is AP
        {
            _unit selectWeapon (_muzzles select 1);
        };```
#

this works

#

just need to handle out of ammo situations

#

(AP vs HE in main gun of tank)

west grove
#

hey fellas. quick question again: is it possible to detect explosions in an area?

#

i don't mean objects being damaged by explosions, but just... explosions

#

i know that i can filter for #explosions with allMissionObjects, but i just have to track a small area around the player

tough abyss
#

Explosion EH but needs to be added to Object

young current
#

@west grove why do you need it?

#

I mean you may be thinking about it the wrong way

west grove
#

i want to check a radius of x - if an explosion happens within it, i want the position of that explosion

#

the thing is, the explosion might not damage anything and i can't add damage EHs to every object, as the radius is not fixed (travels with player)

#

so basically, if an explosion happens in x range of the player, i want to know where it happens so that i can spawn stuff there

#

the explosion can be from any grenade or rocket or whatever there is

young current
#

Not 100% sure but I would say you cant detect explosions very easily like that

#

is this a generic thing or part of a specific situation?

west grove
#

a generic thing

#

i can workaround not having that, but if i could get this to work (with reasonable performance), that would be nice

young current
#

is it some kind of an awareness system or what are you spawning?

#

I might help to understand what you need if you tell what you are trying to achieve

west grove
#

yeah, i guess it can be called an awareness system

#

mark the position of the explosion on the map

young current
#

realtime or can it miss some?

#

I mean you could perhaps look for explosion related particles

west grove
#

whatever gives the best performance - so i guess it can miss some

#

can we detect particles with nearEntities or something?

young current
#

mm true maybe not

#

I think you could test it by making a object/entity listener and start dropping artillery around the detection area

#

and see what if it spots anything

unborn ether
#

@west grove What is the source of explosion?

west grove
#

grenades primarily, missiles, etc.

#

if you mean that with source

#

hmm nearestObjects picks it up

unborn ether
#

allMissionObjects "#crater" detects an aftermath of explosion as an objects.

#

You can't handle the explosion itself as it is. Because you can't normally track projectiles death. You can do it only on the side of each of client with Fired* EVH.

#

Then you need to parse what is that, and was it explosive enough.

#

If indirectHit config value of CfgAmmo is >2 - that's usually an explosive ammo already, but depends on what size of explosive, because that might be just 40mm

west grove
#

yeah, but sounds like a big load of additional code that i have to run through

#

detecting the crater objects isn't too bad, actually.

unborn ether
#

Depends on application, if you wish to run some broadcast about i am explosive you can attach Fired* EVH like I said and use remoteExec towards your server with pre-defined functions. Not like a lot of code, but this might cause some broadcast spam in case players will use HMG's or similar.

west grove
#

it's for singleplayer, so no server involved

unborn ether
#

No issue then at all. Just use Fired* EVH

#

The most intensive action will be getNumber of indirectHit value.

west grove
#

but then i need to add EHs to every ai

#

and the player

#

or is it enough on player side?

#

probably not, i guess

unborn ether
#

Every unit that you want to fixate being firing explosive stuff.

#

That case will give you an ability to detect the power of explosion, radius etc.

#

Using #crater will tell you it was a boom and nothing else.

west grove
#

yeah, found out about that right now. sucks.

unborn ether
#

As I said, depends on your purpose.

west grove
#

welp, i will have to think about it.

#

in any case, thanks for the help

eager prawn
#

@west grove fyi, there is an event handler for when a vehicle/unit is hit/damaged by an explosion

tall dock
#

Hey, I've got a rather specific question about enableAI / disableAI on servers:
In my mission there are two "Praetorian 1C" units as air defense (that are classified as UAV's by the game), which are disabled by default with this disableAI "ALL"; in their init.
Then there is a radius trigger which triggers on enemy air units entering the radius, which in turn activates the units with {_x enableAI "ALL"} forEach defUnits;
When no enemy air unit is present anymore, the trigger deactivates with {_x disableAI "ALL"} forEach defUnits;
This is working fine in singleplayer and local MP, but as soon as I load the mission on my dedicated, the units activate for the first enemy air unit, then disable, then never activate again.
I've checked with hints if the trigger fires, which it indeed does. So, somehow the second enableAI command never activates the units.
The strange thing is - if I activate them manually via the remote debug console, they start working again.
What the hell am I doing wrong?
// Edit: the goal is to make them fire only at air targets. Maybe there is an easier way?

tough abyss
#

Do you use player command on dedicated?

tall dock
#

I'm sorry, what exactly do you mean with that? If player can control the UAV's? If so, no, I disabled access to them

tough abyss
#

What is trigger condition

tall dock
#

Type none, activation OPFOR, type present, repeatable, server only, condition this && {_x iskindof "Air"} count thislist > 0

tough abyss
#

And where the enemy unit spawned?

tall dock
#

But as I said, the trigger works fine - I've set up chat commands for every trigger activation / deactivation and it works.

#

I've placed the enemy air units with Zeus to test this, in the normal workflow some scripts spawn them

tough abyss
#

There is obviously issue with locality, 99% of the time it is when you move to dedicated, so not really enough information to identify the problem

tall dock
#

Well I do a check if isServer before I try to activate or deactivate the units and also before it writes the debug messages in chat. And somehow the very first execution works, the second one not, although the chat message says it activated

#

Thats why I'm a bit confused

tough abyss
#

Chat messages you see are they remote executed?

tall dock
#

yep

tough abyss
#

And when you enable units manually from debug console do you use server exec?

tall dock
#

Exactly

austere granite
#

Anyone happen to know how I can stop mouseDown getting triggered in arma, when arma doesnt even have focus and my mouse is on other display? πŸ˜„

#

Like I put my mouse on arma, use alt+tab, move my mouse to another screen and click a couple times, when I then alt-tab back in, arma will report a mouseDown

tough abyss
#

Can you show your onactivation statement?

#

@austere granite yeah known issue unit fires on alt tab

austere granite
#

it's for dialog stuff, no units involved so if I can do some hacky workaround that's good for me

tall dock
#

trigger deactivation: [false] execVM "fn_basedefense_activate.sqf";
script: `#define THIS_FILE "fn_basedefense_activate.sqf"
params ["_active"];

if !(isServer) exitWith {};
if !(_active) then {
{_x disableAI "ALL"} forEach d_basedefense_units;
"DEBUG: DISABLED" remoteExec ["systemchat", -2];
};
sleep 2;`

#

And this works fine. Same code & script for activation, _active gets checked for true in another if. Both if's work on first activation and deactivation

tough abyss
#

Why sleep?

tall dock
#

For debug purposes, this wasn't present in the first place

#

Either way, it somehow stops working

#

(with debug purposes I mean: cooldown condition, currently it locks itself after deactivation for 5 seconds before it can be triggered again. This is also in the trigger condition. Didn't make a difference)

tough abyss
#

Are you sure this disableAI works on init? Maybe it never disables AI for the first wave but trigger disables it after and it just fails to enable

tall dock
#

Yeah good call, I'm currently changing that by putting the initial disable into the init.sqf, maybe thats the problem

tough abyss
#

Try it who knows AI implementation is a mystery

tall dock
#

sadly there seems to be no way to let them fire only at air targets :/

tough abyss
#

helo

#

Does anybody know how do I make the night go faster than the day?

#

in mission only

ruby breach
#

setTimeMultiplier coupled with a sunOrMoon check

ruby breach
#

@tough abyss Keep it here, not in PMs. sqf private _daySpeedMultiplier = 1; // 1 IRL Hour = 1 In-Game Hour private _nightSpeedMultiplier = 2; // 1 IRL Hour = 2 In-Game Hours setTimeMultiplier ([_daySpeedMultiplier,_nightSpeedMultiplier] select (sunOrMoon < 1)); You'll need to run that periodically on the server for it to work. Pretty sure that's how the math behind setTimeMultiplier works, but @winter rose may know for sure.

tough abyss
#

ok

#

sorry for PMing you

ruby breach
#

Nah, you're good. Just better for it to be here in case someone capable of using search has a similar question later

tough abyss
#

does creating a sqf file solve something

#

?

#

named time.sqf

#

and then I place this on there

#

if (!isServer) exitWith {}; __startingdate = [2015, 04, 25, 3+floor (random 8), 00]; and 10am, 00 = minite setdate _startingdate; while {true} do { if (daytime >= 19 || daytime < 5) then { setTimeMultiplier 10 } else { setTimeMultiplier 5 }; uiSleep 120; };

#

but also

#

I think I need to change the params

#

or delete this starting date

#

I don't have the minimum idea of what am i doing

#

so i decided to copy a ready script and change all stuff

tall dock
#

@tough abyss Just fyi, I fixed the issue. Strangest thing ever - to toggle the AI of those stationary "UAVs" , you have to do it to both the unit and the imaginary gunner inside and also you have to toggle them client AND serverside (else they'll shoot without moving). #JustArmaThings

tough abyss
#

Is there a way to stack a bunch of strings into a hint so it all displays at once?

//display rounds fired by type for each player
{
_name = name _x;
    {
    _type = format ["%1",_x select 0];
    _number = format ["%1",_x select 1];
    hint composeText [_name, lineBreak, _type, " x ", _number ];
    } forEach magazinesAmmoFull _x;
} forEach AllPlayers;
#

Or is there a better way to display text, or save it out to a text file?

#

Trying something like this

{
_name = name _x;
_fullLine = format [];
    {
    _type = format ["%1",_x select 0];
    _number = format ["%1",_x select 1];
    _thisline = format [_name, lineBreak, _type, " x ", _number ];
    _fullLine = format ["%1 %2", _fullLine,_thisLine];
    } forEach magazinesAmmoFull _x;
    hint composeText [ _fullLine ];
} forEach AllPlayers;
#

Disable/enable AI is local command I doubt non server does anything unless locality changes @tall dock

tall dock
#

Yeah but when I don't execute it on clients, the turrets will shoot in the right direction, but their model won't move. As I said, really strange.

#

Seems like the turret movement is not synced

tough abyss
#

Well it won’t hurt exec it everywhere

tough abyss
#

Having an issue with this. It keeps throwing an error that _thisType is a String and not a number (and it should be a string)

{
_name = name _x;
_fullLine = [];
_ammoTypesArray = [];
_magAmountArray = [];

    {
        //if mag type is not in array, add it
        _ammoThisMag = (_x select 1);
        _ammoTypeThisMag = (_x select 0);
        if !(_ammoTypeThisMag in _ammoTypesArray) then {
        _newElement = count _ammoTypesArray;
        if (count _ammoTypesArray == 0) then {_newElement = 0};
        _ammoTypesArray set [_newElement, _ammoTypeThisMag];
        _magAmountArray set [_newElement, _ammoThisMag];
        };
        
        _element = _ammoTypesArray find (_x select 0);
        _magAmountArray set [_element, (_magAmountArray select _element) + _ammoThisMag];
    } forEach magazinesAmmoFull _x;
    
    {
    _element = _x;
    _thisType = _ammoTypesArray select _element;
    _thisAmount = _magAmountArray select _element;

    _thisline = format ["%1 x %2",_thisType, _thisAmount];
    _fullLine = formatText ["%1%2%3", _fullLine, lineBreak, _thisLine];
    } forEach _ammoTypesArray;
    
    hint formatText ["%1%2%3", _name, lineBreak, _fullLine ];
} forEach AllPlayers;
radiant needle
#

Would there be any decent way to restrict the range of SAMs?

astral dawn
#

Maybe... measure the distance between launched rocket and the launcher and blow it up...

#

If it's too far

#

Still will make pilots perform crazy maneuvers

radiant needle
#

Yeah that's the problem, it'll still lock it up, and still get missile fired warning

#

Is there a way to get AI to ignore certain targets?

astral dawn
#

Well there is a forgetTarget command

#

Maybe you can edit the configs of these SAMs to reduce the range of their sensors?

radiant needle
#

Config editing isn't an option for me

tough abyss
#

_ammoTypesArray select _x, expected number bool, got string?

{
    _thisline = format ["%1 x %2", _ammoTypesArray select _x, _magAmountArray select _x];
    _fullLine = formatText ["%1%2%3", _fullLine, lineBreak, _thisLine];
    } forEach _ammoTypesArray;
#

How come it's not getting the index as _x?

radiant needle
#

Maybe disable AUTOTARGET?

#

aand use triggers to assign, unassign targets

astral dawn
#

Well you could certainly try to forgetTarget the target your SAM knowsAbout which are too far away. It's some time anyway before the launcher knows about a plane and it launches the rocket because it has to turn its launcher. So you don't have to poll it too often, maybe one second should be ok.

#

Yeah or maybe try this one, I think it's even better

#

If it works ofc, I don't know myself about how certain aspects of disableAI work

#

How dynamic is this thing? Is it a dynamic scenario or the launchers are placed in a static way?

radiant needle
#

They are static SAM launchers defending a border

#

Basically want them close enough to be able to fire near instantly if border is crossed

#

But not actually lock and shoot over the border

astral dawn
#

@tough abyss
inside forEach, _x is the element you are currently iterating through
_forEachIndex is the index of the element

tough abyss
#

you can forgettarget as sparker said but need to exec it repeatedly

#

I just figured it out, so can you nest _x?

#

yes

tough abyss
#

So I have my mag tracker working, it displays how much ammo everyone has left at the end of the mission or whatever, but I'm displaying it with Hint right now and it's too much info for it. Is there a better text format to use?

last rain
#

How destroy object only explode?

astral dawn
#

Sure, you can get deep into the magic world of arma UI and controls @tough abyss

tough abyss
#

How destroy object only explode? ???

#

@astral dawn easier way was to write it to the RPT

astral dawn
#

I thought you need to show it to actual players in the mission and it had to look nice, you didn't say that you need it for debug purposes

#

So, @last rain wanted to know, how to make a UAV only receive damage from placeable explosives, but not from grenades

tough abyss
#

are you a psychic?

astral dawn
#

Yes I used another means of communication (PM) πŸ˜„

tough abyss
#

You know the answer, HandleDamage

astral dawn
#

Yeah I guided him there
Maybe someone would like to expand the dammage handling further, IDK 🀷

tough abyss
#

It requires like super advanced knowledge of Arma

astral dawn
#

Well sometimes it's not trivial to filter out certain damage types

#

Why doesn't it provide some damageType enum, would be so much better

#

like burning, drowning, bullet, explosion, collision, etc

tough abyss
#

because it doesn't care, only damage of selection matters, not with what it was damaged. If you need more advance damage info, HitPart is your friend, which is like super uber advanced

astral dawn
#

So, is ability to retrieve the name of selection, hit point, etc, an argument against having damage type? I still think a damage type enum would make sense for script writers.

tough abyss
#

I'm pulling random weapons from CFGWeapons, but is there a way to restrict it by mod? I'd like to have an option for "no vanilla weapons"

still forum
#

collect classnames from CfgPatches weapons entry

#

and skip all cfgpatches that start with A3_

tough abyss
#

Ok, I'll take a peek into that, thanks

radiant needle
#

Is there a way to make a trigger activate every time a unit enters it

tough abyss
#

if it's a trigger in the editor, just set it to Repeatable, there's a checkbox

radiant needle
#

Won't work if theres a unit already inside the trigger

tough abyss
#

Ah

#

something along the lines of if unit not thisList, not sure the actual syntax though

#

This is what I have for my random weapons, not sure how I'd work a CfgPatches check in there though

weaponToAdd = configname selectrandom("(configname _x call BIS_fnc_itemType)#1 in ['AssaultRifle','LightMachineGun','SniperRifle','MarksmanRifle','Shotgun','Rifle','SubmachineGun','Handgun']" configClasses (configFile >> "CfgWeapons"));
robust hollow
#

something like this perhaps

weaponToAdd = configname selectrandom("(configname _x call BIS_fnc_itemType)#1 in ['AssaultRifle','LightMachineGun','SniperRifle','MarksmanRifle','Shotgun','Rifle','SubmachineGun','Handgun'] && {((configSourceAddonList _x)#0 select [0,3]) != 'A3_'}" configClasses (configFile >> "CfgWeapons"));
tough abyss
#
16:09:37   Error position: <!= 'A3_'}>
16:09:37   Error !=: Type Array, expected Number,String,Not a Number,Object,Side,Group,Text,Config entry,Display (dialog),Control,Network Object,Team member,Task,Location
16:09:37 Error in expression <nfigSourceAddonList _x)#0 select [0,3]) != 'A3_'}>
16:09:37   Error position: <!= 'A3_'}>
16:09:37   Error Generic error in expression```
robust hollow
#

πŸ€”

tough abyss
#

what is select [0,3] selecting?

robust hollow
#
weaponToAdd = configname selectrandom("(configname _x call BIS_fnc_itemType)#1 in ['AssaultRifle','LightMachineGun','SniperRifle','MarksmanRifle','Shotgun','Rifle','SubmachineGun','Handgun'] && {((configSourceAddonList _x)param[0,'A3_'] select [0,3]) != 'A3_'}" configClasses (configFile >> "CfgWeapons"));

try this. a few of the base classes dont have a patch apparently.

#

select [0,3] first 3 characters of the patch

high marsh
#

...you make my head hurt connor...

robust hollow
#

you may need to cycle through the entire array though, it may have multiple patches

#

whydis?

high marsh
#

It's very untidy.

robust hollow
#

yea, i can agree with that

tough abyss
#

Seems to work, but for some reason (at least with the Unsung mod) the time of day keeps resetting to 3am. I have this in my description and it works with everything else (vanilla/RHS)

class Daytime
    {
        title = "Time";
        texts[] = {"Random","0400","0500","1200","1800","1900", "Midnight"};
        values[] = {99,4,5,12,18,19,0};
        default = 99;
        function = "BIS_fnc_paramDaytime";
        isGlobal = 1; // (Optional) 1 to execute script / function locally for every player who joins, 0 to do it only on server
    };
radiant needle
#

Is there a way to get the side of a captive, without making them no longer a captive?

robust hollow
#

dont think so, though i do believe you can get their actual side from their group instead (if thats the issue)

tough abyss
#

Must be something weird with Unsung, it messes up the time on the old working version of my script too

radiant needle
#

@robust hollow that works well, thanks

tough abyss
#

welp it was my fault, paramArray was wrong one

tough abyss
#

this keeps using the same value over and over between matches, any ideas?

class Daytime
    {
        title = "Time";
        texts[] = {"Random","0400","0500","1200","1800","1900", "Midnight"};
        values[] = {random 23,4,5,12,18,19,0};
        default = random 23;
        function = "BIS_fnc_paramDaytime";
        isGlobal = 1; // (Optional) 1 to execute script / function locally for every player who joins, 0 to do it only on server
    };
robust hollow
#

default = random 23; cant directly use sqf in a config like this, even if you did with __EVAL, the result would remain the same until you reload the mission.

tough abyss
#

So doing this in init should work then right>?

if (paramsArray select 0 == 99) then {random 23 call BIS_fnc_paramDaytime;};
#

assuming my random param is set to 99 of course

robust hollow
#

yea, though it should only need to run on the server

#

oh, BIS_fnc_paramDaytime handles that for you anyway

high marsh
#

if I initialize and set a variable to a value, and then change the value of the variable. Is the variable when stored in memory the same or is it allocated as a different variable with a different value but same name?

#

I guess what I'm asking is that, if I change the value of a variable is more memory allocated now that I've changed it?

#

Trying to keep overhead to a minimum

tough abyss
#

What is the data type of the variable?

still forum
#

I guess what I'm asking is that, if I change the value of a variable is more memory allocated now that I've changed it? yes. Maybe. Probably. Most likely. It depends.
What does "change" mean?

#

are you assigning a different value to your variable? in that case no. Are you generating a new value? then yes.

tough abyss
#

What does Trying to keep overhead to a minimum in your case mean?

still forum
#

answering one question with a dozen more questions πŸ˜„

tough abyss
#

Because it is an XY Problem, I’m sure

high marsh
#

@tough abyss Scalar

#

@still forum
Ex.

_blah = 50:
if(blahblah) then
{
   _blah = 100;
};
still forum
#

you are just taking a reference to a existing value

#

the value 100 is actually created when you compile the script

#

And you just say that _blah will now point to that value instead of the other value

astral dawn
#

but then the other 50 gets dereferenced and destroyed?

still forum
#

dereferenced yes

#

destroyed no

#

the compiled script still has a reference to it

#

it has to be there when the script get's called the next time

high marsh
#

Ok. that makes a lot more sense now.

astral dawn
#

The compiled script? Do you mean the code-type variable? It has reference to 50 as if 50 is const float varname = 50;?

still forum
#

kinda

#

yeah

astral dawn
#

That's funny πŸ˜„

tough abyss
#

I ran into a problem with my Team Deathmatch on the one good Vietnam map tonight. I have a trigger that ends the match when there is nobody alive of either team, but a few times the map took so long to load that one team won before the other team could even log in. Any way to prevent that?

robust hollow
#

wait for there to be players in the game before checking if anyone is still alive?

#

if u have a pre-match countdown dont run the check until after that time.

tough abyss
#

I don't have a prematch countdown, but how do I put that in, or how would I check if they're in the game?

robust hollow
#

without a countdown, do a loop waiting for a player of each side to be in the game.

with a countdown, mark a time (eg: tag_markedTime = time + 30;) and then people cant leave a certain area until time > tag_markedTime.

i personally combine the two for one of my missions.

tough abyss
#

Ok yeah the loop makes sense, thanks as always

#

what's an easy line for seeing if there is at least one player on a side?

robust hollow
#
waitUntil {west countSide allPlayers > 0 && east countSide allPlayers > 0};
``` should do
tough abyss
#

that's what I was looking for, thanks

#

would I need a forEach to check multiple conditions on something? I have a list of weapons to blacklist that could be randomly pulled and I figure there's a way I can put them in an array to compare the if statement to right?
if weaponToAdd == [FakeWeapon, Rifle, HandgunBase]

#

I want to return True if any of those conditions are met, preferably without doing "if weapon == FakeWeapon or weapon == Rifle or weapon == HandgunBase"

robust hollow
#

if (weaponToAdd in [1,2,3,whatever])

tough abyss
#

Ahhhhhhhh

still forum
#

weapon in [wep1,wep2,a]...
That. You might need toLower because in is case sensitive

robust hollow
#

depends what exactly ur doing tho cause in would require an exact list of what u dont want

tough abyss
#

going off of this from earlier, but excluding fakeweapons:

weaponToAdd = configname selectrandom("(configname _x call BIS_fnc_itemType)#1 in ['AssaultRifle','LightMachineGun','','MarksmanRifle','Shotgun','Rifle','SubmachineGun','Handgun']" configClasses (configFile >> "CfgWeapons"));
};
#

which vanilla seems to have plenty of

#

or at least I've rolled em multiple times

astral dawn
#

What is the best event / event script which gets triggered when player spawns or respawns, both in MP and SP?

#

There are:
init.sqf - gets called per mission start, not at respawn
EntityRespawned mission EH
onPlayerRespawn.sqf - doesn't work in SP?
NVM actually onPlayerRespawn gets called if respawn is enabled

tough abyss
#

getting this error when I select a weapon class that I know has no weapons in it:

21:20:12   Error position: <weaponToAdd == nil) then {weaponToAdd = >
21:20:12   Error Undefined variable in expression: weapontoadd```

```sqf
_SelectedWeapon = (paramsArray select 3);

if (_SelectedWeapon == 0) then {
weaponToAdd = configname selectrandom("(configname _x call BIS_fnc_itemType)#1 in ['AssaultRifle','LightMachineGun','','MarksmanRifle','Shotgun','Rifle','SubmachineGun','Handgun']" configClasses (configFile >> "CfgWeapons"));
};

if (_SelectedWeapon == 1) then {
weaponToAdd = configname selectrandom("(configname _x call BIS_fnc_itemType)#1 in ['AssaultRifle','LightMachineGun','SniperRifle','MarksmanRifle','Shotgun','Rifle','SubmachineGun','Handgun'] && {((configSourceAddonList _x)param[0,'A3_'] select [0,3]) != 'A3_'}" configClasses (configFile >> "CfgWeapons"));
};

if (_SelectedWeapon == 4) then {
weaponToAdd = configname selectrandom("(configname _x call BIS_fnc_itemType)#1 in ['Shotgun']" configClasses (configFile >> "CfgWeapons"));
};

if (weaponToAdd == nil) then {weaponToAdd = srifle_DMR_01_F;};
//if (weaponToAdd in [FakeWeapon, Rifle, HandgunBase, nil]) then {weaponToAdd = srifle_DMR_01_F;};

magazineToAdd = getArray(configfile >> "CfgWeapons" >> weaponToAdd >> "magazines")#0;
#

Should it be something other than nil, like just a blank space or something?

verbal saddle
#

isNil "weaponToAdd"

tough abyss
#

ay

verbal saddle
tough abyss
#

Is there a way to reload a mission automatically after it's ended?

verbal saddle
#

Though the mission or a server?

tough abyss
#

Preferably through the mission itself I guess? Not sure. On our server after a match (which takes like 2 minutes), we have to go through #missions, select the map, select the mission and reslot. Prefer to have it be there automatically if that's a possibility

#

Or maybe I should not end the mission and just restart it from within

verbal saddle
#

If you add the mission file to your server's mission rotation it will automatically load that mission on server start.

#

to the role screen

tough abyss
#

I don't necessarily want to do that, especially since it's not my server haha

#

and we have a Training Mission we keep up for the new guys

verbal saddle
#

I don't think its possible to restart a mission through itself.

#

That's all controlled by the server running the mission

tough abyss
#

That's what I thought.

#

Wonder how much a pain it would be to make it neverending looping rounds instead of a mission end then

verbal saddle
#

You'll eventually run into issues with mission stability & performance

tough abyss
#

Oh?

#

It wouldn't be running for long periods, probably 30 minutes at a time at most

#

and each round is like 2-5 minutes

verbal saddle
#

Something small will probably work

#

But having a 30 minute mission loop for 4 hours will eventually run into issues.

tough abyss
#

I get that. This is a simple team deathmatch in randomly selected zones with a random weapon each round

#

No AI, nothing fancy

#

I haven't messed with respawns before, I know how to spawn new units, but can I transfer a dead player into one of those units somehow?

verbal saddle
tough abyss
#

I know that, I wasn't sure if it was the way to go. I'd like the dead players to be in spectator mode until the round ends

verbal saddle
#

If you want that then I would suggest that you have the mission restart at the end of the round.
Would make it a lot easier for you.

tough abyss
#

Okay. How do I make a mission restart though?

verbal saddle
#

End the mission

tough abyss
#

I think we came up that idea 30 minutes ago

west grove
#

oi fellas. i'm back with my daily questioning: is there an easy way to detect if the player is "a camera"? i have a script that runs constantly and does something whenever the player is not actually the player. as example, the spectator mode, or the camera view in arsenal, or just a generic camera created via camcreate

fleet hazel
#

Guys. How can I check the player in the presence of VAC ban?

#

Maybe there is a special dll?

foggy moon
#

@fleet hazel getPlayerUID gets you a player's steam id

fleet hazel
#

@foggy moon I in sqf to vac ban a player?

high marsh
#

no, you cannot vac ban players with SQF

#

that's stupid.

#

Plus, Battleye handles global bans with BI games

robust hollow
#

i think he wants to check if a player has a vac ban on their account 🀷
How can I check the player in the presence of VAC ban?

high marsh
#

I get that, but the follow up question raised my concern

fleet hazel
#

I wanted to ban players with vac ban from accessing my server. Suddenly have him ban from the other game. Any ideas?

#

@robust hollow yes.

robust hollow
#

you will need an extension

fleet hazel
#

@robust hollow eh(

tough abyss
#

how do you end a script?

#

or stop running it

robust hollow
#

terminate _thisScript

#

assuming its a scheduled script

west grove
#

if (true) exitwith {}; πŸ˜„

fleet hazel
west grove
#

hm is it possible to force a resource layer ontop of every other? i have a graphic on my hud, but now i noticed that subtitles are shown behind it.

robust hollow
#

im pretty sure you need to make them in the order you want them shown (front layer last)

west grove
#

that's bad

#

dang it, i always want to use the subtitle function, but for some reason i always have to scrap it again at a later point

#

and go back to the normal sidechat

thorn saffron
#

How can I get the name of currently played animation on the player character? I need to get in order to debug my mod that edits the transitions and such.

robust hollow
#

animationState player

thorn saffron
#

derp

#

I completely misread what that one did

#

can you run a loop using the command console? I remember crashing arma when I tried

robust hollow
#

in debug? you can if you spawn it. debug executes in unscheduled.

tough abyss
#

cameraOn == player @west grove ?

west grove
#

returns always true

tough abyss
#

Even if you spectate other unit?

west grove
#

dont know, can't test that

#

but it is true when switching to camera mode in e.g. 3den, so it's not of use for me

tough abyss
#

Try PlayerViewChanged EH as well it has many params retuned when fired

#

Wait you want it to work in 3den?

west grove
#

i want it to work everywhere. 3den, arsenal, spectator, etc

tough abyss
#

You need 3den specific commands

west grove
#

right now i'm checking the namespace variables, but i was curious if i can simplify that

tough abyss
#

Dunno, it is unclear to me what you’re trying to do

west grove
#

(the condition is not improved yet, i just slapped all the stuff together)

#

with this condition i'm checking that we are actually in the game, not in the main menu, not in arsenal view, not in spectator, not in a cutscene

#

i might have missed something, though.

#

and this morning i wondered if it's possible to shorten all of that above with simply detecting if a general camera mode is active or not. then i could scrap most of these lines.

tough abyss
#

Check that no displays are open except the usual ones with allDisplays

west grove
#

hm that might work

#

there's usually 4 displays open. so i just have to count them

tame lion
#

Question regarding get/set pos. I've created a system that allows players to spawn owned vehicles. I create a local vehicle preview for them to choose where it will spawn, and when they "commit" it, the position of the preview is grabbed, the preview deleted, and a new vehicle is spawned. It works as intended when they are on land, but when you try to spawn it on something like the carrier, the new vehicle spawns on the ocean floor. How should i get the vehicles position when it's hovering over sea?

tough abyss
#

Use setvehicleposition if boat will float

tame lion
#

And what getpos should i use to get it from the preview vehicle?

young current
#

SetPosASL could be better

tame lion
#

Only problem is that with this system, they could be spawningthe vehicle over land or over sea. And i would have to figure out which at the time the commit

young current
#

GetposASL

spark turret
#

anyone got a suggestion why the doTarget command is not working and how i can get it to work?

#

been excessivly testing it and the unit does the doWatch but no the doTarget

#

i just need a way to make an AI point their weapon at coords or and object wihtout using the vanilla autotargeting

#

also doSuppressiveFire does not work

gray thistle
#

Where can i ask ACE3 related Questions?

slim oyster
#

Ace 3 slack

tough abyss
astral dawn
#

What is your unit pointing at? What is the target? Did you reveal the target to the unit before making him doTarget the target?

#

@spark turret

#

I found that making doTarget on civilian targets is broken. As an alternative I use this:

target = "FireSectorTarget" createVehicle (getpos player);
target attachto [player, [0, 0, 0], "pelvis"];
target hideObject true;

sol1 reveal [target, 4];
sol1 doTarget target;
sol1 dofire target;
cursive whale
#

looking for advice on RemoteExec/RemoteExecCall

#

if I want a player to initiate a jump animation

#

how would I format; player SwitchMove "AovrPercMrunSrasWrflDf"; such that the animation runs on all clients but only for the initiating character object?

#

wiki examples suggest use of 'player' will be interpreted as all-players

still forum
#

player is the local player

#

not all players

cursive whale
#

i'm looking at;

#

// all clients will have their ammo set to 1 for their current weapon
{player setAmmo [primaryWeapon player, 1];} remoteExec ["bis_fnc_call", 0];

still forum
#

[player, "Aovrrrrfdgfsagrh4et43dgdg..."] remoteExec ["switchmove", 0]

cursive whale
#

which seems to suggest 'player' will mean each player

still forum
#

in that case you execute player locally on each player

#

so that will end up in player meaning all players

#

in my example you take the local player's object. And then tell all other players to switchmove on that object

cursive whale
#

right array rather than code?

still forum
#

I am calling a different command

#

different commands == different arguments

cursive whale
#

ok, thanks

still forum
#

switchMove takes 2 arguments. So you pass array with 2 values. which are the two arguments

cursive whale
#

and 'player' will be transmitted as the callers object?

still forum
#

no

#

the result that the player command returns will be transmitted

#

that's stuff that people often get wrong. Order of execution

#

player command is executed first. Which returns an object.
Then that object will be put into the array, and that array passed to remoteExec

#

remoteExec has no clue where the object came from

cursive whale
#

right so the biki example is passing a code snippet (referencing 'player' when finally executed on each client) to bis_fnc_call

still forum
#

yeah

cursive whale
#

cheers

tough abyss
#

It has also a note in blue explaining the functioning of the command

#

Its like everything you asked is on that page

astral dawn
#

it's just attached to player so that AI will doTarget on this target, since they were not targeting captive players IIRC

#

but can also be used in other cases

sage flume
#

I've done this before but man I just cant remember. I want to change my original group (s) to one that I have in a dl'd mod. I am trying to find out how to find the path to the new group I have placed. the original is...

#

[east,configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "UInfantry" >> "OIA_GuardSentry"],

#

..and I want to change that to something new that I downloaded

#

Where or how ( in the config viewer?) do I find th eproper path?

cursive whale
#

@tough abyss Just updating an old script that previously used BIS_Fnc_MP, no particular reason to review the SwitchMove page.

vast verge
#

So I need help getting attachTo working

#

_cwis1 = "CWIS1";
_destroyer = "Destroyer";
_cwis1 attachTo _destroyer;

#

i'm getting a generic error from that

robust hollow
vast verge
#

I'm sorry, I've never been really good with this sort of stuff, could you elaborate a bit for me? kinda lost.

robust hollow
#

object1 attachTo [object2, offset, memPoint]
attachTo works by attaching one object to another object. Your snippet shows you trying to attach one string to another string, which simply isnt a thing.

vast verge
#

ah, yeah what i read on the page gave me the idea that i had to make the string to do it in the first place.

neon snow
#

Can we extend functionality of built in actions either via scripting or config? I want a script to run after flaps down/up action or key was pressed

tough abyss
#

Hello All

#

You can try UI action event handler @neon snow

high marsh
#

@neon snow You could use animationPhase to check if the flaps are or down.

thorn saffron
#

I want to run a script on every man character after it gets spawned/created and I want to pass the info to the script about the unit so I can use it the script. Would this work for triggering the script using CBA?

class Extended_InitPost_EventHandlers {
    class Man {
        class taro_set_AI_skill {
            Init = "(_this select 0) execVM 'taro_set_AI_skill.sqf';";
        };
    };
};
high marsh
#

@thorn saffron Looks good. I believe you can just use _this, as I don't think it has any more passed params than just the unit itself.

verbal saddle
#

I'm having a very strange issue with respawn tickets in my mission.
If I end the mission while both west & east have > 0 tickets then it shows Blue vs Red on the debriefing screen.
If one of the sides has 0 tickets then it shows Blue vs Green on the debriefing screen.
Has anyone else experienced this issue or know a way to solve it?

thorn wraith
#

Anyone know if you can point an .ext value to another .ext value?

#

something like

class maingun{
    gun = missionConfigFile >> "cfgLoadouts" >> "Base" >> "Weapons" >> "Rifle" >> "gun";
}```
#

?

young current
#

in config?

#

@thorn wraith

thorn wraith
#

yes

young current
#

that definitely does not look right

thorn wraith
#

like that, it just stores it as a path.

#

I'm wondering if I can make it read the actual value

young current
#

I highly doubt that

thorn wraith
#

or would that need to be a macro?

young current
#

macro would work yeah

#

but not that

#

config values dont run scripts

thorn wraith
#

well, there goes that idea.

#

thanks!

tough abyss
#

Yeah you can __EVAL it

dim kernel
#

is it possible to check who remoteExec'd the function

dim kernel
#

will it return an player slot

#

like cop_4

still forum
#

Return Value: Number - id of the client, which initiated remote execution Mh.....

dim kernel
#

oh

#

lol

#

k

still forum
#

I'm not suuuuuure. But I thiiiiiiiiiiink it doesn't

dim kernel
#

....

#

k

#

ty

grizzled spindle
#

Is there a way to get a weapons inventory weight/mass?

tough abyss
#

load
loadAbs
loadBackpack
loadUniform
loadVest
getContainerMaxLoad

grizzled spindle
#

Sorry should have been more specific, Wanted to get weight from classname

ruby breach
#

Looks like there's a mass defined in the config

#

Looks like you'd need to manually calculate a total for the weapon and any attachments, however

unborn ether
#

@grizzled spindle ```SQF
getNumber (configFile >> "CfgYourConfig" >> _yourclassname >> "mass");

`mass` value `\10` means lbs.
So 10 mass is 1lbs.
AFAIR.
grizzled spindle
#

Thank you very muxh

golden storm
#

Hi guys, so i was wondering if i could get a little help on something "easy"(?)

#

Thing is i want that in a certain place on the map, when a certain unit with a variable name of : "oficial1" enters "COMBAT" mode, an alarm starts playing, i tried this code on a trigger but it doesn't work, any advice?

Condition:
behaviour oficial1 == "COMBAT";

On Act.:
nul = [thisTrigger] spawn {while {true} do {playSound3D ["A3\Sounds_f\sfx\alarm_BLUFOR", player]}; sleep 6;};

It does execute, problem is that the sound won't play, i can hear somewhat of "white noise" tho, i mean the other sounds (gunfire, engines, explosions) sound like there is a louder sound (i.e. the alarm) is playing.

dapper path
#

Anyone here familiar with the altis life framework?

finite cloud
#

Does anyone know if there's a way to dynamically create radio protocol messages? For example., if I have an AI recon squad in an overwatch position, can I have that squad send a voiced radio message to the player's group, like "Enemy tank at 019224"? I found where all the radio protocol sound files and configs are located and I've looked into kbtell, but it looks like with that command I would have to use sentence classes that are pre-defined in some config

EDIT: I figured it out by looking at A3/systems/fn_spotter.sqf and fn_spotter.bikb. Basically it involves using the 3rd argument of kbTell to pass a dynamically generated string (for the message text) and an array of Words (defined in dubbing_radio_f/config.cpp, for the voice) to a sentence class you define in a bikb file

robust hollow
#

@dapper path yes, though depending on what you need you may want to try the altis life discord first.

high marsh
#

Is it possible to add a sort of "text field" option to a parameter in lobby parameters. I am sure you could do this with a mod, and not a mission. But how would I go about this?

still forum
#

Oof.. No not really.

#

That stuff is all handled in engine

tough abyss
#

@golden storm have you looked up the wiki, example 3 in particular?

brave jungle
#

Hello, i'm struggling to find out how to return what has been damaged on a player while using ACE3. I've found the handleDamage fnc but that's for setting damage, not returning. Anyone got an idea?

brave jungle
#

oh

#

well

#

that's awkward

#

didn't think that returned ACE3 tho

still forum
#

Or do you want to find out exactly what kinda wounds exist?

#

That command returns what parts of the body are damaged, but not in what way

brave jungle
#

I more just need to know if the head was hit, or if the leg was hit

still forum
#

Yeah then that command should do it. It will still show damage though if the limb was bandaged and isn't bleeding anymore

brave jungle
#

on unconscious would make it easier

#

Oh right, so not very good say, 30 minutes into a firefight

#

Does ACE not have one at all?

#

I find it odd to believe

still forum
#

If you do personal aid kit full heal then the damage will be gone

#

But a bandaged non stitched wound will have damage even if not bleeding

#

can you describe exactly what you need?

brave jungle
#

Detect what was hit, then play one of the animations depending on what was hit, head, arm, chest, leg

#

currently they're just random

#

but would be nice to have them tie in with the damage

still forum
#

Gimme 10 minutes. Just found a memory leak in ace that I gotta fix first before I forget

brave jungle
#

Oof, okay no problem πŸ˜›

still forum
#

Well I found something that would do what you want.. But it's broken and doesn't work. πŸ˜„

#

Gonna find the next possible way to do that then πŸ˜„

brave jungle
#

πŸ˜‚πŸ˜

still forum
#

getHitpointDamage might be best. Just choose the hitpoint with highest damage.

brave jungle
#

Alright πŸ˜‰ Cheers

dapper path
#

@robust hollow the get damage script doesn't seem to be triggering for me

runic sandal
#

hello guys so guys im trying to make a GUI Weapon List there is some people says that i must to make weapon list config and its GUI like i spawn weapons its admin menu so can any one helps me or give me example's

robust hollow
#

skid menu david from two days ago, is that you? πŸ€”

tough abyss
#

some punctuation would have been good

still forum
#

@runic sandal #rules no crossposting.

radiant egret
#

@robust hollow
deja vu πŸ˜‚

keen bough
#

I kind of need a (in depth) complete tutorial that covers the full topic of creating your own functions in armed assault 3. I find only partial stuff or stuff thats so old that isnt even working anymore 😦

keen bough
#

thanks @radiant egret - somehow that didnt even show up on my google search.

keen bough
#

If i am correct, i use my function like this:
[] remoteExec ["nar_myfunction", target, isPers];

Correct? nar is the tag i am using.

tough abyss
#

If you want to remoteExec it that should work, yes. That'll "spawn" your function.

//local
[params] spawn nar_myFunction;
[params] call nar_myFunction;
//remote
[params] remoteExec ["nar_myFunction", target, jip];
[params] remoteExecCall ["nar_myFunction", target, jip];
keen bough
#

i was just unsure with the "" and if its nar_function or fnc_nar_myfunction :3 thanksies @tough abyss

winter rose
#

nar_fnc*
And it would be if you use CfgFunctions to declare it

still forum
#

That's missing the _fnc part

obsidian kiln
#

doartilleryfire needs to be broadcasted with remoteexec if the AI unit is local to the server and it's executed client side?

tough abyss
#

That depends on how you declare the function. In his example I assumed he did something like nar_myFunction = {}

keen bough
#

So, i have this in my cfgFunctions.hpp
file = "path";
class myFunction {};

To add another one, do i have to open up new curly brackets or do i just add another
class myFunction2 {};

beneath the first function, please?

still forum
#

yes. Same as you wrote

#

another class below the first one. All the same just different name

keen bough
#

ah. Because all examples show always only 1 thing :3 thank you @still forum

keen bough
#

I do this:
_inidbi = ["new", "Vehicle Garage"] call OO_INIDBI;
_readVehicles = ["read", ["Vehicle Garage", "Merc Vehicles"]] call _inidbi;
theGarage = _readVehicles;

which has 3 vehicles in it. But "theGarage" is still completely empty. Another script works like a charm (weapons script) but the variable there is actually empty too but works.

#

its with inidbi

#

I use extended debug console but with 'watch:' the variable is empty. Its... extremely strange...

Thats in the inidbi databse:
MercVehicles="["I_C_Offroad_02_unarmed_F","I_C_Offroad_02_LMG_F","I_C_Heli_Light_01_civil_F"]"

(Yes mercvehicles and merc vehicles. We are testing a lot of things and working on the fly currently)

astral dawn
#

Is it possible to simulate a key press through an SQF script?

robust hollow
#

as in triggering a key press evh? no

astral dawn
#

Like make arma think that I am pushing the 'move left' button for some time?

tough abyss
#

via extension

astral dawn
#

Did someone already make such an extension? πŸ˜„

tough abyss
#

I saw something hold on

astral dawn
#

So what I want to achieve is this:
Make player operate vehicle in a bad way, like GTA drunk driving
Or make player operate turret like he's aiming with WASD keys instead of mouse
I think it's not possible to manipulate a turret like this, right?

tough abyss
astral dawn
#

That's cool, thanks!

young current
#

such could perhaps be achieveb by tampering with the vehicles movement velocity

sudden yacht
#

//Recently been having issues with script. Seems to spawn the unit, but the rest of the script appears not to be working. Where did i go wrong?

#
_target = group player createUnit ["CUP_B_USMC_Soldier", position player, [], 0, "FORM"]; 
[_target] join _grp; 

removeAllWeapons _target;
_myNearestEnemy = _target findNearestEnemy _target;
while {alive _target} do


{

if (_target distance _myNearestEnemy < 100) then

{
_myNearestEnemy = _target findNearestEnemy _target;
_target switchmove "Acts_GetAttention_End";
sleep 2;
_myNearestEnemy setDamage 1;

} else

{

};

sleep 5;

};```
young current
#

could you wrap the code inside code tags

#
so its like this
sudden yacht
#

Sure how do i do that?

young current
robust hollow
#

```sqf
<ur code here>
```

young current
#

πŸ‘†

sudden yacht
#

thank you

robust hollow
#

gotta do 3 of these `before and after for a proper block

young current
#

put one more ` in both ends

sudden yacht
#

So um yeah hope someone van help.

young current
#

so what do you want it to do?

sudden yacht
#

if nearest enemy is within 100 and the unit is alive then setdamage 1 to nearest enemy

lapis jungle
#

I have an issue with a mod I'm making for my unit. It currently just has a single function that is essentially just a wrapper for ace_arsenal_fnc_initBox. When I load the mod, it says in the RPT that the mod is included in the "List of Mods", but when I look in the "Loaded Add-ons" I cannot find its single addon core listed anywhere.
When I try and call the wrapper function, it just doesn't work. No error messages or RPT log made.

I currently don't have internet to upload the add-on else I would to show you what I mean.

Does anyone have previous experience with mods not being loaded properly? If so, what steps could I take to seek the solution?

#

I have an issue with a mod I'm making for my unit. It currently just has a single function that is essentially just a wrapper for ace_arsenal_fnc_initBox. When I load the mod, it says in the RPT that the mod is included in the "List of Mods", but when I look in the "Loaded Add-ons" I cannot find its single addon core listed anywhere.
When I try and call the wrapper function, it just doesn't work. No error messages or RPT log made.

I currently don't have internet to upload the add-on else I would to show you what I mean.

Does anyone have previous experience with mods not being loaded properly? If so, what steps could I take to seek the solution?

robust hollow
#

does ur mod have a CfgPatches entry?

foggy moon
#

@sudden yacht think you need to move the findNearestEnemy check before the distance check, otherwise you're using the previous enemy

edgy dune
#

U might need spawn

#

Since sleep

drowsy spruce
#

having some troubles with something and was wondering if anyone had any ideas. Im trying to attach a cargo container to one of the Tanoa cranes using rope. The rope isn't actually being created, I tried spawning in a small physics object then attaching that to the container then attaching a rope from the crane to the little physics object but still no luck. No errors or anything, just doesn't create the rope. Here is a pic of the crane i'm talking about. https://imgur.com/a/LPE5Kxs

drowsy spruce
slate gull
#

Can i ask a question here about a problem im running into with my mod?

distant egret
#

@slate gull ask the question and people might answer it.

slate gull
#

Well i am new to all this and have been practicing scripting and wrote my first mod. But i have no idea what else it needs to become a mod. Right now its just a .sqf and i watched a video about packing .pbo's but i tried and it gave me an error. "Build failed result code=1" I dont know what that means

#

All tutorials i see on Google are old and dont make sense or dont have enough detail

distant egret
slate gull
#

ok, so im missing config.cpp

distant egret
#

Yes

slate gull
#

how do i write a config.cpp?

distant egret
#

Make a text file and rename it

slate gull
#

Sorry, if these questions seem a bit derivative but what goes in the text file?

#

Like i said im new, this is my first mod

distant egret
#

First example from the first link

#

However this is more of a job for #arma3_config as these are config files.

tough abyss
#

@drowsy spruce attached object inherits simulation properties from object it was attached to

drowsy spruce
#

so it has to do with the crane then?

#

Also, thanks for your reply

lapis jungle
#

@robust hollow It does. Here's the entire config.cpp file:

class CfgPatches {
    class bnb_f_core {
        units[] = {};
        weapons[] = {};
        requiredVersion = 1.76;
        requiredAddons[] = {
            "ace_arsenal"
        };
        author[] = {
            "Arend"
        };
    };
};


class CfgFunctions {
    class bnb_f_core {
        class functions {
            file = "\x\bnb_f\addons\core\functions";
            class arsenal {};
        };
    };
};
#

and then in fn_arsenal.sqf I have this:

[this,true] call ace_arsenal_fnc_initBox;

and in $PREFIX$ I have this:

x\bnb_f\addons\core

The structure of the mod is:
root
| addons
| | core
| | - $PREFIX$
| | - config.cpp
| | | functions
| | | - fn_arsenal.sqf

robust hollow
#

CfgFunctions: file = "\x\bnb\addons\core\functions";
Prefix: x\bnb_f\addons\core
?

lapis jungle
#

It's supposed to be such a simple little mod xD

robust hollow
#

ur prefix is bnb_f while ur function looks in bnb

lapis jungle
#

Yeah, my bad. I've renamed bnb to bnb_f, but I did double check to make sure I consistently did so. Just changed it whilst copy pasting into here.

#

spent 2 hours dedicated to making sure they're the same, and testing with and without the _. Is a _ allowed in a prefix?

robust hollow
#

yes

lapis jungle
#

Because when it comes to calling the function, you'd have to then write bnb_f_core_fnc_arsenal

#

or am I wrong?

robust hollow
#

yea thats right. just tested ur config and it loaded fine, function too. i guess double check the addon is loaded in CfgPatches, maybe also check ur prefix is actually being applied to the pbo 🀷

lapis jungle
#

Alright. Well, at least I now know it's not that I completely fucked up the path format or anything

#

Thanks, I'll keep at it

young current
#

What do you pack it with?

rose hatch
#

Not entirely sure where I might ask this, but does anyone know if there's a way to modify my OFPEC tag listing? The website I put down when I registered the tag no longer exists but I want to continue using the same tag.
Do I have to get in contact with the OFPEC site admins or something...?

young current
#

this one?

rose hatch
#

Yep, already made my tag ages ago
I want to take the website out of the tag listing, as well as change the recently completed field

young current
#

theres a login at the top left corner

#

I recall you can edit those yourself when youre logged in

rose hatch
#

Logged in but I can't find anything. The site's a bit old, might've missed the option somewhere

young current
#

when youre registered and browse tags you get your tags list

#

hmm

#

but where was the edit button

rose hatch
#

Hmm...

#

I don't even see that, and I'm logged into the account I made the tag with

#

Ehh, I'll dig around on their forums and see if I can find something, thanks for the help though

young current
#

this is the edit button xD

rose hatch
#

I think their system got fubar'd at some point. I don't even see that, tried in chrome and firefox
Maybe somehow the tag got unlinked from my account in their db

young current
#

possibly. I read some old forums post related to that and there it was said that some people have had similar trouble

#

I think best is to contact ofpec admins

rose hatch
#

Done, I'll see if they respond

#

Place for sure has cobwebs strewn about, lol

brave jungle
#

Hello, so I tried to get the returned damage from a player while ACE3 is active using getAllHitPointsDamage which sort of worked during testing but in action it was a nightmare xD

I've attempted to look, but does ACE have any way of returning the damaged sections?