#arma3_scripting

1 messages · Page 539 of 1

tough abyss
#

do i just have to use everyContainer and go through everything like that?
yes

smoky sun
#

hey, just wondering is there an easy script to run on the debug console to force ai to leave player targeted vehicle, ai in the mission are staying in the vehicle even if its disbaled

winter rose
lucid junco
#

hey there. Is it possible somehow to terminate local function inside script? lets say i have function stored in local variable "_fnc" then i call it and during the script i want to terminate it immediately. Some tips?

winter rose
#
  • terminate = you're happy
lucid junco
#

lol. i should think then ask 😄

#

its hot here and im overheated

winter rose
#

nah don't worry! I admit I have an advantage here, the temp dropped @ 25°C hehe

compact maple
#

Vive la France pour ses températures extrêmes

plush oriole
#

Whta's the best way to create a UI element in Zeus?

#

i currently have this

#

_emptyDisplay = findDisplay 312 createDisplay "dialogName";

#

but the zeus ui disappears and it closes when escape is pressed

lucid junco
#

_this addEventHandler ["FiredNear", "_fired = true"]; someone know why after its fired _fired var is still false? 8-o

still forum
#

fired is a local variable

spark sun
#

you mean _fired

lucid junco
#

yes, i want to change local var _fired to true

still forum
#

well a local variable is... local

plush oriole
#

in fact it has worked

still forum
#

It only changes. locally

plush oriole
#

but only inside the code block

#

yes

#

so if you had sqf _this addEventHandler ["FiredNear", "_fired = true; hint _fired"]

still forum
#

if you had... that would be a syntax error

plush oriole
#

why?

spark sun
#

boolean

plush oriole
#

oh yeah

#

well something like that

#

i always forget the format

#

still can't find any documentation on how to have zeus gui + description.ext guis

#

seems like an odd issue

#

like cutRsc only having one resource

lucid junco
#

_this= civ5;
_bed = bed5;
sleep 1;
_fired = false;

_this disableAI "AUTOCOMBAT";
_this addEventHandler ["FiredNear", "_fired = true"];
//calm fnc
_calm =
{
while {true} do {
_this setbehaviour "careless";
_this setunitpos "UP";
_this setspeedmode "limited";
sleep 5;
hint format ["Hello %1",_fired];
//sleep.......................................

#

cant work like this?

plush oriole
#

_fired is local

#

so _fired only gets changed in the event handler code

#

the other bits don't 'know' about it

lucid junco
#

ooo.

#

that is sad

plush oriole
#

so make it fired

#

not _fired

#

in all places

lucid junco
#

in my case i cant use global var fo this shit

plush oriole
#

why not?

lucid junco
#

this script will be for civ units for changing behaviour and there will be many of them. So global var affect all of them

plush oriole
#

ah

#

so

#

what you can do is

#

setVariable

#

basically stores a variable inside the namespace of an object

#

like one of the civ units

#

so each one would have its own 'fired'

spark sun
#

Or, put your code directly inside the EH

plush oriole
#

yeaha

#

oops

#

Ok so I can create a control with zeus

#

with ctrlCreate

#

but can't create a whole dialog

#

ooh control groups

dim kernel
#

hi, im trying to add military rank icons on the Drawicon3d but its not working, the icons are in the mission file , drawIcon3D ["*Military ranks here*",[1,1,1,1],_pos,0.65,0.65,0,_text,2,0.03,"PuristaMedium"];

#

Military ranks icon change upon Variable levels

plush oriole
#

is your icon called sqf *Military ranks here*

#

hang on

#

that's where you put the path to your texture

dim kernel
#

yea

#

its the path

plush oriole
#

but your file isn't called

#

oh i see

#

can you put what you literally wrote

dim kernel
#

im just showing u

#

"ranks\5.paa"

#

i tried that but doesnt show

#

ranks is a folder in the mission file

plush oriole
#

hmm

#

is the paa definitely valid

dim kernel
#

yes

#

drawIcon3D ["ranks\5.paa",[1,1,1,1],_pos,0.65,0.65,0,_text,2,0.03,"PuristaMedium"];

brazen ibex
#

Is there a way of doing a massive paratrooper invasion like d-day without much hit on the performance? I was looking for something to make the ambient more immersive. The units doesn't not need to have any logic at all, they can even be deleted after touching the ground.

spice axle
#

agents

plush oriole
#

you could either make them agents or just simple objects which are keyframed

#

also wow that pfp

spice axle
tough abyss
#

where did you define _pos @dim kernel

brazen ibex
#

That's awesome, thanks. I think that will just fine!

#

Btw, I didn't know that I could make an unit a simple object, thanks 😃

young current
#

Im not sure you can

dim kernel
#
private _pos        = (_unit modelToWorldVisual (_unit selectionPosition "head")); 
_pos set [2, (_pos select 2) + 0.35]; ```
#

@tough abyss

tough abyss
#

outside of EH or inside?

plush oriole
#

i meant with an addon type thing

#

or even just spawn a parachute object

#

actually not sure if you can get the opened animation since it's a vehicle

#

eh actually you can be dead in an open parachute so probably

dim kernel
#

all inside

plain urchin
#

is there a way to snap an object to the floor below it when detached from the player? (making a carry object script)

#

even if placed inside a building

still forum
#

get player eyepos, then lineIntersects downwards to find the next ground. Then snap object to that position

plain urchin
#

thanks!

dim kernel
#

any idea why icons in the mission doesnt show with drawicon3d

winter rose
#

Yes.

dim kernel
#

what

winter rose
#

showHUD might be set to false, your icon may not be in the correct 2^x × 2^y format, your icon doesn't exist, your game isn't started, your computer doesn't have a CPU, or you are actually dreaming

dim kernel
#

k ty

ruby breach
#

Not sure if drawIcon3D requires the entire path similar to playSound3D

#

But if I had to guess, probably

plush oriole
#

For long distances a transparent user texture might even work

#

But only very long

jade abyss
#
Not sure if drawIcon3D requires the entire path similar to playSound3D
But if I had to guess, probably

Example:

drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\repair_ca.paa", _Color, _inModelPos, 1, 1, 45, _Text , 2, 0.0325, "RobotoCondensed", "center", false];
#

@ruby breach

#

@dim kernel

#
_CTarget = cursorTarget/cursorObject/DoWhatYouWant;
_inModelPos = (_CTarget modelToWorld (_CTarget selectionPosition [_PointName, "HitPoints"]));```
In this case i selected a memory Point

Are you sure, it does have the correct position?
smoky sun
#

hey uhh, my debug console has gone to half size , doesnt have the previous script buttons and stuff anymore, dont know what ive done or how to fix it, anybody experienced this and how do i fix it?

vernal mural
#

Hey there. If I do something like

{
    if(blabla) exitWith {blublu};
    someCode;
} forEach _array;

Will the exitWith break the whole forEach stuff, or only the current iteration ?

still forum
#

whole

#

@smoky sun you stopped loading CBA

smoky sun
#

ahhhhhhh thank you

ruby breach
#

@jade abyss In his case, it'd probably be ```sqf
private _fullPath = (str missionConfigFile select [0, count str missionConfigFile - 15]) + "ranks\5.paa"; //maybe \ranks\5.paa?
drawIcon3D [_fullPath,[1,1,1,1],_pos,0.65,0.65,0,_text,2,0.03,"PuristaMedium"];

#

Now that I'm at a PC I can be bothered to actually do that lol

cold pebble
#

If I have an object, with variables set on it, and I delete the object, do the variables stick about? I'd expect not, but with ArmA can never be sure...

hollow thistle
#

They don't, there would be no way to access them anyway.

cold pebble
#

👍

#

Just wouldn't be surprised if they stayed in memory

tough abyss
#

Would anyone happen to know a script to get global chat to display something along the lines of "NameHere: I am a dipshit and shot a civie" when a player kills a civilian?

#

the _killer var never gets correctly passed through. Its always the victim object

plush oriole
#

code?

tough abyss
#
  params ["_Victim", "_Killer", "_Instigator", "_bEffects"]; 
  if(isNull _Killer) then{ _Killer = _Instigator; }; 
 
    _killerstring = format ["The civilian %1 has been killed", name (_victim)];
    hint _killerstring;

}];```
dim kernel
#

use killed

#

not mpkilled

fierce oyster
#

Is there someway to make the Nyx Recon be able to lock onto targets and provide info about them on the sensor UI itselves

#

Like in King Of The Hill servers

#

This must be a simple script

exotic tinsel
#

what is a good way to get a player out of a Failed animation? to reset them essentially?

#

like being stuck in drag animation

exotic tinsel
#

thx

high marsh
#

With remoteExec, is the types array parameter target certain units or just any types in array?

#

I'm positive it's the latter of the two. Making that many remoteExec calls to complete my use for it would cause insane net usage when walking into towns.

peak plover
#

Hmm

#

Well

#

Should be allits on the wiki

compact maple
#

Hey, I am trying to add the base root of my folder inside my rvmat texture file. :

#define PATH "mission.Altis\rvmats\data\"

and in rvmat:
class Stage1
{
    texture=PATH "body_nohq.paa";
}
#

but Im not sure how I shoul write it in texture =

velvet merlin
#

any ideas how to get displayEH working in briefing screen? (keyDown or mouseButtonDown)
i can find the native displays and add EHs but they wont trigger
(setting onMapSingleClick works though)

winter rose
#

@high marsh I am not sure I got your question?

tough abyss
#

Briefing screen has a bunch of own displays, you sure you get the right ones @velvet merlin ?

compact maple
#

Is there no way at all to make a path with pre process command ?

tough abyss
#

What?

compact maple
#

I mean I cant concatenate strings with macros ?

still forum
#

you can

compact maple
#

Here is what I get :

mission.altis\rvmats\data\"body_nohq.paa.
#

And Im going to try this when my game load :

#define SETPATH(var1) mission.Altis\rvmats\data\##var1.paa
still forum
#

the ## is useless

#

the \ is already a seperator

compact maple
#

Ok so i'll remove it

#

But it give me this now :

13:07:18 Warning Message: Cannot load texture mission.altis\rvmats\data\"body_nohq".paa.
#

He cant found the texture because of the quotes

tough abyss
#

Don’t use quotes then

compact maple
#

If I dont do this :

texture=SETPATH("body_nohq");

The game crash

#

I mean If I dont put quotes

still forum
#

"The game crash" and why? what does it tell you?

#

using quotes in there is wrong. Remove them.

compact maple
#

I figured it out why it crashed, I think this is because the macro was trying to concatenates what's before the ## with what's after it, and it wasnt the same type

still forum
#

nope

#

And I already told you the ## is not needed

compact maple
#

Now I have my path:

13:13:23 Warning Message: Cannot load texture mission.altis\rvmats\data\body_nohq.paa.

without extra quotes

#

Yes but I tried it before you told me

#

I should probably stringify it now, thanks

#

Can I do something like this ?

texture=STRINGIFY(SETPATH(body_nohq));
still forum
#

Yes

compact maple
#

Ok, I'll give it a try!

still forum
#

Such a macro is usually called QUOTE (ACE,CBA, Many C/C++ projects)

#

but you shouldn't need to

#

config files will quote automatically

compact maple
#

Oh okay, so thats weird it doesnt found the texture

still forum
#

And if you got
Warning Message: Cannot load texture mission.altis\rvmats\data\body_nohq.paa
That means it already quoted it correctly

#

why is that weird?

#

The path looks wrong to me, I thought you know that

#

"mission.altis" doesn't look like a pboprefix

#

it looks like a mission foldername, and that's not how internal pathing works

compact maple
#

Thats rvmat inside the mission folder, I tought I had to set the full path, but I think you're right, should I remove the .Altis ?

still forum
#

That is not the full path

#

no you shouldn't

#

that's not how mission paths work

#

you probably need a full path, which.... is kinda complicated

#

and i don't think the preprocessor can even do it

#

you could try local path

#

just "data\body_nohq.paa" but I don't think that'll work

compact maple
#

I've already tried such a path, it doesn't work

still forum
#

You need the full path

#

You can start the mission, and execute str missionConfigFile in debug console

#

that should give you the full path to the mission

#

but that can change on your computer/on a dedicated server/on other players

compact maple
#

"mpmissions\__CUR_MP.Altis\description.ext"

#

have to try, brb

velvet merlin
#

@tough abyss allDisplays lists these

in briefing mode from 2d editor you have:
0 - RscDisplayMain (main menu)
26 - RscDisplayArcadeMap
37 - RscDisplayGetReady (briefing)

#

i added to all of them; 26 triggers 4x but only before you can interact

tough abyss
#

Which one you add EHs to?

#

Ah ninjaed

velvet merlin
#
["26x",[Display #26,56,false,false,true]]
["26x",[Display #26,15,false,false,true]]
["26x",[Display #26,15,false,false,true]]```
#

tried KeyDown, MouseButtonDown, MouseZChanged

#

actually it seems to trigger when i return to the editor - so not in the briefing phase itself

#

["allDisplays",[Display #0,Display #26,Display #37]]
["IGUI_displays",[Display #305,Display #303,Display #300,Display #300,Display #311,Display #320,Display #313,Display #315,Display #312]]

#

is what is said to be available but seems the DEH is not handled during briefing phase

compact maple
#

@still forum Lmao so here is the path :
texture="C:\Users\x\Documents\Arma 3 - Other Profiles\x\missions\mission.Altis\rvmats\data\body_nohq.paa";
there is no way I can get it working in MP, I need to make a mod

still forum
#

Yep

#

I already tried to tell you that

compact maple
#

yup

#

I know

#

thats why I tried the full path, bc u told me

velvet merlin
#

could be the engine blocking the DEH. there is some scripted, some ctrl and a mission loaded EH by rscdiary.sqf

fossil yew
#

Would it be possible to force respawn "dead players" at the same time?

hollow thistle
#
[0] remoteExec ["setPlayerRespawnTime", 0];
tough abyss
#

You need atomic clock for that otherwise players closest to the server will spawn first 😂

kind wing
#

hello guys, sorry to bother but im really stuck with something. Maybe it it global and local execution problem but wondering if anyone could point me in the right direction

#

im trying to modify alias's screamer script so it is compatible with ACE

spark turret
#

alias scripts are awfully documented nad buggy

#

probably easier to create your own thing than get his running reliably

kind wing
#

his does work reliably though

#

the issue isnt his script

#

its ace

#

or more likely a gap in my understanding

#

i modified the following to this

#

one sec

#
        scream_on=true;
        {_x setVelocity [1+random 3,1+random 3,1+random 5];    _x setDammage ((getDammage _x) + 0.2)} foreach _units_range_1;
        sleep 0.1;
        {_x setVelocity [1+random 3,1+random 3,1+random 5];    _x setDammage ((getDammage _x) + 0.2)} foreach _units_range_2;
        sleep 0.1;
        {_x setVelocity [1+random 3,1+random 3,1+random 5];    _x setDammage ((getDammage _x) + 0.2)} foreach _units_range_3;
        _wave_obj setVelocity [_press_implicit_x*_al_pressure,_press_implicit_y*_al_pressure,0];

to

[_entitate] call fnc_avoid_screamer;
        
        scream_on=true;
        
        {
            _x setVelocity [1+random 3,1+random 3,1+random 5];
            _selection = selectRandom ["body","head","hand_r","hand_l","leg_r","leg_l"];
            [_x, 0.5, _selection, "stab"] call ace_medical_fnc_addDamageToUnit;
        }foreach _units_range_1;
        
        sleep 0.1;
        
        {
            _x setVelocity [1+random 3,1+random 3,1+random 5];
            _selection = selectRandom ["body","head","hand_r","hand_l","leg_r","leg_l"];
            [_x, 0.4, _selection, "stab"] call ace_medical_fnc_addDamageToUnit;
        } foreach _units_range_2;
        
        sleep 0.1;
        
        {
            _x setVelocity [1+random 3,1+random 3,1+random 5];
            _selection = selectRandom ["body","head","hand_r","hand_l","leg_r","leg_l"];
            [_x, 0.3, _selection, "stab"] call ace_medical_fnc_addDamageToUnit;
        } foreach _units_range_3;
        
        _wave_obj setVelocity [_press_implicit_x*_al_pressure,_press_implicit_y*_al_pressure,0];```
spark turret
#

lel

still forum
#

```sqf

```

spark turret
#

so it randomly gives ace damage to some body part?

kind wing
#

yeah thats all i want it to do

#

and it works locally

#

just not when i run it on dedicated

#

when the thing attacks

spark turret
#

hm

hollow thistle
#

use remote exec then.

spark turret
#

iirc ace damage are global and dont need to be run locally

#

it more likely the initialization, f.e. the script is executed locally but has a if !(isServer) exitwith {} somewhere

kind wing
#

yeah it does, that could be a start to fiddle with

spark turret
#

i am 95% sure if you do
[_unit, 0.8, "rightleg", "bullet"] call ace_medical_fnc_addDamageToUnit
initialized on the server it will work on dedicated.

#

but thats rather an Alias script problem, they are not optimized for multiplayer and dedicated. i used his fire script and it drove me crazy

kind wing
#

that at least gives me two things to have a whack at least, so thanks guys. Been pulling my hair out, coder but new to arma scripting and forgot about joys of replication / server client stuff

#

massively appreciated as tearing hair out/ driving crazy sounds familiar

#

also been having issues just with GetPos over water because im not used to it

spark turret
#

do some tests with the ace medical and check it thats the problem. bc its probably not

kind wing
#

would have thought getPosASL would get me what i need but nope, spawns me in space. Over land agl works fine for teleport stuff.

ivory lake
#

if you use getposASL you have to use setposASL

#

otherwise thats what happens yes

kind wing
#

noice!

oblique vale
#

Is there anyway to make Icons drawn with drawIcon clickable? Would like to select Units on a RscMinimap like on an UAV terminal. Is there an easy solution for this?

kind wing
#

i soon found out i needed to use a different function to get the required z level but guess i forgot the set one

#

thanks lads major props

spark turret
#

@oblique vale pls tag me if you find a solution

real moat
#

Would it be possible to define different insignia based on rank?

#
class CfgUnitInsignia
{
    class 111thID
    {
        displayName = "111th Infantry Division";
        author = "Bohemia Interactive";
        texture = "\a3\UI_F_Bootcamp\Data\CfgUnitInsignia\B_111thID_texture_ca.paa";
        textureVehicle = "";
    };
};
#

This is the example I picked up from the wiki

#

I assume this applies to every player?

still forum
#

you can manually do it with scripting

real moat
#

Could you point me in a good direction to get this done please?
Just a basic of how I would go about doing this ^^

surreal peak
#

would also help

#

you should be able to make a simple script to detect players ranks every 10 seconds or so and then apply the correct insignia they require

real moat
#

Thanks! Will have a look at these.

real moat
#

I wander if using on player respawn instead of running a loop would be better though

plush oriole
#

can their rank only change on respawn?

surreal peak
#

depends I guess

#

you can change ranks whenever

high marsh
#

@winter rose
When using an array as your target for remoteExec. Do all units of the same type listed in array get effected? Or anything that those specific objects are local to.

surreal peak
#

@high marsh what array are you using?

#

could you give an example

high marsh
#

Target Param.

plain urchin
#

hey fellas, i'm checking to see if players are nearby a military base/airport and spawning in units and despawning them when players are far away

#

is the best way to do this with while

#

i'm using a nested forEach loop, the first checking players positions, and then comparing each pos to distance to base/airport

#

idk if thats the best way to do it

high marsh
#

Use nearEntities with a loop.

plain urchin
#

im just worried about performance server side

#

like is that check intensive at all? idk

high marsh
#
while{SpawnAllTheAI} do {
  _enemies =  _airPortObj nearEntities["Man",300] select {(side _x) isEqualTo "EAST"};

    if
};
plain urchin
#

oh whattt i didnt realize you could do that

high marsh
#

Not really. Add suspension to that loop (sleep)

plain urchin
#

thats sick

high marsh
#

nearEntities is really cheap.

plain urchin
#

thanks man! thats really helpful

high marsh
#

:+1:

proven crystal
#

Which function is best to use if id like AI to enter search and potentially occupy buildings for a while while patrolling? There should be ace functions but i cant seem to find them

#

Or cba i guess

#

Also does AI automatically switch back to safe behaviour after a certain time or so?

winter rose
#

@high marsh it's array of target types, such as group, unit etc. ; not a unit type as "B_Soldier_F"

high marsh
#

Weird. I tried this, but it kept broadcasting to every unit of that type. So I was curious.

#
/*
    Initializes interaction with regular civilian AI
*/
interactionWeapon = getArray(missionConfigFile >> "CfgInteractions" >> "civ" >> "civ_upsale" >> "civ_weapons");
params[
    ["_ai",objNull,[objNull]]
];
_ai call rpg_fnc_requestReader;
isChatting = false;
while{alive _ai} do {
    if(!isChatting) then {
    nearPlayers = _ai nearEntities["Man",10];
    radioIndex = missionNamespace getVariable["RPG_READER",2];
    [str nearPlayers] remoteExec["systemChat",0];
     [_ai,format["[%1]: %2",name _ai,selectRandom interactionWeapon]] remoteExec["globalChat",nearPlayers];
    sleep 10;
    };
};
#

and no. This isn't life.

spark turret
#

@proven crystal there are scripts out there occupying buildings, but usually they occupy at mission start. AI has kind of a hard time dynamicylly entering and leaving buildings so some scripts just TP em.

#

especially multi story buildings and buildings from mods. had to write a "check if stuck" part for random village patrols bc over time more and more ai would get stuck at house entrances

plain urchin
#

any ideas how to get a building's modelToWorld position from where the cursor is being pointed at?

meager granite
#

If cursor is center of the screen then its easy

#

Otherwise there is no way to get where your cursor is pointed. You can get weapon vector but only if you have weapon up.

fierce oyster
#

ohh its Samatra

#

dude

meager granite
#

For center of a screen - make a vector with positionCameraToWorld, say 50 meters in front of you, [0,0,0] to [0,50,0]. Cast a ray with lineIntersectsSurfaces, find your building in results (or any applicable building), get intersection point and building and worldToModel it

#

@plain urchin

fierce oyster
#

can you tell me how you made the nyx recon be able to lock onto it's target

#

in KOTH

#

vanilla Nyx Recons dont do this

meager granite
#

Hm, I don't think I did anything specific to Nyx Recon

#

Lock as in engine lock with T?

fierce oyster
#

It doesnt work in editor for me

#

only in your servers

meager granite
#

How did you test it? Against empty vehicle?

plain urchin
#

thank you sa-matra, that's helpful

fierce oyster
#

No,against live moving helis and planes

#

The targets shows up on the radar

#

but cant lock onto them

#

so no info,nothing

meager granite
#

🤔

fierce oyster
#

Other Radars work fine though,like from a Cheetah or a tigris

meager granite
#

I didn't really do anything to it in KotH

plain urchin
#

but he probably didn't :laugh:

fierce oyster
#

That is illegal

#

why bother doing that when you can ask the man himselves

meager granite
#

Watch out for cyber police!

#

I just checked, nothing done to it apart from setting some camos

fierce oyster
#

thx man,i will check if my game is corrupted or something

meager granite
#

I just tested it in VR with nothing and it locks fine

plain urchin
#

maybe you disabledAI?

meager granite
#

Maybe you had your button unbinded since you played KotH or something?

plain urchin
#

or something?

#

or that

#

wait no im dumb sorry

fierce oyster
#

i need to verify my game files

still forum
#

@high marsh if _ai means AI
Then they are probably on the server. All of them.

#

remoteExec executes the code where "unit is local" not on "unit"

high marsh
#

Precisely.

#

systemChat has local effects. With AI being local to server, I need every unit within a certain proximity to recieve the effects.

spark turret
#

is there a way for AI to target an object? i want to give suppresive fire by AI at positions without a "legitimate tartget"

#

basically make it the AI shoot at any position i want

#

also is there a function to shuffle/ randomize an array?

peak plover
#

Ai doesn't drive the car

#

I delete the gunner

#

ai starts driving

#

How do I fix this?

digital jacinth
#

i read something about this constellation, but it was an rhs btr. put the sql in the gunner seat.

proven crystal
#

@spark turret thanks. But AI seems to do their job ok when i use ACE (or Achilles?) modules for occupation. Id like to work with those functions

#

But cant find them i. The functions viewer

real moat
#

Anyone know how I might be able to remove ace interact from specific units?

#

Havent found anything in ACEs documentation

spark turret
#

can someone help me correctly understand waitUntil {x} function?

still forum
#

It's a while loop

#

with the condition in the {}

#

and a ! around the condition

#

while not x, wait

proven crystal
#

It checks on every frame, so add sleep in the beginning and make sure it returns true at some point

still forum
#

wait until x

spark turret
#

yeah i got that, and the last line in the {} has to be the condition?

winter rose
#

Yup

spark turret
#

okay thanks. took some time to figure out the "last line has to return true boolean"

winter rose
#
waitUntil { sleep 1; hint "you're alive" ; not alive player} ;```
spark turret
#

yep it works now. awesome

winter rose
#

:+1: kewl!

balmy crescent
#

Is it possible to make it so stepping in water kills you. And if so how would one do that. Trying to recreate lava, any ideas or better ideas of what would work best?

radiant egret
austere hawk
#

what happens if i have a large array as global variable and change one element in it and broadcast change to all clients. Effectively, would the entire array be sent over network again or just the change? (i'm assuming entire array?)

hollow thistle
#

I would assume the whole array too.

#

Clients could change the array in meantime so diff only would be useless then.

balmy crescent
#

Now are there any better ways to do lava?

#

Cuz i could make it a dynamic object, just want it so whenever something steps on it it burns and dies

plush oriole
#

Is it water

#

That you want people to die from

still forum
#

@austere hawk entire

austere hawk
#

hm... unfortunate, but expected

tough abyss
#

What’s in the array?

balmy crescent
#

Lava

#

So my options are orange color the water or make lava objects

#

Either one, the player has to die when step in/over

#

Not sure what is best

#

i will have to use lava objects either way so is there way to execute or burn a player that steps on a certain object?

austere hawk
#

its a matrix, each cell having data arrays (mission related) . I suppose i can store the dynamic data elsewhere (maybe in object-space of game objects) - just not as handy

ivory lake
#

you might be able to use a publicvariable eventhandler or something similar, have it send the position and contents in the array that needs changing

#

and change it locally

balmy crescent
#

Or is there a way to make an “infinite mine” with no explosion or sound and that is the object so if they step on it they die?

austere hawk
#

particles can cause fire damage

balmy crescent
#

Particles hmm, so have it emit particles?

ivory lake
#

yeah but iirc vehicles are immune to fire damage

balmy crescent
#

If im making a map that is 100km2 and 30% lava... is that smart?

ivory lake
#

i'd just script it

austere hawk
#

depends on their config, but yeah they are pretty resistant mostly

ivory lake
#

make the water lava

balmy crescent
#

How to make water kill?

ivory lake
#

isSurfaceWater and whatever the underwater one is = dead

balmy crescent
#

or burn xD

austere hawk
#

covering 30km² with particles is not very cpu friendly....

balmy crescent
#

Not cpu friendly indeed

tough abyss
#

Covering 30sqkm with anything is not cpu friendly

balmy crescent
#

The map im making is very rocky and mountainous, so lava is found everywhere, not just sea level, i mean i could just make the lava be straight down into the deadly water

#

looking for what is best option haha

#

or even better.... can i make a certain color of my satmap kill/burn things?

#

is that possible?

#

cuz if so jackpot baby

austere hawk
#

you can detect what kind of surface material someone is standing on (originally used for sound environment stuff) iirc

ivory lake
balmy crescent
#

So i can turn a material to kill things? What would that command look like? (Im not good at scripting, its just necessary for this part of map lol)

#

Lets say my material is sand that kills

austere hawk
#

every object needs eventhandler that checks at intervalls if it stands on earth blood

ivory lake
#

yeah

balmy crescent
#

So im talking about like in the terrain

ivory lake
#

that's pretty much the only sane way of doing it

balmy crescent
#

_surface = surfaceType position player;
if _surface = sand
kill player
Else
Continue
End

#

Is that how arma scripting works 😂

plush oriole
#

no

#

and why do you want all the sand to kill people

#

sand is like the opposite of lava

#

:D

balmy crescent
#

just example XD

winter rose
high marsh
#
while{alive player} do {
    waitUntil{(surfaceType position player) isEqualTo "#sand"};
    player setDamage 1;
};
winter rose
#

-while

brazen ibex
#

Is there a way to check if a unit in a parachute have reached the ground? I want to delete the unit after touching the ground.

winter rose
#

@brazen ibex
isTouchingGround parachute
isNull parachute

brazen ibex
#

thanks

ruby breach
#

@high marsh flies helicopter over sand

spark turret
#

@jagged bay if (_unit getPosAtl select 2 <= 1) then {hint str "touchdown"}

zinc rapids
#

I'm having an issue with custom radios

#

It's the first time I've used them

#
_c1Name = "Acorn 1\'1 Squad Net";
_c1 = radioChannelCreate [[0.6, 0, 0], _c1Name, "%UNIT_NAME", [], false];
[_c1 {_this radoiChannelAdd [A11SL, A11SM, A11ATL, A11BTL]}] remoteExec ["call", [0, -2] select isDedicated, _c1Name];
#

That's the code I have so far, but it's not working

winter rose
#

radoi*
also channel should be created on every machine iirc; please check the wiki @zinc rapids

zinc rapids
#

Thanks for the assistance, local worked

dim kernel
#

is it possible to convert String to Object

ruby breach
#
allUnits select {str _x isEqualTo "STRING"} param [0,objNull];
``` (or similar)
muted ember
#

Hey everyone. I'm pretty amateur with scripts and was wondering if someone could help me out with a small issue I can't solve.
I have a little gimmick mission where the last person standing fires a script to say titleCut [ format ["%1 Wins.", name _player], "Plain"]; before ending the mission.

What would be a way get it to pull the last alive player's name?

meager granite
#

allPlayers select 0, assuming you already sure there is just one player left.

high marsh
#

@ruby breach Yikes.

tough abyss
#
private _lastAlive = (allPlayers - allDeadMen) param [0, objNull];
hint str ([name _lastAlive, "All Dead"] select isNull _lastAlive);

@muted ember

muted ember
#

Thanks, I'll try it out!

tough abyss
#

This will pull name of any one player that is alive. If you want the only alive player then you should additionally check that ```sqf
count (allPlayers - allDeadMen) == 1

meager granite
#

Oh wait, I thought allPlayers doesn't have dead players like playableUnits

tough abyss
#

You need some coffee dude, playableUnits contains ONLY alive players

meager granite
#

🤔 🔫

#

Meant dead, not alive

plush oriole
#

Don't watergun yourself smh

proven crystal
#

so i finally found the ace functions to garrison or ungarrison buildings. now is there a way to check whether or not a unit is garrisoned? otherwise ill just write a variable to the units, but im wondering whether something like that altready is in it

proven crystal
#

so sometimes it seems that group leaders dont want to leave buildings. they get stuck in certain positions on the way out, and try to get back there when i move them by hand. also when i delete the leader then, the next guy goes to that position.

#

also the garrison function seems to switch them to aware

proven crystal
#

hmmm there seems to be something with a scriptedwaypoint

#

hm that just lets them walk into a building but it looks in no way garrisoned. they are just standing around in ground floor

#

with the ace fuction they do enter the buildings nicely. the teleport is optional. filling up buildings is ok. just occacionally TLs get stuck when using ungarrison

dusky pier
#

i'm trying to use ropeCreate - in editor is work's fine. But when trying on mp created car's is not working 😦

#

what can block creating ropes?

proven crystal
#

no idea, seems to work for me.... make sure you execte it on the server maybe?

dusky pier
#

@proven crystal i will try to make it from server, ty for idea

proper flower
#

Anybody got script for standing at attention? I got the at ease script but couldn’t find at attention & replacing ease with attention didn’t work..

young current
#

you can look up the correct animation name in the in game animation viewer perhaps

proper flower
#

That’s what I mean I didn’t see it in there.. are u saying there’s a search function? I usually just scroll thru it..

#

It does seem like a slim list so they might not have all in the scroll list

young current
#

theres different animations sets that you can change with the dropdown menus

#

its a bit difficult to navigate yeah

proper flower
#

Ok.. I figured that at ease & at attention would be in the same drop down set up.. I’ll look thru it again to make sure.. thanks

proper flower
#

Why do these scripts not work when I play my mission in multiplayer.. single player it’s as it should be but multiplayer every unit is in default stances.. I just want some guys doing push ups & the other standing at ease

young current
#

what commands are you using?

#

some of them need to be executed differently in MP

proper flower
#

This playMove “AmovPercMstpSnonWnonDnon_exercisePushup”; & Ease

#

Replacing excersisePushup with ease for the second script

#

I’ve re-exported & still no joy.. they all just stand in default

#

Stance

#

*but I spelled everything correct

winter rose
#

@proper flower if it works in SP and not in MP, the issue is locality

proper flower
#

Can u explain please @winter rose

#

How do I get it to work in MP

plush oriole
#

remoteExec

#

basically it's possible in multiplayer for code to run on one person's computer but not everyone's or not the server

#

so remoteExec basically says to the other computers 'hey you should run this code as wlel'

#

and you can choose who that gets sent to

proper flower
#

Ok, is that written in each of the units I have scripted or the debug console? How do I use this.. I’ve never had to do this

plush oriole
#

yeah it's a bit of a leap

#

where is the animation code triggered from

#

is it in the unit init fields

#

or where

proper flower
#

Yea in each units init field

plush oriole
#

hmm

#

that should actually work afaik

#

can someone more knowledgable about multiplayer weigh in

still forum
#

yawns

proper flower
#

Oh lord

still forum
#

playMove is arg local. Meaning it needs to run where the unit is local

#

if you have it in init box, it'll run everywhere

#

if (local this) then {this playMove...}

plush oriole
#

that's what I thought

#

but wouldn't it work without the locality check

proper flower
#

Ok so add: if (local this) then { to the beginning of the code?

plush oriole
#

don't take that as advice that's a genuine thing i've been wondering

still forum
#

without the locality check, you have everyone trying to override everyone else

#

glitchfest

proper flower
#

Ok I’ll add that to the script & see if it works for me.. thanks.. I know u love hating to help me Ded

#

Nope

#

Still nothing

#

If (local this) then {removeVest this; removeBackpack this; removeAllAssignedItems this; removeAllWeapons this; this playMove “AmovPercMstpSnonWnonDnon_exercisePushup”; this disableAL “ANIM”;};

#

This is what I have as my code in the init field..

still forum
#

your script doesn't execute at all

#

typo in there

young current
#

playMove also needs a delay when used in init?

still forum
#

two typo's

proper flower
#

It does.. prob just a spelling error when. I typed it now

still forum
#

never type off code if you want help with it

proper flower
#

It was a mistake

still forum
#

You either make mistakes, or you make mistakes and accidentally fix your problem

#

Always copy code

proper flower
#

Can u help

still forum
#

wat?

proper flower
#

Ok I fixed the spelling error..

still forum
#

nope

#

still error in there

#

As I said. Always copy-paste code

proper flower
#

On my phone let me open up on desktop

#

if (local this) then {removeVest this; removeBackpack this; removeAllAssignedItems this; removeAllWeapons this; this playMove "AmovPercMstpSnonWnonDnon_exercisePushup"; this disableAI "ANIM";};

#

copied . pasted

#

works in Sp not in MP

still forum
#

looks good 🤔

#

dedicated server MP?

#

self-hosted MP should also work

proper flower
#

self hosted but like I said it does not work

#

only SP

young current
#

probs need the delay the wiki page talks about

proper flower
#

u got a link to the wiki u are refering to?

proper flower
#

thanks

young current
#

I suggest you bookmark that

still forum
#

if (local this) then {this spawn {Sleep 2; _this playMove...};};
probably

#

🤔

#

That's wrong embed

proper flower
#

didnt work

#

@young current I do have it bookmarked but it only helps so much if u don;t know how things are written..

#

Im no t a superior coder & most ppl only give answers based on the fact they know a lot more & its hard to know what they are saying if theyre not specific

winter rose
#

^ is a very good start @proper flower

plain urchin
#

hey guys, i'm trying to create an easy way to output each modelToWorld positions of every object placed in the mission, relative to a set target object's position

#

here's my script, for some reason this isn't working properly (it's not displaying the correct values of PositionRelative)

#

can someone help me fix this?

plain urchin
#

edit: nvm i'm dumb i fixed it

exotic tinsel
#

is there away to detect if player has UAV terminal open?

meager granite
#

!isNull findDisplay 160

#

@exotic tinsel

exotic tinsel
#

@meager granite thx mate

#

@meager granite is there any way to check from server side?

ivory lake
#

what are you trying to do that would require that?

tough abyss
#

Recconaisance pod (screenshot as an intel picture)
What I wanted to achieve is, basically, old school cold war scheme recconaisance during MP session that use of a plane and its recce pod. I need to take screenshots while flying the plane equipped with the pod (doable, I guess) and than need to send the screenies over the network from the pilot's local PC to a server (or website). Than those pictures are to be setObjectTexture'd on frames in a briefing room by different player using a mission script. Could it be achieved using some mods, persistent DB or other method? Alternatively, is it possible to kinda "frozen" a frame from live camera pod so that it would appear still on a projector screen, TV set or smth in the briefing room?

exotic tinsel
#

@ivory lake i use a server side addon for everything. i need to kick afk players but not uav pilots.

ivory lake
#

mmm you'd probably have to run a script clientside (remotExec) that uses !isNull findDisplay 160 and saves the result in a unit variable

#

or when you're looking for AFK players, 'ping' them so to speak and if they return taht they're not in the display, kick them

winter rose
ivory lake
#

300 is the 'unitinfo' one iirc, ammo zeroing etc

winter rose
#

Pause menu = 49

#

Chat menu = 24

meager granite
#

Check defineResincl.inc in ui_f.pbo

#

It has pretty much all IDDs there

winter rose
#

thanks (I don't want to list them all though)

meager granite
#

Lots of crap but you can pick useful stuff out of it

winter rose
#

aaah, mighty nice of you!

#

PS: you are playing Arma for 5 hours now, time to rest your eyes and look into the distance to relax your pupils ^^

meager granite
#

I just have it on all the time

winter rose
#

hehe, I could relate!
is this pastebin "eternal" so I could link it to the biki?

tough abyss
#

just make a page

#

it should be on biki anyway unless it is already there

winter rose
#

seems not on the biki, will make a findDisplay subpage

tough abyss
#

google says there isn't

#

it is an export from the engine BTW, engine is using those defines for various engine spawned displays

winter rose
#

no "license breach" concern?

tough abyss
#

it is also in the config files of the main game so doubt it breaks any rules

fleet hazel
#

Hi guys. I have ctrl RscMapControl. How do I make transparent background like in a gps Navigator.

winter rose
#

@tough abyss @meager granite any idea what "MUF" means?

meager granite
#

Dev name

tough abyss
#

Most likely some programmer initials, not designer

fleet hazel
#

@winter rose Thanks. Will look for

tough abyss
#

I suggest you remove those initials from the page not to confuse users

#

XBOX 360 profile and save messages
Dont need this as well

#

@winter rose

winter rose
#

the initials and some comments can go, but the XBOX thing may not be pointless to have (good to know why it is defined, etc)
also inventory seems to be 602, and this list stops @ 300+ so I will dig a bit more later (or if anyone has data…!)
I am moving this convo to #community_wiki as to not clog #arma3_scripting 😉

spark turret
#

is there a function to get an array of all markers or triggers?

meager granite
#

allMapMarkers, allMissionObjects "EmptyDetector"

#

second one is slow, don't call it too often

spark turret
#

thanks man

spark turret
#

quick question again.
i run a MP compatible animation script. in the beginning i assign the varibale "inAnimation" to the unit, after the animation is finished, i set the variable to false.
idea is to avoid having a loop that starts the animation again and again, therefor, only if unit not in animation, start new animation.
thing is it doesnt work.

_unit setVariable ["inAnimation", true, true];    //at anim start
_unit setVariable ["inAnimation", false];    //at anim end


//in the other script:
if (_unit getVariable ["inAnimation",false]) then { 
//run animation
}

i assume its a problem that the ariable is not public? i did set the var to public tho

ivory lake
#

_unit setVariable ["inAnimation", true, true]; the 2nd true is what broadcasts it over the network

#

if you're doing ["inAnimation", false]; that's not being broadcast it will need to be ["inAnimation", false,true];

tender fossil
#

What's wrong with this function?

EZ_fnc_drawTextPlayer = {
    _playersInRange = EZ_fnc_playersInRange;

    {
        drawIcon3D ["", [0,0.6,0,1], ASLToAGL getPosASL _x , 0, 0, 0, "Target", 2, _x call EZ_fnc_setTextSize, "PuristaMedium"];
    } forEach _playersInRange;

    _return = count _playersInRange;
    _return
};
#

I get "Generic error on expression" at

} forEach _playersInRange
#

Here's the called fnc

EZ_fnc_playersInRange = {
    if (EZ_frameNumber > 0) then {
        deleteMarker "playersRecognizedInArea";
    };


    _playersRecognizedInRadius = call KK_fnc_trueZoom * 60;

    _playersRecognizedInArea = createMarkerLocal ["playersRecognizedInArea", getPos player];
    _playersRecognizedInArea setMarkerText "";
    _playersRecognizedInArea setMarkerSize [_playersRecognizedInRadius, _playersRecognizedInRadius];
    _playersRecognizedInArea setMarkerDir 0;
    _playersRecognizedInArea setMarkerShape "ELLIPSE";

    _players = allUnits; // just for testing, for production use this instead: allPlayers - entities "HeadlessClient_F"; or allUnits - entities "HeadlessClient_F";
    _playersInRange = _players inAreaArray _playersRecognizedInArea;

    _playersInRange;
};
ivory lake
#

_playersInRange = EZ_fnc_playersInRange; you're not calling it?

fleet hazel
#

guys. How to change the background that appears when the mouse indicates an item in your inventory?

tender fossil
#

...lol 😄

still forum
#

Why do you

    _return = count _playersInRange;
    _return

Instead of just returning the value directly?

tender fossil
#

So I just put "count _playersInRange" in the end?

still forum
#

Yes

ivory lake
#

yeah

tender fossil
#

Ok

still forum
#

And you have lots of missing private

tender fossil
#

Alright

tropic mist
tender fossil
#

@still forum Where can I learn more about using private variables?

still forum
tender fossil
#

Aight, thanks 😃

still forum
#

don't use private "string" nor private [array] they are expensive

spark turret
#

more questions: how to tell if a sounds played with [_unit, "ruchatter1", 30] call CBA_fnc_globalSay3d;
is over? i wanna start random lip movement in the beginning and then stop moving lips when hes doen talking

tough abyss
#

you can try using vectorFromTo and selectionPosition @tropic mist

fleet hazel
#

guys. How to change the background that appears when the mouse indicates an item in your inventory?

tropic mist
#

@tough abyss How can I use it because I do attachto righthand from me player

tough abyss
#

add MouseEnter/Exit EH to the element you want to change background then use its reference to change background color when EH triggers @fleet hazel

#

the hand has fingers and other selections you can get selection position, find 2 that you can draw line through that indicates correct vector for the bottle @tropic mist

fleet hazel
#

@tough abyss I want to change the texture in an already existing handler for the inventory. I can't find these handlers.

tough abyss
#

findDisplay, displayCtrl, ctrlAddEventhandler

tropic mist
#

@tough abyss I can't find the command to draw a line

young current
#

draw3d

tropic mist
tough abyss
#

why do you need to draw a line?

#

i was talking about imaginary line

#

you can draw it in your mind then take positions from 2 selections and plug them in vectorFromTo

tropic mist
young current
#

I got to say you have picked a very difficult task to do

tropic mist
tough abyss
#

now use it to setVectorUp for the bottle on each frame

tropic mist
#

oh sorry set

#

@tough abyss I have an error https://i.postimg.cc/T3vNFp6s/screenshot-179.png ```_item = "waterBottle";

_point1 = player selectionPosition "RightHand"; // [0.310878,-0.0737944,0.784343]
_point2 = player selectionPosition "RightHandThumb1"; // [0.218116,0.358148,1.2034]
_pos = _point1 vectorFromTo _point2; // [-0.383661,-0.0447152,-0.922391]

switch (true) do {
case (_item isEqualTo "waterBottle"): {
player switchmove "sezon_anims_boire";
_bouteille = "Land_WaterBottle_01_full_F" createVehicle [0,0,0];
_bouteille attachTo [player, [0,0,0], "RightHand"];
_bouteille = setVectorUp _pos;
};
default {
hint "Pas utilisable";
};
};

tough abyss
#

_bouteille = setVectorUp _pos; script error

tropic mist
#

yes

#

oh xD "="

tough abyss
#
_point1 = player selectionPosition "RightHand"; // [0.310878,-0.0737944,0.784343]
_point2 = player selectionPosition "RightHandThumb1"; // [0.218116,0.358148,1.2034]
_pos = _point1 vectorFromTo _point2;
_bouteille setVectorUp _pos;`

you have to do this for each frame of the animation

tropic mist
tough abyss
#

you might want to switch to setVectorDirAndUp instead of setVectorUp alone, but this is going to be even more complicated

tropic mist
#

when you say for each frame how to do that?

tough abyss
#

addMissionEventhandler ["Draw3D", {}]

#

then you cant use local variables

#

anyway, this is mega complicated task and you obviously lack some knowledge

tropic mist
spark turret
#

i keep forgetting that:
how do i pass custom variables into an eventhandler?
f.e.

_soundsource = "randomword";_radius = 100;

            _unit addEventHandler ["FiredMan",
                {
                    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle",_soundsource,_radius];
                    hint str _this;
                }
            ];
#

do i have to use private for that?

still forum
#

for what?

#

that's not at all how that works so no
that's not how local variables work, that's not how params works, that's not how eventhandlers work. You basically got everything wrong there

#

and you can't pass variables to an eventhandler like that

#

you can save the variables on the unit by using "_unit setVariable"
and then using getVariable inside the eventhandler

drowsy axle
#
_objects = [
    [2,"VSM_ProjectHonor_Backpack_Kitbag", table_1],
    [2,"VSM_ProjectHonor_Backpack_Compact", table_2],
    [2,"VSM_ProjectHonor_carryall", table_3],
    [1,"VSM_ProjectHonor_Boonie", table_4],
    [1,"VSM_ProjectHonor_Cap", table_5],
    [1,"VSM_Mich2000_ProjectHonor", table_6],
    [1,"VSM_Mich2000_2_ProjectHonor", table_7],
    [1,"VSM_ProjectHonor_OPS_2", table_8],
    [1,"VSM_ProjectHonor_OPS", table_9],
    [1,"VSM_ProjectHonor_Camo", table_10],
    [1,"VSM_RAV_operator_ProjectHonor", table_11],
    [1,"VSM_RAV_MG_ProjectHonor", table_12],
    [1,"VSM_RAV_Breacher_ProjectHonor", table_13],
    [1,"VSM_LBT6094_operator_ProjectHonor", table_14],
    [1,"VSM_LBT6094_MG_ProjectHonor", table_15],
    [1,"VSM_LBT6094_Breacher_ProjectHonor", table_16],
    [1,"VSM_CarrierRig_Operator_ProjectHonor", table_17],
    [1,"VSM_CarrierRig_MG_ProjectHonor", table_18],
    [1,"VSM_CarrierRig_Breacher_ProjectHonor", table_19],
    [1,"VSM_FAPC_Operator_ProjectHonor", table_20],
    [1,"VSM_FAPC_MG_ProjectHonor", table_21],
    [1,"VSM_FAPC_Breacher_ProjectHonor", table_22]
];
{
    _type = _x select 0;
    _object = _x select 1;
    _table = _x select 2;
    _spawn = "groundweaponholder" createVehicle getpos _table;
    if (_type isEqualTo 0) then {
        _spawn addWeaponCargoGlobal ["_object",1];
        _spawn attachTo [_table,[0,0.25,1]];
    };
    if (_type isEqualTo 1) then {
        _spawn addItemCargoGlobal ["_object",1];
        _spawn attachTo [_table,[0,0.25,1]];
    };
    if (_type isEqualTo 2) then {
        _spawn addBackpackCargoGlobal ["_object",1];
        _spawn attachTo [_table,[0,0.25,1]];
    };
} forEach _objects;``` https://cdn.discordapp.com/attachments/469936906461773834/597460351453495306/unknown.png Context
ivory lake
#

remove the "" around object

drowsy axle
#

oh yeah

#

thanks!

still forum
#

^

tender fossil
#
EZ_fnc_drawTextPlayer = {
    private _playersInRange = call EZ_fnc_playersInRange;

    {
        // ERROR: [Type Number, Not a Number, expected Number]
        drawIcon3D ["", [0,0.6,0,1], ASLToAGL getPosASL _x, 0, 0, 0, "Target", 2, _x call EZ_fnc_setTextSize, "PuristaMedium"];
    } forEach _playersInRange;

    count _playersInRange;
};
#
EZ_fnc_setTextSize = {
    private _target = _this;

    private _textSize = (ln (10 / (player distance target)) * 0.434 * 0.05) / (getResolution select 5);

    if (_textSize > 0.05) then {
        _textSize = 0.05;
    };

    _textSize;
};
still forum
#

_textSize is NaN

#

cuz distance returns nil/nonsense

#

because... target.

tender fossil
#

Oh, so it's missing an underscore? lol

#

I can't understand how I'm so blind to these errors 😄

#

Same error after I fixed it... Hmm

#

"Type Not a Number, expected Number"

still forum
#

your textSize function returns a NaN I suppose

#

also why does setTextSize not actually set anything?

tender fossil
#

@still forum I think it should be rather getTextSize

tender fossil
#

Is there a bug with distance? Commands using it return any at mission start

#

And I get zero divisor when using eg. player distance _target with math commands

still forum
#

maybe "player" doesn't exist yet at mission start

#

there is some time at init.sqf where player is objNull

#

try diag_log'ing all your stuff

tender fossil
#

Also the hints in my function get never shown even though the function is placed in onEachFrame

still forum
#

checked RPT?

tender fossil
#

Yeah, this is all I get

`{
drawIcon3D ["", [0,0.6,0,1], ASLToAGL ge>
0:49:30 Error position: <drawIcon3D ["", [0,0.6,0,1], ASLToAGL ge>
0:49:30 Error Type Not a Number, expected Number
0:49:30 File C:\Users\Net_2\Documents\Arma 3 - Other Profiles\Ezcoo\mpmissions\fishing_test_CC_2.Tanoa\recognizePlayersNearby.sqf, line 70
0:49:30 Error in expression <t = _this;

private _textSize = (ln (10 / (_target distance player)) * 0.434 * 0>
0:49:30 Error position: </ (_target distance player)) * 0.434 * 0>
0:49:30 Error Zero divisor
0:49:30 File C:\Users\Net_2\Documents\Arma 3 - Other Profiles\Ezcoo\mpmissions\fishing_test_CC_2.Tanoa\recognizePlayersNearby.sqf, line 53
0:49:30 Error in expression <nRange = call EZ_fnc_playersInRange;
`

#

Maybe I should check whether player is still objNull

tender fossil
#

Hmm, I guess it was the actual math done in the function. It returned too high or too small values for Arma and got messed up

austere hawk
#

does anyone know how to set attributes to markers in eden via script?

_mrk = create3DENEntity ["Marker", "mil_dot",[_xpos-25, _ypos-25, 0]];
_mrk set3DENAttribute ["name",format ["%1",_mname]];

I tried it the same as for objects/logic entities there it works... the markers all have default names (marker_xx) instead

hollow thistle
#

marker uses markerName attribute

tough abyss
#

Nevermind got it working

desert lava
#

does anyone know if you can add markers in a specific place to cover the black area around the map

drifting copper
#

I am trying to keep RHS UH-60 doors open, I tried this animateDoor ["DoorLB", 1]; this animateDoor ["DoorRB",1]; in the object init though this only opens and then closes the doors. Can someone maybe assist please

frozen gull
#

Doesn't the RHS UH-60's have scripts that allow them to open and close the right and left cargo doors?

austere hawk
#

@hollow thistle thanks

drifting copper
#

@frozen gull yeah, searched on how to keep them open but the only thing found was this animateDoor

ornate sky
#

is there a polar version of modelToWorldWorld

#

that takes direction + distance?

#

I have a pos [x,y]. I want to find a pos that is 30° and 100m from it, is there a direct command that was added for that? Or do I go the sin/cos way?

#

If anyone knows just @ me

young current
#

@ornate sky dont think there is, have to be calculated "manually"

ornate sky
#

I guess one could use an invisible object that will first be setDir'd and then use modelToWorldWorld

#

a workaround without sin cos

young current
#

yeah why not

#

sin cos might be faster though

#

as a process

ornate sky
#

right, I'm doing a little custom polar plot script for arty

#

oh shoot, there's a direct command origin getPos [distance, heading] (Since Arma 3 v1.55.133361)

tough abyss
#

It doesn’t do what you asked directly but can be used as part of solution

spark turret
#

any function like pushback but instead it inserts in the front? im creating an array of numbers (times) and want the newest to always be in front. i imagine its unnecessary caculation to sort the array time and time again

tough abyss
#

you can reverse array

#

test what is faster

still forum
#

why do you need newest from front?

#

if you're trying to make a stack, you can use pushBack to push to end and deleteAt to pop from end.

#

I made a pushFront in Intercept CBA

tough abyss
#

or append
[newelement] append oldarray

#

oldarray append [newelement] == pushback

spark turret
#

@still forum just for convenience so i can be sure that _timearray select 0 is always the newest value. its used for comparison of firedat EH times. the civilian decideds upon that if it was a single "warning shot" or if he is being attacked, so he knows wether to freeze or panic

austere hawk
#

how do i make a valid object or "global variable name" out of a string?
I create locations (logic) in 3den, they have local variable data assigned to them via init field. I also give them custom Variable names.
I save all their names inside the init field of a "master object".

With the scenario started, i want to read the location names from the master object, and then the information from the local variables of each object. How would i do that? Or is there a better way?

#

so the master object's array would look somewhat like this:

[["GP01"],["GP02"],["GP03"],
 ["GP11"],["GP12"],["GP13"],
 ["GP21"],["GP22"],["GP23"]]

and the editor attributes of a location looks like this

Varname: GP01
initfield:  this setvariable ["mydata",[1,2,3,4]]
#

and i want to retrieve the "mydata" variable from global variable GP01 (or location object GP01)

still forum
#

missionNamespace getVariable ["GP01", objNull]

#

need to check for isNull in case object isn't there, just to be safe

muted ember
#

I've been doing a little looking into removeAction. There is a lot for removing an AddAction after one attempt using the arguements, but how would I do it to remove it locally so that each player can only perform an actionAction once?
For a basic example, let's say a I want everyone to grab a pair of NVGs with an addaction, but after that person uses it they can no longer perform that Addaction, but anyone else still can, if unused.

hollow thistle
#
parameters array passed to the script upon activation in _this variable is:
params ["_target", "_caller", "_actionId", "_arguments"];
#

so in the script that adds the nvgs you can do:

params ["_target", "_caller", "_actionId"];

_target removeAction _actionId;
muted ember
#

Hmm... I thought I tried that earlier... Let me look again.

hollow thistle
#

it should work, the actions are added/removed localy.

#

so if you activate the action this should remove your local action on the target object.

muted ember
#

Okay, yup... I'm an idiot. Short version... I forgot a character. 😬 Thank you anyway! LUL

#

Sometimes I just need people to color code it for me. 😉

hollow thistle
#

as an alternative you can always do:

_target setVariable ["my_nvg_actionDone", true];

and in the action condition check:

(_target getVariable ["my_nvg_actionDone", false]);

this allows you to temporarily disable the action without removing it.

muted ember
#

I'll note that for the future. Thanks again!

hollow thistle
#

good luck, it's sleeping time here (3am) 🛏 💤

mortal nacelle
#

Would there be a way to directly copy all the classnames of a persons loadout

#

E.g., their backpack and everything inside of it

#

So you can put it on an addaction

#

If that makes sense

hollow thistle
#

getUnitLoadout
setUnitLoadout

mortal nacelle
#

Lifesaver, thanks a bunch @hollow thistle

slim oyster
#

What is the most reliable way to use setUnitPos on new units with createUnit? time delay, stance check, etc? Using it with a CBA_fnc_waitUntilAndExecute with an !isNull condition does not work, and setting the pos as soon as unit is created also does not work, spawning on headless client works with a simple time delay but don't want to stack events for lots of spawned units.

tough abyss
#

hi guys, I tried using the following in a Equipment box, says "this is not defined" for the second this used, what's the issue?

this addAction["Delete gear","clearItemCargo this"];

thanks in advance

#

It's called in the init field of the object

winter rose
tough abyss
#
this addAction ["Delete Gear", "clearItemCargo (_this select 0)"];
#

ah, the description of the init field got me confused, thanks!

still forum
#

this is a local variable in the init script scope. Local variables don't carry over into new script instances (action script is a new instance as it get's called some time in the future)

tough abyss
#

ah, I see, thanks for the information, ill note it down

tough abyss
#

How do you guys use tasks in arma 3? I've always done it this way:

//briefing.sqf executed everywhere using init.sqf
OBJ_INFIL = player createSimpleTask ["Infiltrate"];
OBJ_INFIL setSimpleTaskDescription ["<br />Make your way to the northern shore.","Infiltrate","Infiltrate"];
//triggers in-game
OBJ_INFIL setTaskState "Succeeded"; ["TaskSucceeded",["","Infiltrate"]] call bis_fnc_showNotification;
OBJ_RADAR setTaskState "Assigned"; ["TaskAssigned",["","Destroy Radar"]] call bis_fnc_showNotification;

this works for my small singleplayer missions but I feel like there's better ways, especially in MP.

hollow thistle
#

it's recommended to use bis functions instead of creating tasks manually. It takes care of tasks synchronization etc.

tough abyss
#

Thanks!

winter rose
spark turret
#

hello, is this the best way to declare a public variable in the beginning of a mission? the variable will be condition to multiple scripts/functions initializing later on throught the mission:

missionNamespace setVariable ["IRON_Debug", true, true];

#

i have to admit that i dont understand what a missionnamespace is

still forum
#

missionNamespace is the place where all global variables are saved

spark turret
#

well that sounds like im doing the right thing then

still forum
#

missionNamespace setVariable ["IRON_Debug", true];
is same as IRON_Debug = true
and missionNamespace setVariable ["IRON_Debug", true, true];
is same as

IRON_Debug = true;
publicVariable "IRON_Debug";
#

yes your code looks like it does what you want to do

spark turret
#

thank you for the clarification

tough abyss
#

@still forum compile caching is back on dev branch, what do you know about it?

still forum
#

nothing

tough abyss
#

great

still forum
#

no mention about it in the changelogs?

#

maybe it's the old caching and they just didn't disable on devbranch?

tough abyss
#

havent seen any mention anywhere. Maybe it has been fixed not to cause memory leak?

still forum
#

Maybe they implemented my idea of removing stuff from cache that hasn't been accessed for X time

#

I'll update my dev branch, but won't have time today to check, not tomorrow either..

tough abyss
#

no idea this is one of the great mysteries of Arma

tough abyss
#

Mystery solved! It was indeed planned improvement and now it is complete @still forum

still forum
#

like. My correct implementation?

#

Or something similar?

tough abyss
#

I dont know details, all I know it was properly fixed this time

still forum
#

I'll believe it after I've tested it :D
Last time they also didn't notice that something was wrong

tough abyss
#

Well, nothing is impossible but it has been fixed by one of the top programmers so...

rugged tangle
#

I need to detect new units on the map, whether Zeus spawned or some other way. What's the most performance-friendly way to do this?

spice axle
#
["Man", "InitPost", {your code goes here}, true, [], true] call CBA_fnc_addClassEventHandler;
rugged tangle
#

@spice axle Thx, I will try this

austere hawk
#

is there a limit how many markers can be placed?

spark turret
#

is there a function to change the inventory space of a container? some mod crates have ridiculously much space for their small size

#

wanna make that storage space smaller, more realisti

drowsy axle
#

@spark turret You need to edit the config's of the boxes, or make new boxes.

cosmic orbit
#

Hi, im looking for a way to set a loiter waypoint for an AI pilot dynamically during a mission, meaning i wont be setting it in the editor, is that feasible?

tribal stump
#

"Setting a loiter waypoint" To me that sounds alot like setting it in the editor 😮

cosmic orbit
#

What I'm looking to use it for is have a blackfish orbit and area, without needing a human pilot, but because the mission is dynamic, I will need to move the loiter point. Tried using Devas' autopilot mod, but it doesn't work as well as the regular loiter waypoint

exotic tinsel
#

How do i allow an injured player to be able to walk backwards while in the drag animation? i do not want to make them invincible while they are dragging either.

radiant needle
#

How complicated is something like ACE arsenal? Is it something that could be replicated with script only?

hollow thistle
#

in theory you could script whole UI...

#

but that would a loooooooooooot of work.

frigid raven
#

I'd love to count infantry and motorized units separatly. So if there is a car with 3 passengers (crew incl.) in it and an infantry squad of size 5 I want the end result of my logic to count 1 motorized unit and 5 infantry units

#

I fiddled around with units, isKindOf, typeOf etc. but I can't really find a good way to do it

#

the source of the calculation should be the result of nearEntities in a marker

#

So in there I have an APC with 10 passengers (4 crew and 6 soldiers)

#
private _entity = (getMarkerPos "counter") nearEntities ["Man", 20] select 0;
count units _entity;

This returns 10. For this example I actually want it to return 0 since all of the infantry are inside a vehicle. Is there something like isInVehicle so I can filter them out?

#

I just found vehicle I think I go with this

ivory lake
#

if (_unit != vehicle _unit) then {InAVehicle = true};

frigid raven
#

👍

ivory lake
#

if you're looking just for a number you can use the alt. count instead

#

_count = {vehicle _x == _x} count _entity

#

that'll return the number of units outside vehicles

frigid raven
#
Syntax:
  getMarkerSize markerName
Parameters:
  markerName: String
Return Value:
Array - in format [a-axis, b-axis], where:
  a-axis: Number - 1/2 width of marker
  b-axis: Number - 1/2 height of marker

Can anybody explain to me why it states 1/2 width of marker ?

#

This is the example

"MarkerOne" setMarkerSize [100,200];
_size = getMarkerSize "MarkerOne"; //returns [100,200]

should return [50,100] according to that explaination of 1/2 of width/height

#

is this a typo in the doc?

hollow thistle
#

I think the author meant like "effective" width

#

because when you define the width you define the radius

frigid raven
#

hm

hollow thistle
#

I'm too pleb to embeed images pepe_screaming

frigid raven
#

so is this the radius or diameter now?

hollow thistle
#

by I think the author meant like "effective" width I meant that the author meant that it returns half of the effective width/diameter

#

This wiki entry is just misleading imo.

frigid raven
#

So getMarkerSize _markerPos select 0 gives me the radius of a circle marker

#

Because I divided that by 2 all the time and got unexpected behaviour therefore

#

_markerPos == _marker

#

sorry

hollow thistle
#

which is exactly the same thing you set by doing setMarkerSize

frigid raven
#

kk

hollow thistle
#

if you want to check if something is in marker area you can just use inArea

#

if you're doing something related to that.

frigid raven
#

I ask because I use this func with the marker radius

private _foundEntities = _markerPos nearEntities ["Man", _markerRadius];
hollow thistle
#

makes sense if you use circle markers.

frigid raven
#

👍

tough abyss
#

A large request but I thought I'd ask. Is there any way to use "firedMan" EH to work with ace grenade throw? IIRC there's some way to do it without adding an additional ACE specific EH. Alternatively is there a CBA/ACE3 EH that does what "firedMan" does? I need the values for projectile, person who fired, weapon used, ammo, magazine, vehicle.

spark turret
#

@radiant needle what do you wanna do? give some fast, restricted access to guns or do you want to create a UI with komplex arsenal?

spark turret
#

If i export a loadout from ace arsenal i get a beatiful ig array. i dont 100% get what each entry is, is there a script that uses this array to equip a unit ? dont really wanna go and try out myself what entry is what in the end
example array of exported ace loadout:


[["rhs_weap_ak74_gp25","rhs_acc_dtk1983","","",["rhs_30Rnd_545x39_AK",30],[],""],[],["rhs_weap_makarov_pm","","","",["rhs_mag_9x18_8_57N181S",8],[],""],["m88_desert_vdv",[["ACE_EarPlugs",1],["ACE_MRE_SteakVegetables",1],["rhs_mag_9x18_8_57N181S",1,8]]],["6B3_RHS_OF",[["ACE_MRE_ChickenHerbDumplings",1],["ACE_WaterBottle",1],["ACE_Canteen",1],["rhs_mag_nspn_red",1,1],["rhs_mag_rdg2_white",1,1],["rhs_30Rnd_545x39_AK",6,30]]],["BWA3_AssaultPack_Fleck",[["rhs_VOG25",9,1]]],"rhs_fieldcap_khk","",["Binocular","","","",[],[],""],
["ItemMap","","TFAR_pnr1000a_1","ItemCompass","ItemWatch",""]]`
still forum
spark turret
#

great thanks @still forum

drowsy axle
#
_loadouts = [
    "O_recon_exp_F",
    "O_recon_JTAC_F",
    "O_recon_M_F",
    "O_recon_medic_F",
    "O_Pathfinder_F",
    "O_recon_F",
    "O_recon_LAT_F",
    "O_recon_TL_F",
    "O_sniper_F",
    "O_ghillie_ard_F",
    "O_ghillie_lsh_F",
    "O_ghillie_sard_F",
    "O_spotter_F",
    "TEC_O_Chief_F",
    "TEC_O_Chief_C_F",
    "TEC_O_Sailor_F",
    "TEC_O_Sailor_C_F",
    "TEC_O_Sailor_M_F",
    "TEC_O_Sailor_SMG_F",
    "TEC_O_Sailor_UAV_F",
    "TEC_O_NavCrew_ATC_F",
    "TEC_O_NavCrew_Purple_F",
    "TEC_O_NavCrew_Brown_F",
    "TEC_O_NavCrew_Medical_F",
    "TEC_O_NavCrew_Green_F",
    "TEC_O_NavCrew_Red_F",
    "TEC_O_NavCrew_Yellow_F",
    "TEC_O_NavCrew_Blue_F",
    "TEC_O_NavCrew_White_F",
    "TEC_O_Helicrew_Navy_F",
    "TEC_O_Helipilot_Navy_F",
    "TEC_O_Diver_F",
    "TEC_O_Diver_EXP_F",
    "TEC_O_Diver_Medic_F",
    "TEC_O_Diver_TL_F"
];

{
    _objectclassname = _x;
    _objectname = getText (configFile >> "cfgVehicles" >> _objectclassname >> "displayName");;
    _objectnameSTR = "Spawn: " + _objectname;
    selectLoadout addAction [_objectnameSTR,{
        _loadout = getUnitLoadout _objectclassname;
        (this select 1) setUnitLoadout [_loadout, true];
    }];
    selectLoadout_1 addAction [_objectnameSTR,{
        _loadout = getUnitLoadout _objectclassname;
        (this select 1) setUnitLoadout [_loadout, true];
    }];
} forEach _loadouts;``` `_objectclassname` is undefined. I cannot figure out why/how.
still forum
#

inside the addAction yes

#

because addAction, the action code is a seperate script

#

I'm sure I already told you that a couple times 🤔

#

addAction lets you pass arguments

drowsy axle
#

omg im stooopid

#

oh wait nvm

#
{
    _objectclassname = _x;
    _objectname = getText (configFile >> "cfgVehicles" >> _objectclassname >> "displayName");;
    _objectnameSTR = "Spawn: " + _objectname;
    selectLoadout addAction [_objectnameSTR,{
        _loadout = getUnitLoadout (_this select 3);
        (_this select 1) setUnitLoadout [_loadout, true];
    }, _objectclassname];
    selectLoadout_1 addAction [_objectnameSTR,{
        _loadout = getUnitLoadout (_this select 3);
        (_this select 1) setUnitLoadout [_loadout, true];
    }, _objectclassname];
} forEach [
    "O_recon_exp_F",
    "O_recon_JTAC_F",
    "O_recon_M_F",
    "O_recon_medic_F",
    "O_Pathfinder_F",
    "O_recon_F",
    "O_recon_LAT_F",
    "O_recon_TL_F",
    "O_sniper_F",
    "O_ghillie_ard_F",
    "O_ghillie_lsh_F",
    "O_ghillie_sard_F",
    "O_spotter_F",
    "TEC_O_Chief_F",
    "TEC_O_Chief_C_F",
    "TEC_O_Sailor_F",
    "TEC_O_Sailor_C_F",
    "TEC_O_Sailor_M_F",
    "TEC_O_Sailor_SMG_F",
    "TEC_O_Sailor_UAV_F",
    "TEC_O_NavCrew_ATC_F",
    "TEC_O_NavCrew_Purple_F",
    "TEC_O_NavCrew_Brown_F",
    "TEC_O_NavCrew_Medical_F",
    "TEC_O_NavCrew_Green_F",
    "TEC_O_NavCrew_Red_F",
    "TEC_O_NavCrew_Yellow_F",
    "TEC_O_NavCrew_Blue_F",
    "TEC_O_NavCrew_White_F",
    "TEC_O_Helicrew_Navy_F",
    "TEC_O_Helipilot_Navy_F",
    "TEC_O_Diver_F",
    "TEC_O_Diver_EXP_F",
    "TEC_O_Diver_Medic_F",
    "TEC_O_Diver_TL_F"
];``` I know that I didn't need to move to _loadouts but I thought why not.
still forum
#

The name of the action are not a script

#

it's a name.

proven crystal
#

im looking for a better way to automatically create a list of units available to a faction. My problem is that in some mods there are units that are apparently buggy or something. some cant be moved or deleted by zeus, or come without weapons. so what i want is to get a list of all units that are also listed i the editor somewhere.

#

atm i get a good list of units, but i still have to create manual blacklists for defect units. thats kind of useless

still forum
#

are the defect units also listed in the editor?

proven crystal
#

nope, thats why id like to switch t that roue

#

i just dont know what attribute that might be

still forum
#

scope entry

#

2 is public. everything lower is not listed in editor

proven crystal
#

ahh nice

#

ill try that, thanks

proven crystal
#

does this look correct?

still forum
#

I can't see anything

proven crystal
#
    private _available = (_condition configClasses (configFile >> "CfgVehicles"));```
still forum
#

ah there's something

#

yes, I guess

proven crystal
#

worked with the first part so far

#

&& (getNumber (_x >> 'scope') == 2)

#

that bit is new now

#

we shall find out in a few minutes

#

appears to do the job! thanks again

austere hawk
mortal nacelle
#

So i've tried setting up a box that gives loadouts, it all works fine, however I cannot get the distance part of it to work. What I am trying to achieve is making sure that if the player is more than 2m away then they cannot see the addaction, but that doesn't appear to be working

#

This is my init on the box

#

if(player distance insbox > 2) exitWith{}; this addAction["Get Instructor Loadout", {[] call LW_InstructorLoadout}];

#

Or do I have to put that in my function?

#

The distance checking that is

#

I tried something different but still no avail..

#
_distance1 = player distance this; 
if (_distance1 < 2) then { 
 this addAction["Get Instructor Loadout", {[] call LW_InstructorLoadout}];  
};```
proven crystal
#

you can instead add the action to an object and give it a range

tough abyss
#

Look up addAction syntax and options

winter rose
#

☝️ You have a "condition" param that can totally be used for this.

spark turret
#

i noticed that if i change a units name (example "Ben Kerry) with the function

 _unit setName ["Ben Kerry","Ben","Kerry"];``` that the name gets correctly displayed if i check it with Zeus, but the ace medical menu keeps the originial name
#

which in this case is nikas isosfiaks or something. any ace function to change the "ace name"?

#

ah just read that setName is singleplayer restricted. any MP function?

exotic tinsel
#

Please weigh in and tell me if this script is good for punishing players for critically injuring other players. I got the killed stuff done but this is giving me a lot of trouble.

params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];                            
private _player_killer = objNull;
private _current_damage = damage _unit;
private _total_damage = _current_damage + _damage;                    
if (lifeState _unit != "INCAPACITATED") then 
{
    if (isPlayer _instigator) then
    {
        _player_killer = _instigator;
    };                
    if (!(isNull _player_killer)) then
    {        
        if (_total_damage >= 0.8) then
        {                            
            if ((getPlayerUID _unit != getPlayerUID _player_killer)) then
            {                                            
                [_unit, _player_killer] remoteExec ["feature_35_fnc_state_2_apply", 2];                                                    
            };            
        };
    };                        
};
sick oar
#

So im trying to create a smoke effect on the tailrotor of a helicopter after an explosion, how should I go about doing it?

tough abyss
#

There is any way i can define functions, like BRPVP_addMission2Action = {...} before the joining player receive JIP?

#

Problem: I run this on server: _trader remoteExecCall ["BRPVP_addMission2Action",-2,true]; but when the joining player receive this JIP, he have not BRPVP_addMission2Action defined.

cold pebble
#

preInit flag?

still forum
#

@tough abyss preInit runs before JIP, remoteExec's before other remoteExec's run before other remoteExec's

exotic tinsel
#

can someone plz tell me why this is happening. it started about a week ago. cant think of code changes that would create this. When it happens, in game the player gets removed from squad and when killed it says error No Unit

this is what shows up a lot in the rpt.
10:06:19 Unit B Alpha 1-1:2 (0x4d450840) - network ID 5:10
10:06:19 - no person

#

@still forum can you help me out mate?

still forum
#

no

#

Maybe someone is reading my todo list 🤔 (well I know they are :D)

#

@exotic tinsel no

austere copper
#

hi all , i have made a Medieval Wooden Fire Torch as a weapon but i can't seem to figure out how to add fire to it . I can add it to projectile but not the actual weapon . any help would be great thanks this is what i got so far : this addEventHandler ["FiredMan", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];

_man = _this select 0;
_weap = _this select 6;
_weap1 = "#particlesource" createVehicle position _weap;
_weap1 setParticleClass "SmallDestructionFire";
_weap1 attachTo [_weap , [0,0,0]];
}];

still forum
#

weapon is a classname

#

you can't get the position of a string

#

you cannot attach anything to the weapon, as it is not an object

austere copper
#

That kills that plan lol ok thanks for the quick response

still forum
#

maybe you can create some particle effect directly with the model and some weapon config? not sure

austere copper
#

Ill play around with it for a couple of days see how I go .thanks for the help

jade abyss
#

@spark turret
https://community.bistudio.com/wiki/setName
Reminder:
Effects of these scripting commands are not broadcasted over the network and remain local to the client the command is executed on.

Execute it (e.g. via remoteExec) on all machines.

still forum
#

Uh..
"ah just read that setName is singleplayer restricted. any MP function?"
I guess he knew that

mortal nacelle
#

This addaction doesn't make sense to me, how would I set the radius

#

I've read the wiki and added an integer after my script

#

but it still hasn't set a radius

ruby breach
#

You're going to have to show us what you're doing for us to tell you if you're doing something wrong. Post your code

mortal nacelle
#

this addAction["Grab Loadout", {[] call LW_InstructorLoadout},2];

ruby breach
#
object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]
#

That's not where radius goes. So that would be your problem

mortal nacelle
#

So could you help me and tell me where I am supposed to put it?

ruby breach
#

After you list the arguments, priority, showWindow, hideOnUse, shortcut, condition

#

You can't not list things and expect later parameters to work. Use the default parameters from the wiki if you don't want to change any of those things

mortal nacelle
#

So like this addAction["Grab Loadout",[], {[] call LW_InstructorLoadout},"",6,false,false,"",true,55];

ruby breach
#

condition must be a string "true", and your radius there is 55, not 2, but otherwise yes

mortal nacelle
#

It says error type number, expected bool

ruby breach
#

You added something to the start, get rid of [],

mortal nacelle
#

at the start of the call you mean?

#

PH

#

OH

#

I see it

#

😂

ruby breach
#
this addAction["Grab Loadout", {[] call LW_InstructorLoadout},[],1.5,true,true,"","true",2];
``` would give you a radius of 2 with all default parameters
mortal nacelle
#

this addAction["Grab Loadout",{[]call LW_InstructorLoadout},"",6,false,false,"","true",2];

#

that works for me ^

#

thank you!

vocal falcon
#

is there a way to switch a player's team via script? so he also respawns after death at the other side ?

surreal peak
#

You can use joinSilent to switch the teams

vocal falcon
#

hmm thx i ll check it out 😃

torn venture
#

So, I was going through a config file generated by Alive, I deleted all 6.8 ammo from a bunch of soldiers' inventories, and now it keeps telling me " Config 'c' after classeventhandler Eventhandlers {" sounds like a missplaced bracket, but when I go to the line it quotes, everything checks out...

surreal peak
#

make sure there are no floating commas or "

still forum
#

also check a dozen or so lines above and below where it tells you

lavish ocean
still forum
#

So new in future are
diag_frameTime and addWeaponWithAttachmentsCargo

ivory lake
#

enableWeaponDisassembly 🤔

ivory lake
#

Oh

#

I was thinking something else entirely

#

like disabling attachment removal

still forum
#

@lavish ocean selectionPosition line 56 was already implemented in 131660

lavish ocean
#

yep but that was slightly different than the original ticket ... update the entry

plain raven
#

anyone aware of any issues with checkAIFeature alternative syntax? Copying it exactly tells me im missing a ; e.g.

bob checkAIFeature "PATH";

I get the error in both a script and the debug console with just that line.

tough abyss
#

what is your game version?

plain raven
#

1.92.... sigh, thanks M242

#

its always me, and its always something silly 😃

#

I'll wait for 1.95 and use the speed command for now

tough abyss
#

or you can switch to dev branch and not wait

dim terrace
#

or RC branch and be ready for 1.94 release which will happen in 2 weeks 😛

tough abyss
#

@cold pebble @still forum thanks.

spark turret
#

whats the best way to have an AI "talk" (play a sound from a file" in multiplayer? right now i use
[_unit, _sound, 30] call CBA_fnc_globalSay3d;
_unit setRandomLip true;
but i would ike to automatically stop the lip movement

tough abyss
#

is there a way to restrict what the arsenal offers? not the ammo box one, just the regular one.

compact maple
tough abyss
#

I've looked into that, seems like you can only use the Add and remove commands on a box

tame lion
#

Is there any command that will write to the server console Window? Kinda like diag_log but not to a file

still forum
#

@tame lion try

tame lion
#

Only thing is out says it's not availablein retail version. I'm not at computer to test it though

#

Thanks for the find though dedmen

still forum
#

yeah might need to try

jovial path
#

how could i add random missions that randomy appear every now and then in a scenario like in exile

noble sentinel
still forum
#

negligible, it's all graphics shader stuff

#

so.. doesn't matter

noble sentinel
#

Great, because I'm making bunker and it would be a shame if some enemy would be shooting from pitch dark for players in high distance

rancid pecan
#

hello how can i change

sturdy cape
#

So, how will all you guys handle the removal of "CreateVehicleLocal" for your effect spawning?triggers? Nearest checks? I am curious!

exotic tinsel
#

How can i get nearest ammo crates using nearesObjets? Im using filter "Ammo" but its not working.

sturdy cape
#

@exotic tinsel nearsupplies maybe?

exotic tinsel
#

na, im using nearestObjects to get trucks and ammo crates. would like to find a way to get both in one shot rather than have to execute two searches.

sturdy cape
#

Well config viewer time for you then Sir.look what its inherited from.should be cargo_base or something

exotic tinsel
#

Ha ReammoBox_F, @Larrow Saves the day again.

exotic tinsel
#

we have an issue where every now and then the squad leader loses squad leader default arma options. its gets passed to another squad member when they are incapacitated but when the Squad leader gets revived they dont get it back. i have a script to check to make sure Squad Leader is actually squad leader and if not then execute this from server but its not working.

params ["_player"];

if ((formationLeader _player != leader _player) && (lifeState _player != "INCAPACITATED")) then
{    
    [group _player, _player] remoteExec ["selectLeader", groupOwner group _player];
};
velvet merlin
#

whats the most slick way to add or remove an element within an array with current sqf means?

cold pebble
#

pushBack, deleteAt, deleteRange?

velvet merlin
#

@lavish ocean on your list is missing selectionNames with LODName filter :P
otherwise setRagdollMode, lockedTarget, diag_server and VON stuff would be neat 😉

lavish ocean
#

lot of thigs added or wip or in tickets aren't there , the list only covers what was discussed when it was made/updated (so just small slice of whole cake)

velvet merlin
#

i praise to the gods for wonders 🙏

#

@cold pebble ty. deleteAt looks good. for adding seems need to reshuffle the contents manually

cold pebble
#

👍

tough abyss
#

@velvet merlin also append set resize + and - oh and pushBackUnique

slender halo
#

hey guys, i've been off arma for a while, did they change something withSourceAnimation ?

#

now it only contains things like Door_1_locked_, Door_1_noSound and nothing happens when you try to animate the doors of a building

velvet merlin
#

@tough abyss who does that help with reshuffle?

noble sentinel
#

Question, I'm creating light sources and I wanted to put parameters into init.sqf so i made something like this

fn_setLight = {

    params ["_light", "_lightBrightness","_lightIntensity","_lightAttenuation","_lightColor"];

    _light setlightbrightness _lightBrightness;  
    _light setlightintensity _lightIntensity;
    _light setLightAttenuation _lightAttenuation;
    _light setlightcolor _lightColor; 
    _light setlightambient _lightColor;

};
[_light, 18, 100, [2,4,4,0,20,20],[0.5,0,0]] remoteExecCall ["fn_setLight", 0, true];
#

every object that should be affected by it has got his in its own init

_light = "#lightpoint" createvehicle getPos lamp_4; 

#

I'm scripting for first time so I'm not really sure If I am doing it correctly

still forum
#

@velvet merlin need a insertAt command? insert element at index?

tough abyss
#

@velvet merlin you asked about "whats the most slick way to add or remove an element within an array with current sqf means?"

velvet merlin
#

doing this now:

for (c = n - 1; c >= position - 1; c--)
    array[c+1] = array[c];

array[position-1] = value;```
#

was just wondering if i missed something along the "new" set with deleteAtIndex, resize and co

tough abyss
#

also append set resize ...

_arr = [1,2,3,4,5,6,7,8,9,0];
_val = -1;
_pos = 4;
_tail = _arr select [_pos, count _arr];
_arr resize (_pos + 1);
_arr set [_pos, _val];
_arr append _tail;
hint str _arr;

is this what you are trying to do? Maybe there is faster way

velvet merlin
#

tx

still forum
#

So you don't need a insertAt command? cuz I could make that be a thing if you did need it

tough abyss
#

it sounds simple but actually it involves millions of checks before you can call that method 😉

velvet merlin
#

thanks for the offer but my case isnt perf critical in any way. not sure if has that common use to make it worthwhile

#

if you look for something useful i would suggest selectionNames with LODName filter

#

and as mentioned earlier going with Dwarden's old list:

setRagdollMode, lockedTarget, diag_server and VON stuff would be neat

rancid pecan
#

@slim oyster i don't want use ,mod 😦

vocal falcon
#

hmm using sector control modules and bleed ticket module, is there an event or so i can hook up to start a "mission end" animation before the debrief screen comes up ?

slender halo
#

what's the best way to programmatically animate doors of a building ?

tough abyss
#

What’s your current approach?

young current
#

User action with animateSource?

slender halo
#

i was using animate + one of the AnimationSource available but it didn't work

#

i noticed UserAction use BIS_fnc_door, but i have two doors and as soon as i call this function on the second door, the geomerty lod of the first one stops until the animation is completly done

#

i can walk througth the door...

#

@young current it is a hangar, the two main doors doesn't have user actions

#

animateSource works but the weird collision behaviour is still here

#

as soon as i execute the command to animate the second door, the first one keeps moving but not its geometry LOD part

young current
#

Geometry part named correctly?

#

Also animate command does not work with animationsource name. It works with animate name.

But in any case animateSource is better performing anyway

slender halo
#

i had the issue on one Apex building and one Vanilla

#

Land_Airport_01_hangar_F

vocal falcon
#

is there an easy way to export loadouts for the CfgRespawnInventory class ?

patent estuary
#

@slender halo are these doors split in the middle aka sliding doors each sliding away from centre?

slender halo
#

yes

#

each sliding door has its own animation

patent estuary
#

and you want em to both open at same time?