#arma3_scripting
1 messages · Page 539 of 1
hey, just wondering is there an easy script to run on the debug console to force ai to leave player targeted vehicle, ai in the mission are staying in the vehicle even if its disbaled
hey there. Is it possible somehow to terminate local function inside script? lets say i have function stored in local variable "_fnc" then i call it and during the script i want to terminate it immediately. Some tips?
@lucid junco _thisScript
https://community.bistudio.com/wiki/Magic_Variables
terminate= you're happy
nah don't worry! I admit I have an advantage here, the temp dropped @ 25°C hehe
Vive la France pour ses températures extrêmes
Whta's the best way to create a UI element in Zeus?
i currently have this
_emptyDisplay = findDisplay 312 createDisplay "dialogName";
but the zeus ui disappears and it closes when escape is pressed
_this addEventHandler ["FiredNear", "_fired = true"]; someone know why after its fired _fired var is still false? 8-o
fired is a local variable
you mean _fired
yes, i want to change local var _fired to true
well a local variable is... local
in fact it has worked
It only changes. locally
but only inside the code block
yes
so if you had sqf _this addEventHandler ["FiredNear", "_fired = true; hint _fired"]
if you had... that would be a syntax error
why?
boolean
oh yeah
well something like that
i always forget the format
still can't find any documentation on how to have zeus gui + description.ext guis
seems like an odd issue
like cutRsc only having one resource
_this= civ5;
_bed = bed5;
sleep 1;
_fired = false;
_this disableAI "AUTOCOMBAT";
_this addEventHandler ["FiredNear", "_fired = true"];
//calm fnc
_calm =
{
while {true} do {
_this setbehaviour "careless";
_this setunitpos "UP";
_this setspeedmode "limited";
sleep 5;
hint format ["Hello %1",_fired];
//sleep.......................................
cant work like this?
_fired is local
so _fired only gets changed in the event handler code
the other bits don't 'know' about it
in my case i cant use global var fo this shit
why not?
this script will be for civ units for changing behaviour and there will be many of them. So global var affect all of them
ah
so
what you can do is
setVariable
basically stores a variable inside the namespace of an object
like one of the civ units
so each one would have its own 'fired'
Or, put your code directly inside the EH
yeaha
oops
Ok so I can create a control with zeus
with ctrlCreate
but can't create a whole dialog
ooh control groups
hi, im trying to add military rank icons on the Drawicon3d but its not working, the icons are in the mission file , drawIcon3D ["*Military ranks here*",[1,1,1,1],_pos,0.65,0.65,0,_text,2,0.03,"PuristaMedium"];
Military ranks icon change upon Variable levels
is your icon called sqf *Military ranks here*
hang on
that's where you put the path to your texture
im just showing u
"ranks\5.paa"
i tried that but doesnt show
ranks is a folder in the mission file
yes
drawIcon3D ["ranks\5.paa",[1,1,1,1],_pos,0.65,0.65,0,_text,2,0.03,"PuristaMedium"];
Is there a way of doing a massive paratrooper invasion like d-day without much hit on the performance? I was looking for something to make the ambient more immersive. The units doesn't not need to have any logic at all, they can even be deleted after touching the ground.
agents
you could either make them agents or just simple objects which are keyframed
also wow that pfp
where did you define _pos @dim kernel
That's awesome, thanks. I think that will just fine!
Btw, I didn't know that I could make an unit a simple object, thanks 😃
Im not sure you can
private _pos = (_unit modelToWorldVisual (_unit selectionPosition "head"));
_pos set [2, (_pos select 2) + 0.35]; ```
@tough abyss
outside of EH or inside?
i meant with an addon type thing
or even just spawn a parachute object
actually not sure if you can get the opened animation since it's a vehicle
eh actually you can be dead in an open parachute so probably
all inside
is there a way to snap an object to the floor below it when detached from the player? (making a carry object script)
even if placed inside a building
get player eyepos, then lineIntersects downwards to find the next ground. Then snap object to that position
thanks!
any idea why icons in the mission doesnt show with drawicon3d
Yes.
what
showHUD might be set to false, your icon may not be in the correct 2^x × 2^y format, your icon doesn't exist, your game isn't started, your computer doesn't have a CPU, or you are actually dreaming
k ty
Not sure if drawIcon3D requires the entire path similar to playSound3D
But if I had to guess, probably
Not sure if drawIcon3D requires the entire path similar to playSound3D
But if I had to guess, probably
Example:
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\repair_ca.paa", _Color, _inModelPos, 1, 1, 45, _Text , 2, 0.0325, "RobotoCondensed", "center", false];
@ruby breach
@dim kernel
_CTarget = cursorTarget/cursorObject/DoWhatYouWant;
_inModelPos = (_CTarget modelToWorld (_CTarget selectionPosition [_PointName, "HitPoints"]));```
In this case i selected a memory Point
Are you sure, it does have the correct position?
hey uhh, my debug console has gone to half size , doesnt have the previous script buttons and stuff anymore, dont know what ive done or how to fix it, anybody experienced this and how do i fix it?
Hey there. If I do something like
{
if(blabla) exitWith {blublu};
someCode;
} forEach _array;
Will the exitWith break the whole forEach stuff, or only the current iteration ?
ahhhhhhh thank you
@jade abyss In his case, it'd probably be ```sqf
private _fullPath = (str missionConfigFile select [0, count str missionConfigFile - 15]) + "ranks\5.paa"; //maybe \ranks\5.paa?
drawIcon3D [_fullPath,[1,1,1,1],_pos,0.65,0.65,0,_text,2,0.03,"PuristaMedium"];
Now that I'm at a PC I can be bothered to actually do that lol
If I have an object, with variables set on it, and I delete the object, do the variables stick about? I'd expect not, but with ArmA can never be sure...
They don't, there would be no way to access them anyway.
Would anyone happen to know a script to get global chat to display something along the lines of "NameHere: I am a dipshit and shot a civie" when a player kills a civilian?
the _killer var never gets correctly passed through. Its always the victim object
code?
params ["_Victim", "_Killer", "_Instigator", "_bEffects"];
if(isNull _Killer) then{ _Killer = _Instigator; };
_killerstring = format ["The civilian %1 has been killed", name (_victim)];
hint _killerstring;
}];```
Is there someway to make the Nyx Recon be able to lock onto targets and provide info about them on the sensor UI itselves
Like in King Of The Hill servers
This must be a simple script
what is a good way to get a player out of a Failed animation? to reset them essentially?
like being stuck in drag animation
thx
With remoteExec, is the types array parameter target certain units or just any types in array?
I'm positive it's the latter of the two. Making that many remoteExec calls to complete my use for it would cause insane net usage when walking into towns.
Hey, I am trying to add the base root of my folder inside my rvmat texture file. :
#define PATH "mission.Altis\rvmats\data\"
and in rvmat:
class Stage1
{
texture=PATH "body_nohq.paa";
}
but Im not sure how I shoul write it in texture =
any ideas how to get displayEH working in briefing screen? (keyDown or mouseButtonDown)
i can find the native displays and add EHs but they wont trigger
(setting onMapSingleClick works though)
@high marsh I am not sure I got your question?
Briefing screen has a bunch of own displays, you sure you get the right ones @velvet merlin ?
Is there no way at all to make a path with pre process command ?
What?
I mean I cant concatenate strings with macros ?
Here is what I get :
mission.altis\rvmats\data\"body_nohq.paa.
And Im going to try this when my game load :
#define SETPATH(var1) mission.Altis\rvmats\data\##var1.paa
Ok so i'll remove it
But it give me this now :
13:07:18 Warning Message: Cannot load texture mission.altis\rvmats\data\"body_nohq".paa.
He cant found the texture because of the quotes
Don’t use quotes then
If I dont do this :
texture=SETPATH("body_nohq");
The game crash
I mean If I dont put quotes
"The game crash" and why? what does it tell you?
using quotes in there is wrong. Remove them.
I figured it out why it crashed, I think this is because the macro was trying to concatenates what's before the ## with what's after it, and it wasnt the same type
Now I have my path:
13:13:23 Warning Message: Cannot load texture mission.altis\rvmats\data\body_nohq.paa.
without extra quotes
Yes but I tried it before you told me
I should probably stringify it now, thanks
Can I do something like this ?
texture=STRINGIFY(SETPATH(body_nohq));
Yes
Ok, I'll give it a try!
Such a macro is usually called QUOTE (ACE,CBA, Many C/C++ projects)
but you shouldn't need to
config files will quote automatically
Oh okay, so thats weird it doesnt found the texture
And if you got
Warning Message: Cannot load texture mission.altis\rvmats\data\body_nohq.paa
That means it already quoted it correctly
why is that weird?
The path looks wrong to me, I thought you know that
"mission.altis" doesn't look like a pboprefix
it looks like a mission foldername, and that's not how internal pathing works
Thats rvmat inside the mission folder, I tought I had to set the full path, but I think you're right, should I remove the .Altis ?
That is not the full path
no you shouldn't
that's not how mission paths work
you probably need a full path, which.... is kinda complicated
and i don't think the preprocessor can even do it
you could try local path
just "data\body_nohq.paa" but I don't think that'll work
I've already tried such a path, it doesn't work
You need the full path
You can start the mission, and execute str missionConfigFile in debug console
that should give you the full path to the mission
but that can change on your computer/on a dedicated server/on other players
@tough abyss allDisplays lists these
in briefing mode from 2d editor you have:
0 - RscDisplayMain (main menu)
26 - RscDisplayArcadeMap
37 - RscDisplayGetReady (briefing)
i added to all of them; 26 triggers 4x but only before you can interact
["26x",[Display #26,56,false,false,true]]
["26x",[Display #26,15,false,false,true]]
["26x",[Display #26,15,false,false,true]]```
tried KeyDown, MouseButtonDown, MouseZChanged
actually it seems to trigger when i return to the editor - so not in the briefing phase itself
["allDisplays",[Display #0,Display #26,Display #37]]
["IGUI_displays",[Display #305,Display #303,Display #300,Display #300,Display #311,Display #320,Display #313,Display #315,Display #312]]
is what is said to be available but seems the DEH is not handled during briefing phase
@still forum Lmao so here is the path :
texture="C:\Users\x\Documents\Arma 3 - Other Profiles\x\missions\mission.Altis\rvmats\data\body_nohq.paa";
there is no way I can get it working in MP, I need to make a mod
could be the engine blocking the DEH. there is some scripted, some ctrl and a mission loaded EH by rscdiary.sqf
Would it be possible to force respawn "dead players" at the same time?
[0] remoteExec ["setPlayerRespawnTime", 0];
You need atomic clock for that otherwise players closest to the server will spawn first 😂
hello guys, sorry to bother but im really stuck with something. Maybe it it global and local execution problem but wondering if anyone could point me in the right direction
im trying to modify alias's screamer script so it is compatible with ACE
alias scripts are awfully documented nad buggy
probably easier to create your own thing than get his running reliably
his does work reliably though
the issue isnt his script
its ace
or more likely a gap in my understanding
i modified the following to this
one sec
scream_on=true;
{_x setVelocity [1+random 3,1+random 3,1+random 5]; _x setDammage ((getDammage _x) + 0.2)} foreach _units_range_1;
sleep 0.1;
{_x setVelocity [1+random 3,1+random 3,1+random 5]; _x setDammage ((getDammage _x) + 0.2)} foreach _units_range_2;
sleep 0.1;
{_x setVelocity [1+random 3,1+random 3,1+random 5]; _x setDammage ((getDammage _x) + 0.2)} foreach _units_range_3;
_wave_obj setVelocity [_press_implicit_x*_al_pressure,_press_implicit_y*_al_pressure,0];
to
[_entitate] call fnc_avoid_screamer;
scream_on=true;
{
_x setVelocity [1+random 3,1+random 3,1+random 5];
_selection = selectRandom ["body","head","hand_r","hand_l","leg_r","leg_l"];
[_x, 0.5, _selection, "stab"] call ace_medical_fnc_addDamageToUnit;
}foreach _units_range_1;
sleep 0.1;
{
_x setVelocity [1+random 3,1+random 3,1+random 5];
_selection = selectRandom ["body","head","hand_r","hand_l","leg_r","leg_l"];
[_x, 0.4, _selection, "stab"] call ace_medical_fnc_addDamageToUnit;
} foreach _units_range_2;
sleep 0.1;
{
_x setVelocity [1+random 3,1+random 3,1+random 5];
_selection = selectRandom ["body","head","hand_r","hand_l","leg_r","leg_l"];
[_x, 0.3, _selection, "stab"] call ace_medical_fnc_addDamageToUnit;
} foreach _units_range_3;
_wave_obj setVelocity [_press_implicit_x*_al_pressure,_press_implicit_y*_al_pressure,0];```
lel
```sqf
```
so it randomly gives ace damage to some body part?
yeah thats all i want it to do
and it works locally
just not when i run it on dedicated
when the thing attacks
hm
use remote exec then.
iirc ace damage are global and dont need to be run locally
it more likely the initialization, f.e. the script is executed locally but has a if !(isServer) exitwith {} somewhere
yeah it does, that could be a start to fiddle with
i am 95% sure if you do
[_unit, 0.8, "rightleg", "bullet"] call ace_medical_fnc_addDamageToUnit
initialized on the server it will work on dedicated.
but thats rather an Alias script problem, they are not optimized for multiplayer and dedicated. i used his fire script and it drove me crazy
that at least gives me two things to have a whack at least, so thanks guys. Been pulling my hair out, coder but new to arma scripting and forgot about joys of replication / server client stuff
massively appreciated as tearing hair out/ driving crazy sounds familiar
also been having issues just with GetPos over water because im not used to it
do some tests with the ace medical and check it thats the problem. bc its probably not
would have thought getPosASL would get me what i need but nope, spawns me in space. Over land agl works fine for teleport stuff.
noice!
Is there anyway to make Icons drawn with drawIcon clickable? Would like to select Units on a RscMinimap like on an UAV terminal. Is there an easy solution for this?
i soon found out i needed to use a different function to get the required z level but guess i forgot the set one
thanks lads major props
@oblique vale pls tag me if you find a solution
Would it be possible to define different insignia based on rank?
class CfgUnitInsignia
{
class 111thID
{
displayName = "111th Infantry Division";
author = "Bohemia Interactive";
texture = "\a3\UI_F_Bootcamp\Data\CfgUnitInsignia\B_111thID_texture_ca.paa";
textureVehicle = "";
};
};
This is the example I picked up from the wiki
I assume this applies to every player?
you can manually do it with scripting
Could you point me in a good direction to get this done please?
Just a basic of how I would go about doing this ^^
Correct me if im wrong but https://community.bistudio.com/wiki/Arma_3_Unit_Insignia should help you out @real moat
would also help
you should be able to make a simple script to detect players ranks every 10 seconds or so and then apply the correct insignia they require
Thanks! Will have a look at these.
I wander if using on player respawn instead of running a loop would be better though
can their rank only change on respawn?
@winter rose
When using an array as your target for remoteExec. Do all units of the same type listed in array get effected? Or anything that those specific objects are local to.
hey fellas, i'm checking to see if players are nearby a military base/airport and spawning in units and despawning them when players are far away
is the best way to do this with while
i'm using a nested forEach loop, the first checking players positions, and then comparing each pos to distance to base/airport
idk if thats the best way to do it
Use nearEntities with a loop.
im just worried about performance server side
like is that check intensive at all? idk
while{SpawnAllTheAI} do {
_enemies = _airPortObj nearEntities["Man",300] select {(side _x) isEqualTo "EAST"};
if
};
oh whattt i didnt realize you could do that
Not really. Add suspension to that loop (sleep)
thats sick
nearEntities is really cheap.
thanks man! thats really helpful
:+1:
Which function is best to use if id like AI to enter search and potentially occupy buildings for a while while patrolling? There should be ace functions but i cant seem to find them
Or cba i guess
Also does AI automatically switch back to safe behaviour after a certain time or so?
@high marsh it's array of target types, such as group, unit etc. ; not a unit type as "B_Soldier_F"
Weird. I tried this, but it kept broadcasting to every unit of that type. So I was curious.
/*
Initializes interaction with regular civilian AI
*/
interactionWeapon = getArray(missionConfigFile >> "CfgInteractions" >> "civ" >> "civ_upsale" >> "civ_weapons");
params[
["_ai",objNull,[objNull]]
];
_ai call rpg_fnc_requestReader;
isChatting = false;
while{alive _ai} do {
if(!isChatting) then {
nearPlayers = _ai nearEntities["Man",10];
radioIndex = missionNamespace getVariable["RPG_READER",2];
[str nearPlayers] remoteExec["systemChat",0];
[_ai,format["[%1]: %2",name _ai,selectRandom interactionWeapon]] remoteExec["globalChat",nearPlayers];
sleep 10;
};
};
and no. This isn't life.
@proven crystal there are scripts out there occupying buildings, but usually they occupy at mission start. AI has kind of a hard time dynamicylly entering and leaving buildings so some scripts just TP em.
especially multi story buildings and buildings from mods. had to write a "check if stuck" part for random village patrols bc over time more and more ai would get stuck at house entrances
any ideas how to get a building's modelToWorld position from where the cursor is being pointed at?
If cursor is center of the screen then its easy
Otherwise there is no way to get where your cursor is pointed. You can get weapon vector but only if you have weapon up.
For center of a screen - make a vector with positionCameraToWorld, say 50 meters in front of you, [0,0,0] to [0,50,0]. Cast a ray with lineIntersectsSurfaces, find your building in results (or any applicable building), get intersection point and building and worldToModel it
@plain urchin
can you tell me how you made the nyx recon be able to lock onto it's target
in KOTH
vanilla Nyx Recons dont do this
Hm, I don't think I did anything specific to Nyx Recon
Lock as in engine lock with T?
How did you test it? Against empty vehicle?
thank you sa-matra, that's helpful
No,against live moving helis and planes
The targets shows up on the radar
but cant lock onto them
so no info,nothing
🤔
Other Radars work fine though,like from a Cheetah or a tigris
I didn't really do anything to it in KotH
but he probably didn't :laugh:
Watch out for cyber police!
I just checked, nothing done to it apart from setting some camos
thx man,i will check if my game is corrupted or something
maybe you disabledAI?
Maybe you had your button unbinded since you played KotH or something?
i need to verify my game files
@high marsh if _ai means AI
Then they are probably on the server. All of them.
remoteExec executes the code where "unit is local" not on "unit"
Precisely.
systemChat has local effects. With AI being local to server, I need every unit within a certain proximity to recieve the effects.
is there a way for AI to target an object? i want to give suppresive fire by AI at positions without a "legitimate tartget"
basically make it the AI shoot at any position i want
also is there a function to shuffle/ randomize an array?
Ai doesn't drive the car
I delete the gunner
ai starts driving
How do I fix this?
i read something about this constellation, but it was an rhs btr. put the sql in the gunner seat.
@spark turret thanks. But AI seems to do their job ok when i use ACE (or Achilles?) modules for occupation. Id like to work with those functions
But cant find them i. The functions viewer
Anyone know how I might be able to remove ace interact from specific units?
Havent found anything in ACEs documentation
can someone help me correctly understand waitUntil {x} function?
It's a while loop
with the condition in the {}
and a ! around the condition
while not x, wait
It checks on every frame, so add sleep in the beginning and make sure it returns true at some point
wait until x
yeah i got that, and the last line in the {} has to be the condition?
Yup
okay thanks. took some time to figure out the "last line has to return true boolean"
waitUntil { sleep 1; hint "you're alive" ; not alive player} ;```
yep it works now. awesome
:+1: kewl!
Is it possible to make it so stepping in water kills you. And if so how would one do that. Trying to recreate lava, any ideas or better ideas of what would work best?
what happens if i have a large array as global variable and change one element in it and broadcast change to all clients. Effectively, would the entire array be sent over network again or just the change? (i'm assuming entire array?)
I would assume the whole array too.
Clients could change the array in meantime so diff only would be useless then.
Now are there any better ways to do lava?
Cuz i could make it a dynamic object, just want it so whenever something steps on it it burns and dies
@austere hawk entire
hm... unfortunate, but expected
What’s in the array?
Lava
So my options are orange color the water or make lava objects
Either one, the player has to die when step in/over
Not sure what is best
i will have to use lava objects either way so is there way to execute or burn a player that steps on a certain object?
its a matrix, each cell having data arrays (mission related) . I suppose i can store the dynamic data elsewhere (maybe in object-space of game objects) - just not as handy
you might be able to use a publicvariable eventhandler or something similar, have it send the position and contents in the array that needs changing
and change it locally
Or is there a way to make an “infinite mine” with no explosion or sound and that is the object so if they step on it they die?
particles can cause fire damage
Particles hmm, so have it emit particles?
yeah but iirc vehicles are immune to fire damage
If im making a map that is 100km2 and 30% lava... is that smart?
i'd just script it
depends on their config, but yeah they are pretty resistant mostly
make the water lava
How to make water kill?
isSurfaceWater and whatever the underwater one is = dead
or burn xD
covering 30km² with particles is not very cpu friendly....
Not cpu friendly indeed
Covering 30sqkm with anything is not cpu friendly
The map im making is very rocky and mountainous, so lava is found everywhere, not just sea level, i mean i could just make the lava be straight down into the deadly water
looking for what is best option haha
or even better.... can i make a certain color of my satmap kill/burn things?
is that possible?
cuz if so jackpot baby
you can detect what kind of surface material someone is standing on (originally used for sound environment stuff) iirc
So i can turn a material to kill things? What would that command look like? (Im not good at scripting, its just necessary for this part of map lol)
Lets say my material is sand that kills
every object needs eventhandler that checks at intervalls if it stands on earth blood
yeah
So im talking about like in the terrain
that's pretty much the only sane way of doing it
_surface = surfaceType position player;
if _surface = sand
kill player
Else
Continue
End
Is that how arma scripting works 😂
no
and why do you want all the sand to kill people
sand is like the opposite of lava
:D
just example XD
@balmy crescent see https://community.bistudio.com/wiki/Code_Optimisation
while{alive player} do {
waitUntil{(surfaceType position player) isEqualTo "#sand"};
player setDamage 1;
};
-while
Is there a way to check if a unit in a parachute have reached the ground? I want to delete the unit after touching the ground.
@brazen ibex
isTouchingGround parachute
isNull parachute
thanks
@high marsh flies helicopter over sand
@jagged bay if (_unit getPosAtl select 2 <= 1) then {hint str "touchdown"}
I'm having an issue with custom radios
It's the first time I've used them
_c1Name = "Acorn 1\'1 Squad Net";
_c1 = radioChannelCreate [[0.6, 0, 0], _c1Name, "%UNIT_NAME", [], false];
[_c1 {_this radoiChannelAdd [A11SL, A11SM, A11ATL, A11BTL]}] remoteExec ["call", [0, -2] select isDedicated, _c1Name];
That's the code I have so far, but it's not working
radoi*
also channel should be created on every machine iirc; please check the wiki @zinc rapids
Thanks for the assistance, local worked
is it possible to convert String to Object
allUnits select {str _x isEqualTo "STRING"} param [0,objNull];
``` (or similar)
Hey everyone. I'm pretty amateur with scripts and was wondering if someone could help me out with a small issue I can't solve.
I have a little gimmick mission where the last person standing fires a script to say titleCut [ format ["%1 Wins.", name _player], "Plain"]; before ending the mission.
What would be a way get it to pull the last alive player's name?
allPlayers select 0, assuming you already sure there is just one player left.
@ruby breach Yikes.
private _lastAlive = (allPlayers - allDeadMen) param [0, objNull];
hint str ([name _lastAlive, "All Dead"] select isNull _lastAlive);
@muted ember
Thanks, I'll try it out!
This will pull name of any one player that is alive. If you want the only alive player then you should additionally check that ```sqf
count (allPlayers - allDeadMen) == 1
Oh wait, I thought allPlayers doesn't have dead players like playableUnits
You need some coffee dude, playableUnits contains ONLY alive players
Don't watergun yourself smh
so i finally found the ace functions to garrison or ungarrison buildings. now is there a way to check whether or not a unit is garrisoned? otherwise ill just write a variable to the units, but im wondering whether something like that altready is in it
so sometimes it seems that group leaders dont want to leave buildings. they get stuck in certain positions on the way out, and try to get back there when i move them by hand. also when i delete the leader then, the next guy goes to that position.
also the garrison function seems to switch them to aware
hmmm there seems to be something with a scriptedwaypoint
hm that just lets them walk into a building but it looks in no way garrisoned. they are just standing around in ground floor
with the ace fuction they do enter the buildings nicely. the teleport is optional. filling up buildings is ok. just occacionally TLs get stuck when using ungarrison
i'm trying to use ropeCreate - in editor is work's fine. But when trying on mp created car's is not working 😦
what can block creating ropes?
no idea, seems to work for me.... make sure you execte it on the server maybe?
@proven crystal i will try to make it from server, ty for idea
Anybody got script for standing at attention? I got the at ease script but couldn’t find at attention & replacing ease with attention didn’t work..
you can look up the correct animation name in the in game animation viewer perhaps
That’s what I mean I didn’t see it in there.. are u saying there’s a search function? I usually just scroll thru it..
It does seem like a slim list so they might not have all in the scroll list
theres different animations sets that you can change with the dropdown menus
its a bit difficult to navigate yeah
Ok.. I figured that at ease & at attention would be in the same drop down set up.. I’ll look thru it again to make sure.. thanks
Why do these scripts not work when I play my mission in multiplayer.. single player it’s as it should be but multiplayer every unit is in default stances.. I just want some guys doing push ups & the other standing at ease
This playMove “AmovPercMstpSnonWnonDnon_exercisePushup”; & Ease
Replacing excersisePushup with ease for the second script
I’ve re-exported & still no joy.. they all just stand in default
Stance
*but I spelled everything correct
@proper flower if it works in SP and not in MP, the issue is locality
remoteExec
basically it's possible in multiplayer for code to run on one person's computer but not everyone's or not the server
so remoteExec basically says to the other computers 'hey you should run this code as wlel'
and you can choose who that gets sent to
Ok, is that written in each of the units I have scripted or the debug console? How do I use this.. I’ve never had to do this
yeah it's a bit of a leap
where is the animation code triggered from
is it in the unit init fields
or where
Yea in each units init field
hmm
that should actually work afaik
can someone more knowledgable about multiplayer weigh in
yawns
Oh lord
playMove is arg local. Meaning it needs to run where the unit is local
if you have it in init box, it'll run everywhere
if (local this) then {this playMove...}
Ok so add: if (local this) then { to the beginning of the code?
don't take that as advice that's a genuine thing i've been wondering
without the locality check, you have everyone trying to override everyone else
glitchfest
Ok I’ll add that to the script & see if it works for me.. thanks.. I know u love hating to help me Ded
Nope
Still nothing
If (local this) then {removeVest this; removeBackpack this; removeAllAssignedItems this; removeAllWeapons this; this playMove “AmovPercMstpSnonWnonDnon_exercisePushup”; this disableAL “ANIM”;};
This is what I have as my code in the init field..
playMove also needs a delay when used in init?
two typo's
It does.. prob just a spelling error when. I typed it now
never type off code if you want help with it
It was a mistake
You either make mistakes, or you make mistakes and accidentally fix your problem
Always copy code
Can u help
wat?
Ok I fixed the spelling error..
On my phone let me open up on desktop
if (local this) then {removeVest this; removeBackpack this; removeAllAssignedItems this; removeAllWeapons this; this playMove "AmovPercMstpSnonWnonDnon_exercisePushup"; this disableAI "ANIM";};
copied . pasted
works in Sp not in MP
probs need the delay the wiki page talks about
u got a link to the wiki u are refering to?
thanks
I suggest you bookmark that
if (local this) then {this spawn {Sleep 2; _this playMove...};};
probably
🤔
That's wrong embed
didnt work
@young current I do have it bookmarked but it only helps so much if u don;t know how things are written..
Im no t a superior coder & most ppl only give answers based on the fact they know a lot more & its hard to know what they are saying if theyre not specific
hey guys, i'm trying to create an easy way to output each modelToWorld positions of every object placed in the mission, relative to a set target object's position
here's my script, for some reason this isn't working properly (it's not displaying the correct values of PositionRelative)
can someone help me fix this?
edit: nvm i'm dumb i fixed it
is there away to detect if player has UAV terminal open?
@meager granite thx mate
@meager granite is there any way to check from server side?
what are you trying to do that would require that?
Recconaisance pod (screenshot as an intel picture)
What I wanted to achieve is, basically, old school cold war scheme recconaisance during MP session that use of a plane and its recce pod. I need to take screenshots while flying the plane equipped with the pod (doable, I guess) and than need to send the screenies over the network from the pilot's local PC to a server (or website). Than those pictures are to be setObjectTexture'd on frames in a briefing room by different player using a mission script. Could it be achieved using some mods, persistent DB or other method? Alternatively, is it possible to kinda "frozen" a frame from live camera pod so that it would appear still on a projector screen, TV set or smth in the briefing room?
@ivory lake i use a server side addon for everything. i need to kick afk players but not uav pilots.
mmm you'd probably have to run a script clientside (remotExec) that uses !isNull findDisplay 160 and saves the result in a unit variable
or when you're looking for AFK players, 'ping' them so to speak and if they return taht they're not in the display, kick them
Hey, I am working on https://community.bistudio.com/wiki/findDisplay and am listing the commonly used displays; so far I have:
Primary display 46
Zeus display 312
Map 12
UAV Terminal 160``` anything else off the top of your head?
300 is the 'unitinfo' one iirc, ammo zeroing etc
thanks (I don't want to list them all though)
Lots of crap but you can pick useful stuff out of it
aaah, mighty nice of you!
PS: you are playing Arma for 5 hours now, time to rest your eyes and look into the distance to relax your pupils ^^
I just have it on all the time
hehe, I could relate!
is this pastebin "eternal" so I could link it to the biki?
seems not on the biki, will make a findDisplay subpage
google says there isn't
it is an export from the engine BTW, engine is using those defines for various engine spawned displays
no "license breach" concern?
it is also in the config files of the main game so doubt it breaks any rules
Hi guys. I have ctrl RscMapControl. How do I make transparent background like in a gps Navigator.
@tough abyss @meager granite any idea what "MUF" means?
Dev name
ah thanks! don't know him
Most likely some programmer initials, not designer
@winter rose Thanks. Will look for
I suggest you remove those initials from the page not to confuse users
XBOX 360 profile and save messages
Dont need this as well
@winter rose
the initials and some comments can go, but the XBOX thing may not be pointless to have (good to know why it is defined, etc)
also inventory seems to be 602, and this list stops @ 300+ so I will dig a bit more later (or if anyone has data…!)
I am moving this convo to #community_wiki as to not clog #arma3_scripting 😉
is there a function to get an array of all markers or triggers?
allMapMarkers, allMissionObjects "EmptyDetector"
second one is slow, don't call it too often
thanks man
quick question again.
i run a MP compatible animation script. in the beginning i assign the varibale "inAnimation" to the unit, after the animation is finished, i set the variable to false.
idea is to avoid having a loop that starts the animation again and again, therefor, only if unit not in animation, start new animation.
thing is it doesnt work.
_unit setVariable ["inAnimation", true, true]; //at anim start
_unit setVariable ["inAnimation", false]; //at anim end
//in the other script:
if (_unit getVariable ["inAnimation",false]) then {
//run animation
}
i assume its a problem that the ariable is not public? i did set the var to public tho
_unit setVariable ["inAnimation", true, true]; the 2nd true is what broadcasts it over the network
if you're doing ["inAnimation", false]; that's not being broadcast it will need to be ["inAnimation", false,true];
What's wrong with this function?
EZ_fnc_drawTextPlayer = {
_playersInRange = EZ_fnc_playersInRange;
{
drawIcon3D ["", [0,0.6,0,1], ASLToAGL getPosASL _x , 0, 0, 0, "Target", 2, _x call EZ_fnc_setTextSize, "PuristaMedium"];
} forEach _playersInRange;
_return = count _playersInRange;
_return
};
I get "Generic error on expression" at
} forEach _playersInRange
Here's the called fnc
EZ_fnc_playersInRange = {
if (EZ_frameNumber > 0) then {
deleteMarker "playersRecognizedInArea";
};
_playersRecognizedInRadius = call KK_fnc_trueZoom * 60;
_playersRecognizedInArea = createMarkerLocal ["playersRecognizedInArea", getPos player];
_playersRecognizedInArea setMarkerText "";
_playersRecognizedInArea setMarkerSize [_playersRecognizedInRadius, _playersRecognizedInRadius];
_playersRecognizedInArea setMarkerDir 0;
_playersRecognizedInArea setMarkerShape "ELLIPSE";
_players = allUnits; // just for testing, for production use this instead: allPlayers - entities "HeadlessClient_F"; or allUnits - entities "HeadlessClient_F";
_playersInRange = _players inAreaArray _playersRecognizedInArea;
_playersInRange;
};
_playersInRange = EZ_fnc_playersInRange; you're not calling it?
guys. How to change the background that appears when the mouse indicates an item in your inventory?
...lol 😄
Why do you
_return = count _playersInRange;
_return
Instead of just returning the value directly?
So I just put "count _playersInRange" in the end?
Yes
yeah
Ok
And you have lots of missing private
Alright
Hello I am trying to recover the direction value of the hand for the bottle to follow this one. Can someone help me? https://i.postimg.cc/zBSmQQXH/ts.gif
@still forum Where can I learn more about using private variables?
https://community.bistudio.com/wiki/private the examples there I guess
Aight, thanks 😃
don't use private "string" nor private [array] they are expensive
more questions: how to tell if a sounds played with [_unit, "ruchatter1", 30] call CBA_fnc_globalSay3d;
is over? i wanna start random lip movement in the beginning and then stop moving lips when hes doen talking
you can try using vectorFromTo and selectionPosition @tropic mist
guys. How to change the background that appears when the mouse indicates an item in your inventory?
@tough abyss How can I use it because I do attachto righthand from me player
add MouseEnter/Exit EH to the element you want to change background then use its reference to change background color when EH triggers @fleet hazel
the hand has fingers and other selections you can get selection position, find 2 that you can draw line through that indicates correct vector for the bottle @tropic mist
@tough abyss I want to change the texture in an already existing handler for the inventory. I can't find these handlers.
findDisplay, displayCtrl, ctrlAddEventhandler
@tough abyss I can't find the command to draw a line
draw3d
@young current https://community.bistudio.com/wiki/drawLine3D ?
why do you need to draw a line?
i was talking about imaginary line
you can draw it in your mind then take positions from 2 selections and plug them in vectorFromTo
ok so I get that. I can not understand how vectorFromTo works https://i.postimg.cc/LsBRqcHy/screenshot-175.png
I got to say you have picked a very difficult task to do
@tough abyss I managed to retrieve the two-point position https://i.postimg.cc/MKFrDdPz/screenshot-177.png
now use it to setVectorUp for the bottle on each frame
https://i.postimg.cc/Bv6TV0Xy/screenshot-178.png like this ?
oh sorry set
@tough abyss I have an error https://i.postimg.cc/T3vNFp6s/screenshot-179.png ```_item = "waterBottle";
_point1 = player selectionPosition "RightHand"; // [0.310878,-0.0737944,0.784343]
_point2 = player selectionPosition "RightHandThumb1"; // [0.218116,0.358148,1.2034]
_pos = _point1 vectorFromTo _point2; // [-0.383661,-0.0447152,-0.922391]
switch (true) do {
case (_item isEqualTo "waterBottle"): {
player switchmove "sezon_anims_boire";
_bouteille = "Land_WaterBottle_01_full_F" createVehicle [0,0,0];
_bouteille attachTo [player, [0,0,0], "RightHand"];
_bouteille = setVectorUp _pos;
};
default {
hint "Pas utilisable";
};
};
_bouteille = setVectorUp _pos; script error
_point1 = player selectionPosition "RightHand"; // [0.310878,-0.0737944,0.784343]
_point2 = player selectionPosition "RightHandThumb1"; // [0.218116,0.358148,1.2034]
_pos = _point1 vectorFromTo _point2;
_bouteille setVectorUp _pos;`
you have to do this for each frame of the animation
oh yes ! thanks https://i.postimg.cc/hvysjtz9/225.gif
you might want to switch to setVectorDirAndUp instead of setVectorUp alone, but this is going to be even more complicated
when you say for each frame how to do that?
addMissionEventhandler ["Draw3D", {}]
then you cant use local variables
anyway, this is mega complicated task and you obviously lack some knowledge
i keep forgetting that:
how do i pass custom variables into an eventhandler?
f.e.
_soundsource = "randomword";_radius = 100;
_unit addEventHandler ["FiredMan",
{
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle",_soundsource,_radius];
hint str _this;
}
];
do i have to use private for that?
for what?
that's not at all how that works so no
that's not how local variables work, that's not how params works, that's not how eventhandlers work. You basically got everything wrong there
and you can't pass variables to an eventhandler like that
you can save the variables on the unit by using "_unit setVariable"
and then using getVariable inside the eventhandler
_objects = [
[2,"VSM_ProjectHonor_Backpack_Kitbag", table_1],
[2,"VSM_ProjectHonor_Backpack_Compact", table_2],
[2,"VSM_ProjectHonor_carryall", table_3],
[1,"VSM_ProjectHonor_Boonie", table_4],
[1,"VSM_ProjectHonor_Cap", table_5],
[1,"VSM_Mich2000_ProjectHonor", table_6],
[1,"VSM_Mich2000_2_ProjectHonor", table_7],
[1,"VSM_ProjectHonor_OPS_2", table_8],
[1,"VSM_ProjectHonor_OPS", table_9],
[1,"VSM_ProjectHonor_Camo", table_10],
[1,"VSM_RAV_operator_ProjectHonor", table_11],
[1,"VSM_RAV_MG_ProjectHonor", table_12],
[1,"VSM_RAV_Breacher_ProjectHonor", table_13],
[1,"VSM_LBT6094_operator_ProjectHonor", table_14],
[1,"VSM_LBT6094_MG_ProjectHonor", table_15],
[1,"VSM_LBT6094_Breacher_ProjectHonor", table_16],
[1,"VSM_CarrierRig_Operator_ProjectHonor", table_17],
[1,"VSM_CarrierRig_MG_ProjectHonor", table_18],
[1,"VSM_CarrierRig_Breacher_ProjectHonor", table_19],
[1,"VSM_FAPC_Operator_ProjectHonor", table_20],
[1,"VSM_FAPC_MG_ProjectHonor", table_21],
[1,"VSM_FAPC_Breacher_ProjectHonor", table_22]
];
{
_type = _x select 0;
_object = _x select 1;
_table = _x select 2;
_spawn = "groundweaponholder" createVehicle getpos _table;
if (_type isEqualTo 0) then {
_spawn addWeaponCargoGlobal ["_object",1];
_spawn attachTo [_table,[0,0.25,1]];
};
if (_type isEqualTo 1) then {
_spawn addItemCargoGlobal ["_object",1];
_spawn attachTo [_table,[0,0.25,1]];
};
if (_type isEqualTo 2) then {
_spawn addBackpackCargoGlobal ["_object",1];
_spawn attachTo [_table,[0,0.25,1]];
};
} forEach _objects;``` https://cdn.discordapp.com/attachments/469936906461773834/597460351453495306/unknown.png Context
remove the "" around object
EZ_fnc_drawTextPlayer = {
private _playersInRange = call EZ_fnc_playersInRange;
{
// ERROR: [Type Number, Not a Number, expected Number]
drawIcon3D ["", [0,0.6,0,1], ASLToAGL getPosASL _x, 0, 0, 0, "Target", 2, _x call EZ_fnc_setTextSize, "PuristaMedium"];
} forEach _playersInRange;
count _playersInRange;
};
EZ_fnc_setTextSize = {
private _target = _this;
private _textSize = (ln (10 / (player distance target)) * 0.434 * 0.05) / (getResolution select 5);
if (_textSize > 0.05) then {
_textSize = 0.05;
};
_textSize;
};
Oh, so it's missing an underscore? lol
I can't understand how I'm so blind to these errors 😄
Same error after I fixed it... Hmm
"Type Not a Number, expected Number"
your textSize function returns a NaN I suppose
also why does setTextSize not actually set anything?
@still forum I think it should be rather getTextSize
Is there a bug with distance? Commands using it return any at mission start
And I get zero divisor when using eg. player distance _target with math commands
maybe "player" doesn't exist yet at mission start
there is some time at init.sqf where player is objNull
try diag_log'ing all your stuff
Also the hints in my function get never shown even though the function is placed in onEachFrame
checked RPT?
Yeah, this is all I get
`{
drawIcon3D ["", [0,0.6,0,1], ASLToAGL ge>
0:49:30 Error position: <drawIcon3D ["", [0,0.6,0,1], ASLToAGL ge>
0:49:30 Error Type Not a Number, expected Number
0:49:30 File C:\Users\Net_2\Documents\Arma 3 - Other Profiles\Ezcoo\mpmissions\fishing_test_CC_2.Tanoa\recognizePlayersNearby.sqf, line 70
0:49:30 Error in expression <t = _this;
private _textSize = (ln (10 / (_target distance player)) * 0.434 * 0>
0:49:30 Error position: </ (_target distance player)) * 0.434 * 0>
0:49:30 Error Zero divisor
0:49:30 File C:\Users\Net_2\Documents\Arma 3 - Other Profiles\Ezcoo\mpmissions\fishing_test_CC_2.Tanoa\recognizePlayersNearby.sqf, line 53
0:49:30 Error in expression <nRange = call EZ_fnc_playersInRange;
`
Maybe I should check whether player is still objNull
Hmm, I guess it was the actual math done in the function. It returned too high or too small values for Arma and got messed up
does anyone know how to set attributes to markers in eden via script?
_mrk = create3DENEntity ["Marker", "mil_dot",[_xpos-25, _ypos-25, 0]];
_mrk set3DENAttribute ["name",format ["%1",_mname]];
I tried it the same as for objects/logic entities there it works... the markers all have default names (marker_xx) instead
marker uses markerName attribute
This wiki page has list of all default attributes:
https://community.bistudio.com/wiki/Eden_Editor:_Setting_Attributes#Marker
Nevermind got it working
does anyone know if you can add markers in a specific place to cover the black area around the map
I am trying to keep RHS UH-60 doors open, I tried this animateDoor ["DoorLB", 1]; this animateDoor ["DoorRB",1]; in the object init though this only opens and then closes the doors. Can someone maybe assist please
Doesn't the RHS UH-60's have scripts that allow them to open and close the right and left cargo doors?
@hollow thistle thanks
@frozen gull yeah, searched on how to keep them open but the only thing found was this animateDoor
is there a polar version of modelToWorldWorld
that takes direction + distance?
I have a pos [x,y]. I want to find a pos that is 30° and 100m from it, is there a direct command that was added for that? Or do I go the sin/cos way?
If anyone knows just @ me
@ornate sky dont think there is, have to be calculated "manually"
I guess one could use an invisible object that will first be setDir'd and then use modelToWorldWorld
a workaround without sin cos
right, I'm doing a little custom polar plot script for arty
oh shoot, there's a direct command origin getPos [distance, heading] (Since Arma 3 v1.55.133361)
It doesn’t do what you asked directly but can be used as part of solution
any function like pushback but instead it inserts in the front? im creating an array of numbers (times) and want the newest to always be in front. i imagine its unnecessary caculation to sort the array time and time again
why do you need newest from front?
if you're trying to make a stack, you can use pushBack to push to end and deleteAt to pop from end.
I made a pushFront in Intercept CBA
@still forum just for convenience so i can be sure that _timearray select 0 is always the newest value. its used for comparison of firedat EH times. the civilian decideds upon that if it was a single "warning shot" or if he is being attacked, so he knows wether to freeze or panic
how do i make a valid object or "global variable name" out of a string?
I create locations (logic) in 3den, they have local variable data assigned to them via init field. I also give them custom Variable names.
I save all their names inside the init field of a "master object".
With the scenario started, i want to read the location names from the master object, and then the information from the local variables of each object. How would i do that? Or is there a better way?
so the master object's array would look somewhat like this:
[["GP01"],["GP02"],["GP03"],
["GP11"],["GP12"],["GP13"],
["GP21"],["GP22"],["GP23"]]
and the editor attributes of a location looks like this
Varname: GP01
initfield: this setvariable ["mydata",[1,2,3,4]]
and i want to retrieve the "mydata" variable from global variable GP01 (or location object GP01)
missionNamespace getVariable ["GP01", objNull]
need to check for isNull in case object isn't there, just to be safe
I've been doing a little looking into removeAction. There is a lot for removing an AddAction after one attempt using the arguements, but how would I do it to remove it locally so that each player can only perform an actionAction once?
For a basic example, let's say a I want everyone to grab a pair of NVGs with an addaction, but after that person uses it they can no longer perform that Addaction, but anyone else still can, if unused.
parameters array passed to the script upon activation in _this variable is:
params ["_target", "_caller", "_actionId", "_arguments"];
so in the script that adds the nvgs you can do:
params ["_target", "_caller", "_actionId"];
_target removeAction _actionId;
Hmm... I thought I tried that earlier... Let me look again.
it should work, the actions are added/removed localy.
so if you activate the action this should remove your local action on the target object.
Okay, yup... I'm an idiot. Short version... I forgot a character. 😬 Thank you anyway! 
Sometimes I just need people to color code it for me. 😉
as an alternative you can always do:
_target setVariable ["my_nvg_actionDone", true];
and in the action condition check:
(_target getVariable ["my_nvg_actionDone", false]);
this allows you to temporarily disable the action without removing it.
I'll note that for the future. Thanks again!
good luck, it's sleeping time here (3am) 🛏 💤
Would there be a way to directly copy all the classnames of a persons loadout
E.g., their backpack and everything inside of it
So you can put it on an addaction
If that makes sense
getUnitLoadout
setUnitLoadout
Lifesaver, thanks a bunch @hollow thistle
What is the most reliable way to use setUnitPos on new units with createUnit? time delay, stance check, etc? Using it with a CBA_fnc_waitUntilAndExecute with an !isNull condition does not work, and setting the pos as soon as unit is created also does not work, spawning on headless client works with a simple time delay but don't want to stack events for lots of spawned units.
hi guys, I tried using the following in a Equipment box, says "this is not defined" for the second this used, what's the issue?
this addAction["Delete gear","clearItemCargo this"];
thanks in advance
It's called in the init field of the object
@tough abyss
if you read https://community.bistudio.com/wiki/addAction , you will see that the second parameter doesn't know what this is; it is given params ["_target", "_caller", "_actionId", "_arguments"]; args though
this addAction ["Delete Gear", "clearItemCargo (_this select 0)"];
ah, the description of the init field got me confused, thanks!
this is a local variable in the init script scope. Local variables don't carry over into new script instances (action script is a new instance as it get's called some time in the future)
ah, I see, thanks for the information, ill note it down
How do you guys use tasks in arma 3? I've always done it this way:
//briefing.sqf executed everywhere using init.sqf
OBJ_INFIL = player createSimpleTask ["Infiltrate"];
OBJ_INFIL setSimpleTaskDescription ["<br />Make your way to the northern shore.","Infiltrate","Infiltrate"];
//triggers in-game
OBJ_INFIL setTaskState "Succeeded"; ["TaskSucceeded",["","Infiltrate"]] call bis_fnc_showNotification;
OBJ_RADAR setTaskState "Assigned"; ["TaskAssigned",["","Destroy Radar"]] call bis_fnc_showNotification;
this works for my small singleplayer missions but I feel like there's better ways, especially in MP.
it's recommended to use bis functions instead of creating tasks manually. It takes care of tasks synchronization etc.
Thanks!
@tough abyss yup → https://community.bistudio.com/wiki/Mission_Optimisation#Creating_your_mission use frameworks, at least for tasks 😉
hello, is this the best way to declare a public variable in the beginning of a mission? the variable will be condition to multiple scripts/functions initializing later on throught the mission:
missionNamespace setVariable ["IRON_Debug", true, true];
i have to admit that i dont understand what a missionnamespace is
missionNamespace is the place where all global variables are saved
well that sounds like im doing the right thing then
missionNamespace setVariable ["IRON_Debug", true];
is same as IRON_Debug = true
and missionNamespace setVariable ["IRON_Debug", true, true];
is same as
IRON_Debug = true;
publicVariable "IRON_Debug";
yes your code looks like it does what you want to do
thank you for the clarification
@still forum compile caching is back on dev branch, what do you know about it?
nothing
great
no mention about it in the changelogs?
maybe it's the old caching and they just didn't disable on devbranch?
havent seen any mention anywhere. Maybe it has been fixed not to cause memory leak?
Maybe they implemented my idea of removing stuff from cache that hasn't been accessed for X time
I'll update my dev branch, but won't have time today to check, not tomorrow either..
no idea this is one of the great mysteries of Arma
Mystery solved! It was indeed planned improvement and now it is complete @still forum
I dont know details, all I know it was properly fixed this time
I'll believe it after I've tested it :D
Last time they also didn't notice that something was wrong
Well, nothing is impossible but it has been fixed by one of the top programmers so...
I need to detect new units on the map, whether Zeus spawned or some other way. What's the most performance-friendly way to do this?
["Man", "InitPost", {your code goes here}, true, [], true] call CBA_fnc_addClassEventHandler;
@spice axle Thx, I will try this
is there a limit how many markers can be placed?
is there a function to change the inventory space of a container? some mod crates have ridiculously much space for their small size
wanna make that storage space smaller, more realisti
@spark turret You need to edit the config's of the boxes, or make new boxes.
Hi, im looking for a way to set a loiter waypoint for an AI pilot dynamically during a mission, meaning i wont be setting it in the editor, is that feasible?
"Setting a loiter waypoint" To me that sounds alot like setting it in the editor 😮
What I'm looking to use it for is have a blackfish orbit and area, without needing a human pilot, but because the mission is dynamic, I will need to move the loiter point. Tried using Devas' autopilot mod, but it doesn't work as well as the regular loiter waypoint
How do i allow an injured player to be able to walk backwards while in the drag animation? i do not want to make them invincible while they are dragging either.
How complicated is something like ACE arsenal? Is it something that could be replicated with script only?
I'd love to count infantry and motorized units separatly. So if there is a car with 3 passengers (crew incl.) in it and an infantry squad of size 5 I want the end result of my logic to count 1 motorized unit and 5 infantry units
I fiddled around with units, isKindOf, typeOf etc. but I can't really find a good way to do it
the source of the calculation should be the result of nearEntities in a marker
So in there I have an APC with 10 passengers (4 crew and 6 soldiers)
private _entity = (getMarkerPos "counter") nearEntities ["Man", 20] select 0;
count units _entity;
This returns 10. For this example I actually want it to return 0 since all of the infantry are inside a vehicle. Is there something like isInVehicle so I can filter them out?
I just found vehicle I think I go with this
if (_unit != vehicle _unit) then {InAVehicle = true};
👍
if you're looking just for a number you can use the alt. count instead
_count = {vehicle _x == _x} count _entity
that'll return the number of units outside vehicles
Syntax:
getMarkerSize markerName
Parameters:
markerName: String
Return Value:
Array - in format [a-axis, b-axis], where:
a-axis: Number - 1/2 width of marker
b-axis: Number - 1/2 height of marker
Can anybody explain to me why it states 1/2 width of marker ?
This is the example
"MarkerOne" setMarkerSize [100,200];
_size = getMarkerSize "MarkerOne"; //returns [100,200]
should return [50,100] according to that explaination of 1/2 of width/height
is this a typo in the doc?
I think the author meant like "effective" width
because when you define the width you define the radius
hm
I'm too pleb to embeed images 
so is this the radius or diameter now?
by I think the author meant like "effective" width I meant that the author meant that it returns half of the effective width/diameter
This wiki entry is just misleading imo.
So getMarkerSize _markerPos select 0 gives me the radius of a circle marker
Because I divided that by 2 all the time and got unexpected behaviour therefore
_markerPos == _marker
sorry
which is exactly the same thing you set by doing setMarkerSize
kk
if you want to check if something is in marker area you can just use inArea
if you're doing something related to that.
I ask because I use this func with the marker radius
private _foundEntities = _markerPos nearEntities ["Man", _markerRadius];
makes sense if you use circle markers.
👍
A large request but I thought I'd ask. Is there any way to use "firedMan" EH to work with ace grenade throw? IIRC there's some way to do it without adding an additional ACE specific EH. Alternatively is there a CBA/ACE3 EH that does what "firedMan" does? I need the values for projectile, person who fired, weapon used, ammo, magazine, vehicle.
@radiant needle what do you wanna do? give some fast, restricted access to guns or do you want to create a UI with komplex arsenal?
If i export a loadout from ace arsenal i get a beatiful ig array. i dont 100% get what each entry is, is there a script that uses this array to equip a unit ? dont really wanna go and try out myself what entry is what in the end
example array of exported ace loadout:
[["rhs_weap_ak74_gp25","rhs_acc_dtk1983","","",["rhs_30Rnd_545x39_AK",30],[],""],[],["rhs_weap_makarov_pm","","","",["rhs_mag_9x18_8_57N181S",8],[],""],["m88_desert_vdv",[["ACE_EarPlugs",1],["ACE_MRE_SteakVegetables",1],["rhs_mag_9x18_8_57N181S",1,8]]],["6B3_RHS_OF",[["ACE_MRE_ChickenHerbDumplings",1],["ACE_WaterBottle",1],["ACE_Canteen",1],["rhs_mag_nspn_red",1,1],["rhs_mag_rdg2_white",1,1],["rhs_30Rnd_545x39_AK",6,30]]],["BWA3_AssaultPack_Fleck",[["rhs_VOG25",9,1]]],"rhs_fieldcap_khk","",["Binocular","","","",[],[],""],
["ItemMap","","TFAR_pnr1000a_1","ItemCompass","ItemWatch",""]]`
great thanks @still forum
_loadouts = [
"O_recon_exp_F",
"O_recon_JTAC_F",
"O_recon_M_F",
"O_recon_medic_F",
"O_Pathfinder_F",
"O_recon_F",
"O_recon_LAT_F",
"O_recon_TL_F",
"O_sniper_F",
"O_ghillie_ard_F",
"O_ghillie_lsh_F",
"O_ghillie_sard_F",
"O_spotter_F",
"TEC_O_Chief_F",
"TEC_O_Chief_C_F",
"TEC_O_Sailor_F",
"TEC_O_Sailor_C_F",
"TEC_O_Sailor_M_F",
"TEC_O_Sailor_SMG_F",
"TEC_O_Sailor_UAV_F",
"TEC_O_NavCrew_ATC_F",
"TEC_O_NavCrew_Purple_F",
"TEC_O_NavCrew_Brown_F",
"TEC_O_NavCrew_Medical_F",
"TEC_O_NavCrew_Green_F",
"TEC_O_NavCrew_Red_F",
"TEC_O_NavCrew_Yellow_F",
"TEC_O_NavCrew_Blue_F",
"TEC_O_NavCrew_White_F",
"TEC_O_Helicrew_Navy_F",
"TEC_O_Helipilot_Navy_F",
"TEC_O_Diver_F",
"TEC_O_Diver_EXP_F",
"TEC_O_Diver_Medic_F",
"TEC_O_Diver_TL_F"
];
{
_objectclassname = _x;
_objectname = getText (configFile >> "cfgVehicles" >> _objectclassname >> "displayName");;
_objectnameSTR = "Spawn: " + _objectname;
selectLoadout addAction [_objectnameSTR,{
_loadout = getUnitLoadout _objectclassname;
(this select 1) setUnitLoadout [_loadout, true];
}];
selectLoadout_1 addAction [_objectnameSTR,{
_loadout = getUnitLoadout _objectclassname;
(this select 1) setUnitLoadout [_loadout, true];
}];
} forEach _loadouts;``` `_objectclassname` is undefined. I cannot figure out why/how.
inside the addAction yes
because addAction, the action code is a seperate script
I'm sure I already told you that a couple times 🤔
addAction lets you pass arguments
omg im stooopid
So how does this show the displayname? https://cdn.discordapp.com/attachments/597594867715145758/598537279954223176/unknown.png
oh wait nvm
{
_objectclassname = _x;
_objectname = getText (configFile >> "cfgVehicles" >> _objectclassname >> "displayName");;
_objectnameSTR = "Spawn: " + _objectname;
selectLoadout addAction [_objectnameSTR,{
_loadout = getUnitLoadout (_this select 3);
(_this select 1) setUnitLoadout [_loadout, true];
}, _objectclassname];
selectLoadout_1 addAction [_objectnameSTR,{
_loadout = getUnitLoadout (_this select 3);
(_this select 1) setUnitLoadout [_loadout, true];
}, _objectclassname];
} forEach [
"O_recon_exp_F",
"O_recon_JTAC_F",
"O_recon_M_F",
"O_recon_medic_F",
"O_Pathfinder_F",
"O_recon_F",
"O_recon_LAT_F",
"O_recon_TL_F",
"O_sniper_F",
"O_ghillie_ard_F",
"O_ghillie_lsh_F",
"O_ghillie_sard_F",
"O_spotter_F",
"TEC_O_Chief_F",
"TEC_O_Chief_C_F",
"TEC_O_Sailor_F",
"TEC_O_Sailor_C_F",
"TEC_O_Sailor_M_F",
"TEC_O_Sailor_SMG_F",
"TEC_O_Sailor_UAV_F",
"TEC_O_NavCrew_ATC_F",
"TEC_O_NavCrew_Purple_F",
"TEC_O_NavCrew_Brown_F",
"TEC_O_NavCrew_Medical_F",
"TEC_O_NavCrew_Green_F",
"TEC_O_NavCrew_Red_F",
"TEC_O_NavCrew_Yellow_F",
"TEC_O_NavCrew_Blue_F",
"TEC_O_NavCrew_White_F",
"TEC_O_Helicrew_Navy_F",
"TEC_O_Helipilot_Navy_F",
"TEC_O_Diver_F",
"TEC_O_Diver_EXP_F",
"TEC_O_Diver_Medic_F",
"TEC_O_Diver_TL_F"
];``` I know that I didn't need to move to _loadouts but I thought why not.
im looking for a better way to automatically create a list of units available to a faction. My problem is that in some mods there are units that are apparently buggy or something. some cant be moved or deleted by zeus, or come without weapons. so what i want is to get a list of all units that are also listed i the editor somewhere.
atm i get a good list of units, but i still have to create manual blacklists for defect units. thats kind of useless
are the defect units also listed in the editor?
nope, thats why id like to switch t that roue
i just dont know what attribute that might be
does this look correct?
I can't see anything
private _available = (_condition configClasses (configFile >> "CfgVehicles"));```
worked with the first part so far
&& (getNumber (_x >> 'scope') == 2)
that bit is new now
we shall find out in a few minutes
appears to do the job! thanks again
hah, its working...
https://abload.de/img/20190710205241_12lkzt.jpg
control points automatic distribution (on inputs) and automatic border drawing based on owner. Need to fix intersecting border lines but thats easy
So i've tried setting up a box that gives loadouts, it all works fine, however I cannot get the distance part of it to work. What I am trying to achieve is making sure that if the player is more than 2m away then they cannot see the addaction, but that doesn't appear to be working
This is my init on the box
if(player distance insbox > 2) exitWith{}; this addAction["Get Instructor Loadout", {[] call LW_InstructorLoadout}];
Or do I have to put that in my function?
The distance checking that is
I tried something different but still no avail..
_distance1 = player distance this;
if (_distance1 < 2) then {
this addAction["Get Instructor Loadout", {[] call LW_InstructorLoadout}];
};```
you can instead add the action to an object and give it a range
Look up addAction syntax and options
☝️ You have a "condition" param that can totally be used for this.
i noticed that if i change a units name (example "Ben Kerry) with the function
_unit setName ["Ben Kerry","Ben","Kerry"];``` that the name gets correctly displayed if i check it with Zeus, but the ace medical menu keeps the originial name
which in this case is nikas isosfiaks or something. any ace function to change the "ace name"?
ah just read that setName is singleplayer restricted. any MP function?
Please weigh in and tell me if this script is good for punishing players for critically injuring other players. I got the killed stuff done but this is giving me a lot of trouble.
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
private _player_killer = objNull;
private _current_damage = damage _unit;
private _total_damage = _current_damage + _damage;
if (lifeState _unit != "INCAPACITATED") then
{
if (isPlayer _instigator) then
{
_player_killer = _instigator;
};
if (!(isNull _player_killer)) then
{
if (_total_damage >= 0.8) then
{
if ((getPlayerUID _unit != getPlayerUID _player_killer)) then
{
[_unit, _player_killer] remoteExec ["feature_35_fnc_state_2_apply", 2];
};
};
};
};
So im trying to create a smoke effect on the tailrotor of a helicopter after an explosion, how should I go about doing it?
There is any way i can define functions, like BRPVP_addMission2Action = {...} before the joining player receive JIP?
Problem: I run this on server: _trader remoteExecCall ["BRPVP_addMission2Action",-2,true]; but when the joining player receive this JIP, he have not BRPVP_addMission2Action defined.
preInit flag?
@spark turret any ace function to change the "ace name" yes https://github.com/acemod/ACE3/blob/master/addons/common/functions/fnc_setName.sqf
@tough abyss preInit runs before JIP, remoteExec's before other remoteExec's run before other remoteExec's
can someone plz tell me why this is happening. it started about a week ago. cant think of code changes that would create this. When it happens, in game the player gets removed from squad and when killed it says error No Unit
this is what shows up a lot in the rpt.
10:06:19 Unit B Alpha 1-1:2 (0x4d450840) - network ID 5:10
10:06:19 - no person
@still forum can you help me out mate?
no
Maybe someone is reading my todo list 🤔 (well I know they are :D)
@exotic tinsel no
hi all , i have made a Medieval Wooden Fire Torch as a weapon but i can't seem to figure out how to add fire to it . I can add it to projectile but not the actual weapon . any help would be great thanks this is what i got so far : this addEventHandler ["FiredMan", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];
_man = _this select 0;
_weap = _this select 6;
_weap1 = "#particlesource" createVehicle position _weap;
_weap1 setParticleClass "SmallDestructionFire";
_weap1 attachTo [_weap , [0,0,0]];
}];
weapon is a classname
you can't get the position of a string
you cannot attach anything to the weapon, as it is not an object
That kills that plan lol ok thanks for the quick response
maybe you can create some particle effect directly with the model and some weapon config? not sure
Ill play around with it for a couple of days see how I go .thanks for the help
@spark turret
https://community.bistudio.com/wiki/setName
Reminder:
Effects of these scripting commands are not broadcasted over the network and remain local to the client the command is executed on.
Execute it (e.g. via remoteExec) on all machines.
Uh..
"ah just read that setName is singleplayer restricted. any MP function?"
I guess he knew that
This addaction doesn't make sense to me, how would I set the radius
I've read the wiki and added an integer after my script
but it still hasn't set a radius
You're going to have to show us what you're doing for us to tell you if you're doing something wrong. Post your code
this addAction["Grab Loadout", {[] call LW_InstructorLoadout},2];
object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]
That's not where radius goes. So that would be your problem
So could you help me and tell me where I am supposed to put it?
After you list the arguments, priority, showWindow, hideOnUse, shortcut, condition
You can't not list things and expect later parameters to work. Use the default parameters from the wiki if you don't want to change any of those things
So like this addAction["Grab Loadout",[], {[] call LW_InstructorLoadout},"",6,false,false,"",true,55];
condition must be a string "true", and your radius there is 55, not 2, but otherwise yes
It says error type number, expected bool
You added something to the start, get rid of [],
this addAction["Grab Loadout", {[] call LW_InstructorLoadout},[],1.5,true,true,"","true",2];
``` would give you a radius of 2 with all default parameters
this addAction["Grab Loadout",{[]call LW_InstructorLoadout},"",6,false,false,"","true",2];
that works for me ^
thank you!
is there a way to switch a player's team via script? so he also respawns after death at the other side ?
hmm thx i ll check it out 😃
So, I was going through a config file generated by Alive, I deleted all 6.8 ammo from a bunch of soldiers' inventories, and now it keeps telling me " Config 'c' after classeventhandler Eventhandlers {" sounds like a missplaced bracket, but when I go to the line it quotes, everything checks out...
make sure there are no floating commas or "
also check a dozen or so lines above and below where it tells you
sudden blast from past https://docs.google.com/spreadsheets/d/13mJqDXAmjzoFRZ0yVOLh9PcATp30xNvX99Uln0mFymU
with more green lines
So new in future are
diag_frameTime and addWeaponWithAttachmentsCargo
enableWeaponDisassembly 🤔
@lavish ocean selectionPosition line 56 was already implemented in 131660
yep but that was slightly different than the original ticket ... update the entry
anyone aware of any issues with checkAIFeature alternative syntax? Copying it exactly tells me im missing a ; e.g.
bob checkAIFeature "PATH";
I get the error in both a script and the debug console with just that line.
what is your game version?
1.92.... sigh, thanks M242
its always me, and its always something silly 😃
I'll wait for 1.95 and use the speed command for now
or you can switch to dev branch and not wait
or RC branch and be ready for 1.94 release which will happen in 2 weeks 😛
@cold pebble @still forum thanks.
whats the best way to have an AI "talk" (play a sound from a file" in multiplayer? right now i use
[_unit, _sound, 30] call CBA_fnc_globalSay3d;
_unit setRandomLip true;
but i would ike to automatically stop the lip movement
is there a way to restrict what the arsenal offers? not the ammo box one, just the regular one.
@tough abyss https://community.bistudio.com/wiki/Arma_3_Arsenal
I've looked into that, seems like you can only use the Add and remove commands on a box
Is there any command that will write to the server console Window? Kinda like diag_log but not to a file
Only thing is out says it's not availablein retail version. I'm not at computer to test it though
Thanks for the find though dedmen
yeah might need to try
how could i add random missions that randomy appear every now and then in a scenario like in exile
Any idea how big impact on performants' can have setLightAttenuation?
https://community.bistudio.com/wiki/setLightAttenuation
Great, because I'm making bunker and it would be a shame if some enemy would be shooting from pitch dark for players in high distance
So, how will all you guys handle the removal of "CreateVehicleLocal" for your effect spawning?triggers? Nearest checks? I am curious!
How can i get nearest ammo crates using nearesObjets? Im using filter "Ammo" but its not working.
na, im using nearestObjects to get trucks and ammo crates. would like to find a way to get both in one shot rather than have to execute two searches.
Well config viewer time for you then Sir.look what its inherited from.should be cargo_base or something
Ha ReammoBox_F, @Larrow Saves the day again.
we have an issue where every now and then the squad leader loses squad leader default arma options. its gets passed to another squad member when they are incapacitated but when the Squad leader gets revived they dont get it back. i have a script to check to make sure Squad Leader is actually squad leader and if not then execute this from server but its not working.
params ["_player"];
if ((formationLeader _player != leader _player) && (lifeState _player != "INCAPACITATED")) then
{
[group _player, _player] remoteExec ["selectLeader", groupOwner group _player];
};
whats the most slick way to add or remove an element within an array with current sqf means?
pushBack, deleteAt, deleteRange?
@lavish ocean on your list is missing selectionNames with LODName filter :P
otherwise setRagdollMode, lockedTarget, diag_server and VON stuff would be neat 😉
lot of thigs added or wip or in tickets aren't there , the list only covers what was discussed when it was made/updated (so just small slice of whole cake)
i praise to the gods for wonders 🙏
@cold pebble ty. deleteAt looks good. for adding seems need to reshuffle the contents manually
👍
@velvet merlin also append set resize + and - oh and pushBackUnique
hey guys, i've been off arma for a while, did they change something withSourceAnimation ?
now it only contains things like Door_1_locked_, Door_1_noSound and nothing happens when you try to animate the doors of a building
@tough abyss who does that help with reshuffle?
Question, I'm creating light sources and I wanted to put parameters into init.sqf so i made something like this
fn_setLight = {
params ["_light", "_lightBrightness","_lightIntensity","_lightAttenuation","_lightColor"];
_light setlightbrightness _lightBrightness;
_light setlightintensity _lightIntensity;
_light setLightAttenuation _lightAttenuation;
_light setlightcolor _lightColor;
_light setlightambient _lightColor;
};
[_light, 18, 100, [2,4,4,0,20,20],[0.5,0,0]] remoteExecCall ["fn_setLight", 0, true];
every object that should be affected by it has got his in its own init
_light = "#lightpoint" createvehicle getPos lamp_4;
I'm scripting for first time so I'm not really sure If I am doing it correctly
@velvet merlin need a insertAt command? insert element at index?
@velvet merlin you asked about "whats the most slick way to add or remove an element within an array with current sqf means?"
doing this now:
for (c = n - 1; c >= position - 1; c--)
array[c+1] = array[c];
array[position-1] = value;```
was just wondering if i missed something along the "new" set with deleteAtIndex, resize and co
also append set resize ...
_arr = [1,2,3,4,5,6,7,8,9,0];
_val = -1;
_pos = 4;
_tail = _arr select [_pos, count _arr];
_arr resize (_pos + 1);
_arr set [_pos, _val];
_arr append _tail;
hint str _arr;
is this what you are trying to do? Maybe there is faster way
tx
So you don't need a insertAt command? cuz I could make that be a thing if you did need it
it sounds simple but actually it involves millions of checks before you can call that method 😉
thanks for the offer but my case isnt perf critical in any way. not sure if has that common use to make it worthwhile
if you look for something useful i would suggest selectionNames with LODName filter
and as mentioned earlier going with Dwarden's old list:
setRagdollMode, lockedTarget, diag_server and VON stuff would be neat
@slim oyster i don't want use ,mod 😦
hmm using sector control modules and bleed ticket module, is there an event or so i can hook up to start a "mission end" animation before the debrief screen comes up ?
what's the best way to programmatically animate doors of a building ?
What’s your current approach?
User action with animateSource?
i was using animate + one of the AnimationSource available but it didn't work
i noticed UserAction use BIS_fnc_door, but i have two doors and as soon as i call this function on the second door, the geomerty lod of the first one stops until the animation is completly done
i can walk througth the door...
@young current it is a hangar, the two main doors doesn't have user actions
animateSource works but the weird collision behaviour is still here
as soon as i execute the command to animate the second door, the first one keeps moving but not its geometry LOD part
Geometry part named correctly?
Also animate command does not work with animationsource name. It works with animate name.
But in any case animateSource is better performing anyway
is there an easy way to export loadouts for the CfgRespawnInventory class ?
@slender halo are these doors split in the middle aka sliding doors each sliding away from centre?
and you want em to both open at same time?