#arma3_scripting
1 messages · Page 176 of 1
thank you
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.
Sorry, this might have an EF dependency. I placed an LPD while testing various obstacles. You can safely remove or force bypass the dependency if you need to.
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
textures must have equal dimensions that are to the power of two. per engine limitation
picture dimensions are power of two, but when I put it on wider tv screen object, texture is spread out fully on screen
what exactly do you mean by wider tv screen object? as in a different object?
you see how WIDE it is, want to keep ratio of picture to be square on wider TV screens
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
The custom option has sounds ya can play in multiplayer. Any ideas on how/if ya could play those sounds via script?
would it be possible to use a different model for ropes?
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
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";
missionNamespace setVariable ["TAG_stringName", 123]; is equivalent to TAG_stringName = 123; 
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 🙃
hello Arma 3 awsome people: Would this be the correct format ?
_randomSound = selectRandom ["ComeGetSome","LetsRock","ComeGetSomeMF"] remoteExec ["playSound"] call BIS_fnc_selectRandom;
Have you read the wiki pages for any of the commands you've put in that code?
well kinda yes i did a sim thing in a EH
with text but ...
im not sure about sound
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.
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
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.
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
It'll probably work, I guess, but kind of by coincidence rather than because it's correct
whats coincidence ?
maby i should explane more
the sounds are defined in the Description.ext and that line of code is in a EH
....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.)
maby i should explane more
the sounds are defined in the Description.ext and that line of code is in a EH
I understand that. I would like you to read what I wrote, and answer the question at the end.
well the EH happends when a enemy get KIA and i have the sounds play
would like to see the EH ?
No, I want you to read what I wrote, and answer the question at the end.
purpose in this code? is to have the sound play when a enemy gets KIA
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?
its just away for me to call the sounds in the EH
So you don't know. Okay. Let me try to explain then.
ok
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.
So what do you need this variable for? What is it used for, specifically?
to call the sounds from the EH
More specifically.
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
You are thinking at the wrong level. I am talking within this line of code.
oh ummm
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?
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
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.
ok i do away with the variable
yes
so, what are you trying to do with your script? select a random sound?
yes
so the variable is for that (?)
It absolutely does not matter that it's inside an EH.
so, one command per line, don't mix them
ok nice
ok will do
try simpler codes
i like simple
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.
so can i show you my EH and can you tell me something about it ?
we have 5 pages of talking about a single line. Imagine seeing entire script?
script is like 10 lines
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_.
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.
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
sooo this ?
_randomSound = selectRandom ["ComeGetSome","LetsRock","ComeGetSomeMF"];
[_randomSound] remoteExec ["playsound", _instigator];
Swap _instigator and _randomSound.
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
holy cow my mission runs way way smoother cuz of you guys thx m8s WooHoo Arma 3 hell yeah thx guys love you guys
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?
According to BIKI, such values are possible: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
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
Does anyone know a simple way to determine if a player has aborted a reload animation?
jeez i dont know m8 sorry
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.
]
I doubt if there even is a way to interrupt one. What kind of interrupt and reload you even mean?
There definitely are ways - GGE Weapon Swap will allow you to change to your pistol mid reload. And I did figure it out, using ARMAs event system
So a Mod, indeed gestureChanged EH or such can work then
It would probably be simpler to move the object rather than deleting it and creating a new one, using setPosASL or setPosATL depending on which format that position is in.
I'm gonna be honest, I didn't think of it ^^'
indeed, should be easier and less prone to bug
and yes ATL, so setPosATL
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)
whatever setPos getMarkerPos "markername";
thanks
I already have the ATL coordinates, I'll reuse them
but I use getMarkerPos to create a trigger for a ppEffect script
copy that m8
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
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?
Do you mean (getPosWorld A) vectorDiff (getPosWorld B)?
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
You probably just want vectorFromTo and a dash of vectorMultiply then.
and afiaik getdirmodelspace doesnt include z co ordinate
thanks ill have a look and try learn i guess best thing to visualize vectors is drawline?
launching an object directly up on z axis then sending it towards "targets" as a weapon
Yes
holy damn thats so much easier than the abomination i had with setvelocity transformation and looks nicer thanks polpox and nikko
is there a way to change the colour etc of a volume light? ive tried set light colour and setlight ambient
Yes. See setLightAttenuation
thanks
Oh you said color. I'm blind (I read change volume of light) 😂
Well setLightColor does change color
that doesnt seem to have a paramater for colour
nvm
weird it doesnt seem to change it ill change a few things and see
Are you trying to use the lights in the day?
nope
though i am using "a3\data_f\volumelight_searchlight.p3d" and not a normal lightsource
Well use setLightIntensity
You mean directional light?
yeah
Did you use setLightConePars to adjust it?
nope havent touched it though it is attached to an object
Use setLightConePars to set its volume and fade
Then use setLightIntensity to change its brightness
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?
bestoff reading description of these and seeing which one fits you best and set the objects texture with setobject texture global
https://community.bistudio.com/wiki/BIS_fnc_playVideo
https://community.bistudio.com/wiki/openYoutubeVideo
https://community.bistudio.com/wiki/setObjectTextureGlobal
Thank you for answering my question
so looks like yeah you can't change the color of the cone shape
also the volume shape is backwards for some reason 
that actually explains a lot about the issue i was having rotating it correctly
yeah you'd have to make your own light volume if you want to change the colour of it
ah shame lol guess no big light cone
oxygen 2 / something that isnt sqf is not something i should touch looking at my amazing lod making skills
(subdivision modifier skill issue on my end)
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"];```
What do you mean by
until I stop the radio
in this context? Until use Stop Radio?
So on line 9, where the Stop Radio function is defined, there is an addAction that basically just respawns the object exactly on the same position
that is what "stops" the radio
And how long these "song"s?
they are all different lengths
Then set _songList length accordinly
the way they are supposed to be calculated is in the waitUntil { time >= _waitTime }; function
Well, you set out that all sounds have the same length -- 25.
well, there is nowhere that I can see where it specifically sets it to that time
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.
but in the code you indicated the same one
what do you mean about this?
The first line in your code contains the same number -- 25.
that's true... hmmm. those are supposed to define the volumes for each song though
i will try to delete those
Regardless of the selected sound, the code waits the same time.
that's true, i feel stupid now. let me test it
that works lmao.
now it starts to throw this error though
code? the code inside your waitUntil no longer returns true/false
Fix it -- the error message clearly says what's the issue.
I see that, however the value it is suppsoed to return technically is a bool?
yes, it waits UNTIL its true
Suspends execution of scheduled script until the given condition satisfied.
if waitUntil { time >= _waitTime }; is still your code then _waitTime is probably undefined?
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
if that's the case, then would _songList not be correctly pulling the song lengths?
maybe i am supposed to define song lengths where all of the 25's are??
Post your _songList.
It's a folder, not _songList
let me test this with all of the 25's replaced with the seconds in time for length
We're asking for your literal code
that wont fix your error
_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
And you still have 25 seconds error from this code?
...
Then I am just not sure what is your issue right now
I may have figured it out by converting the song length in minutes to seconds and putting that as the parameter in the array
so this error magically fixed itself by changing the 25's into the correct seconds?
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
that shouldn't fix that error but anything is possible in Arma ig ¯_(ツ)_/¯
there is no more error as far as the waitUntil function is concerned
Do you mean you still have the error or not?
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
not even by modifying configs and model paths?
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
[content, size, color, skipVarName, bgColor, keepAspect] spawn BIS_fnc_playVideo
relevant part for your code is is [_video, [10, 10]] remoteExec ["BIS_fnc_playVideo"];
so content = _video and size = [10, 10]
Whats the [10,10] mean on first part ?
See the docs onBIS_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
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
give a variable name to your billboard nr and it should work
My bb are named nr in editor and video still play on player monitors not on bb
where are you calling this script from ?
Its on hold action
And the hold action is on the init of the object ?
Trigger on act with true cond
Why do you need hold action if you all ready have trigger ?
I need hold action to play vid on my controll
Hold action are placed on data projection
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.
Video showed on monitor and when its end players can see end pic of vid on the bb , where vid are stoped at end
What script can i use to play a .ogg surrounded and also control the volume?
private _code = [ {}, compile preProcessFile _path ] select ( fileExists _path );
I am getting warning that file in path does not exist
This is because preProcessFile causes that.
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.
_path is non empty string
it should compile before selecting, though?
Oh yeah, that'd do it
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.
private _code = if (fileExists _path) then {compile preProcessFile _path} else {{}}; should do the lazy trick, i suppose?
Is there any command to make screen go full black?
the only way I know is cutText ["", "BLACK OUT"];
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.
sounds like you got the answer 🙂
Yeah thanks 😉
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
{
};
}];
If you're using the latest ace release, that fullHeal function doesn't exist, it will be in the next release
Use [_unit, _unit] call ace_medical_treatment_fnc_fullHeal
I am not sure, I am using official ace mod, same as I used years prior. Just "ace"
Or whatever unit you want to heal
_unit will be the person that got hit, _source will be whatever unit / vehicle damaged them
Yeah that function isn't in the workshop release yet
Gotcha, but I am pretty sure units aint getting setCaptive either
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
allowDamage false probably works with ACE anyway.
- are you sure the "if" is actually activating? Add a
systemChator something to make sure. setCaptivedoesn'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.
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.
They wont leave the area. As in this is for spawn. If they damage another player, they get cuffed. Than someone else can uncuff them manually
I dont think it does.
There's no cuffing in there.
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.
About the first bullet point, I am not sure if its activating, but it should, as I have another safe zone script running, which is identical currently just with different script in then
Alright thats what I needed probably
Now about fullhealing person who was shot, if the function doesnt yet exist, what do I use?
Running fullHeal in the middle of handleDamage is almost certainly not going to do what you want either.
Also ye I will switch to HitPart
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.
Our ace settings rely on medics being busy and having stuff to do, so people usually dont die for a while
Nvm I figured it out I think. Thanks!!!!
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".
It does
There's also a variable you can use, but it's only needed for like scripted health stuff
But then you change EVERY rope in the game. >>>config_editing
not too concerned with that
class CfgVehicles
class All;
class Rope: All {
model = "\A3\Data_f\proxies\Rope\rope.p3d";
};
};
Any tip?
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
([p1, p2, ...] findIf { !(_x inArea myTrigger) }) < 0
Also a "no": You can not change the elasticity of it or any other stuff on it 😦
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
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
Post your code, screens, more info
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
Well desclaimer because this question might be seriously stupid, but this is a serious question though, do you run Arma 3 smoother than 60FPS?
yeah at around average 165 fps
#arma3_feedback_tracker message
99% certain that you're having this issue
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?
Enable Vsync
it's actually enabled already for me
You sure in-game one is
doesn't vsync just limit the game to the refresh rate of ur monitor?
because mine is at 165hz
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
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?
try doMove command
I already tried it but it didn't work
well you must use the first syntax of createUnit and give valid group: _dog = group player createUnit ["Alsatian_Black_F", position player, [], 0, "NONE"];
Expansion: this is because, as indicated in the large red warning on its wiki page, the syntax of createUnit that you were originally using does not return a reference to the unit. So in your original code, _dog contained nothing, and when you tried to use it for other commands it would just fail.
Help :<
is it possible to disable player injured sound effects? i mean if damage player > 0.5
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
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
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
where is the bomb being created?
its funny cause it doesnt even have to be a bomb it could be a tank if i wanted it to LOL
the bomb is already in game i just created a variable named "bombEast_Drone" and honestly if possible i just want it to incorporate the what number drone its trying to attach itself to..
lmk if u need me to rephrase ill try
ill send another ss so u can see
so if you know the bomb variable name you can just use that in the script you posted
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" 
because as i place bombs they update their name
as i place drones they too as well just not the script itself
sigh, maybe just create bombs with the script running on the drone and don't torture yourself?
that IS the drone script LOL just not all of it
its an autonmous drone
suicide diver
I get that
you don't need to place literally everything in the editor. You don't place bullets players would shoot
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
but you randomly pick a bomb and put to random drone?
I pick a specific bomb and can put it to a specific drone
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
because diferent drones with different munnitions have different altitude preferences
but ilyk and get back to u 👍
im curious where you got that script if your new?
It’s from a drone mod and I’m tweaking it to work with A mod called Nr6Hal’s reinforcement module
ok
I’m working on a singles player project with two AI commanders(HAL)
And I’m just bum brushing my brain with information
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.
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*
ok well i hope you find the necessary info from the coding tutorials to be able to do all that
LOL same 🥲
Ty and wish meh luck cause my dum ass gonna need it
Nr6 is already capable of targeting ammo depots I just need to make the drones dependent on that depot wich is why the explosives must be placed in game.
patience is one tip i can give you 🙂
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?
why do you need to keep track of how many times he was healed
Could store a counter on the character and increment it when they heal
Just with a setVariable
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
Because that's how you know when to say which line. 1st heal: line 1. 2nd heal line 2. etc
^
Oh man. ChatGPT. Sometimes it helps. Sometimes I spend hours and never get it to work, lol.
omg no Chat GPT
you can use setVariable if you want to keep track of it
Can you expound on how to use setVariable please? I'm unfamiliar.
_someVariableName =
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.
what is the true doing at the end?
i give you one guess
As you may be able to gather from the documentation, it's a flag to make the variable public (broadcast it to other machines).
He's been helping me for close to 2 years. I agree he's awesome!
and ofcorse all the other great guys in here
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.
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
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}];
};
};
}];
You've defined _newHealCount in this scope and you can continue to use it in this scope. It's just a normal private variable.
You can simplify that a bit though to reduce duplicated code.
if (_newHealCount > 0) then {
private _convo = ["heal1", "heal2", ...] select (_healCount - 1);
[_convo, [POW]] remoteExec ["FoxClub_fnc_Conversation", allPlayers select {_x distance POW <= 100}];
};```
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 🙂
might get more complicated if the number of heals is potentially infinite though 🤔
I haven't tested this yet but I wonder if it would break once he was healed 4 times or more. Like would it just default to that last one or start looping over again?
It would break, can't select a higher number than exists in the array
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.
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}];
};
};
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.
You can drop the >0 check assuming that you're not intentionally chucking negative values in there.
_healConvs = ["heal1", "heal2", ...];
_convo = _healConvs select ((_healCount - 1) % (count _healConvs));
It's more important to make a dynamic system if you have a lot of cases to work through. Making specific cases for, like, 1-3 options is basically fine.
Oh right. Of course there will be no zero'th heal event.
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.
What does % do again in this context? Is it dividing the count of _healConvs?
https://community.bistudio.com/wiki/a_%25_b
Here it prevents the index from going beyond the array bounds, i.e. for array size 3 if _healCount is 1 then the index is 0, if _healCount is 5 then the index is 1, etc.
I have it like this. In testing it only fires the == 1 line, no matter how many heals. So I'm thinking it's not actually counting up. Could that be because of this line?
private _oldHealCount = _object getVariable ["fox_var_healCount",0];
Like every time the EH fires its resetting the variable back to zero?
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.
Ah I was hoping that this would reference the object since this code is pasted inside the object's init inside the editor.
The EH provides a reference to the object it's running on, which you're actually using elsewhere in the code: _injured
Ah okay that make sense to me. So I could just the actual object name or _injured. Cool.
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.
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.
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)
"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?
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.
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?
That is typically how you get commands to execute on other machines, yes
[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];
It would be better to use the unit as the locality target, rather than using 0 which makes all machines execute the command.
0 is the server AND all clients right?
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)
Lemme read.
All machines.
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?
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.
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?
You can use nearestObjects, or https://community.bistudio.com/wiki/BIS_fnc_sortBy if you have an unordered array generated by other means.
Ty about to try it rn
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.
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.
Is that because objects persist globally?
Ahh okay so [_this, ["legs", 0.5]] remoteExec ["setHit", _this]; is it.
This is so confusing to me because. Yeah I get that its GE but the LA throws me off.
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.
Like even if I do it locally, since objects exist globally I feel like it should then update all other machines?
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.
Where do you live? This analogy doesn't make sense to me as an American. Do street lights not operate until you get close to them there?
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.
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?
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.
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.)
You need to make a mod that defines the face in CfgFaces. Then you can use the face's classname with setFace. Unfortunately, CfgFaces can't be modified by missions - a mod is required.
A good safety for this is this sort of check:
if (local this) then {
...
};```
Then the code in the init field will only be executed on one machine, becauses objects can only be local to one machine at a time.
So this command is better place in a file that just get's run once at mission start. IIRC initplayerLocal gets ran whenever that player joins. So init would be better?
init.sqf is also run on all joining machines.
In testing the code within this only works on the local host (server) and doesn't execute on the client.
Presumably because the object in question is local to the server
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.
It doesn't have to, it only has to execute on the machine where the unit is local at the moment of execution. If that's not the client then that's fine.
If you have other code that does need to be executed on other machines, separate that and either put it outside the locality check, or move it somewhere else.
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.
damn, alright well I will try to add it to our unit mod then. Thank you.
How do you guys paste code here? That way you guys can read it clearly and help me troubleshoot more efficiently?
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
Ty
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 👋
its posible to change the opacy of a marker locally, when created in editor?
i want to do sided markers
Yes. There's a whole bunch of setMarkerXxxLocal commands.
Doesn't matter whether they're created in the editor or by script.
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
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.
how do i turn this from a script i found into smth that teleports my whole group not jus me
No idea what variables you have above, but this will include your entire group with your exact script;
{
_x setPos [(getMarkerPos _dest select 0)-0*sin(_dir),(getMarkerPos _dest select 1)-0*cos(_dir),+0];
}forEach (units group player);
I'm still trying to persuade the triumvirate of evil to put this into the upcoming ACE update.
Just push it to 3.5.0, I thought only major releases were intended for new features.
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
Not entirely sure how the Respawn event works and when it runs, however name _unit wont return the variable name of the player, it will return the player name.
If you define each player object with the variable name in the editor, you can use vehicleVarName _unit instead of name _unit
Nice. So I just found a solution. Since I wanted to only have the initial spawn be in the room, setting respawnOnStart = -1 was all I needed and just put the players in the room
Really overthought the problem here
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?
Explain that to the triumvirate of evil then.
what are your sources
Having a simple term "performance" without any credible details sounds simply wrong to measure anything
The performance impact is negligible. The issue with the ambient anim function is that it creates a new logic for every player every time a new player joins the mission. That way you can end up with hundreds if not thousands of logics. And even though they have no model they still need to be handled by the engine.
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.
I see, so in this case, not the Game Logic is the problem but the multiplayer implementation of the function. That is really helpful. Thanks for your help.
Yeah or rather the lack of MP implementation of the function 😄
AmbientAnim is simply poorly implemented
Ah, yeah, I see. Okay, this is really good to know. There was so much confusing stuff I heard and found about this, its really good to get input from more experienced folk. Thanks man
@winter rose wanted to update it but he never lived up to his promise 😄
I did not die! :p
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)
BIS_fnc_ambientAnim2 when?❤️
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 😄
It is much easier to make Community Involvent a thing and deactivate QA team
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"!
Where are you passing through?
between Frankfurt and Stuttgart 🤣
Good thing it's not between Hamburg and Munich
if its between Hamburg and Munich yull be Muniched into Hamburger, he he
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
works when you define size
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
Problem fixed , thank
in case this helps this is the entire script from start to finish
will this change anything
_position = getMarkerPos _dest;
_radius = selectMin (getMarkerSize _dest);
{
_x setVehiclePosition [_position, [], _radius];
} forEach (units player);
There is function (ace uses same in teleport players in zeus)
https://community.bistudio.com/wiki/BIS_fnc_moveToRespawnPosition
https://github.com/acemod/ACE3/blob/master/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf
BIS! GIVE US FINALY removeMagazine FOR VEHICLES/GWH! AAAAAAAAAAAAHHHHHHHHHHHHHHH
is this the whole script?
i dont need the get random dir and move player 15m away thing
Yes.
Reduce radius.
so it should jus be plug and play?
Yes.
This is off topic ash but u guys finished the convo so….. ksp is getting murder this year by Space Engineers 2.. just sayin :))
They had their chance ..
what r u talking abt theyre two different genres
😐
A lot of mf about to make a genre change then.. and so will you 👈hypnotizes
🛎️💫😵💫
There's https://discord.com/channels/105462288051380224/105799655417233408 you know
Yeh Ik I’m just leaving it at that I wasn’t gonna continue… ur absolutely right tho 🫡
[_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?
[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.
Well, crew player only returns player anyway
and fullHealLocal is the local function, so it wouldn't work on other players.
then is it possible to do it globaly, i cant seem to find a different command for it
The normal fullHeal function is global, so this should work:
{[_x, _x] call ACE_medical_treatment_fnc_fullHeal} forEach crew vehicle player;
oh right, just saw what I did xD
thank you for putting up with my stupidness
they do that every day they have me lol
you gotta add an extra underscore in there somewhere, just to mess with people... looking at you BIS_fnc_ambientAnim__terminate...
We love ambient anim 
BIS_fnc_ambientAnim__attached
BIS_fnc_ambientAnim__animset
BIS_fnc_ambientAnim__anims
BIS_fnc_ambientAnim__interpolate
BIS_fnc_ambientAnim__time
BIS_fnc_ambientAnim__logic
BIS_fnc_ambientAnim__linked
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.
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 ""
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?
It doesn't defined that false
It will return false if that is not defined
Forgive me but did you not just say that "values after "" is true by default"?
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.
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.
No, it will read it as 123, because you just told it to use that as the default value.
But it wont proceed to the inner loop UNTIL setvariable 123?
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.
if A3 scripting actually had a supported IDE like reforger, you could set breakpoints and watches to actually see what it is doing.
It is possible AFAIK with VS Code extensions combined with debug mod
debug extension is missing a lot of commands last i checked
Oh, I see
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`.
Help me with this bit please:
For example. Lets take the while loop. It needs to see missionNamespace getVariable ["fox_var_radioLoop",false] to satisfy the condition, right?
So why then does missionNamespace setVariable ["fox_var_radioLoop",true] satisfy the condition?
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.
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.```
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
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?
|| (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.
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.
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.
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
Oh wow that's right! So my condition in the field should actually be:
this || missionNamespace getVariable ["PlayersSpotted", false];
It.. does though.
ArmaDebugEngine does exactly that.
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
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];
My wild guess out there is related with this command: https://community.bistudio.com/wiki/save3DENInventory
Which is related to Arsenal behavior in Eden workspace. From what I can see is so the variable prevents it from inventory randomization
I did look into that, and we don't use that, nor does it seem to set the variable.
Probably something I might have to live with I guess. Just trying to reduce as much network as I can.
Much appreciated
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"];
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
yeah i never saw that saved3deninventory
Actually, is that variable something to concern?
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
no
I just noticed it looking through BE filters that it was getting set at arbitrary times.
oh ok
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?
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];
};
}];
You can just add a Killed event handler to the object you want to trigger it, instead of using the EntityKilled event.
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Killed
_object addEventHandler ["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
}];
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];
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.
hmm, what does str _computer evaluate to here?
1 display per frame does sound like a plausible issue though.
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
To "variableName_0" or "variableName_1", all text within limits of that format. I think explicitly as a test case I use "console_0"
Can you do both? Demonstrating the sphere is important (and could be done in a way that's less opaque), but near impossible to make out actual differences in radius, while the radii are very clear about what a 2D slice looks like
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
Same effect -- dialog under the briefing
If i go back to lobby, I can see it under slots dialog
Well, you can't have anything in the inventory if the player doesn't exist yet.
This will always be visible. Or can it be toggled?
Player already exist at the briefing
If action gear doesn't work, then there is no way. Except recreating the whole menu yourself.
i can make it either or
How work the gear button in units tab?
No idea. It's different.
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
A2 != A3
I once tried to make a "equip yourself during briefing" script.
But I was told there already is a solution by BI.
I like the visuals but I'd probably not always show it.
So I droped it.
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
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 ,,,,,
_object = addEventhandler.
Should be
_object addEventhandler ["killed",...
If you want id of eh
privatel _killedID = _object addEventhandler..
//_killedID will return ID of eh
ahhh ok wow thx m8
Unlikely.
Is the formula for phi correct?
https://observablehq.com/@meetamit/fibonacci-lattices
yeah should be
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
boogers... I need to convert to degrees to use arma's cos and sin
getting there, looks kinda cool
lol what count did you do for that
10k
Now I wish we had an array version of the drawCommants so we don't have to loop through every position
this kinda seems like a cool way to visualize radioactive decay
Yeah, only thing is you need a lot of points for some decent density
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
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
Probably because the person and bench are colliding
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.
https://community.bistudio.com/wiki/disableCollisionWith, another command you may need is https://community.bistudio.com/wiki/attachTo.
I've tried attachTo but it locks the player ability to move the head. But I didn't know about disableCollisionWith, this is an interesting command ! Thank you !
If you need to position the unit relative to the object so that its feet are under the terrain level or levitate above the terrain level, then you may need the attachTo command to lock it in place.
DisableCollisionwith doesn't seems to do anything.
and when I attach a player to the bench with attachTo I loose the ability to move my head
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
Ace mod have sitting,
Why don't you take a look at how they are doing that?
https://github.com/acemod/ACE3/blob/master/addons/sitting/functions/fnc_sit.sqf
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.
I did look into it. when I saw they used a negative Z position for their offset in their cfgVehicles, I've changed mine to a -1.
It is a player. the animation used are the ace's sitting animation (e.g. "ace_sitting_HubSittingChairA_idle1").
You can't expect a player to be able to move his head when it is playing an animation with all the body parts. But maybe the ACE anim is different.
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 !
What is the bug?
😄 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.
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];
Is the observing player (the one just standing) already on the server when the change is happening?
Yes, I use a local dedicated server with the Lan Only option, so I have two Client instance and one server instance . I can see both happening in real time.
This should be working fine, you definitely have some bugs in your code.
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?
I've attached the bench to an invisible Heli and did not disableColision because it works only on the side of the bench (I think the guys that did the bench did something wrong), but not the unit. I just want to keep the free movement head.
Wait, is this something like a moving space ship or something?
Well it is a space ship, but not a moving one. It's always static and can't be moved. I've attach the bench because overwise they fly everywhere due to colisions
Is the plastic chair also attached to the heli?
OK, that's a progress.
I would try to attach the unit to a logic object.
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
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.
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
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.
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.
use setVelocityTransformation every frame. that way the player will stay in place like attachTo and he can still look around
Just tried it, and it didn't work
It's pretty easy to make "a mission". Plop down some stuff in the Editor, hit Export and you have "a mission".
The level of complexity depends on what you want the mission to contain.
#arma3_editor might be a good place to start if you've never done it before. For basic mission making, no scripting is required.
Thank you
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.
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
Okay, my mistake. But AGL conversion is still an annoying problem in this situation and setting to ASL would still guaranteed solve it.
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.
Could you update the wiki to reflect that? Currently it just says "Position"
AGL is very similar to ASL when over the sea because it's measured from the wavetop height.
Over land, AGL's "zero" is higher than 0 ASL, so giving an ASL position on land to an AGL command would result in the object being placed too high.
looks like it uses AGLS
unless you use CAN_COLLIDE
What does it use then?
hmm it still uses AGLS, but if he can't "float" it places him under water instead of above 
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
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.
Incredibly annoying that it isn't just the same as createVehicle
To me, it would be enough, if all the commands had explicitly stated position type. 😄 I bet there are some cases where you literally can not match some commands (use together) due to how they process the positions.
I would love to have createVehicleASL and createUnitASL commands to not have to deal with any of this
looks like createVehicle also uses AGLS height 
I always thought it was AGL
actually no it was AGL, my bad
I always assumed the wiki was correct (ATL except for floaties, which are AGL) :U
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
If you want use mission eventhandeler,
Use
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#EntityKilled
And your need check typeOf unit
yeah i dont know what im doing here
If you want check is your unit type "O_Offiser_F"
oh ok ill try
this part should be
_unit isEqualTo "O_Officer_F"
-->
typeOf _unit == "O_Officer_F"
ahhh ok nice
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
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
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 ?
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
You're welcome 🤗😁
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 ========================================================================================
https://dev.arma3.com/post/spotrep-00056
Added: A "saved3DENInventory" variable is saved to a character's variable space at the scenario start after the character's loadout was customized
So, once per player join?
Ah found it. Its engine code yeah. It is set once when the player unit is created, and is pubVar'd
can you pack me that into a mission folder as a repro, and probalby make a feedback tracker ticket about it? if it keeps happening?
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?
Without the code that you use and Mods that you use ,
Cannot say where your issue is.
yeah lets see the code m8 i want to learn more and more and more
thx god i dont use any mods omg
Could you share your code of HandleDamage event
@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
It's pretty simple.
this addEventHandler ["HandleDamage", {0.99999997019767755}];
All the numbers are from me trying to figure out at which point the instant death turns into invincibility.
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
dont we need to get the damage 1st then we can chane the damage
or at least private _damage = damage player;
So copy paste this into the unit and adjust all the variables as needed?
im not sure m8 im just a peeon better ask them good guys
I do not know what that reaction means.
you put that stuff in the EH not the unit
EH?
eventHandler
Kk
So what do all those numbers even mean?
(If you can’t tell, I’ve got zero scripting skills.)
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
yes the numbers you see in there are explaned in the code
Maybe I’m blind, but I don’t see any explanations.
just read it out loud say it like this _unit _this select 0;
if you say it it will start to make sense
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?
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
I’m looking for something I can just slap into a unit without needing to throw it into the mission script.
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
kk
not that i can even help that much im still learning myself
Managed to figure it out.
Just threw that into my units, adjusted one of the values, and bam.
Thanks for the help.
is it good idea to call attachTo each frame on local simpleobject? i mean there shouldnt be any network traffic from that?
Why do you need to call attachto every frame?
made a object placing script, where player needs to position the object
I did the same kind of solution , and didn't get any performance traffic because everything happens on client.
yeah thats what im hoping for
https://youtu.be/NaJ09KIaIoY?feature=shared
Like this.
Action to build a tent , and show up where your object should "spawn" after it's done
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...
If you are using any mod, every mod can cause more lag than your one little code that is using each of frame event.
If your code is not infinite, it doesn't affect the client noticeably.
If you don't broadcast your event for every client I bet you are safe.
just thinking how fast attachTo is when used every frame
What are you attaching the object to?
player (client side)
umm i think we know how to use attachTo scotty 🙂 thx
alright ty
It should be fine but Arma has been known to broadcast things that shouldn't be broadcast.
yea you never know 🤔
Spam it a bit and check whether there are any related errors in the server RPT.
test it in multiplayer?
DS + client, yeah.
ok i'll do that when i get the time
if you have tested it in dedi that should suffice
I'll make a FB tracker bug when I remember my password
Can a player unit be moved (run/walk) via script?
what do you mean run walk ? You can teleport player unit you can also set speed of animation for walking/running but what do you mean moved run walk ?
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
You could make your own display for this and create it with createDisplay
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.
Hello folks. By any chance does anyone have a script to make OPFOR randomly mortar areas around BLUFOR players on multiplayer
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?";
yes.
What would make it different?
I was thinking that any time I write _randomPlayer it would then reiterate the process = selectRandom _playersinHeli; thus making it a new player.
Nope
You're saving the return from selectRandom _playersInHeli to the variable
So to change the variable I would then have to write again: _randomPlayer = selectRandom _playersinHeli;?
If you wanted another random player, yes
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?
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
you only need to exec "attachTo" if the coords change
Would this throw and error if the pow was alive at one point but dead before this code ran?
if (pow in heli) then {
No
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...
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
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.
boundingBoxReal and using clipping type 0 or 2 with it as well
yet still wildly inaccurate related to geometry
for instance when used for "does this object fit somewhere" scripts
what about boundingBoxReal [object, "Geometry"]
the problem with the boundingbox is it includes memorypoints and proxies
like in this example the reason its so tall is the gunner proxy triangle is probably pushing the size up
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?
interesting didnt even know this was possible
ie. this, the line representing the 'side view' of a 2d triangle
Is that different to clipping type 2 with the other syntax?
wow yes it is
it can be but im not sure what clipgeometry uses
Kerc just solved my problem
the above is 0 boundingBoxReal _obj
below is boundingBoxReal [_obj,'geometry'];
Yeah and the visual lods (0) would have the crew proxies in them
I would suggest firegeometry instead as its usualy more accurate but it has the crew proxies problem agian
just saved me from a few hours of fiddling around with redoing bounding boxes using raycasts
Hopefully the launcher isn't collision geometry...
its for a vehicle cargo script, only really care about the X,Y
Ah, you're trying to stuff boxes together automatically?
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
Dumb question because I can't remember where to find the answer on the Biki
Can you suspend within EventHandler code?
no, you'll have to spawn something within the event handler if you want to
Didn't think so
Thanks!
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];)?
No. You can't change the JIP value without rebroadcasting.
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.
No unless using disableUserInput
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.
}]
Oh, indeed that could be one
man thats a good idea. why didnt I think of that 👍 there's now maybe a small lag when changing the object position which i guess is because KeyDown/KeyUp EH doesnt run fast enough? not a big deal though...
ya i did something similar for performance
_coords = <desired pos>
if (_coords isNotEqualTo (_parent getRelPos _attachedObj)) then {
_attachedObj attachTo [_parent,_coords];
};
basically like that
i guess no point calling player disableCollisionWith on the attached object?
what is disabling the collision for?
yep got that one working
so that player and the placed object wont collide
the parent and child dont collide
thats what i thought
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
im actually deleting the attached object when done placing because its local and then I create the new object
ya i call it combat engineering, you can place ladders, planks etc
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?
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
any way to make my other controls visible when i do the below?
private _emptyDisplay = findDisplay 46 createDisplay "RscDisplayEmpty";
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
The text is hidden because you created it on display 46 and then immediately created _display on top of display 46. Now display 46 is hidden behind _display (which is empty). Only one display can be seen at any time; it is not possible to show two displays at once.
if something permanent is needed use https://community.bistudio.com/wiki/cutRsc
thanks guys
Hello I am very new to arma 3 scripting and I dont really know what I did wrong so could anyone help?
I am trying make a script to bomb the tanks when they enter the trigger
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
remove comments from code
anything after including //
ohhh
Okay well thats a no brainer thanks so much
Yeah now it works
thanks very much!
Could you give an example where and for what you use it for.
You want to check that the x value in the array is x.
Let's say you have an array
[1,2,3,4]
And you want to compare is 3rd value 3 or not?
Or whole array
[1,2,3,4] is equalt to [1,0,3,5]
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",""]```
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
If you are using sleep you need use scheduled environment,
See spawn
https://community.bistudio.com/wiki/spawn
Execute your code in an environment where suspension is allowed: https://community.bistudio.com/wiki/Scheduler#Scheduled_Environment