#arma3_scripting

1 messages · Page 176 of 1

hallow mortar
#

Inside the top of a Tanoa office tower is OK

open hollow
#

thank you

hallow mortar
#

Right, I've reintroduced the aircraft carrier and now there are issues.
There are some safe spots near or even on the carrier, but generally, the aircraft will reject any move command that sends them close to the carrier.

#

Well, the middle levels of an ATC tower are also apparently problem spots. Literally inside a mountain is OK though!

#

Demo mission. Auto-spawns 2 aircraft which attempt to move to the 2 invisible wall objects. You'll know they're rejecting if they immediately start to turn; if they've accepted the command they'll continue flying straight. Function should be pretty simple to figure out if you want to spawn more on the fly.

#

Clearly there is some kind of destination validation for move, but I have no idea what logic it operates on, because some seemingly ordinary positions are rejected, while positions you'd expect to be obviously bad are accepted fine.
This has been a very annoying voyage of discovery and I look forward to refitting several systems to use waypoints instead in the morning.

hallow mortar
real tartan
#

is there a way to setObjectTextureGlobal with custom ratio ?
e.g. I have square texture 1:1, but want to keep ratio of picture on wider TV screen 16:9, so it does not stretch

lime rapids
real tartan
lime rapids
real tartan
#

you see how WIDE it is, want to keep ratio of picture to be square on wider TV screens

lime rapids
#

ah pretty sure best way to do that is get the texture then combine your image to fit in the black space then set the entire texture to cover it but thats propably better answered at #arma3_texture

astral bone
#

The custom option has sounds ya can play in multiplayer. Any ideas on how/if ya could play those sounds via script?

agile pumice
#

would it be possible to use a different model for ropes?

next kraken
#

i wonder if its possible to show a defined name of a player in multiplayer within the radiochatter conversations instead of the players name

#

i can change the callsign, which is shown in mp, but if i setName or Identity instead after the callsign the player name is shown in the radio chatter conversation

real tartan
#

is there a way to create global variable from string?
from "TAG_fn_functionName" to TAG_fn_functionName ?

#

trying to create bunch of public variables from array

private _array = [ [ "TAG_var1", 0 ], [ "TAG_var2", "zero" ] ];
// want to iterate and create 
TAG_var1 = 0;
TAG_var2 = "zero";
south swan
#

missionNamespace setVariable ["TAG_stringName", 123]; is equivalent to TAG_stringName = 123; blobdoggoshruggoogly

hallow mortar
#

trying to troubleshoot why my airstrike call-in is missing the laser aim point, only to discover that it's because the laser designator target's vertical positioning doesn't work properly over/around water 🙃

pallid palm
#

hello Arma 3 awsome people: Would this be the correct format ?

#
_randomSound = selectRandom ["ComeGetSome","LetsRock","ComeGetSomeMF"] remoteExec ["playSound"] call BIS_fnc_selectRandom;
hallow mortar
#

Have you read the wiki pages for any of the commands you've put in that code?

pallid palm
#

well kinda yes i did a sim thing in a EH

#

with text but ...

#

im not sure about sound

hallow mortar
#

Okay, well, you should look a little closer at this and think about the logic of what you're doing here. Forget about whether it's sound or text, just read it from left to right and think about what's happening.
You start with _randomSound =. That means everything that follows up until the next ; is going to be used to produce some result, which will be saved into the variable _randomSound. What exactly do you want to be saved into this variable?
You follow up with selectRandom [ ... ]. OK, so in theory you could be saving the result of that selectRandom, which will be one of those Strings (pieces of plain text). BUT THEN, you throw in remoteExec. What is this doing here? Think about what remoteExec expects as its arguments.
Then to top it off you've got BIS_fnc_selectRandom. What is the purpose of this? You've already selected a random string. What do you want BIS_fnc_selectRandom to do (leaving aside that it is completely superseded by the faster selectRandom as a command)? Think about what you're passing to it as arguments and what it expects.

pallid palm
#

ahhh ok i see

#

nice thx you m8 i understand now

#

very nice

#

thx you

#

awsome that realy helps thx again

#

i just didnt want to blow up my PC thats why i asked, good thing i did right,,,,,,

#

you guys are the Best

hallow mortar
#

You wouldn't blow up your PC by doing that. You'd just get a script error and the thing you wanted to happen, wouldn't.

pallid palm
#

yes i know i was just kidding lol

#

thx again @hallow mortar

#

you guys are so awsome thx so much

#

works awsome thx you again @hallow mortar

#
_randomSound = selectRandom ["ComeGetSome","LetsRock","ComeGetSomeMF"] remoteExec ["playSound"];
#

correct format

#

totaly awsome WooHoo Arma 3 hell yeah WooHoo

hallow mortar
#

It'll probably work, I guess, but kind of by coincidence rather than because it's correct

pallid palm
#

whats coincidence ?

#

maby i should explane more

#

the sounds are defined in the Description.ext and that line of code is in a EH

hallow mortar
#

....OK.
Follow the logic, left to right. In execution order:
_randomSound = - whatever is the final result from everything after this, will be saved to this variable.
selectRandom [ ... ] - choose a random string.
remoteExec ["playSound"] - send playSound, with whatever's before this as its argument (sound name to play).
remoteExec is the last command that gets executed. It takes the randomly-selected string, and returns either nil (if there was an error) or a JIP ID string (if it succeeded). Since this happens last, it's the return from remoteExec that gets saved to _randomSound.

#

Now technically it will do what you want, I guess, because it does choose a random sound name, and then tell everyone to play that sound.
BUT, what is _randomSound = doing here? What is its purpose in this code? (I would like you to actually answer this question with what you think it's doing.)

pallid palm
#

maby i should explane more
the sounds are defined in the Description.ext and that line of code is in a EH

hallow mortar
#

I understand that. I would like you to read what I wrote, and answer the question at the end.

pallid palm
#

well the EH happends when a enemy get KIA and i have the sounds play

#

would like to see the EH ?

hallow mortar
#

No, I want you to read what I wrote, and answer the question at the end.

pallid palm
#

purpose in this code? is to have the sound play when a enemy gets KIA

hallow mortar
#

No. Look. I know what the code overall is supposed to do.
I am asking about specifically this part of it:

_randomSound =```
What purpose do you think this has _within_ the code? What does it do? What is it supposed to do?
pallid palm
#

its just away for me to call the sounds in the EH

hallow mortar
#

So you don't know. Okay. Let me try to explain then.

pallid palm
#

ok

hallow mortar
#

It is a variable assignation. When you do this:

_someVariableName =```
What this means is "the variable `_someVariableName` now contains <the result of whatever code comes after>". You are assigning this value to the variable with that name.
pallid palm
#

yes

#

in the EH yes

hallow mortar
#

So what do you need this variable for? What is it used for, specifically?

pallid palm
#

to call the sounds from the EH

hallow mortar
#

More specifically.

pallid palm
#

ummmm

#

ok let me see umm the EH fires when a enemy gets KIA , so what i want is the sound to play when the EH fires

hallow mortar
#

You are thinking at the wrong level. I am talking within this line of code.

pallid palm
#

oh ummm

hallow mortar
#

The purpose of a variable is to save a value, so it can be used again later. This line of code creates the variable and sets its value. Now, where is it used?

pallid palm
#

in the EH useeffects part

#

mayb if i show you the EH it will explane more ok

hallow mortar
#

Look I'm not asking because I don't know how this works, I'm asking because you don't know and I'm trying to get you to figure it out

pallid palm
#

oh ok ummm so,,,,,

#

so i need to get rid of the variable right ?

hallow mortar
#

Strictly speaking, you don't need to. It's not actively causing harm. It's just completely pointless, because you're saving a useless value and then never doing anything with it again.

pallid palm
#

ok i do away with the variable

thin fox
#

Do you know how to play a sound by script? like a simple one or any

#

start with that

pallid palm
#

yes

thin fox
#

so, what are you trying to do with your script? select a random sound?

pallid palm
#

yes

thin fox
#

so the variable is for that (?)

pallid palm
#

yes

#

its inside a EH

hallow mortar
#

It absolutely does not matter that it's inside an EH.

thin fox
#

so, one command per line, don't mix them

pallid palm
#

ok nice

thin fox
#

read further the biki pages

#

check examples

pallid palm
#

ok will do

thin fox
#

try simpler codes

pallid palm
#

i like simple

hallow mortar
#

The code that's there works and is simple. I'm trying to get you to understand why, and why you don't need that variable.

pallid palm
#

so can i show you my EH and can you tell me something about it ?

south swan
#

we have 5 pages of talking about a single line. Imagine seeing entire script?

pallid palm
#

script is like 10 lines

hallow mortar
#
selectRandom ["string1", "string2"] remoteExec ["playSound"];```
Read it left to right.
We select a random value, from the array. Now what we have "in our hand" is the selected string. Next, we read `remoteExec`. We already have the string in our hand, so we give it to `remoteExec` as its left-side argument. Then we continue to the right-side argument for `remoteExec`. Then we're done. Mission accomplished. `remoteExec` reports (returns) whether it succeeded or failed.
The `_randomSound` variable is not needed. If we _did_ have `_randomSound =` at the start of the line, _all it would do_ is make that variable contain the final result of the whole line. Which is `remoteExec`'s report on whether it succeeded or failed. The variable would be _created_ or _set_ in this line, but not _used_.
pallid palm
#

ahhh ok i see i understad now

#

ok cool ill change the line

#

in the EH

hallow mortar
#

We could involve a variable, if we wanted to break this up into multiple lines. Like this:

_randomSound = selectRandom ["string1", "string2"];
_randomSound remoteExec ["playSound"];```
See how in the first line, we _create_ the variable, and make it contain the result of `selectRandom`.
Then on the second line, we _use_ the variable we created before, as the left-side argument for `remoteExec`.
This is useful for more complex code because it makes it easier to read, and it means we can use the variable's value again later, if we need to do more than one thing with it.
But your code is so simple that we can do it all in one line, and no one will get confused, and we don't need to use any of the values again later.
pallid palm
#

so that means i dont need the variable in the text chat line eather ummm ok

#

ohhhhh ok i realy see now awsome m8

#

wow thx @hallow mortar

#

awsome

#

where would i be with out you guys omg

#

thx you so much m8s realy love you guys

#

i do think if i would show you my EH script it would of saved lots of text lol

#

but its all good

pallid palm
#

sooo this ?

#
 _randomSound = selectRandom ["ComeGetSome","LetsRock","ComeGetSomeMF"];
[_randomSound] remoteExec ["playsound", _instigator];
faint burrow
#

Swap _instigator and _randomSound.

pallid palm
#

copy

#

thx m8

#

wow thx so much

#

man you guys make my mission so good thx you guys so so so much

#

ok i fixed it up there see

#

so now with you guys help i got 10 things right WooHoo Arma 3

#

lol

#

i hope i dont run out of things for you guys to fix lol he he

#

i dont know how to thank you guys any better way, but to say you guys are Awsome

pallid palm
#

holy cow my mission runs way way smoother cuz of you guys thx m8s WooHoo Arma 3 hell yeah thx guys love you guys

west umbra
#

Hello, I am encountering an issue with the following eventHandler:

this addEventHandler ["HandleDamage", { 
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit", "_context"];
}];

It only returns an empty string "" for _selection and _hitPoint. Has the behavior of this event changed?

faint burrow
pallid palm
#

holy hell that a lot of params

#

so even tho i dont know much looks like to me that you have params but nothing else

#

if im correct you need to use them params

wind flax
#

Does anyone know a simple way to determine if a player has aborted a reload animation?

pallid palm
#

jeez i dont know m8 sorry

bleak valley
#

hello !

I'm working on an MP operation on dedicated, and I use two ways for people to get back in the frontline when they respawn :

  • a teleporter to their Squadleader
  • a teleporter to an object (for the Squadleader)
    the teleporter to the Squadleader works (a dozen use now), but I'm not so sure about the teleporter to an object.
    Teleporting to the object is the easy part, but I need that object to move when the squad goes through certain points in the mission.

Right now, what I'm using is quite (too ?) simple :

  • a teleporter to "ee"

  • In a trigger, set to any player present, not repeatable,
    deleteVehicle ee; ee="Land_Cyt_FE_Pipe_round_vent" createVehicle [2048.304, 6322.103, 0.012]; (coordinates are copied from an object I placed in editor)

Do you see any bug coming ?

[

  • Why not a moving respawn ? I need them to respawn at the base.
  • Why not teleporting the Squadleader yourself as Zeus ? The map I use (Cytech) has issues when you teleport people "manually".
  • Why not moving the object yourself as Zeus ? Because the map is fully inside, so moving objects on big distances is rather complicated.
    ]
warm hedge
wind flax
warm hedge
#

So a Mod, indeed gestureChanged EH or such can work then

hallow mortar
bleak valley
hallow mortar
#

Probably make the trigger server-only as well, so players can't mess it up by having their copy of the trigger activate at different times (e.g. JIP)

pallid palm
#

whatever setPos getMarkerPos "markername";

bleak valley
pallid palm
#

copy that m8

lime rapids
#

how does one go about creating a vector and making it run from one object to another? im looking through a few vector commands and cant see how you create one

hallow mortar
#

A vector is a mathematical concept, a set of positional or directional instructions. Any 2D or 3D position or direction, expressed as [x, y] or [x, y, z] is a vector. You can't really "create a vector", it's not an entity.

#

You might be thinking of drawLine3D?

warm hedge
#

Do you mean (getPosWorld A) vectorDiff (getPosWorld B)?

lime rapids
#

not really meaning create more so define but what im trying to do overall is get the direction of one position in a 3d space and then use setvelocity to send another object directly to it

hallow mortar
#

You probably just want vectorFromTo and a dash of vectorMultiply then.

lime rapids
#

and afiaik getdirmodelspace doesnt include z co ordinate

warm hedge
#

Or my solution

#

What is your usecase

lime rapids
#

thanks ill have a look and try learn i guess best thing to visualize vectors is drawline?

lime rapids
lime rapids
#

holy damn thats so much easier than the abomination i had with setvelocity transformation and looks nicer thanks polpox and nikko

tough abyss
lime rapids
#

is there a way to change the colour etc of a volume light? ive tried set light colour and setlight ambient

little raptor
lime rapids
little raptor
#

Oh you said color. I'm blind (I read change volume of light) 😂
Well setLightColor does change color

lime rapids
#

that doesnt seem to have a paramater for colour

#

nvm

#

weird it doesnt seem to change it ill change a few things and see

little raptor
lime rapids
#

nope

#

though i am using "a3\data_f\volumelight_searchlight.p3d" and not a normal lightsource

little raptor
#

Well use setLightIntensity

lime rapids
little raptor
#

Did you use setLightConePars to adjust it?

lime rapids
#

nope havent touched it though it is attached to an object

little raptor
#

Use setLightConePars to set its volume and fade

#

Then use setLightIntensity to change its brightness

buoyant hound
#

Hey guyZ
I have to show a video clip on billbord via addaction on mp , for an dedicated server , no matter for jips.

Anyone to guide?

buoyant hound
little raptor
#

also the volume shape is backwards for some reason meowsweats

lime rapids
ivory lake
#

yeah you'd have to make your own light volume if you want to change the colour of it

lime rapids
lime rapids
#

(subdivision modifier skill issue on my end)

pallid sequoia
#

I have an issue with my script I wrote. I have a list of songs that I play on a boombox object. It acts just like a radio.
My problem is that exactly after 24 seconds has passed, the next song overlaps and plays over each other until I stop the radio.

playRadio.sqf

_song = (_songList select 0);
_songLength = (_songList select 1);

[boombox, [_song, 60, 1]] remoteExec ["say3D"];

boombox remoteExec ["removeAllActions"];

[boombox, ["<t color='#FF0000'>Stop Radio</t>",
{
    _pos = getPosATL (_this select 0);
    _dir = getDir (_this select 0);
    deleteVehicle (_this select 0);

    boombox = "plp_bo_Boombox_Mvl" createVehicle [0, 0, 0];
    boombox setPosATL [_pos select 0, _pos select 1, _pos select 2];
    boombox setDir _dir;
    boomboxH remoteExec ["terminate"];

    [boombox, ["Play Radio", {boomboxH = [] execVM "playRadio.sqf"}, [], 6, false, true, "", "_target distance _this < 2"]] remoteExec ["addAction"];
}, [], 6, false, true, "", "_target distance _this < 2"]] remoteExec ["addAction"];

_waitTime = time + _songLength;
waitUntil { time >= _waitTime };
boombox remoteExec ["removeAllActions"];

boomboxH = [] execVM "playRadio.sqf";

initPlayerLocal.sqf

["<t color='#00FF00'>Play Radio</t>", {radioH = [] execVM "playRadio.sqf"}, [], 6, false, true, "", "_target distance _this < 2"];```
warm hedge
#

What do you mean by

until I stop the radio
in this context? Until use Stop Radio?

pallid sequoia
#

that is what "stops" the radio

warm hedge
#

And how long these "song"s?

pallid sequoia
#

they are all different lengths

warm hedge
#

Then set _songList length accordinly

pallid sequoia
#

the way they are supposed to be calculated is in the waitUntil { time >= _waitTime }; function

faint burrow
#

Well, you set out that all sounds have the same length -- 25.

pallid sequoia
faint burrow
#

You wrote that sounds have different lengths, but in the code you indicated the same one, which is what you wait. That's the reason why exactly after 24 seconds has passed, the next song overlaps and plays over each other.

pallid sequoia
#

but in the code you indicated the same one
what do you mean about this?

faint burrow
#

The first line in your code contains the same number -- 25.

pallid sequoia
#

that's true... hmmm. those are supposed to define the volumes for each song though

#

i will try to delete those

faint burrow
#

Regardless of the selected sound, the code waits the same time.

pallid sequoia
#

that's true, i feel stupid now. let me test it

#

that works lmao.
now it starts to throw this error though

atomic niche
#

code? the code inside your waitUntil no longer returns true/false

faint burrow
pallid sequoia
#

I see that, however the value it is suppsoed to return technically is a bool?

atomic niche
#

if waitUntil { time >= _waitTime }; is still your code then _waitTime is probably undefined?

pallid sequoia
#

so if it reads that a song is 180 seconds long, and it compares that to time elapsed... it should be continuing the script as intended after said time is elapsed

pallid sequoia
faint burrow
#

Post your _songList.

pallid sequoia
#

i just converted all the lengths to seconds

warm hedge
#

It's a folder, not _songList

pallid sequoia
#

let me test this with all of the 25's replaced with the seconds in time for length

warm hedge
#

We're asking for your literal code

atomic niche
#

that wont fix your error

pallid sequoia
#
_song = (_songList select 0);
_songLength = (_songList select 1);

[boombox, [_song, 60, 1]] remoteExec ["say3D"];

boombox remoteExec ["removeAllActions"];

[boombox, ["<t color='#FF0000'>Stop Radio</t>",
{
    _pos = getPosATL (_this select 0);
    _dir = getDir (_this select 0);
    deleteVehicle (_this select 0);

    boombox = "plp_bo_Boombox_Mvl" createVehicle [0, 0, 0];
    boombox setPosATL [_pos select 0, _pos select 1, _pos select 2];
    boombox setDir _dir;
    boomboxH remoteExec ["terminate"];

    [boombox, ["Play Radio", {boomboxH = [] execVM "playRadio.sqf"}, [], 6, false, true, "", "_target distance _this < 2"]] remoteExec ["addAction"];
}, [], 6, false, true, "", "_target distance _this < 2"]] remoteExec ["addAction"];

_waitTime = time + _songLength;
waitUntil { time >= _waitTime };
//sleep 1000;
boombox remoteExec ["removeAllActions"];

boomboxH = [] execVM "playRadio.sqf";
#

no more error

warm hedge
#

And you still have 25 seconds error from this code?

atomic niche
#

...

pallid sequoia
#

nope

#

earlier i had all of the numbers at the top set to 25

warm hedge
#

Then I am just not sure what is your issue right now

pallid sequoia
#

I may have figured it out by converting the song length in minutes to seconds and putting that as the parameter in the array

atomic niche
pallid sequoia
#

yes. only because I THOUGHT the array took the same first value as in CfgSounds which is volume

#

so I tried to set all song volumes to 25

atomic niche
#

that shouldn't fix that error but anything is possible in Arma ig ¯_(ツ)_/¯

pallid sequoia
#

there is no more error as far as the waitUntil function is concerned

warm hedge
#

Do you mean you still have the error or not?

pallid sequoia
#

i think it's because it could not pull any values from the array

#

no

#

just confirming if songs are overlapping, listening rn

#

seems to be working! i think i got one of the times mixed up, but yeah that code works with the lengths for songs set in the array

agile pumice
#

not even by modifying configs and model paths?

buoyant hound
#

Hey , about playing vid on dedicated server for all players

_video = "\a3\missions_f_exp\video\exp_m04_v02.ogv";
_screen setObjectTextureGlobal [0, _video];
[_video, [10, 10]] remoteExec ["BIS_fnc_playVideo", ([0, 2] select isDedicated), false];

Do its ok?
Whats the [10,10] mean on first part ?
It means video size?
And about [0,2] select isDedicated 0 mean

atomic niche
little raptor
# buoyant hound Hey , about playing vid on dedicated server for all players _video = "\a3\missi...

Whats the [10,10] mean on first part ?
See the docs on BIS_fnc_playVideo
size: Array of Numbers - (Optional, default [safeZoneX, safeZoneY, safeZoneW, safeZoneH]) screen size in format [x, y, w, h]
so in this case it just plays the video on position [10,10] of the monitor, which is very much outside the screen so you won't really see it (you just want it on an in-game object, not your monitor)

And about [0,2] select isDedicated 0 mean
well you've written it wrong. it should be [0,-2] select isDedicated
it means pick number 0 when isDedicated is false, and -2 when isDedicated is true
as for what 0 and -2 mean, read the docs on remoteExec
0 means all players
2 means server only
-2 means all but server

buoyant hound
#

Hello
_video = "V\r.ogv";
_screen = nr;
_screen setObjectTextureGlobal [0, _video];
[_video] remoteExec ["BIS_fnc_playVideo", ([0, -2] select isDedicated), true];
This will play vid on monitor And not on billbord , what change i need to apply

fleet sand
buoyant hound
fleet sand
buoyant hound
fleet sand
buoyant hound
fleet sand
buoyant hound
#

I need hold action to play vid on my controll

#

Hold action are placed on data projection

fleet sand
# buoyant hound .

Try executing that code that you posted in console and see if it plays on billboard if not then you are not refrencing the billboard correcly.

buoyant hound
quick sky
#

What script can i use to play a .ogg surrounded and also control the volume?

faint burrow
real tartan
#
private _code = [ {}, compile preProcessFile _path ] select ( fileExists _path );

I am getting warning that file in path does not exist

faint burrow
#

This is because preProcessFile causes that.

hallow mortar
#

Can you check and report the actual contents of _path? According to fileExists documentation, it can return true if the given path is an empty string, which would cause preProcessFile to receive an empty string and then presumably fail.

south swan
#

it should compile before selecting, though?

hallow mortar
faint burrow
#

A possible problem with using select instead of if is that the array elements are calculated and then one of them is selected, so even if file doesn't exist, compile preProcessFile _path is executed, which causes a warning.

south swan
#

private _code = if (fileExists _path) then {compile preProcessFile _path} else {{}}; should do the lazy trick, i suppose?

faint burrow
#

Agree.

tall slate
#

Is there any command to make screen go full black?

proven charm
tall slate
#

The worst part it is I want to make text on black background and I feel like the last idiot to even ask for this. Thanks man too much hours in front of the computer. I think I started losing IQ.

proven charm
#

sounds like you got the answer 🙂

tall slate
#

Yeah thanks 😉

cobalt path
#

I am trying to make a "safezone" script. Any ideas how to make it work?

player addEventHandler ["HandleDamage", {

params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit", "_context"];

if ( (_this select 0) distance2D safespawnmfv1 < 100 )
then
{
_source setCaptive true;
_source call ace_medical_fnc_fullHeal;
_unit call ace_medical_fnc_fullHeal;
}
else
{
};
}];
tulip ridge
cobalt path
#

I am not sure, I am using official ace mod, same as I used years prior. Just "ace"

tulip ridge
#

Or whatever unit you want to heal
_unit will be the person that got hit, _source will be whatever unit / vehicle damaged them

tulip ridge
cobalt path
#

Gotcha, but I am pretty sure units aint getting setCaptive either

tulip ridge
#

Also in general, you should avoid using HandleDamage on units with ace medical, it can mess with stuff

You can just use HitPart if you don't need to modify the damage being dealt

granite sky
#

allowDamage false probably works with ACE anyway.

hallow mortar
# cobalt path Gotcha, but I am pretty sure units aint getting setCaptive either
  • are you sure the "if" is actually activating? Add a systemChat or something to make sure.
  • setCaptive doesn't automatically have any visible effects. It doesn't handcuff the unit or anything. It just means they're treated as a civilian for aggression purposes. ACE has its own captivity systems if you want more than that.
granite sky
#

Assuming that you want to turn off the setCaptive when they leave the area you'll need something else anyway.

#

Main thing setCaptive does is stop AIs shooting at the unit, but they may not do so immediately.

cobalt path
fleet sand
granite sky
#

There's no cuffing in there.

hallow mortar
#

Yeah so you want the ACE methods of setting captivity, or to put them in a cuffed animation yourself. The vanilla setCaptive command doesn't do what you want.

cobalt path
cobalt path
#

Now about fullhealing person who was shot, if the function doesnt yet exist, what do I use?

granite sky
#

Running fullHeal in the middle of handleDamage is almost certainly not going to do what you want either.

cobalt path
#

Also ye I will switch to HitPart

granite sky
#

Depending on your ACE settings, they might just die before any of your attempted interference kicks in.

#

And you can't un-kill a unit.

#

If you want players to be prevented from dealing damage from a zone, maybe better to delete their projectiles.

cobalt path
#

Nvm I figured it out I think. Thanks!!!!

hallow mortar
#

It isn't my comment. But those arguments for the ACE fullHeal function refer to 0. the medic unit to be credited for the heal, and 1. the unit to be healed. In your case they are probably both the same unit. _unit in Dart's example is just a placeholder for "whichever unit you want to heal".

tulip ridge
#

There's also a variable you can use, but it's only needed for like scripted health stuff

tough abyss
#

But then you change EVERY rope in the game. >>>config_editing

agile pumice
#

not too concerned with that

tough abyss
#
class CfgVehicles
    class All;
    class Rope: All {
        model = "\A3\Data_f\proxies\Rope\rope.p3d";
    };
};
pallid palm
#

Hello: How do i detect, if all players are in a trigger Area? each player is named p1 p2 p3 p4 and so on up to p10 , i cant seem to get it right

#

and also if your in spectating mode are you still a player

faint burrow
pallid palm
#

ahh ok yeah i saw that befor thx m8

#

awsome man thx

jade abyss
#

Also a "no": You can not change the elasticity of it or any other stuff on it 😦

pallid palm
#

works perfectly @faint burrow thx you so much again

#

the hole purpose was to have a lose condition, to this 1 mission i made, so the trigger detects if all players are in the trigger area, then the trigger execVM the OutroLose script

#

if all tickets are spent for a player then the player would go into spectating mode as they die,, they do respawn 1 final time, and they get moved to a marker far from the objective, This allows players that are still alive to complete some Tasks to add respawns to each player, then each player would respawn, as Normal at the respawn_west Marker.

#

so in the task if 2 respawns are given, each player would get 2 more respawns

#

and so on

#

so no one dies till all respawns or tickets are spent

#

you just get held in limbo lol

#

i wish i could remember all this C++ stuff eveyone says im old, but i feel like im 30, and ill be 64 on Feb 17 WooHoo ill be playing ArmA3 for my B-Day WooHoo

#

What a great Game

#

really thx to all you guys that helped me make my missions awsome, thx you guys So Much

teal vine
#

is anyone experiencing animations being buggy and freezing when using switchMove, playMove, etc?

#

especially when i'm trying to do transition animations with multiple anims

warm hedge
#

Post your code, screens, more info

teal vine
#

im just doing a basic anim loop.

TTS_fnc_runAnimations = {
    params["_unit", "_animationsArray"];
    _unit setVariable ["LastAnimation", _animationsArray select (count _animationsArray) - 1];
    _unit disableAI "ANIM";
    if(_unit == player) then {[0, -1, false, false] call BIS_fnc_cinemaBorder;};
    _unit switchMove (_animationsArray select 0);
    _animationsArray deleteAt 0;
    {_unit playMove _x;} forEach _animationsArray;
    _unit addEventHandler ["AnimDone", {
        params["_unit", "_anim"];
        if((_unit getVariable "LastAnimation") == _anim) then {
            _unit enableAI "ANIM";
            _unit switchMove "";
            if(_unit == player) then {
                [1, 3, false, false] call BIS_fnc_cinemaBorder;
                player switchMove "AmovPercMstpSlowWrflDnon";
            };
            _unit removeEventHandler["AnimDone", _thisEventHandler];
        };
    }];
};
//Run code
[jay, ["Acts_welcomeOnHUB02_AIWalk"
,"Acts_welcomeOnHUB02_AIWalk_1",
"Acts_welcomeOnHUB02_AIWalk_2",
"Acts_welcomeOnHUB02_AIWalk_3",
"Acts_welcomeOnHUB02_AIWalk_4",
"Acts_welcomeOnHUB02_AIWalk_5",
"Acts_welcomeOnHUB02_AIWalk_6"]] call TTS_fnc_runAnimations;
#

but basic briefing animations like

harris switchMove "Acts_A_M01_briefing";

have a lot of freezing, the AI would randomly freeze while in animation for multiple times

#

it's not perfect code but im just trying to make a function to run multiple animations smoothly

#

i never had this animation issue long time ago, just got back to arma scripting and i'm experiencing it now.

fyi i don't have any mods installed other than developer addons that help me with 3den and stuff

#

and also when i played the arma 3 main scenarios, i do encounter the ai having animation freezes during cutscenes as well.

#

some anims run smoothly while others freeze a lot

warm hedge
#

Well desclaimer because this question might be seriously stupid, but this is a serious question though, do you run Arma 3 smoother than 60FPS?

teal vine
#

yeah at around average 165 fps

warm hedge
teal vine
#

a 100%, that's what i am experiencing, and it's annoying because i can't properly set up cutscenes without the anims freezing every 10 seconds

#

is there a way to lock arma 3 at 60 fps?

warm hedge
#

Enable Vsync

teal vine
#

it's actually enabled already for me

warm hedge
#

You sure in-game one is

teal vine
#

doesn't vsync just limit the game to the refresh rate of ur monitor?

#

because mine is at 165hz

warm hedge
#

I don't recall ingame FPS limiter or something does more than 60

#

Try it at least

teal vine
# warm hedge Try it at least

ok well vsync doesn't work cuz of the refresh rate of my my monitor.

so i locked the fps using nvidia control panel

#

and anims are working fine... for now

timber owl
#

Hello, try to create a dog and have it follow me with this command _dog = "Alsatian_Black_F" createUnit [getPos player, player, "", 0, "NONE"];
while {alive _dog} do {
_dog moveTo (getPos player);
sleep 1;
};
but he doesn't follow me, can someone help me?

timber owl
proven charm
#

well you must use the first syntax of createUnit and give valid group: _dog = group player createUnit ["Alsatian_Black_F", position player, [], 0, "NONE"];

hallow mortar
last crystal
last crystal
#

Help :<

drowsy geyser
#

is it possible to disable player injured sound effects? i mean if damage player > 0.5

last crystal
#

Rephrasing the question…

#

Still trying to…..

last crystal
#

I want the drone name to be incorporated inside the scope of the bomb name that way the bomb knows which drone to attach itself to

#

FINALLY

charred monolith
#

Hi ! I have currently two(ish) problem because of a script I made.
Context :
I've made my own version of the script so that player can sit, it use Game Logic as object to sit, so that I can put it everywhere I want but there is some bugs :

1 - The player animation doesn't work for everyone, when the player sit they see themselves using an animation while sitting (Intended) but everyone else just see them standing up (In the image) why is this happening ? I use switchMove that as global Execution, everyone should see the animation.

1.5 - There is a another animation bug where the player is constantly in falling animation while sitting (I think this one and issue one are related

2 - Because I use the script high in the air (we use an aircraft as an HQ) we have the sound of people falling from the air, making so much noise. What could cause this ?

(Script provided in a pastebin due to the size of it)
https://pastebin.com/n4jZmYSG

proven charm
last crystal
last crystal
#

lmk if u need me to rephrase ill try

#

ill send another ss so u can see

proven charm
#

so if you know the bomb variable name you can just use that in the script you posted

south swan
#

i read the question as "i have 5 drones and 10 bombs, how do i make a single script to work on all of them without manual changes" blobdoggoshruggoogly

last crystal
#

because as i place bombs they update their name

#

as i place drones they too as well just not the script itself

south swan
#

sigh, maybe just create bombs with the script running on the drone and don't torture yourself?

last crystal
#

that IS the drone script LOL just not all of it

#

its an autonmous drone

#

suicide diver

proven charm
#

I get that

last crystal
#

im extremely new to this btw :))

#

like two days ago new :/

south swan
#

you don't need to place literally everything in the editor. You don't place bullets players would shoot

last crystal
#

i see what you mean but in this way i can update wich explosive type is used

#

and have them saved as compositions

#

hold on lemme gather my thoughts im sorry

proven charm
#

but you randomly pick a bomb and put to random drone?

last crystal
#

i can even do a human being if i wanted

#

i already did....

#

he died on impact..

#

But the reson why im doing it like this

#

is because i want the capability of detroying the ammunition for the drones

#

their for resulting in once suicide drones becoming reconnasaince drones

#

but im going to gather the info you guys told me and try that out

last crystal
#

but ilyk and get back to u 👍

proven charm
#

im curious where you got that script if your new?

last crystal
proven charm
#

ok

last crystal
#

I’m working on a singles player project with two AI commanders(HAL)

last crystal
#

But by all means is this my first time coding just my first time getting into “mod dev” and that sort of stuff…

#

but even then I never built anything with the prior skills I have.

last crystal
# proven charm ok

That way when a drone spawns in it fetches the proper bomb stored in a hanger.

#

And if the enemy commander finds the depot that can actually call in mrls and have it destroy.

#

Thus making the drones useless for attack missions.

#

destroyed*

proven charm
#

ok well i hope you find the necessary info from the coding tutorials to be able to do all that

last crystal
#

Ty and wish meh luck cause my dum ass gonna need it

last crystal
proven charm
#

patience is one tip i can give you 🙂

blissful current
#

Is there a way for EH to "count" how many times a event happened? I want to have a unit say something every time he is healed. But not a random thing. I want him to say it like this Line 1 < Line 2 < Line 3. So it's a progression if that makes sense?

this addEventHandler ["HandleHeal",{
    params ["_injured"];
    _injured spawn {
         sleep 7;
         _this setHit ["legs",0.5];
         _this sideChat "I've been healed 1 time.";
    };
}];
#

Right now he will just say this one line. Maybe I could use if then statement? But I don't know how to keep track of how many times he was healed?

pallid palm
#

why do you need to keep track of how many times he was healed

dusk gust
#

Just with a setVariable

last crystal
#

Yes, you can achieve this by using a variable to count the number of times the event has been triggered and then use that count to control the progression of the unit’s dialog. Here’s how you can implement it:

Example Script

// Add a variable to track the number of times the unit has been healed
this setVariable ["healCount", 0];

// Add an event handler for "HandleHeal"
this addEventHandler ["HandleHeal", {
params ["_injured"];

// Increment the heal count
private _healCount = _injured getVariable ["healCount", 0];
_healCount = _healCount + 1;
_injured setVariable ["healCount", _healCount];

// Define lines to say for each heal
private _dialogues = [
    "I've been healed 1 time.",
    "I've been healed 2 times.",
    "I've been healed 3 times.",
    "I'm still standing after 4 heals!"
];

// Check if there is a corresponding line for the current heal count
if (_healCount <= count _dialogues) then {
    _injured sideChat (_dialogues select (_healCount - 1));
} else {
    // Optional: Handle cases where the heal count exceeds the available lines
    _injured sideChat format ["I've been healed %1 times. This is getting excessive!", _healCount];
};

}];

#

That’s what chat gpt said

#

LOL

blissful current
last crystal
#

🫡

#

Lmk if it works

blissful current
#

Oh man. ChatGPT. Sometimes it helps. Sometimes I spend hours and never get it to work, lol.

pallid palm
#

omg no Chat GPT

thin fox
pallid palm
#

Chat GPT don't even know how to color TexT

#

lol

blissful current
pallid palm
#

_someVariableName =

hallow mortar
# blissful current Can you expound on how to use setVariable please? I'm unfamiliar.

setVariable allows you to set variables in an object's namespace, rather than in the default mission namespace. This means that an object can have its own set of variables, which are attached to it, and their names won't conflict with variables in other namespaces.
So for example:

private _oldHealCount = _object getVariable ["fox_var_healCount",0];
private _newHealCount = _oldHealCount + 1;
_object setVariable ["fox_var_healCount", _newHealCount, true];

Other scripts, or instances of this script, can retrieve the variable from the object's namespace. It's a way of making variables object-specific without having to give them unique names.

blissful current
pallid palm
#

i give you one guess

hallow mortar
#

As you may be able to gather from the documentation, it's a flag to make the variable public (broadcast it to other machines).

pallid palm
#

yeah KikkoJT is awsome he helped me just yesterDay,

#

big time

blissful current
pallid palm
#

and ofcorse all the other great guys in here

blissful current
#

Yes I really enjoy the help here. I like that it's encouraged to work and learn on your own scripts instead of just having it done for you.

pallid palm
#

yes they make us work to figure it out i like that

#

i learned so much from all the awsome people in here and i forgot so much too lol opps 🙂

#

man my missions would be so lame is i didnt have the help from all the super cool people in here

blissful current
# hallow mortar `setVariable` allows you to set variables in an object's namespace, rather than ...

Can I use a comparison to check the heal count like so? Or do I need to getvariable?

this addEventHandler ["HandleHeal",{
params ["_injured"];
    
private _oldHealCount = _object getVariable ["fox_var_healCount",0];
private _newHealCount = _oldHealCount + 1;
this setVariable ["fox_var_healCount", _newHealCount, true];
    
if (_newHealCount == 1) then {
    _injured spawn {
    sleep 7;
    _this setHit ["legs",0.5];
    ["heal1", [POW]] remoteExec ["FoxClub_fnc_Conversation", allPlayers select {_x distance POW <= 100}];
    };
};

if (_newHealCount == 2) then {
    _injured spawn {
    sleep 7;
    _this setHit ["legs",0.5];
    ["heal2", [POW]] remoteExec ["FoxClub_fnc_Conversation", allPlayers select {_x distance POW <= 100}];
    };
};
    
if (_newHealCount == 3) then {
    _injured spawn {
    sleep 7;
    _this setHit ["legs",0.5];
    ["heal3", [POW]] remoteExec ["FoxClub_fnc_Conversation", allPlayers select {_x distance POW <= 100}];
    };
};   
}];
hallow mortar
#
if (_newHealCount > 0) then {
  private _convo = ["heal1", "heal2", ...] select (_healCount - 1);
  [_convo, [POW]] remoteExec ["FoxClub_fnc_Conversation", allPlayers select {_x distance POW <= 100}];
};```
pallid palm
#

and you know what really makes NikkoJT, and other awsome people in here Awsome, is he did Not screem at me, and he did Not make fun of me, he just helped Me !

#

and i love that, cuz you know i can be kinda thick in the brain sometimes 🙂

hallow mortar
blissful current
hallow mortar
#

It would break, can't select a higher number than exists in the array

blissful current
#

Yeah that's what the _healcount - 1 does right?

#

that selects the array

hallow mortar
#

The original _healCount is 1-indexed (1 is the first heal). select is 0-indexed (0 is the first array element). So that just converts the number to the right indexing.

blissful current
#

I could wrap all this in an if statement that makes it old run if heal count is less than 4?

#
if (_newHealCount < 4) then {
if (_newHealCount > 0) then {
  private _convo = ["heal1", "heal2", ...] select (_healCount - 1);
  [_convo, [POW]] remoteExec ["FoxClub_fnc_Conversation", allPlayers select {_x distance POW <= 100}];
};
};
hallow mortar
#

If you really only want to consider 3 heal levels, and just repeat the 3rd message for any subsequent heals, then you might as well just use your original implementation and change the third == to >=. Trying to make this more adaptable will end up making it just as long, in the end.

granite sky
#

You can drop the >0 check assuming that you're not intentionally chucking negative values in there.

faint burrow
hallow mortar
hallow mortar
blissful current
#

I think maybe the best approach for this specific event in the mission is to just loop the last one. Or in my case make a 4th line and just loop that one.

blissful current
faint burrow
blissful current
hallow mortar
#

That doesn't reset it to zero. That's just a default value to assume if the variable hasn't been previously defined (so you don't have to initially set it to 0 before doing anything else).

#

The problem is that you're using this with the setVariable, so the new value is not being stored. this does not exist inside the EH code.

blissful current
#

Ah I was hoping that this would reference the object since this code is pasted inside the object's init inside the editor.

hallow mortar
#

The EH provides a reference to the object it's running on, which you're actually using elsewhere in the code: _injured

blissful current
#

Ah okay that make sense to me. So I could just the actual object name or _injured. Cool.

hallow mortar
#

You should use _injured so the code isn't hardwired to only work with that one object. _injured is dynamic, so you can easily reuse the same code for other objects.

blissful current
#

In my code I am using sethit to apply leg damage to simulate a leg would that cannot be healed. After a first aide is used it applys set hit. This works. But after a few seconds the blood goes away and the unit is magically healed. Im thinking it's a server issue telling the clients that the unit isn't hurt but I rechecked the BIKI and sethit is supposedly a global execution.

#

If I use advanced zeus on the server one I can see that it thinks the unit has 100 health which might support this theory.

hallow mortar
#

It is global effect, but local argument. That means it must be executed where the target is local, but when that happens, all machines accept the effects. And HandleHeal fires on the machine of the unit that does the healing, not the machine that is being healed (unless they're the same obviously)

blissful current
#

"it must be executed where the target is local" The target is a unit so where is it local? the client that applys the heal or the server?

hallow mortar
#

If it's a player, it's local to that player's machine. If it's an AI, it could be anywhere really. AI are usually local to the server by default, but if they have a player group leader, they'll be local to that player, and they can also be force transferred, or created on other machines via scripting or Zeus.

#

But it doesn't really matter exactly where the target unit is local, because you can use objects as locality targets for remoteExec. So you don't need to know, you can just use the object reference and the game will figure it out.

blissful current
#

Oh wow. Well in this case it's an AI but Im testing it on one that isn't in a group yet. During the mission it will be.

#

Ok so the solution is to remoteExec the sethit?

hallow mortar
#

That is typically how you get commands to execute on other machines, yes

blissful current
#
[POW, ["legs", 0.5]] remoteExec ["setHit", 0];
#

Alternitivley I see this sometimes but I don't understand when it's more appropriate?

[POW, ["legs", 0.5]] remoteExec ["setHit", 0, POW];
hallow mortar
#

It would be better to use the unit as the locality target, rather than using 0 which makes all machines execute the command.

blissful current
#

0 is the server AND all clients right?

hallow mortar
#

This explains what the different parameters for remoteExec do. https://community.bistudio.com/wiki/remoteExec At the moment we're working with the Targets parameter, and your last question was about the JIP parameter (spoiler: we don't need it)

blissful current
#

Lemme read.

hallow mortar
last crystal
#

Is there a way to find the closest instance of an object that way instead of trying to grab the first one it just grabs the closest instance?

hallow mortar
#

You should use your dynamically-generated object reference (contained in _this in the scope where we're currently working) rather than the hard-coded POW variable name.

blissful current
#

Yeah so is 0 not the same as POW in that index? They both fire on all machines?

#

Object - the order will be executed where the given object is local

#

Ahhh so it's more effecient?

hallow mortar
hallow mortar
# blissful current Ahhh so it's more effecient?

0 - the command is executed on every machine currently connected (+ JIPs if the JIP handling is turned on)
object - the command is executed only where the object is local, which in this case is the only machine that actually needs to execute it.

blissful current
#

Making object less JIP friendly, no?

hallow mortar
# blissful current Making `object` less JIP friendly, no?

As I mentioned above, we don't need any JIP handling for this, because this is a one-time command. The command only needs to be executed where the object is local. Once executed correctly, its job is done. The object's health state has been updated, and the command doesn't need to persist. JIP machines will receive the object's current health state at the time they join.

#

Remember, it's a Global Effect command. Other machines automatically receive its effects, as long as it's executed where the target is local.

blissful current
#

Is that because objects persist globally?

#

Ahh okay so [_this, ["legs", 0.5]] remoteExec ["setHit", _this]; is it.

blissful current
hallow mortar
#

Consider a signal lamp. You must be at the signal lamp to make it flash. But people who are far away can see the flashes. This is LA/GE.

blissful current
#

Like even if I do it locally, since objects exist globally I feel like it should then update all other machines?

hallow mortar
#

Objects existing globally is not the same as them being owned globally. One machine is still the authoritative owner of the object and gets the final say in what happens to it.

#

Some commands internally have the capacity to give orders to the owner machine; this is Global Argument. Others don't, and only the owner machine can use them properly; this is Local Argument.

blissful current
hallow mortar
#

I don't mean traffic signals, I mean a signal lamp for sending signals. Like Morse code.
Doesn't really matter what kind of lamp, it's just an analogy. Any kind of lamp that can only be switched on when you're standing next to it, really.

blissful current
#

Ahh perfect example. I understand now. tyvm!

#

At the start of the mission I have this setHit ["legs", 0.5]; within the object's init. Since this get compiled at mission start there's no need to remoteExec here right?

viral spire
#

hello, if I would like to create a custom face for an enemy to use, one that I created my self, not one from the predefined list, how do i get the setFace command to see the face and not revert to the default list available in the game?
From what I understand in the wiki, it may not let me path to a place that is in the mission file, like an image folder, to replace a face with a custom made one.

Any help would be appreciated.

hallow mortar
# blissful current At the start of the mission I have `this setHit ["legs", 0.5];` within the objec...

Well, I wouldn't do that, because Editor object init fields are executed on all machines at mission start and on JIP machines when they join. So this guy could've been happily healed up to 1, then some savage idiot joins the game and suddenly the poor bastard has broken knees again because they've setHit 0.5.
(In theory anyway. Because setHit is LA, the JIP machine won't have authority to inflict damage. But it's bad practice because some commands don't have that restriction.)

hallow mortar
hallow mortar
blissful current
hallow mortar
blissful current
hallow mortar
#

Presumably because the object in question is local to the server

blissful current
#

Ahh yes because the AI isn't in a group yet.

#

Or maybe not. Even within the group the code doesn't execute on the client.

#

As a work around I could remoteExec the command when players near the AI. That way a JIP player wont ruin it. I'll just take it out of the init.

hallow mortar
blissful current
#

Oh yeah, of course. I dont need to put the whole EH inside the check. Just the stuff that would get ruined by a JIP player.

viral spire
last crystal
hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
last crystal
#
call{                                                                       this spawn {                                                                 _nearestDroneBomb = nearestObject [_this, "explosives"];      
_nearestDroneBomb attachTo [_this, [0, 0.22, 0.1]];  
_this addEventHandler ["killed", {nearestDroneBomb setDamage 1; }];     
_this setBehaviour "CARELESS";  
_this flyInHeight 40;       
_this setSkill 1.1;    
_this setSpeedMode "FULL";   
   
while {isNull(_this findNearestEnemy _this)} do {sleep 1;};         
private _target = _this findNearestEnemy _this;  
for "_i" from count waypoints (group _this) - 1 to 0 step -1 do  
{  
 deleteWaypoint [(group _this), _i];  
};    

private _cutDistance = 0;    
while {(_this distance2D _target > _cutDistance) && (_this distance2D _target > 5)} do {    
_this DoMove (position _target);    
sleep 0.2;     
_temp = (2*9.81*(((getPosASL _this)select 2)-((getPosASL _target)select 2)));  
_temp = sqrt _temp; 
_cutDistance = (((speed _this)*0.278)*_temp*0.102);    
};      
      
_this deleteVehicleCrew driver _this;      
};  }                                                                            
#

as soon as i pasted i saw where i fucked up...

#

Nvm still doesn’t work fck

#

Im so close too if not I’m going to try to create a global variable for ever instance of an explosive I put dow- nvm I’m gonna call it a night 👋

open hollow
#

its posible to change the opacy of a marker locally, when created in editor?

i want to do sided markers

granite sky
#

Yes. There's a whole bunch of setMarkerXxxLocal commands.

#

Doesn't matter whether they're created in the editor or by script.

blissful scarab
#

Can some malefic sorcer inform me how to attach a player to another player?

#

I assume something like...

#

this attachTo {Player's variable name here}

#

In the players init file

hallow mortar
#

Well, you're pretty close.
https://community.bistudio.com/wiki/attachTo

if isServer then {
    this attachTo [otherPlayer, [0,0,0]];
};```
That's for them to be attached on the same position (standing in the same shoes) immediately on mission start. If you want something more complex than that, many things are possible, but it's 2am so someone else can explain.
nocturne bluff
#

:O

#

That is too useful

keen drum
#

how do i turn this from a script i found into smth that teleports my whole group not jus me

dusk gust
tough abyss
#

I'm still trying to persuade the triumvirate of evil to put this into the upcoming ACE update.

gleaming rivet
#

Just push it to 3.5.0, I thought only major releases were intended for new features.

plain linden
#

im having a hard time with my multiplayer script to have people when they initially load in to load into their room. I've given each playable character the name p_1,p_2, etc. and each room is room_1, room_2, and so on. when i spawn it sends me to position 0,0

{
    _player = _x;

    _player addEventHandler ["Respawn", {
        params ["_unit"];

        private _varName = name _unit;

        if (!isNil "_varName" && {_varName find "p_" == 0}) then {

            private _playerNum = parseNumber (_varName select [2]);

            private _markerName = format ["room_%1", _playerNum];

            if (!isNil _markerName) then {
                private _markerPos = getMarkerPos _markerName;
                _unit setPos _markerPos;
            };
        };
    }];
} forEach allPlayers;
#
respawnDelay = 3;          
respawnOnStart = 1;        
respawnTemplates[] = {};  ```

thats my respawn settings
#

using empty markers for spawn location

dusk gust
indigo snow
#

But its an update to the inventory module

#

Not a new feature

plain linden
remote cobalt
#

Hey folks, I want to understand Game Logics a bit more and why I found so many old posts that suggested they are "bad for performance".

In the Wiki it is only mentioned that they have a namespace and simulation but no model. I never used a Game Logic (because I wouldn't know what for) but I read they are used in Bis_fnc_ambientAnim and this is the reason why you don't want to use multiple Bis_fnc_ambientAnims in Multiplayer, because that would make the server performance go down.

But I am really struggeling to see the reason why that should be like that. No model so no visual performance Impacts for the player machines to render, but what Simulation is going on in the background if there is no "model" to simulate anything for the server machine?

Can anyone explain further or point me somewhere where this is explained in more detail?

gleaming rivet
#

Explain that to the triumvirate of evil then.

fair drum
#

what are your sources

warm hedge
#

Having a simple term "performance" without any credible details sounds simply wrong to measure anything

cosmic lichen
remote cobalt
# fair drum what are your sources

For once this is mentioned as a negative aspect of Bis_fnc_ambienAnim in the comments in the wiki, and I found a few reddit posts where it was mentioned several times that they would be a "waste of performance" and not be needed.

remote cobalt
cosmic lichen
#

Yeah or rather the lack of MP implementation of the function 😄

warm hedge
#

AmbientAnim is simply poorly implemented

remote cobalt
cosmic lichen
#

@winter rose wanted to update it but he never lived up to his promise 😄

winter rose
#

I said it could be improved, but it may (most likely not but still) break backward compatibility if someone did something weird with it before (e.g referencing/using the unit's game logic)

#

But yes, I wrote my own version of it in LM CAAS

#

(free advertising again)

cosmic lichen
#

BIS_fnc_ambientAnim2 when?❤️

winter rose
#

tbh? gimme a Snickers-like chocolate bar when I drive through Germany in next month and I will force @pastel python (with threats of visiting too) to add my new functions 😄

warm hedge
#

It is much easier to make Community Involvent a thing and deactivate QA team

winter rose
#

SQF-wise, eventually, but QA sees things players cannot, too
I realised when joining what QA really means, and it's definitely not "playing en masse and write down encountered bugs"!

cosmic lichen
pallid palm
#

dam now you made me hungry for a Snickers

#

if (have Snickers) then {🙂 }else{😆 };

winter rose
cosmic lichen
#

Good thing it's not between Hamburg and Munich

winter rose
#

as well
going east!

#

between Norway and Italy basically, give or take

pallid palm
#

if its between Hamburg and Munich yull be Muniched into Hamburger, he he

buoyant hound
#

Hello again
I would like to show a video(ogv) on a billboard for players with trigger activate by radio on a dedicate server

_video = "V\r.ogv";
_screen = n;
_screen setObjectTextureGlobal [0, _video];
[_video] remoteExec ["BIS_fnc_playVideo", ([0, -2] select isDedicated), true];

This code work but video showed on player monitor and not on the bb
Please guide

stable dune
#
private _video = "a3\missions_f_exp\video\exp_m07_vout.ogv";
private _screen = n1;
_screen setObjectTextureGlobal [0, _video];
[_video, [10, 10]] remoteExec ["BIS_fnc_playVideo", ([0, -2] select isDedicated),true];

Tested via initServer.sqf

keen drum
faint burrow
#
_position = getMarkerPos _dest;
_radius = selectMin (getMarkerSize _dest);

{
    _x setVehiclePosition [_position, [], _radius];
} forEach (units player);
jade abyss
#

BIS! GIVE US FINALY removeMagazine FOR VEHICLES/GWH! AAAAAAAAAAAAHHHHHHHHHHHHHHH

keen drum
#

i dont need the get random dir and move player 15m away thing

faint burrow
faint burrow
keen drum
faint burrow
#

Yes.

last crystal
#

They had their chance ..

keen drum
#

what r u talking abt theyre two different genres

last crystal
#

😐

last crystal
proven charm
last crystal
vocal chasm
#
[_This, ["Medical Treatment",
    {
        if 
            !(isNull objectParent player) 
        then 
            {
                {[player] call ACE_medical_treatment_fnc_fullHealLocal}forEach crew player;
            };
    }
    ,nil,6,false,true,"","True",4,false,"",""] ]
remoteExec 
    ["addAction",0,_This];

so ive got this script which works perfect for ace heal but doesnt work for everybody in the vehicle, what did I do wrong?

hallow mortar
#
[player] call ACE_medical_treatment_fnc_fullHealLocal```
You're only targeting the player who uses the action. You're healing them once for each person in the vehicle - but only them, because you're specifying `player`.
<https://community.bistudio.com/wiki/forEach>
Use `_x` instead.
granite sky
#

Well, crew player only returns player anyway

#

and fullHealLocal is the local function, so it wouldn't work on other players.

vocal chasm
faint burrow
granite sky
#

The normal fullHeal function is global, so this should work:

{[_x, _x] call ACE_medical_treatment_fnc_fullHeal} forEach crew vehicle player;
vocal chasm
#

oh right, just saw what I did xD

vocal chasm
pallid palm
#

they do that every day they have me lol

fair drum
dusk gust
blissful current
#

This is working as intended and I understand what it does but I need help in understanding why.

while {true} do {
    waitUntil {
        sleep 5;
        missionNamespace getVariable ["fox_var_radioLoop",false];
        };
            while {missionNamespace getVariable ["fox_var_radioLoop",false]} do {
                if (alive speakers) then {
                hint "fired";
                sleep 60;
                };
            };
        };
    };
#

In my mind the waitUntil should only return true once it see's missionNamespace getVariable ["fox_var_radioLoop",false] but it actually returns true with missionNamespace getVariable ["fox_var_radioLoop",true] which is not what the line reads.

stable dune
#

True values after "" is default

#

So if your value is true, it return true,
If that is defined false it return false.
But if your variable is not defined it will return default value that is defined after ""

blissful current
#

This is what is not clicking for me. It is defined false here. So it needs to see false in order to continue the script. But it only continues the script when true is broadcast.

#

Okay wait. Is this NOT defining it?

stable dune
#

It doesn't defined that false
It will return false if that is not defined

blissful current
hallow mortar
#

The true value that comes after the "" [variable name string] is the default value, which will be returned if the specified variable is not defined.

#
// nothing is done before this
missionNamespace getVariable ["someVarName", 123]; // returns 123
missionNamespace setVariable ["someVarName", 555];
missionNamespace getVariable ["someVarName", 123]; // now returns 555
#

This is done so you don't need to pre-define the variable to avoid a script error.
As long as you haven't specifically defined the variable as something else, getVariable will read it as false (or whatever default value you gave). Once the variable is defined, getVariable will return its actual value.

blissful current
#

So assuming it hasn't been defined before then within the waitUnitl you could write missionNamespace getVariable ["someVarName", 123]; and it will read this as FALSE.

hallow mortar
#

No, it will read it as 123, because you just told it to use that as the default value.

blissful current
#

But it wont proceed to the inner loop UNTIL setvariable 123?

hallow mortar
#

waitUntil (and while ) requires a boolean (true or false) return from its condition. If you do this:

waitUntil {
  missionNamespace getVariable ["someVarName",123];
};```
then you will cause a script error if the variable is undefined, because `getVariable` is returning `123`, which is not a boolean.
#

waitUntil is "wait until <this piece of code> returns true". while is "while <this piece of code> returns true". It doesn't have to be getVariable in the condition, it could be whatever other piece of code, _as long as it either returns true or false _. We happen to be using getVariable because it's appropriate for our situation.

fair drum
#

if A3 scripting actually had a supported IDE like reforger, you could set breakpoints and watches to actually see what it is doing.

tender fossil
fair drum
tender fossil
#

Oh, I see

hallow mortar
# blissful current This is working as intended and I understand what it does but I need help in und...

This piece of code has:

while {true} do {```
Condition always returns `true`. This is a continuous loop that won't exit on its own.
```sqf
waitUntil { missionNamespace getVariable ["fox_var_radioLoop",false] }

This condition requires that fox_var_radioLoop returns true before it will proceed. If the variable is undefined, it returns false, so you don't need to define the variable until you want to set it to true.

while {missionNamespace getVariable ["fox_var_radioLoop",false]}```
This loop will continue to run as long as `fox_var_radioLoop` returns `true`. If the variable is undefined, it returns `false`, but this is basically just a reserve safety because we can't even reach this loop until the variable is defined as `true`.
blissful current
#

I could broadcast missionNamespace setVariable ["fox_var_radioLoop",false] all day long and it wont enter the rest of the script. But if I broadcast it as true it will. So from a readability standpoint its SO confusing.

hallow mortar
# blissful current Help me with this bit please: For example. Lets take the `while` loop. It needs...

https://community.bistudio.com/wiki/getVariable
https://community.bistudio.com/wiki/while
missionNamespace getVariable ["fox_var_radioLoop",false] is not a "thing" the loop "needs to see". It is a code expression, retrieving the value of fox_var_radioLoop, and returning false if that variable is not defined. If fox_var_radioLoop is defined and its content is true, the loop will run. If fox_var_radioLoop is undefined, or specifically set to false, the loop will exit.

#
while { missionNamespace getVariable ["fox_var_radioLoop", false] }
// SAME AS
while { fox_var_radioLoop }
// EXCEPT that the second one will cause a script error if the variable is not defined.```
fair drum
#

all getVariable is doing is looking into the big book of variables looking for the page "fox_var_radioLoop". the second argument says hey, if you don't find that page, make a temporary page and give it this value.

missionNamespace setVariable ["fox_var_radioLoop",true]

says, look for page "fox_var_radioLoop" and if it doesn't exist, just give me back true

so your "fox_var_radioLoop" is undefined, so the book gave back the value of true, thus causing your loop to run

blissful current
#

Ok it's starting to click I think. The code within the brackets is not the literal condition. I was reading it as: The condition is met if "fox_var_radioLoop" = false

In reality the code is retieving the value of "fox_var_radioLoop" the false after that code tells what to define the variable if it hasnt been defined already`

#

So it still needs to see a boolean. So if I later define the variable setvariable as true. Then when getvariable retrieves it the script proceeds.

#

And you write it that way so that you can avoid errors if it's not defined.

#

Thank yall so much for the help!

#

Is the above condition written incorrectly? When testing, satisfying the this part of the condition will not cause the trigger to fire. However, PlayersSpotted will. Perhaps I need two separate triggers (|| doesn't work) in this context?

hallow mortar
#

|| (or) works in this context.
The Detected By system is a little bit black-boxy. Are you certain it's actually being satisfied?
Is playersSpotted defined (as false ) before you set it to true to activate the trigger? If it's undefined, or contains a non-boolean value, the trigger will encounter an error every time it tries to run its condition and that will probably prevent it from activating.

blissful current
#

To satisfy the condition of this I shoot at enemies for few minutes then use zeus to check if any trackers have spawned. They did not.

playersSpotted is undefined and get's ran as missionNamespace setVariable ["PlayersSpotted", true, true]; when the player encounters the patrol. I test this by shooting at the patrol then checking zeus to see if any trackers have spawned. Which they do.

#

I will define it in initServer and retest.

hallow mortar
#

Right, so we go back to what we were just talking about with getVariable: in this case, you're not using getVariable and so there is a script error when you try to reference an undefined variable.

placid trellis
#

Hey, guys. May be someone know how open inventory dialog on briefing from script? I tried "createGearDialog [player, "RscDisplayInventory"];", but it appears under the map

blissful current
#

Oh wow that's right! So my condition in the field should actually be:

this || missionNamespace getVariable ["PlayersSpotted", false];
still forum
dusk gust
#

I've been trying to hunt the saved3deninventory variable down for a while, does anyone know where it originates from?

It's not in any script on mission/server/addons, and I can't seem to find it in BIS functions aside from
bis_fnc_unitheadgear

if (is3DEN || _unit getvariable ["saved3DENInventory",false]) exitwith {};

It seems to get broadcast cross network with decent frequency on player objects, and doesn't seem to align with death or anything specific that I can tell.

SetVariable.txt log
"saved3deninventory" = false 531:549 B_RangeMaster_F

Edit: This is in a live server, not in any editor and happens on every player randomly

pallid palm
#

hmmm I never saw saved3deninventory

#

whats it used for ?

#

i just use this

#

//something like this

//Micro-optimization
private _player = player;

_player setVariable ["SAL_StartLoadout",getUnitLoadout _player];
warm hedge
pallid palm
#

hmmm i see ok

#

oh oh oh ok i see now

dusk gust
pallid palm
#

that seems like something i would just use in the Editer to see loadouts

#

or to change loadouts or save loadouts or randomize loadouts

#

i just use the Bis Ammo to set my loadout then i export it to clipboard then i past it into a sqf file

#

then i edit it some more lol

#

then ofcorse i call the loadout on whoever i want to

#

//something like this

"O_Officer_F" createUnit [_spawnPos, _grp, "_handler = this execVM 'loadouts\CSAT_OfficerAK.sqf';", 0.0, "COLONEL"];
dusk gust
#

Just for the record; We spawn loadouts through server with player dictated loadouts via database. The variable itself is just something seemingly from the engine/bohemia functions I was trying to remove

pallid palm
#

yeah i never saw that saved3deninventory

warm hedge
#

Actually, is that variable something to concern?

dusk gust
#

No, just seems like a variable that doesnt get used that gets setVar'd publicly.

#

I've removed 30 or so vars like that that are over network from our mission file due to past developers, mainly just trying to decrease JIP queue

pallid palm
#

nice

#

so was u useing that saved3deninventory in any code ?

#

or no

dusk gust
#

no

#

I just noticed it looking through BE filters that it was getting set at arbitrary times.

pallid palm
#

oh ok

placid trellis
#

Works fine only "_brief_display createDisplay "RscDisplayInventory";" But it's just empty display without any gear in slots. May be there is some function, which fills the inventory display controls?

pallid palm
#

hello again: so i have this EH and i want it to only fire when i kill the (O_Officer_F)
but it fires when i kill any east man how do i fix this

if (!isServer) exitwith {};

addMissionEventHandler ["EntityKilled", {
    params ["_unit", "_Killer", "_instigator", "_randomSound", "_useEffects"];

    if (isPlayer _instigator or side group _instigator isEqualTo west &&
    side group _unit isNotEqualTo west && _unit isKindOf "O_Officer_F") then 
    {
        _randomSound = selectRandom ["LetsRock","ComeGetSome"];
        [_randomSound] remoteExec ["playsound", _instigator];
    };
}];
dusk gust
pallid palm
#

ah i see ok

#

thx m8

#

wow that was easy enough lol thx m8

tough abyss
#

Yes, but it's a hard coded one.

#

There is a action that can open the inventory though. Gimme a sec.

#

player action ["Gear", cursorTarget];

split oxide
#

Trying to use some UI texture on the base game 3 monitor computer. Specifically I'm using this script to render description.ext defined UI elements (CfgUI attached):

_computer setObjectTexture ["Screen_1", format ["#(rgb,512,512,1)uiEx(display:RscCountDown,uniqueName:%1Count,texType:co)", _computer]];
_computer setObjectTexture ["Screen_3", format ["#(rgb,512,512,1)uiEx(display:RscLoadingBar,uniqueName:%1Bar,texType:co)", _computer]];```About 60% of the time, when I use `findDisplay` (the alt syntax with the string identifier), the identifier for the instance of RscLoadingBar fails to be found. Is there something I'm missing about more than one display initialized per frame? Or even just with the elements? I didn't find any config errors with the display, so I imagine this is a scripting issue.
granite sky
#

hmm, what does str _computer evaluate to here?

#

1 display per frame does sound like a plausible issue though.

fair drum
#

which method of visual do you think is better? only shows in 3DEN editor. I have 7 formulas with user input k for modifier and it will update dynamically for 0.25 (green), 0.50 (yellow), 0.75 (red) jam amounts. large orb method I would fiddle with opacity, small orb circumference method I would scale the spacing and size depending on area of module

split oxide
split oxide
fair drum
#

the third option, the nightmare option, is to build the circle outlines using the small spheres haha

#

this is with both on, but with the small orbs updating every 0.1 of jam amount

#

well there is one more sphere but it looks like im too close in that pic (still working on scaling formula)

#

looks like the small orbs get cut by the big orbs though

placid trellis
#

Same effect -- dialog under the briefing

#

If i go back to lobby, I can see it under slots dialog

tough abyss
#

Well, you can't have anything in the inventory if the player doesn't exist yet.

cosmic lichen
#

This will always be visible. Or can it be toggled?

placid trellis
#

Player already exist at the briefing

tough abyss
#

If action gear doesn't work, then there is no way. Except recreating the whole menu yourself.

fair drum
#

i can make it either or

placid trellis
#

How work the gear button in units tab?

tough abyss
#

No idea. It's different.

placid trellis
#

In arma 2 there is the way: "ctrlActivate (_display_brief displayCtrl 112);" opens player gear, but in a3 it's working only in editor briefing

tough abyss
#

A2 != A3

#

I once tried to make a "equip yourself during briefing" script.

#

But I was told there already is a solution by BI.

cosmic lichen
#

I like the visuals but I'd probably not always show it.

tough abyss
#

So I droped it.

fair drum
#

while it is pretty, I wonder if there is a rounding/accuracy error somewhere in the math:

// GenerateSpherePoints
// -- Generates the points on a sphere
private _generateSpherePoints = compileFinal {
    params ["_numPoints", "_center", "_radius"];

    private _points = [];
    private _phi = (1 + sqrt(5)) / 2;

    for "_i" from 0 to (_numPoints - 1) do {
        private _z = 1 - (2 * _i) / (_numPoints - 1.0);
        private _radiusAtHeight = sqrt (1 - _z^2);
        private _theta = 2 * pi * _i / _phi;
        private _xx = _radiusAtHeight * cos(_theta);
        private _yy = _radiusAtHeight * sin(_theta);

        _points pushBack [
            _xx * _radius + _center#0,
            _yy * _radius + _center#1,
            _z * _radius + _center#2
        ];
    };

    // return
    _points;
};
_moduleObject set ["GenerateSpherePoints", _generateSpherePoints];

where if I do the same thing on python, I get my wanted sphere points

pallid palm
#

Hello all: man i was thinking i had this right,
but then i see its messed up, what's wrong Here
i want the sound to play when the "O_Officer_F" is killed

if (!isServer) exitwith {};

_object = addEventHandler ["Killed", {
    params ["_unit", "killer", "_instigator", "_randomSound", "_useEffects"];
    
    if (isPlayer _instigator or side group _instigator isEqualTo west &&
    side group _unit isNotEqualTo west && _unit isEqualTo "O_Officer_F") then 
    {
        _randomSound = selectRandom ["LetsRock","ComeGetSome"];
        [_randomSound] remoteExec ["playsound", _instigator];
    };
}];
#

i know im not defining the object the right way but ,,,,,

stable dune
#

_object = addEventhandler.
Should be

_object addEventhandler ["killed",...

If you want id of eh

privatel _killedID = _object addEventhandler..

//_killedID will return ID of eh
pallid palm
#

ahhh ok wow thx m8

cosmic lichen
#

Is the formula for phi correct?

fair drum
cosmic lichen
#

is it possible th at this is due to radians vs degrees?

#
import math


def fibonacci_sphere(samples=1000):

    points = []
    phi = math.pi * (math.sqrt(5.) - 1.)  # golden angle in radians

    for i in range(samples):
        y = 1 - (i / float(samples - 1)) * 2  # y goes from 1 to -1
        radius = math.sqrt(1 - y * y)  # radius at y

        theta = phi * i  # golden angle increment

        x = math.cos(theta) * radius
        z = math.sin(theta) * radius

        points.append((x, y, z))

    return points
fair drum
#

boogers... I need to convert to degrees to use arma's cos and sin

#

getting there, looks kinda cool

cosmic lichen
#

sweet

#

Fun 😄

fair drum
#

lol what count did you do for that

cosmic lichen
#

10k

#

Now I wish we had an array version of the drawCommants so we don't have to loop through every position

fair drum
#

this kinda seems like a cool way to visualize radioactive decay

cosmic lichen
#

Yeah, only thing is you need a lot of points for some decent density

fair drum
#

yeah and the orbs disappear pretty soon with distance in the editor

#

so large areas it doesn't quite work. the big orbs seem to do better with that

charred monolith
#

Hi !
I have a problem with a script i've made to make player's sit on a bench, I use an ace action so that player can sit (I do not use the sitting mechanic from ace). The problem is the player float above the bench, whatever offset I set it.

There is a part of the code I use (Not everything is in there, but there is all the code that management de position and animation of the player while sitting);

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

        _caller switchMove "amovpercmstpsnonwnondnon";
        private _dir = getDir _target; 
        _caller setDir (_dir - 90);
        [_caller, ([(_arguments select 0), 1] call CBA_fnc_selectRandomArray)] remoteExec ["switchMove", 0, true, true]; 
        _target setVariable ["isOccupied", true, true]; 

        private _cPos = getPosASL _caller;
        private _tPos = getPosASL _target;
                private _offset = [-0.2,0,0];
        [_caller, (AGLToASL (_target modelToWorld _offset))] remoteExec["setPosASL", 0, true];

In this code the _target is the bench and the _caller is the player executing the action

warm hedge
#

Probably because the person and bench are colliding

charred monolith
#

Yeah Colision are weird, because when i walk over the bench theres not problem of colision.
but I've found a fix, I've set the Z Offset a -1 and it seems to do the trick.

charred monolith
ornate whale
charred monolith
#

Well disableCollision Kinda works xD, when I can go trought the bench only at the sides, but when i try to go throught it via the front there is still collision

ornate whale
# charred monolith DisableCollisionwith doesn't seems to do anything. and when I attach a player t...

Is it a player or an AI unit. If it is a player, then you probably don't want to make him play a static animation outside of some cutscenes. Also, if you are attaching a unit to anything, it is best to use a proxy (intermediate) object of type logic. You can place it at the root of the object (bench, chair) and then attach the unit to it, and the animations should play well then, not sure about the player's head movement though.

charred monolith
charred monolith
ornate whale
charred monolith
#

Yeah i've tried the regular arma 3 animation and the ace ones and they are different, the vanilla arma you rotate the whole body, but not for the ace one where you can move only the head but don't worry i've fixed my problem ^^ I fixed that using this offset : [-0.25,0,-1].

Now I have another bug but I don't think it's fixable 😅

Thanks everyone for all of your help !

ornate whale
#

😄 That's funny.

#

Well, the animations, IIRC, need to be called on all machines individually. Positioning and attaching should work fine, if called from the server, but animations should be called everywhere.

charred monolith
#

Yep make sense, but that's what i already do with a remoteExec :

private _animation = [(_arguments select 0), 1] call CBA_fnc_selectRandomArray;
[_caller, _animation] remoteExec ["switchMove", 0, true, true];
ornate whale
charred monolith
ornate whale
#

I mean, ambient anims in Arma are simply not perfect, you can not sync them perfectly between machines. But you should be able to play them at least.

#

Did you use disable collision with the bench and attached the unit to something?

charred monolith
ornate whale
charred monolith
ornate whale
#

OK, that's a progress.

#

I would try to attach the unit to a logic object.

fossil yarrow
#

Hi

#

Im new in here, and i want to create a custom mision is it easy?

#

People tell me that its not hard at all

ornate whale
#

Something like this:

private _logicGroup = createGroup civilian;
private _basePos = getPosASL myChairObject;
private _myLogic = _logicGroup createUnit ["Logic", _basePos, [], 0, "CAN_COLLIDE"];
myUnit attachTo [_mylogic, [0,0,0]]; //Your rel pos instead of 0,0,0.
charred monolith
#

hey quick question before doing this, could using BIS_fncAttacthToRelative cause this ? because I don't use attachTo for the bench but BIS_fncAttacthToRelative. But only for the bench. Otherwise I use attachTo

ornate whale
#

Attaches object 1 to object 2, while preserving object 1 initial position and orientation against object 2. - from BIKI.
I think the orientation is the only difference.

ornate whale
#

He is sitting, nice. 😄 Not on the bench though.

#

Have you tried to disable simulation on the benches instead of attaching it to the heli?

#

Either in Eden or via a command.

#

I think it is a standard option in Eden, or in Eden Enhanced Workshop Mod.

little raptor
charred monolith
hallow mortar
fossil yarrow
#

Thank you

hallow mortar
#

You're passing an ASL position to createUnit, but that command might be working in AGL or ATL instead. That would cause a height offset.

#

If it is AGL (and it probably is) it might also have difficulty getting the correct height, because AGL is measured from "the surface" including objects, which becomes a lot more complex to determine when you're working inside an enclosed object.
It might be better to immediately setPosASL the logic after creating it. That way you can be sure it's positioned according to the correct frame of reference.

little raptor
#

AGL is measured from "the surface" including objects
that's AGLS not AGL

#

AGL is height from terrain/water, whichever's higher
createUnit takes AGL height yes

hallow mortar
#

Okay, my mistake. But AGL conversion is still an annoying problem in this situation and setting to ASL would still guaranteed solve it.

ornate whale
#

I have used it in my script over the terrain and it worked. If the terrain were below the sea (in case of AGL), it would probably render the unit below the target position. So it is either some user miscalculation, or it really uses AGLS or something, if it is possible.

hallow mortar
hallow mortar
little raptor
#

unless you use CAN_COLLIDE

hallow mortar
little raptor
#

hmm it still uses AGLS, but if he can't "float" it places him under water instead of above meowsweats

#

basically this is the pseudo code:

if the code is allowed to change position (i.e not can_collide):
   find safe pos above water/surfaces

if unit can float
   find safe pos above water/surfaces and place above
else
  find safe pos above water/surfaces and place under
ornate whale
# charred monolith Just tried it, and it didn't work

The bottom line is that you need to play with the positioning a bit, but it will work, I would say. Also, I think that you don't need to attach the benches to make them stop flying around, just disable their simulation and damage input.

hallow mortar
#

Incredibly annoying that it isn't just the same as createVehicle

ornate whale
hallow mortar
#

I would love to have createVehicleASL and createUnitASL commands to not have to deal with any of this

little raptor
#

I always thought it was AGL

#

actually no it was AGL, my bad

hallow mortar
pallid palm
#

Hello all: once again i failed to get this right,
i want the sound to play when the "O_Officer_F" is killed
can someone help me get this right

if (!isServer) exitwith {};

_object addEventHandler ["Killed", {
    params ["_unit", "killer", "_instigator", "_useEffects"];
    
    if (isPlayer _instigator or side group _instigator isEqualTo west &&
    side group _unit isNotEqualTo west && _unit isEqualTo "O_Officer_F") then 
    {
        _randomSound = selectRandom ["LetsRock","ComeGetSome"];
        [_randomSound] remoteExec ["playsound", _instigator];
    };
}];

i know im not defining the object right ?

#

i can do a mission EH but i never used a reagular EH

stable dune
#

And your need check typeOf unit

pallid palm
#

yeah i dont know what im doing here

stable dune
#

If you want check is your unit type "O_Offiser_F"

pallid palm
#

oh ok ill try

stable dune
pallid palm
#

ahhh ok nice

stable dune
#

but , that you dont even need because you attach current event on specific object, and that object type wont change.
_unit type will be "O_Officer_F", if you attach to object.
and

side group _unit isNotEqualTo west 

if you dont change side of unit somewhere, it will be same.

But if you use Missioneventhandler which will be executed everytime when some unit will be killed, then you need do checks that your conditions will met

pallid palm
#

yeah umm when i used Missioneventhandler sound played on every man that was killed

#

ok let me see if i can change the side as well

#

i feel like im getting closer to understanding this

stable dune
#
addMissionEventHandler ["EntityKilled", {
    params ["_killed", "_killer", "_instigator"];
    if ((isPlayer _instigator or side group _instigator isEqualTo west) &&
        (side group _killed) isNotEqualTo west && 
        typeOf _killed == "O_Officer_F") then 
    {
        _randomSound = selectRandom ["LetsRock","ComeGetSome"];
        [_randomSound] remoteExec ["playsound", _instigator];
    };
}];

You want check if isPlayer or side of _instigator is west
and killed is not west
and typeof killed == O_officer_F ?

pallid palm
#

yes ,oh i see wow awsome m8 really awsome

#

yeah that looks correct

#

oh man that looks nice

#

@stable dune lol i was having so much fun i almost forgot to come in and tell you thx m8 it works great thx you soooo much m8

#

man thats so cool i love it thx you again

stable dune
#

You're welcome 🤗😁

pallid palm
#

i also have it so you can turn this off, in the params in the Description.ext

#

or ON ofcorse

#

@stable dune that Tatoly Makes My Day omg m8 thx you so so so much ========================================================================================

still forum
#

Ah found it. Its engine code yeah. It is set once when the player unit is created, and is pubVar'd

still forum
shell kiln
#

I'm trying to buff my unit's damage resistance with the handledamage event handler. For some reason though it'll either make the unit entirely immune to damage or die in one shot. Anyone know what's going on here?

stable dune
pallid palm
#

yeah lets see the code m8 i want to learn more and more and more

#

thx god i dont use any mods omg

stable dune
pallid palm
#

@stable dune i cant thx you enough for helping me with that EH, i love you man

#

if you can remove the sexual conotations from that lol

#

lol

shell kiln
#

All the numbers are from me trying to figure out at which point the instant death turns into invincibility.

pallid palm
#

hmmmm wth

#

i think you need more then that in your EH

south swan
#

a) it looks awfully close to floating-point-precision equivalent of 1
b) number returned from "HandleDamage" is the total resulting damage state of body part/whatever. If you want to modify only the new incoming damage - search this channel for "HandleDamage", it's been discussed more than once 😉

#

something like this, for example

pallid palm
#

dont we need to get the damage 1st then we can chane the damage

#

or at least private _damage = damage player;

shell kiln
pallid palm
#

im not sure m8 im just a peeon better ask them good guys

shell kiln
pallid palm
#

you put that stuff in the EH not the unit

shell kiln
#

EH?

pallid palm
#

eventHandler

shell kiln
#

Kk

#

So what do all those numbers even mean?

#

(If you can’t tell, I’ve got zero scripting skills.)

pallid palm
#

all what numbers

#

witch numbers

#

witch numbers do u mean

#

the numbers you see in there are explaned in the code as i see it

#

but what do i know not much

shell kiln
#

This stuff here.

#

There’s a bunch of numbers on the top and bottom.

pallid palm
#

yes the numbers you see in there are explaned in the code

shell kiln
#

Maybe I’m blind, but I don’t see any explanations.

pallid palm
#

just read it out loud say it like this _unit _this select 0;

#

if you say it it will start to make sense

shell kiln
#

So it’s selecting the unit the event handler is placed in? Or is this placed in a trigger and then assigned to a unit via a number value?

pallid palm
#

so 1st where is this EH placed in your mission, in the units init or what,,,

#

or is it a script

#

or what

#

or is it in a trigger or what

#

store run ill bb like 10 min

shell kiln
#

I’m looking for something I can just slap into a unit without needing to throw it into the mission script.

pallid palm
#

ill bb soon m8 i need drink

#

10 min

#

w8 befor i go you should not just want to slap something into your mission, you should want to learn what the best way to do this is, and you should want to understand what going on in the EH

#

understanding builds the best missions

#

ill bb m8

shell kiln
#

kk

pallid palm
#

not that i can even help that much im still learning myself

pallid palm
#

ok im back

#

hello world

#

lol

shell kiln
#

Managed to figure it out.

#

Just threw that into my units, adjusted one of the values, and bam.

#

Thanks for the help.

pallid palm
#

rgr m8 rgr =roger

#

i realy did nothing tho lol

proven charm
#

is it good idea to call attachTo each frame on local simpleobject? i mean there shouldnt be any network traffic from that?

stable dune
proven charm
#

made a object placing script, where player needs to position the object

stable dune
#

I did the same kind of solution , and didn't get any performance traffic because everything happens on client.

proven charm
#

yeah thats what im hoping for

stable dune
proven charm
#

looks good but i wish one of the Devs could verify that attachTo can be used like this and that it wont cause any noticeable lag on slower clients...

stable dune
proven charm
#

true 🙂

#

just hoping there isnt any big loops happening on attachTo but I hope not

proven charm
#

just thinking how fast attachTo is when used every frame

granite sky
proven charm
#

player (client side)

#

umm i think we know how to use attachTo scotty 🙂 thx

#

alright ty

granite sky
granite sky
#

Spam it a bit and check whether there are any related errors in the server RPT.

proven charm
#

test it in multiplayer?

granite sky
#

DS + client, yeah.

proven charm
#

ok i'll do that when i get the time

#

if you have tested it in dedi that should suffice

split oxide
scarlet tree
#

Can a player unit be moved (run/walk) via script?

fleet sand
scarlet tree
#

As in, not teleport, but actually have the unit move from one position to next.

#

So if I understand correctly, that I can set the animation speed for walking/running, then my question remains if I can set a velocity and direction for a player controlled unit to simulate walking or running

placid trellis
#

You could make your own display for this and create it with createDisplay

hallow mortar
#

You can set the direction easy enough (setDir). You can also set their velocity or position continuously, but that won't really be the same as walking.
You could try using playAction with a walking action like WalkF (https://community.bistudio.com/wiki/playAction/actions), but you'll have to test whether that works because I haven't.

solid hill
#

Hello folks. By any chance does anyone have a script to make OPFOR randomly mortar areas around BLUFOR players on multiplayer

blissful current
#

In the following example, will the random player be the same before AND after the sleep?

_randomPlayer = selectRandom _playersinHeli;
_randomPlayer sideChat "I am a player.";
sleep 10;
_randomPlayer sideChat "Is this the same player?";
stable dune
#

yes.

blissful current
tulip ridge
#

Nope
You're saving the return from selectRandom _playersInHeli to the variable

blissful current
#

So to change the variable I would then have to write again: _randomPlayer = selectRandom _playersinHeli;?

tulip ridge
#

If you wanted another random player, yes

blissful current
#

How does the game assign a group leader if I players don't choose the one I made in the editor? For example they could not choose it and turn off the AI that would have been their leader. At this point who would be the group leader?

tulip ridge
#

Creation order iirc

So the first player who picks a unit in that group would be the leader

#

If someone later picks the leader spot I don't think it makes them the leader

pulsar bluff
blissful current
#

Would this throw and error if the pow was alive at one point but dead before this code ran?

if (pow in heli) then {
little raptor
#

No

foggy stratus
# scarlet tree So if I understand correctly, that I can set the animation speed for walking/run...

I've written scripts for force walking/running units anywhere. As @hallow mortar NikkoJt said, it uses playAction. With this script this is simplified for mission maker by allowing you to define waypoints for unit to move wherever you want. https://youtu.be/TCKSAue6BJM

Demonstration of script you call from editor placed waypoints which allows AI to move anywhere they would not normally move. It is great forcing units to walk on rooftops, large rocks, cross bridges, crawl through pipes, custom building paths, etc. Force your AI to look natural walking through buildings, on roofs, etc.

You can download the s...

▶ Play video
pulsar bluff
#

anyone worked much with bounding boxes? some bbs are much larger than the entity. any idea how to shrink the bounding box down to just cover the geometry of the object? for instance the Hunter MRAP has about 3 meters infront of it, as part of the bb

granite sky
#

boundingBoxReal is much closer IME.

#

Not sure if there's a tradeoff.

#

Note that the bounding box is relative to the object's position for most vehicles, and you shouldn't adjust with boundingCenter.

hallow mortar
#

boundingBoxReal and using clipping type 0 or 2 with it as well

pulsar bluff
#

yet still wildly inaccurate related to geometry

#

for instance when used for "does this object fit somewhere" scripts

ivory lake
#

what about boundingBoxReal [object, "Geometry"]

#

the problem with the boundingbox is it includes memorypoints and proxies

ivory lake
# pulsar bluff

like in this example the reason its so tall is the gunner proxy triangle is probably pushing the size up

hallow mortar
#

Is it possible that that vehicle just genuinely has some kind of invisible freaked-out vertex that's floating out there and affecting the geometry bounding box?

pulsar bluff
ivory lake
hallow mortar
pulsar bluff
#

wow yes it is

ivory lake
#

it can be but im not sure what clipgeometry uses

pulsar bluff
#

Kerc just solved my problem

#

the above is 0 boundingBoxReal _obj

#

below is boundingBoxReal [_obj,'geometry'];

ivory lake
#

Yeah and the visual lods (0) would have the crew proxies in them

pulsar bluff
ivory lake
#

I would suggest firegeometry instead as its usualy more accurate but it has the crew proxies problem agian

pulsar bluff
#

just saved me from a few hours of fiddling around with redoing bounding boxes using raycasts

granite sky
#

Hopefully the launcher isn't collision geometry...

pulsar bluff
#

its for a vehicle cargo script, only really care about the X,Y

granite sky
#

Ah, you're trying to stuff boxes together automatically?

pulsar bluff
#

yea

#

basically just improving the vehicle cargo (vehicle in vehicle or whatever) stuff

#

tetris etc

#

with regular bounding box there is a lot of unused space

tidal ferry
#

Dumb question because I can't remember where to find the answer on the Biki

Can you suspend within EventHandler code?

fair drum
tidal ferry
split oxide
#

So setVariable can be JIP compatible (persistent is the verbiage the wiki uses) by setting the last indice of the 2nd argument to true (i.e., missionNamespace setVariable ["myVariable", "heckin", true];). In a multiplayer session, is there a way for the server to edit just the JIP version of a variable without rebroadcasting it to all the clients by repeating the setVariable command (i.e., with the last example for reference, doing a missionNamespace setVariable ["myVariable", "heckin2", true];)?

granite sky
#

No. You can't change the JIP value without rebroadcasting.

royal quartz
#

bit of a strange question. Is there anyway via code or config to interupt the default behavourie of a keybind in arma. For example the R button for "Next Target (Vehicle)" I would like to stop it from doing that function but without unbinding it in controls.

I wish to interrupt its function and run my own. The running my own with inputAction ive done, I just am not sure if I could interrupt the default action. I know I could make my own custom controls but im looking use this specific bound control.

warm hedge
#

No unless using disableUserInput

dusk gust
# royal quartz bit of a strange question. Is there anyway via code or config to interupt the de...

Technically you can override functionality on specific displays for keyboards, however you'd need to take into account different keys, combinations, etc.
This would only be able to be used for keyboard actions as well due the eventhandler allowing blocking. Controllers and mouse input cannot be blocked as far as I am aware.
It's quite a bit of work to do properly, and not quite worth it for the most part.
https://community.bistudio.com/wiki/User_Interface_Event_Handlers

(findDisplay 46) displayAddEventHandler["KeyDown",{
params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"];
true // Intercepts the default action, e.g. pressing Escape won't close the dialog.
}]
warm hedge
#

Oh, indeed that could be one

proven charm
pulsar bluff
#

ya i did something similar for performance

#
_coords = <desired pos>
if (_coords isNotEqualTo (_parent getRelPos _attachedObj)) then {
    _attachedObj attachTo [_parent,_coords];
};
#

basically like that

proven charm
#

i guess no point calling player disableCollisionWith on the attached object?

pulsar bluff
#

what is disabling the collision for?

proven charm
proven charm
pulsar bluff
#

the parent and child dont collide

proven charm
#

thats what i thought

pulsar bluff
#

you do need to manage detaching though... for instance attaching to a safe non-colliding position, prior to detaching

#

you may need to bounce back and forth between modelToWorld and worldToModel

proven charm
#

im actually deleting the attached object when done placing because its local and then I create the new object

pulsar bluff
#

ah k

#

like base building sort of thing

#

or object creation

proven charm
#

ya i call it combat engineering, you can place ladders, planks etc

gleaming onyx
#

I have a script which makes me able to spawn already created boxes (US weapons for example) and vehicles. But if I want to have a box where I choose the inventory and then want to spawn it. How do I do that? Can I somehow save a box that I've adjusted the inventory to?

proven charm
#

well one way to do that is call scripting command to hide the box and when you "spawn" it unhide it. but i dont know how complicated system you are after

drowsy geyser
#

any way to make my other controls visible when i do the below?
private _emptyDisplay = findDisplay 46 createDisplay "RscDisplayEmpty";

drowsy geyser
#

example below of what i mean:

private _text = findDisplay 46 ctrlCreate ["RscStructuredText", -1];    
_text ctrlSetPosition [0.471 * safezoneW + safezoneX, 0.08 * safezoneH + safezoneY, 1 * safezoneW, 1 * safezoneH];  
_text ctrlSetStructuredText parseText format ["<t align='left' size='2' shadow='2'>Hello</t>"];                
_text ctrlSetTextColor [1, 1, 1, 1];     
_text ctrlSetFont "puristaMedium";       
_text ctrlShow true;     
_text ctrlCommit 0;  
 
private _display = findDisplay 46 createDisplay "RscDisplayEmpty";  // create somewhere else later if needed
#

now text is hidden but i need it to stay visible always

willow hound
proven charm
drowsy geyser
#

thanks guys

ancient oyster
#

Hello I am very new to arma 3 scripting and I dont really know what I did wrong so could anyone help?

ancient oyster
real tartan
#

is there some command/function to check if all values in array are equal? looking for something other than looping thru whole array
note: some values can be in array multiple times

real tartan
#

anything after including //

ancient oyster
#

ohhh

#

Okay well thats a no brainer thanks so much

#

Yeah now it works

#

thanks very much!

stable dune
queen cargo
#

mkay ... anybody knows what i am missing here?
_name = "asd"; [markerColor _name, markerAlpha _name, markerPos _name, markerSize _name, markerBrush _name, markerShape _name, markerType _name, markerText _name]
currently struggeling with some solid markers which do not want to show up on the map

#
["Default",1,[0,3000,0],[100,100],"Solid","RECTANGLE","Empty",""]
//Placed manualy using the editor, showing up
["Default",1,[3016.31,5786.72,0],[20,20],"Solid","RECTANGLE","Empty",""]```
ancient oyster
#

Another problem… I wanna make it so that the bombs drop in 1 sec waves so 20 bombs drop then theres a 1 sec deley then another 20 bombs but now theres an error but I dont know what it means. How would i fix it?

#

Also dont mind the wagner error

stable dune