#arma3_scripting
1 messages Β· Page 20 of 1
this script is not intended for object inits, it's probably designed to be set up as a function
_this is the object calling the script, which is clearly what I'm doing wrong, and I have no idea what the correct format is to relay that info.
_this is an undefined variable in this case. It's nothing
this without the underscore is the object that the init belongs to
this select 0 is wrong anyway
this is the object, not an array
_crate = this;
wait, is the script going in the init or is it a function that's called from the init?
That script is in my scripts folder, and I'm looking to call it in a spawner module and a couple pre-spawned object inits.
then you're calling it wrong.
Yes, I know
can you share how you're calling it?
Tried execVM "scripts\fillCrate.sqf"; and some variations of [this] execVM "scripts\fillCrate.sqf";
can you run ```sqf
fileExists "scripts\fillCrate.sqf";
Yeah, it returns true.
[this] execVM "scripts\fillCrate.sqf";
``` should work in the crate's init
if ("B" in [_x splitString "_" select 0]) then
``` what is this for?
My guess is it's checking that the item isn't a unit? Found this through google.
And yeah, it still says crate is undefined.
it looks like it's to check if the item is a backpack, assuming backpacks start with B_
I think backpacks work with additemcargo though
I definitely could be wrong
"B_" is also a prefix for a backpacks
i'm slow and should read to the end of convo before commenting, sorry π€¦ββοΈ
or if it has "isBackpack == 1"
not guaranteed it will be B prefixed
I could probably take it out entirely, since I'm running this on a vehicle spawner
but in the code, _items never changes, and it doesn't have anything with a B, so why check it?
To know which command to use to load the item?
dependent on vanilla naming convention
both of those ifs are redundant, they always run the same code
unless you pasted that list for testing
No, I pulled that off of google and changed the list to my items. Supposedly in 2018, that script worked to load an object's inventory.
in that particular case, you can get rid of the ifs, and only leave the addItemCargoGlobal line
That streamlines that, but the call itself still doesn't work.
you're executing it from an initbox of a crate/vehicle or something?
initbox of a helicopter
And I'll be doing the respawn module too, which I think has to change [this] to [_newVh]? But neither seem to work
initbox of a helicopter
code?
//for init:
// this call tag_your_function
// this execVM "path\toScript.sqf"
if !isServer exitWith {}; //exit if not server (prevent repeated clearing and adding + JIP)
private _crate = _this;
private _items = [
["ACE_quikclot", 5],
["ACE_elasticBandage", 5]
]; //list items
private _backpacks = [
]; //list backpacks (leave blank if none)
//clear inventory
clearBackpackCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearWeaponCargoGlobal _crate;
clearItemCargoGlobal _crate;
{ _crate addItemCargoGlobal _x } forEach _items; //add items
{ _crate addBackpackCargoGlobal _x } forEach _backpacks; //add backpacks
Here's something a little cleaner and more dynamic
and it doesn't work?
Nope.
_crate = |#|this;
Undefined variable in this and _crate
yeah
_crate = _this select 0;
I made that correction without the context of it being a separate file
Yeah, we already made that correction
this would still work if you defined it as a function instead of execVM though
then you didn't save the script
no the original code is right for a function-as-file
my correction applies to pasting directly in init, which is what I thought you were doing
use _crate = _this select 0; or the script I posted with the instructions at the top
I'll try your full rewrite
there's a sample line for using execVM in the comment at the top
Undefined variable in expression _this
post your code for calling the script
is that line of code anywhere but in an object init box?
Nope
can i see a screenshot of the init box
Looks like it IS working, though. Weird. Might restart the whole game, see if it clears up the error.
That seems to have fixed it. Thank you for the help with that.
yw
Sounds interesting. Maybe have it return command output as well if possible?
do references to groups break if the group changes locality?
Don't think so, but locality is tricky. Read docs for specific commands and test in multiplayer.
They don't
I was looking at suppression and how it works in game against AI. How come weapon sway affected when a player gets hit and not NPC's???
Suppression certainly affects their ability to shoot straight either way.
@granite sky yeah.. but they are not effected by bleeding.. players are... and suppression only works for a few seconds before the ai recovers. Just seems a bit unfair if you ask me.
Will "getRelPos" work with a marker? something like sqf private _rdmDir = random 360; private _spawnPos = "Marker_1" getRelPos [50,_rdmDir];
left argument is object, so no
getMarkerPos "Marker_1" vectorAdd [sin _rdmDir * 50, cos _rdmDir * 50, 0]
```just calculate it yourself
Weid... because even markers have a direction...
Cool! Thanks, Will test
What do you mean? the password authentication is asynchronous process you canβt just return it from command. I know it sounds obvious the server executes and the server authenticates but it uses network implementation because of headless clients that have the same rights as server so if you have to wait might as well be an event handler
I'm only talking about serverCommand usage on server-side, not whatever client types in the chat with hashtag
Problem I am myself having, I don't know if server-side ran
password serverCommand "#mission something.Altis"
``` will work because of password or not, I need to know if password is correct so I can be sure that `serverCommand` will change the mission.
the event handler will fire either way and return bool. you can also execute a dummy command to know if password works
i have a pbo i want to turn into a mod how would i go about doing so?
thanks
By output I meant whatever command outputs like #userlist
Not need for it personally, just a thought about possible EH
what #missions outputs?
2022/09/15, 15:01:52 Successfull attempt to execute serverCommand '#mission KingOfTheHill_RHS_by_Sa-Matra_for_CODE4.Altis' by server.
``` in RPT after `#mission` through `PASSWORD serverCommand COMMAND` on server side.
is there faster alternative to findIf?
it depends
what are you trying to do?
checking if any group is near enough to position
https://community.bistudio.com/wiki/inAreaArray you can use that instead
thx will do some speed tests
one problem though, is that it cannot take groups , only units etc
im looping groups and getting leader pos for the distance check
well if it's only leader you care about, you should probably stick to findIf
(_groupsArray apply {leader _x}) inAreaArray [...] π€·ββοΈ
apply fast?
try it. I'd say apply or any other in-sqf loop over the array would take way more time than any form of distance-computing in-engine
depends how many groups you have
you can also maybe just keep an array of leaders, and occasionally poll it
Premature optimisation is the root of all evil β Donald Knuth
true my code is pretty much finished so time for optimizations
you sure?
if there are any matches - sounds almost certain π€·ββοΈ
I think doing distance check in loop is slower 
I mean if no group is in the "area"
if no group is in the "area" - then findIf passes over the entire array in-SQF and we have 1 loop. If we go with ...apply...inAreaArray - we go over the entire array in-SQF for sure.
yeah but then also if first group is in the area π
i do think inAreaArray is the best
but with managed array of leaders, that you keep track of
yeah it's easier now that we have group EHs
with managed array of leaders that you keep track of you have 3x the code and 5x the failure points π
with 6 groups in VR on my machine :
grps findIf {(leader _x) distance player < X} is 0.0028 ms with match on first, 0.0109 with no match
(grps apply {leader _x}) inAreaArray [getPosWorld player, X, X] is 0.0099 with (grps apply {leader _x}) part being 0.0078 of those
If going for "any unit" instead of "group leader":
flatten (grps apply {units _x}) inAreaArray [getPosWorld player, 3, 3] 0.0175 ms
grps findIf {count ((units _x) inAreaArray [getPosWorld player, 3, 3]) > 0} 0.005 - 0.0219 ms (match first/no match)
yeah so like i said, cache leaders if you want best perf
loop is like 90% runtime, and if you have a lot of groups it becomes terrible quick
π§
it's not a fair comparison tho π
you're making a new array in every iteration of the loop
pls add inlineAsm π with an assembly parser on top of that, so i can create array constants in peace
(joke π€ )
I would need to touch the compiler for that
Just write assembly manually and pack it as bytecode π
well yeah i already have π just saying it would be nice to have it in the game itself 
thx for all the ideas, havent got much more speed yet , the milliseconds are so fluctuating.....
I suppose you cant combine these two lines? ```sqf
private _eneGroups = _groups select { side _x != _side };
private _enePositions = _eneGroups apply { _x call frontGetGroupPos };
you can but not sure how much faster it would get
and instead of this:
_eneGroups apply { _x call frontGetGroupPos };
you can write
_eneGroups apply frontGetGroupPos;
and use _x instead of _this (or params)
but again it's not noticeably faster
writing SQF loop for that probably wouldn't be faster?
anyone know a faster and better working way to block thermals on optics? if you spam the thermal/nightvision command you are able to use the thermal 1 sec.. which makes the script kind of useless.
while {true} do {
if (currentVisionMode player isEqualTo 2) then {
cutText ["THERMAL IMAGING OFFLINE", "BLACK", -1];
waitUntil {currentVisionMode player != 2};
0 cutFadeOut 0;
};
};
does it also work with the viper helmets?
hi there, i am having a bit of trouble with this code:
ugv_1 disableAI "ALL";
ugv_1 EngineOn false;
heli = ugv_1 nearEntities ["Air", 15];
ugv_1 attachTo [heli, [0.2,2,-2]];
ugv_1 setObjectScale 0.8;
The problem is, that the ugv (a vehicle) wont attach because, I assume, the nearEntities returns an array where as I would need an object. But how would I convert the array into a object?
Is there a way to set walk to defult on a server ?
@trim tree Do you want it to attach to the closest air vehicle or is picking one randomly out of the 15m list fine?
I am currently making a jet deathmatch mission where there is a FFA between players and also AI, so player vs player vs AI.
Currently all players are civilian and all AI east.
How can I disable the crossed square / diamond indicating a friendly unit?
closest would be needed
What is this?Server: Object info 4:2647 not found. Can't change owner from 0 to 210907364 Server: Object info 4:2646 not found. Can't change owner from 0 to 210907364 Server: Object info 4:2649 not found. Can't change owner from 0 to 210907364 Server: Object info 4:2648 not found. Can't change owner from 0 to 210907364 Server: Object info 4:2651 not found. Can't change owner from 0 to 210907364 Server: Object info 4:2650 not found. Can't change owner from 0 to 210907364 Server: Object info 4:2653 not found. Can't change owner from 0 to 210907364I probably tried to change the owner of an null object?
what is the state-of-the-art way of sending a camera feed on a screen ? JIP compatible ?
depends
whats state of the art
Newest way, best practices, etc.
But I found what I needed I think
I still don't get why render to texture fails when switching to splendid camera, but anyway
Not a big deal in my case
engine doesnt support PiP if you are using any camera that is not player camera. Hence it fails.
Is there any way to enable the / chat entry in SP? Whether officially or through a mod. Realized it was gone and working on sth to utilize typing
no
you can recreate it though with scripting
but why not just play the scenario in mp, player host?
as in making custom GUI for typing? or is there something else you can point me towards?
yes, custom gui
inconvenient considering it's wholly sp otherwise, thinking of it from an end-user perspective if I ever finish it
ty for the help π
what do you need chat for though (in sp)? π
that is.. complicated to explain lol. working on a networking project that exists outside of arma's existing server infrastructure, was looking to implement a "global chat" that would work in all scenarios, even if you were by yourself in another mission
basics are done but I was hoping to utilize HandleChat and pass off the entered message, since that's not an option I'll look into GUI for text entry :p
a custom chat sounds even more proper for what you're trying to do
definitely, thanks again for the pointer in the right direction
Thanks, but why does it stay failed once exiting the splendid camera?
Even re calling the initializing function seems to have no effect
It shouldnt fail iirc but I am not sure.
try changing it to another texture then back again.
I'll try thanks
looking for some sqf code optimization advice for unscheduled running 3d target indicators
https://pastebin.com/B67E5fGF
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.
from my profiling the checkVisibility, and even more so terrainIntersect + lineIntersects are the biggest heavy hitters
optimization done already:
- only compute for known targets
- for targets in field of view
- only every 1s (instead per frame) when already known
possible improvements:
- cache stuff on known units (ie class type)
- avoid isKindOf by caching type (Infantry/StaticWeapon/Tank/Vehicle)
possible improvements:
- cache stuff on known units (ie class type)
- avoid isKindOf by caching type (Infantry/StaticWeapon/Tank/Vehicle)
yeah, you should do that, from a quick look:
{({alive _x} count (crew _unit)) > 0}
findIf instead
ο»Ώ
{(getNumber (configFile/"cfgVehicles"/(typeOf _unit)/"isPlayableLogic")) != 1};
configOf and use >> instead (abit faster than /)
if ((difficultyOption "visionAid" == 0) && {(!([side _unit, playerSide] call BIS_fnc_sideIsFriendly))}) exitWith {};
this should literally be in the _condition?
if (!((_angle <= 90) || (_angle >= 270))) exitWith {};
variables in lines 57-59, can be defined after this exitWith.
if (time < ((_unit getVariable ["LIB_UnitIndicatorLastSeen",0]) + 1)) then
{
_seenVeryRecently = true;
}
this can literally be _seenVeryRecently = time < ((_unit getVariable ["LIB_UnitIndicatorLastSeen",0]) + 1);, cut the else and invert i.e., if !_seenVeryRecently then { ... }
same thing in line 96. line 114, you can use a hashmap, infact you should first check the condition at line 122, then decide whether you want to pick a color, or use the unconscious one
not really part of optimization, but you can use exitWith in many places instead, so you don't have to indent as much.
one less scope indeed please!
also each and any if (condition) then { rest of the script with extra tab} can be painlessly swapped to if (!condition) exitWith {}; rest of the script without an extra tab π€£ but that's more on code formatting than actual performance
@copper raven much appreciated πββοΈ will share how much % this brought
best would be have access to the native unit icon drawn tho π¬
is there a way to declare a variable without assigning a value?
private "_varname"; is probably the closest thing. But there's barely a usecase for that, i suppose?
i have a few variables that only get used if certain conditions are met, so far i've just been setting them as empty arrays, thought i could use that there
private _varname = 0; might be fastest.
that is two script instructions only
If you want to do more than one then private ["_var1", "_var2"] is faster
(assuming that you don't need an initial value)
either way having uninitialized variables is a sign of bad design
it's only (sometimes) acceptable with function args
it has its use cases, it doesn't hurt to initialize though (what Dedmen wrote) even if it's unnecessary
no. a var that may be uninitialized is not justifiable. you can always do other stuff instead
the only thing I can think of is when you store the return of a function that sometimes returns nil when it fails
and you can leave the default value of the variable nil anyway
if a child scope always assigns to x and y, and you need those values in the parent scope, i see no point in initializing them, but just "declaring them" in the parent scope
that's not the same
huh?
I said if it may sometimes be uninited
if it is always initied at some point then yes it's fine
ah i read what you said wrong way then π
tho I guess in SQF it does make sense 
because I think the more you nest something, the slower newer calls get
I like nils generally because they throw errors early :P
so you can just do a isNil check in the outer scope:
private "_var";
if (bla) then {
if (blabla) then {
..
_var = value;
// a function call here will be nested several times, so just do it outside
};
};
if (!isNil "_var") then function;
Also when you're storing bool flags on objects, true/nil tends to work out much cleaner than true/false.
if you mean setVariable you can have a default value
yeah because it has to look up more scopes when trying to get a variable
i wouldn't worry too much about it though
got any idea yet?
Reusable function for finding the nearest object in an array to a position or object:
private _fnc_findNearest = {
params ["_fromPos", "_objects"];
private _nearest = objNull;
private _nearDist = 1e6;
{
private _dist = _x distance2d _fromPos;
if (_dist < _nearDist) then { _nearDist = _dist; _nearest = _x };
} forEach _objects;
_nearest;
};
Should be a command for it, but there isn't.
What's the difference between that and BIS_fnc_nearestPosition?
Other than being a bit quicker? Not a lot hopefully.
Hello, is there anyway to make a m113 faster on water? Thanks
Ask the mod creator
aka not something you can do in scripting
You can't make it natively faster but you can script an action to give it a temporary velocity boost. It's a little janky but doable
I think "setUnitFreefallHeight" command is not getting synced with other clients and stays local
can someone check ?
Any way to keep a Logic from getting deleted? I'm trying to use a tree of Logics with a script, but the child Logics sometimes get deleted before the root Logic gets a chance to run its script.
logics don't just delete themselves though? is it a module you're using maybe that does it?
apply + sort is faster
it takes local arg
Did you try it? IME sort's pretty awful for large arrays.
i tested it some time ago
Yeah something seems to be deleting my Logics... wasn't sure if that's expected. Could potentially be another mod, let me try in vanilla...
@copper raven but it supposed to change on all computers if I execute it on me for example , right ?
if you execute it where unit is local, it should properly sync
Since Im using it on me , it should do that
but it dosent
player setUnitFreefallHeight 600;
and If someone does getUnitFreefallInfo ME it will return back [false,false,100]
yeah seems to be local effect actually (or a bug
)
remoteExec it
Ok, in vanilla testing the logics stick around like I hoped. I think a bug in my own script is deleting them π€¦ββοΈ
Where can I report bugs again ?
apply+sort comes out as slightly worse for me in both 10 and 40 object cases.
Code is a bit shorter though:
private _fnc_findNearest = {
params ["_fromPos", "_objects"];
private _sortArray = _objects apply { [_fromPos distance2d _x, _x] };
_sortArray sort true;
_sortArray select 0 select 1;
};
should really be a command that executes 20x faster anyway :P
Looking for some help on a script acting differently when local host testing vs Dedicated server testing.
Locally the script works great
on a dedicated server the model never seems to attach to the player then the player seems to get "stuck" in the script forever unable to perform any other menu actions at all.
so far this is what I've been able to been able to gather from my testing:
call BIS_fnc_WL2_sendClientRequest ... this part is working correctly, I'm getting a system chat message back from the correct part of the code.
_h/_offset_tweaked is working correctly in local testing...I get no model and I can't hit spacebar to do anything on a dedicated server.
call BIS_fnc_WL2_hintHandle...other parts of this script are working correctly and I was able to force call it by setting it to TRUE.
I'm stuck on where its broke. On dedicated server, I get no model attached to player, I can't assemble and I can't cancel...just stuck in a forever type loop.
Script link on github:
https://github.com/korbelz/WarlordsReduxMe.altis/blob/main/Functions/client/WL2_orderDefence.sqf
i'd guess it's an issue with the BIS_fnc_WL2_sendClientRequest suspending forever thus no code runs after that
i have no experience with warlords framework, so don't know what the function exactly does
put some debug in line 17 and 19, see if both of them run (preferably also print the _asset)
@unique sundial How feasible it would be to change object destruction type per object instance in the engine? This has been a long going issue where some great objects are borderline useless because how easily they get destroyed, especially since PhysX ragdolls kill everything around them in multiplayer.
Specifically a lot of stuff with DestructTent, it looks ugly, very bad for gameplay (you can prone hide under flattened objects)
Simple objects don't help here either because destruction type is defined in the model as far as I understand
Practical use - have some kind of camo netting that can't be killed at all.
Another approach to solve the issue would be a command to disable collision damage that flattens the object
Otherwise ENTITY setDestrType STRING with string being something like DestructNo
allowDamage should work for that, no? Or do physics kills evade that somehow?
Anything TYPE is a common property for given object class. The object has dynamic properties and static properties. This would be static property and to be able to change it per object it would have to be implemented as dynamic property so on top of more work it would add additional burden on object simulation, so I'd like to avoid this. I'd rather think how to solve a particular problem you are having. So lets hear the concrete scenario so we can see what can be done.
No, this damage isn't stopped by allowDamage nor HandleDamage
that can be added relatively easy
Hmm, looks like my info is outdated and it both allowDamage and HandleDamage stop object flattening from vehicle at least π€
False alarm, apparently it been fixed some time ago, been an issue for years
Not sure about PhysX bodies though, gonna see how it behaves now
Gonna observe more to see if ragdolls bypass this fix or not because previously having any DestructTree and DestructTent objects near dying units in populated multiplayer killed these objects very quickly
Ok let us know
is it possible to import functions into description.ext from another file?
something like #import OtherClassOfFunctions.ext or something?
What should be the extension of the file I'm including? .ext?
doesn't matter
usually people like to use .h or .hpp, so you have syntax highlighting in the ide
is there a way to disable the horn on a vehicle via script?
Remove horn weapon via removeWeapon
removeWeapon and whichever one of the horn types on this list works: https://community.bistudio.com/wiki/Arma_3:_CfgWeapons_Vehicle_Weapons
how can I send a script I want to trigger as a parameter to another script?
I tried this and sending "scriptname.sqf" and a empty array as params. but it did not work.
params["_script", "_args"];
_args execVM _script;
First, don't use execVM, it's intended for single use only
make it a function
and then for example
_Number = 69;
_Number call fn_doStuff;
or
_Number1 = 69;
_Number2 = 420;
[_Number1,_Number2] call fn_doStuff;
ok, this example is likely only gonna run once. but good to know in general. where would I define fn_doStuff ?
and how would I actually use it. the intention here is that the missionmaker can add their own script/code as a parameter and have that trigger when my script reach a certain state.
So I want them to be able to just send the name of the their script. or if it can be done using functions in some other way if that is better
Then the problem is something else
alright, i used nearestObject like this
heli = nearestObject [ugv_1, "Air"];
but now ive come across a new problem: is there a way to return the user of an addaction so that i could send only him a hint?
The addAction code is remoteExec'ing to the server?
it is written into the object init
ugh, object init :/
it would be no problem tho to call it through init.sqf or similar
Whatever activation code you have in the addAction will run locally to the player that triggers the action.
so simply calling hint "some text" in there will only be seen by the player that triggered the action.
interesting, alright thanks!
The object init itself is run everywhere, hence everyone can see the action.
This is not always what you want
regarding that, would my heli variable not be global then even though i didnt use _heli?
There are two separate uses of global/local here.
A global variable is visible to every script on a particular client, but not necessarily visible on other clients.
Indeed, you can have two global vars called heli on different clients with different values.
But in this case it should definitely be private _heli
because it's short-term usage and you don't want or need it to be visible outside local scope.
but i need it in another one
what i am (or currently actually am lol) trying to achieve is to load a UGV into a helicopter and then be able to unload it as well. heli needs to be global (for all clients) because the unload action 1.) requires the orientation of the actual helicopter used and i believe that it is the easiest solution to simply store the variable from the load action instead of trying to figure it out again during unload and 2.) because it may not be the same person unloading the ugv vs who loads it.
well, maybe on second though i could use attachedTo to get the heli. that way i wouldnt need to store it π€
Any helicopter or a transport one that can actually fit the UGV? If second - then vanilla vehicle-in-vehicle transport may work as-is.
If any - would the UGV be attached to the heli model or removed and recreated on unload? If second - then storing the UGV state in a variable on the heli and adding an action to the heli may be the way.
unfortunately there is no helicopter available to me that can naturally transport it (it clips a little with the one i am using right now), hence im using attachto ^^
and no, i want it to be visible
then yes, attachedTo would give the heli. And both actions can be added at the same time, with one only showing up if not attached and other one only showing up if attached
Conventionally with these things you add the unload action to the heli rather than the object, although maybe that'll work if you can see the thing well enough.
much easier logically if you can add both actions to the UGV.
i'd still say shove both actions in the Init of the UGV with inverse show conditions
Definitely try it that way.
like, ```sqf
this addAction ["memeAttach", {
params ["_target", "_caller", "_actionId", "_arguments"];
_target setPosATL (getPosATL _target vectorAdd [0,0,1]);
[_target, nearestObject [_target, "Air"], true] call BIS_fnc_attachToRelative;
}, [], 0, false, true, "", "isNull attachedTo _target && {nearestObject [_target, ""Air""] distance _target < 15}"];
this addAction ["memeDetach", {
params ["_target", "_caller", "_actionId", "_arguments"];
detach _target;
}, [], 0, false, true, "", "!isNull attachedTo _target"];``` already seems to work close to intended π€£
i got it working this way:
loading:
ugv_1 disableAI "ALL";
ugv_1 EngineOn false;
private _heli = nearestObject [ugv_1, "Air"];
if (isNil "_heli") then {hint "Kein Hubschrauber in Reichweite"} else {
ugv_1 attachTo [_heli, [-0.5,1,-2]];
_heli addAction ["Ausladen", "ausladen.sqf"];
removeallactions ugv_1;
hint "UGV eingeladen";
};
unloading
private _heli = attachedTo ugv_1;
private _helialt = getPosATL _heli;
private _helidir = getDir _heli;
if (speed _heli >=5 or (_helialt select 2) >=5) then {hint "Geschwindigkeit muss unter 5Km/h und HΓΆhe unter 5m liegen"}
else {
ugv_1 enableAI "ALL";
ugv_1 EngineOn true;
_heli allowDamage false;
ugv_1 allowDamage false;
ugv_1 attachTo [_heli,
[-0.5,-7,-2.5]];
ugv_1 setDir _helidir;
detach ugv_1;
_heli allowDamage true;
ugv_1 allowDamage true;
ugv_1 addAction ["Einladen", "einladen.sqf"];
removeallactions _heli;
hint "UGV abgeladen";
};
just need to test it in MP
It won't work correctly in MP because the addActions and removeAllActions are only applying to the client that triggered the previous action.
so i would need to remoteexec that?
You should try artemoz's solution first, because it's much simpler if it works well enough.
i dont really get it though π
but yes, if you're going to add and remove actions dynamically then you'll need to remoteexec those operations to all clients.
I'm currently pulling my hair out trying to get this script working.
I'm taking a mod that already exists (with permission from author) and adjusting the scripts so that they can be used while remote controlling an AI. would anybody be able to help me with said script? It's already pretty much written, just need to know what to swap out and change.
My uh, scripting knowledge is next to none. I tried swapping
if(driver _this == player)
with
if(driver _this == Alive)
and it threw at least 6 separate errors.
what are you trying to accomplish?
driver vehicle player isEqualTo player // check if player is driver of current vehicle
if just checking if the driver is still alive you could try ```sqf
if (alive (driver _this))
Police Lightbars and Sirens, being able to enable them while Remote Controlling an AI in Multiplayer.
It checks if the driver is a player, which works wonderfully when I myself am driving. but if I remote control AI the options don't appear
and alive check is
alive player;
I'm more trying to figure out how to... show the script/action while I'm controlling someone else.
["Ivory", "ivory_highbeams", ["High Beams", ""], {
_this = vehicle;
if((typeOf _this find "ivory") < 0) exitWith {};
if(dialog) exitWith {};
if(Alive(_this) AND driver _this == Alive) then {
if((_this animationPhase "light_lh" == 0 || _this animationPhase "light_rh" == 0) || !isLightOn _this) then {
addAction["lightOn", _this];
_this animate["light_lh",1];
_this animate["light_rh",1];
} else {
_this animate["light_lh",0];
_this animate["light_rh",0];
};
};
Heres an example of a piece of the code itself
#arma3_scripting message
read this first
_this = vehicle; that's not valid
it was player vehicle beforehand I believe
vehicle player*
if(Alive(_this) AND driver _this == Alive) then { also this, driver _this == Alive is a a syntax error
I knew it was one of those lmfao
Would you know what to replace it with? so that everyone that entered the vehicle would get the options for the lightbars?
alive driver _this
is this not possible? I am basically just trying to create all of the vehicles in the array but without hitting each other and exploding, so im pretty much just incrementing the x from the x/y/z array returned from the markerpos
index = 0;
{
// Current result is saved in variable _x
_x createVehicle (getMarkerPos "start") select 0 += index * 5;
index = index + 1;
} forEach [];
what is += supposed to do?
basically the equivelant of index = index + 1; now that I think about it im not sure if sqf has that
I rewrote it instead like so
index = 0;
pos = getMarkerPos "start";
newPos = [];
{
// Current result is saved in variable _x
newPos = [(pos select 0) + (index * 5), pos select 1, pos select 2];
_x createVehicle pos;
index = index + 1;
} forEach [
and got my wanted result
yep, no += /= -= *= ++ -- in sqf
big sad
even if it was a thing, it's not valid, you're trying OBJECT select 0
Final Question
_this = vehicle;
what should I replace this with since it's an error?
remove it completely
this phrase says assign something to _this which is a protected variable
That line tells the game to apply the animations to the object/vehicle the trigger/action was executed from
getMarkerPos returns an array though no?
_this = vehicle;
if((typeOf _this find "ivory") < 0) exitWith {};
if(dialog) exitWith {};
if(Alive(_this) AND alive driver _this) then {
if(_this animationSourcePhase "turn_left" < 0.5) then {
_this animateSource ["turn_left",1];
/*(ivory_indicatorl = true;
if!(ivory_indicatorr) then {
[_this,player] spawn ivory_fnc_indicator;
};*/
} else {
//ivory_indicatorl = false;
_this animateSource ["turn_left",0];
};
};
}, {}, [DIK_Q, [false, false, false]]] call CBA_fnc_addKeybind;```
precedence
So would removing it still allow the script to work?
(This is to my knowledge, please correct me if I'm wrong)
that line is trying to overwrite the magic variable _this. if you want _this to be assigned to something else, you do _myvehicle = _this
Now doing that line, would it allow me to execute the script while controlling an AI in the vehicle?
you are using _this everywhere else. you don't even need that line.
I've removed the line completely, will let you know if it works
I also included the other code sharp told me to use
Should setVelocity be used in any specific circumstances similar to setVelocityTransformation needing to be on each frame? Trying to run player setVelocity [100, 100, 100]; from debug and it's doing zilch
I'm not moving at all 
You're just running player setVelocity [100, 100, 100]; like that as is, right..?
yeah I just saw I actually didn't move anywhere, I just died instead
Yeah that's what I meant lol
I just get killed
I set damage allowed to false and do it
zilch
Nope, can't get it to appear when controlling AI :(
you need to be higher than the ground. works when i'm falling through the air
but the velocities will depreciate
thinking theres a chance it could be EM (again)
EM?
enhanced movement
oh yeah i don't have that running. just ace.
hmmmmmmm
Hypoxic is there any way I could trouble you to look at the main script and see what's wrong with it? (Like send it to you and you have a super quick look)
player allowDamage false;
_plrPos = getPosASL player;
player setPos (_plrPos vectorAdd [0,0,1]);
player setVelocity [1, 10, 10];```
works but i dont *really* want to have to change the players position before movement if its unavoidable
I'm unable to figure out what I'm doing wrong
whats the issue?
are they showing up at all
I literally will send you $10 as a steam gift card for you to help me fix this
Nope, not showing up at all, I'm so lost
show the addaction bit
I can't find the addaction bit
I'm not sure how the original author did this without that line
It shows up via scroll wheel menu normally, now it doesn't show up at all. This hurts my smooth brain
are they adding it in a different script
would createDialog be what I'm looking for?
I know what that is lmfao
I searched for that in nearly every sqf in here
Bingo! Didn't think of that
π
I'm still searching at the moment lmfao
I butchered this damn script, I'm gonna start over and work from there.
I'll send the original so it's easier to work off of
_this = vehicle player;
if((typeOf _this find "ivory") < 0) exitWith {};
if(dialog) exitWith {};
if(driver _this == player && ((_this animationPhase 'lbSystem_top' > 0) OR (_this animationPhase 'lbSystem_front' > 0) OR (_this animationPhase 'lbSystem_back' > 0))) then {
playSound "ivory_beep2";
if(_this getVariable 'ani_siren' == 0) then {
_this setVariable ['ani_lightbar', (_this getVariable "ani_lightbar_todo"), true];
_this setVariable ['ani_siren', (_this getVariable "ani_siren_todo"), true];
} else {
_this setVariable ['ani_siren', 0, true];
};
};
}, {}, [DIK_R, [false, false, false]]] call CBA_fnc_addKeybind;```
what editor are you using?
Would you mind if I DM'd you what all I have?
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
use this too
Post... the entire SQF?
if its huge you can use https://pastebin.com
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.
sqfbin.com
yeah that
Then just save it and post it here?
yeah
(I am not reading that - good luck guys)
even i think that doesnt look organised in the slightest
I didnt make this lmfao.
It's giving me a headache if I stare too long
ngl i would recommend just making it over again
I may just ditch this project
Been a nightmare since I started trying to fix this guys mod
dont worry im still working on my grappling hooks after thinking i was happy with them because it doesnt work as i want it to in both mp and when hitting walls
i think its been at least a month since i started
pretty sure I figured out a way around it.
{
displayName = "<t color='#ff0000'>Reset Lock/Fast</t>";
position = "drivewheel";
radius = 10;
condition = "alive driver _this";
statement = "this setobjecttexture [31,'\MeansCars\2011_CVPI\data\radar\pic0.paa']; this setobjecttexture [32,'\MeansCars\2011_CVPI\data\radar\pic0.paa']; this setobjecttexture [33,'\MeansCars\2011_CVPI\data\radar\pic0.paa']; Prevspeed = 0;";
onlyForplayer = 0;
};```
Does this look right?
Question: Using the InventoryOpened eventHandler, I only get the information of the player's inventory/container, the ground weaponholder (WeaponHolderSimulated), and inventory of a crate/vehicle if any. My current issue is the ground weapon holder pulled in the params of the eventHandler does not allow me to get info of the actual target body being looted. I'm assuming I'll need to use some code using nearSupplies command but not sure how I can make it more precise if I am amongst several dead bodies/weaponholders.
My goal is to pull items, weapons, magazines, uniform, vest, assignedItems, etc. from the body but the WH pulled does not have any of that in it.
Do dead bodies have assigned weaponholders that can be pulled?
get-corpse-from-WH would soon(-ish?) be possible with https://community.bistudio.com/wiki/getCorpse, i guess
Oh shit nice
I have player starting with ambient animations, but they can't interrupt them and just keep dancing. How break free of animations?
player switchMove "";
thanks where exactly should I use that? I'm totally noob in editor, that's my first mission
If it's a player you can just globally execute it in the debug window if you have access to it (Has to be enabled in the description.ext though)
can i bind it to a timed trigger, like after receiving radio message?
Is it a singleplayer mission?
no, MP
You can do that then. I'd make a trigger that's "Server Only" and then in the activation of the trigger put something like:
[player,""] remoteExec [ "switchMove" , thisList , true ];
See if that works.
Worked for me, make sure the countdown/timer isn't 0 otherwise it'll execute too fast upon loading mission if players in the trigger.
Activation dropdown set to Any Player
Present
I set countdown for 20 sec but they break as soon as they load
ok figured it out, the time on the map before mission start counts too
Could try setting condition to:
this && time > 1
where do I get time? is it triggers countdown time?
time is a script command: https://community.bistudio.com/wiki/time
If you're totally new to scripting, this page is your friend:
https://community.bistudio.com/wiki/Category:Arma_3:_Scripting_Commands
The code I posted basically means the condition is if player is in trigger && (and) the mission time is at least 1 second, the timer should start
I have a problem, when exiting the triggers area the character starts to dance again, and this time there is no trigger to stop him )))
You must have something else spamming a dance animation on them or something then
yeah, I created animation in character's attributes
Probably a mod you're using that forces the unit to play the animation over and over then. You can try getting rid of the animation set and just put this in the init of the unit, if you want them dancing right away:
this switchMove ( selectRandom [ "Acts_Dance_01" , "Acts_Dance_02" ] );
That's about all I can help with
thank you
switchMove might need a little delay though
Especially in MP on a loaded server
I have 2 variables hostage1 and hostage2, how to make mission end sucessfully after they are present inside a trigger zone? They are blufor.
You can use this condition for your trigger:
hostage1 in thisList && hostage2 in thisList
what about onActivation field?
see BIS_fnc_endMission
Having a slight issue with something, although it's probably because I'm not too good at dealing with HC's and such. Or am executing this incorrectly.
TLDR, Executing a script to keep specific scores to an individual that way they can retrieve prizes. Only issue is, each time someone scores a kill, it seems to apply across all players, and sometimes multiplied by headless client.
addMissionEventHandler ["EntityKilled", {
params ["_killed", "_killer", "_instigator"];
if (!isPlayer _killer or _killed isEqualto _killer) exitWith {};
player execVM "addScore.sqf";
}];
If the EH is added on all clients, it will fire on all clients whenever an entity is killed. You should add the EH only on the server, and do _killer execVM "addScore.sqf" (make addScore a function though).
So calling the eventhandler in the mission init.sqf wasn't a good choice?
init.sqf is executed on all clients, so no, not a good call in this case. Use initServer.sqf instead.
absolute legend
Next question is probably more complicated than I anticipate
But how would one just make something a function?
Thank ya, shall have a read
having issues attaching an object to a mortar shell (server shell, server attached object)
not done this stuff before, wondering if there is a known reason for this
Hmm, we attach smoke grenades to mortar shells in Antistasi and it works locally at least. There are locality issues with the Fired EH.
Hey, I've recently revived one of my older mission files after 2 years and we're suddenly experiencing an odd issue that hadn't been a problem before.
Whenever the 'dropdown' box (RscCombo) is clicked, the clients game crashes/closes. This seems to happen more often when there is no data in the dropdown.
Has there been an Arma 3 update in the past 2 years that affected dropdown menus and created an issue for older mission files?
@pulsar bluff Don't think you can attach objects to projectiles because they are local on all machines or something.
I've seen similar issue very recently. #arma3_scripting message
Probably a bug that introduced recently?
Yet I couldn't reproduce that one, but still
Yeap that's it, if I make sure the combo isn't empty it doesn't seem to crash (well not yet). Interesting
If you can provide the game version and the code that reproduce the issue 100%, that's better for devs
Hello, sry for the inconvenience. But I'm trying to create a solution to a situation and im out of ideas.
I'm looking down to make a small PvP, blufor vs opfor vs independent. Im looking to gave a small briefing. and i need that each one recives a diferent diary.sqf.
is there a way? something i should read for this? The same for the missions, there are 6 diferent missions, but i need that each recives a diferent version(one destroy, one defend and the other steal).
createDiaryRecord is local so what's the hangup specifically?
i need that blufor receive one version, opfor another and independent a third one. how do i accomplish that?
private _diaryText = switch (side player) do
{
case west: {loadFile "westDiary.txt"};
case east: {loadFile "eastDiary.txt"};
case independent: {loadFile "indepDiary.txt"};
};
``` one of many possibilites
you're using createDiaryRecord right?
loadFile moment
Stringtablesss
yeah, they are
for storing text
loadFile reads the file from the disk, not ideal I'd say
is there a way to tell who killed a unit after they are already dead?
or is that only available in the killed event handler on time of death
any idea whats up with this? according to the wiki it wants a player object < setunitloadout > loadout array
22:02:13 Error in expression <_liberation_arsenal_type) then {
player setUnitLoadout (_loaded_loadout select 1>
22:02:13 Error position: <setUnitLoadout (_loaded_loadout select 1>
22:02:13 Error Type HashMap, expected Bool
not ideal, but simple enough to slap some txt files in the mission folder for loading a brief at init
event
but you can use the event to set a variable on the body
I have confirmed that the _loadout_loadout is not empty and is a correct loadout array as well. Really confused here
Im unsure what would even want a bool
you are using "select 1" on a loadout array then
well ace loadout array sorry, the first index is the loadout name, second is the correct loadout array
the error might be somewhere else, as it talks about a hashmap
where are you getting the loadout from?
from what im seeing, loadout is index 0, index 1 is some "extended info" stuff, which is a hashmap
the loadout seems to come from ace saved loadouts? I assume that is saved in some player profile vars
_loadouts_data = +(profileNamespace getVariable ["ace_arsenal_saved_loadouts", []]);
private _loaded_loadout = _loadouts_data select (lbCurSel 201);
if (KP_liberation_ace && KP_liberation_arsenal_type) then {
player setUnitLoadout (_loaded_loadout select 1); // Line with error
} else {
[player, [profileNamespace, _loaded_loadout]] call BIS_fnc_loadInventory;
};
I logged the loadout var and index 0 is the loadout name while 1 is the array, ill send the log one sec
huh
ok so apparently its only erroring with a certain loadout.
This one works fine
"[""Scar"",[[""rhs_weap_SCARH_FDE_LB"",""rhsusf_acc_aac_762sdn6_silencer"",""rhsusf_acc_anpeq15_bk"",""rhsusf_acc_ACOG_RMR_3d"",[""rhs_mag_20Rnd_SCAR_762x51_m61_ap_bk"",20],[],""rhsusf_acc_harris_bipod""],[""launch_MRAWS_olive_F"","""","""","""",[""MRAWS_HEAT_F"",1],[],""""],[],[""rhs_uniform_FROG01_wd"",[[""ACE_CableTie"",2],[""ACE_EarPlugs"",1],[""ACE_EntrenchingTool"",1],[""ACE_IR_Strobe_Item"",1],[""ACE_Flashlight_XL50"",1],[""ACE_key_master"",1],[""ACE_tourniquet"",4],[""ACRE_PRC152"",1],[""ACRE_PRC343"",1]]],[""UK3CB_ANA_B_V_SL_Vest_TAN_03"",[[""ACE_elasticBandage"",30],[""ACE_morphine"",3],[""ACE_epinephrine"",3],[""ACE_splint"",4],[""rhs_mag_an_m8hc"",3,1],[""HandGrenade"",3,1]]],[""UK3CB_CW_US_B_EARLY_B_RIF_2"",[[""rhs_mag_20Rnd_SCAR_762x51_m61_ap_bk"",15,20]]],""rhsusf_lwh_helmet_marpatwd_headset_blk"","""",[""rhsusf_bino_lerca_1200_black"","""","""","""",[],[],""""],[""ItemMap"",""B_UavTerminal"",""ItemRadioAcreFlagged"",""ItemCompass"",""ACE_Altimeter"",""NVGogglesB_blk_F""]]]"
While this one errors
23:04:06 "[""Fatass Sniper"",[[[""rhs_weap_t5000"","""","""",""rhsusf_acc_ACOG_RMR"",[""rhs_5Rnd_338lapua_t5000"",5],[],""rhs_acc_harris_swivel""],[""launch_MRAWS_olive_F"","""","""","""",[""MRAWS_HEAT_F"",1],[],""""],[""rhsusf_weap_glock17g4"","""","""","""",[""rhsusf_mag_17Rnd_9x19_JHP"",17],[],""""],[""rhs_uniform_FROG01_wd"",[[""ACE_EntrenchingTool"",1],[""ACE_IR_Strobe_Item"",1],[""ACE_Flashlight_XL50"",1],[""ACE_tourniquet"",4],[""ACE_CableTie"",2],[""ACE_epinephrine"",2],[""ACE_morphine"",4],[""ACE_splint"",1]]],[""rhsusf_spc_rifleman"",[[""ACE_elasticBandage"",30],[""ACE_SpraypaintRed"",2],[""ACE_splint"",2],[""ACE_wirecutter"",1],[""rhs_mag_an_m8hc"",3,1],[""HandGrenade"",2,1]]],[""B_Carryall_oucamo"",[[""ACE_CableTie"",2],[""ACE_bodyBag"",2],[""MineDetector"",1],[""ACE_EarPlugs"",1],[""HandGrenade"",2,1],[""rhsusf_mag_17Rnd_9x19_FMJ"",10,17],[""rhs_5Rnd_338lapua_t5000"",100,5]]],""rhsusf_lwh_helmet_marpatwd_blk_ess"",""G_Aviator"",[""rhsusf_bino_lerca_1200_tan"","""","""","""",[],[],""""],[""ItemMap"",""Ite
couldnt log all of it annoyingly enough
perhaps its the TFAR radios?
im noticing that in index 1 of the second array there is 3 [ brackets while the first array only has 2. Wonder whats going on here
it would seem it is Tfar, I need to figure out how to log the entire array without it getting cut off
just copy it, with copyToClipboard str _array
huh that didnt work before, thanks
but its going to be what i wrote earlier i think
just do this
not a bad idea, not exciting to re-write this script tho either lmao.
I dont even see how tfar is changing it
tfar changing it?
well I can load kits that dont have TFAR radios
hmm maybe its not tfar?
im noticing the only difference in the loadouts is the one giving an error has this extra index
[["ace_earplugs",true]]
yes it's what i said, it's the cba extended loadout thing, where it has an extra hashmap
just check if count == 2, then pick first one (the loadout), else use as is
ok
I will try, i will try use this. i should use it in my initPlayerLocal.sqf right?
I mean, that was just an example of selecting a string with a switch statement. You can use any method of inputting the string (loadfile is unnecessary)
but yes initPlayerLocal was the idea
you would then use _diaryText in your createDiaryRecord
ok, i will try and update the result. is there naywere to upload it for future reference? i mean, if i crack it id be happy to give it to the comunity
you can just make a function that you call from initPlayerLocal
ok, I will put my best efort, let's see what I can make! Thanks!
G'day all.
Can you please tell me what im doing wrong here.
Keeps giving an error around the _credits section
https://pastebin.com/gwsDXrSq
you have syntax errors everywhere
hey this is going to sound really dumb but I have a variable that I want to activate when my vehicle is dead
Eg.
_det = false
if _det then
{
CODE
}
I tried to do an event handler but ultimately didn't work
any ideas?
what do you mean by "activate a variable"?
like turn it from false to true
_var = !alive _veh
look at the end of it
no need for any EH or something
alright thanks ill try it
hey so i tried it and the code in the if statement is not being deployed
here's what i have so far (vehicle name is akbar2)
_det = !alive akbar2;
if _det then
{
systemChat "DET ON";
private _pos = this;
private _bomb1 = createVehicle ['ammo_Missile_Cruise_01', _pos, [], 0, 'CAN_COLLIDE'];
private _bomb2 = createVehicle ['ammo_Bomb_SDB', _pos, [], 0, 'CAN_COLLIDE'];
private _bomb3 = createVehicle ['Bo_GBU12_LGB', _pos, [], 0, 'CAN_COLLIDE'];
_bomb1 setDamage 1;
_bomb2 setDamage 1;
_bomb3 setDamage 1;
_bomb1 setVelocity [0,0,-2500];
_bomb2 setVelocity [0,0,-2500];
_bomb3 setVelocity [0,0,-2500];
};
because the check runs once, fails, and is never checked again π€·ββοΈ
how can i make it check constantly?
every few ms
you either waitUntil {sleep 0.5;!alive akbar2} to check every 0.5 seconds. Or move the code from inside the "if" statement into a "Killed" Event Handler of a vehicle π€·ββοΈ
P.S. or "MPKilled" Event Handler if the vehicle can be driven by players on a server
every second would be enough
i did move it into a event handler and it didnt work but ill try the waitUntill
this code should work anywhere
as long as you don't use this in the event handler ofc
What's up with doing setDamage 1 on the bombs and then giving them 2500m/s of down velocity? I'm pretty sure the setDamage will cause them to explode before they go anywhere. (and if you're creating them at ground level and/or clipped inside something, you don't need either because they're contact detonated)
use event handler then
also the "official" way of exploding ammunition is triggerAmmo, not setDamage
setDamage doesn't always work
ok thanks
im getting a error with the event handler, 0 elements 3 expected or something?
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
i just moved the code into a EH from an If
this^^^^
There are a lot of small things that can cause code to break and it's not possible to tell which is causing this without seeing the actual code.
here she is!
this addEventHandler ["killed", "
private _bomb1 = createVehicle ['ammo_Missile_Cruise_01', _pos, [], 0, 'CAN_COLLIDE'];
private _bomb2 = createVehicle ['ammo_Bomb_SDB', _pos, [], 0, 'CAN_COLLIDE'];
private _bomb3 = createVehicle ['Bo_GBU12_LGB', _pos, [], 0, 'CAN_COLLIDE'];
_bomb1 setDamage 1;
_bomb2 setDamage 1;
_bomb3 setDamage 1;
_bomb1 setVelocity [0,0,-2500];
_bomb2 setVelocity [0,0,-2500];
_bomb3 setVelocity [0,0,-2500];
"];
Your EH is missing {} for the code argument
this is a magic variable that's only accessible inside the Init field of a unit π€·ββοΈ
private _pos makes it not accessible for other functions as well
To access the unit inside the EH, you use its params: sqf this addEventHandler ["Killed", { params ["_unit", "_killer", "_instigator", "_useEffects"]; }]; with _unit being the unit itself.
ah
so something like sqf this addEventHandler ["killed", { params ["_unit", "_killer", "_instigator", "_useEffects"]; private _pos = _unit; private _bomb1 = createVehicle ['ammo_Missile_Cruise_01', _pos, [], 0, 'CAN_COLLIDE']; private _bomb2 = createVehicle ['ammo_Bomb_SDB', _pos, [], 0, 'CAN_COLLIDE']; private _bomb3 = createVehicle ['Bo_GBU12_LGB', _pos, [], 0, 'CAN_COLLIDE']; _bomb1 setDamage 1; _bomb2 setDamage 1; _bomb3 setDamage 1; _bomb1 setVelocity [0,0,-2500]; _bomb2 setVelocity [0,0,-2500]; _bomb3 setVelocity [0,0,-2500]; }];to preserve the logic
ah ok i see now what you mean π
ok i tested it and it works thanks so much for this and tolerating my stupidity
https://community.bistudio.com/wiki/triggerAmmo
might be what you're looking for
instead of setDamage and setVelocity
guys is there a better way to do this?:
private _click_pos = [];
openMap true;
onMapSingleClick "_click_pos = _pos;";
onMapSingleClick "";
openMap false;
player setPos _click_pos;
only seems to work with alt click
I imagined it would be the case, since its private
but for some reason it works while holding alt, so figured that was probably something else
gonna test making it global
Alt+Click teleport is an Eden Editor feature π
openMap true;
addMissionEventHandler ["MapSingleClick", {
params ["_units", "_pos", "_alt", "_shift"];
player setPosATL _pos;
openMap false;
removeMissionEventHandler ["MapSingleClick",_thisEventHandler];
}];```
thank you, going to switch to this method
except adding an ability to close the map without teleporting would increase line count by 5 times :3
no?
just a click EH on the map control should be enough?
this is supposed to happen only once, at the beggining of the mission, wouldn't be a problem
Hey there, I was just wondering if something like this is possible.
The server is running ACE and has some server settings that override clients and mission. Would it be possible to change these settings using scripts in the mission file?
For example setting the ace_medical_playerDamageTreshold to 0.75 instead of whatever the server forces.
Was thinking about finding out the namespace these are stored in and trying to overwrite them by executing it on server/all clients.
Anyone any experience with it?
ACE has a Discord server π see #channel_invites_list
I'll ask there too then! Thanks for the info.
But if anyone here experimented with it, let me know too
Did some testing and seems like I can just overwrite these settings in mission and they will apply, as the server settings don't overwrite the mission, only the clients.
But I am still interested in this, as I might need it in the future for dynamic changes.
they use CBA settings i think, you can configure stuff anyway you want with them, check their wiki
Yeah, they just answered me on their DC. Setting these with cba_settings_fnc_set and setting the source to server will work and achieve what I need. But that you for the info too!
can you make the action menu shown longer via sqf (or config means) ?
the problem is with holdAction function it fades out due the standard fadeOut/hide time of action menu being 10s
class Menu hideTime = 60; quickMenuDelay = 0.5;
this is for the command menu
but seems nothing exposed for action menu
there is https://community.bistudio.com/wiki/isActionMenuVisible to check it
but seems no way to open/refresh it
Yeah found a second array in index 1 so I basically just had to do a check for if index 1 is 1or 2 arrays
I meant this π
i guess that's a clipboard size limit at some point between the actual code and Discord. Like copypasting stuff into the Notepad allows to move much more data than copypasting from the same debug output into the VSCode π€£
I need a mission failure when a certain helicopter enters trigger area. Currently I have this and it doesn't work
Type lose, activation none,
condition "heli1 in thisList or heli2 in thisList or heli3 in thisList"
on Activation BIS_fnc_endMission
that's just trimmed diag_log
ah ok ^^
you can't just put BIS_fnc_endMission, you have to call it with arguments
just BIS_fnc_endMission wouldn't do anything. Check examples at https://community.bistudio.com/wiki/BIS_fnc_endMission
triggers have an end type or whatever, you can just use that instead
If this is a multiplayer mission you'll also want to remoteExec it
it is MP mission
make sure you make the trigger server only
alternatively instead of remoteExecing yourself, you can use https://community.bistudio.com/wiki/BIS_fnc_endMissionServer
that applies to coop MP vs bots too, right?
it applies anywhere, this will work in sp and mp
ticket created: https://feedback.bistudio.com/T167561
Hey there, I'm trying to set up ACE Fortify to be enabled/disabled in my mission.
https://ace3.acemod.org/wiki/framework/fortify-framework.html
There's a chat command for this but I need it to be handled by a trigger. Syncing the modules to a trigger in the editor seems to have no effect with fortify still being available even when the conditions for the trigger had not been met.
There was a settings framework in ACE (https://ace3.acemod.org/wiki/framework/settings-framework.html) which looked promising, however I couldn't find the correct ace-setting for enabling/disabling ACE Fortify. Additionally, it's now deprecated and instead ACE uses CBA settings (https://github.com/CBATeam/CBA_A3/wiki/CBA-Settings-System#mission-settings). However, when in game all there isn't a CBA setting for enabling / disabling ACE Fortify, just adjusting budgets etc.
Does anyone know of a way for me to send a message as admin through a trigger? Or does anyone know of a different way I could achieve this? Many thanks.
Ah yeah the log got cut off so I couldn't paste the full thing for whatever reason got it solved now though
Do you guys know if I have a one unit Ai group with this EH: sqf _group addEventHandler ["LeaderChanged", { params ["_group", "_newLeader"]; }];
Will the EH still fire when I kill that one leader?
I mean, the group is now empty so there is no "_newLeader"
probably nothing happens, leader only changes if there is someone else in the group who can take over
Yeah that is probably the case
From inside the EH, to delete it, should I do this: sqf player removeEventHandler [_thisEvent, _thisEventHandler];
or this: sqf player removeEventHandler _thisEventHandler;
PS: I have seen both ways being used and therefore the doubt
First one
where have you seen the second one?
_thisEventHandler is the index, a number
read the doc
an old script of the armaholic times... thanks for clearing that up
https://community.bistudio.com/wiki/removeEventHandler
target removeEventHandler [aType, anIndex] // array
he's dead, Jim
It would probably be good to add Example 2 from this to the removeMPEventHandler and removeMissionEventHandler pages as well
I spawned a character using createvehicleLocal
I'm trying to execute
character playActionNow 'ThrowPrepare'
but its not doing the gesture
tried making it play the gesture animations (via switchMove):
['awoppercmstpsgthwrfldnon_start2', "awoppercmstpsgthwrfldnon_throw2","amovpercmstpsraswrfldnon"]
it remains static and doesn't do it too, despite being capable of running other animations
is there a way of making it do the throw animation?
uh I remembered what Leopard20 taught me
isnil {
_unit switchMove "move";
_unit playMoveNow "move";
};
that made it work
I'm running into an issue with BIS_fnc_wpArtillery. It seems like it gets stuck and just keeps firing or assigning the target after its done
or it might just be me, I'm not exactly sure what's happening here
oh I'm an idiot and used dumb debug messages
lemme start over
systemChat "start"; //this gets printed
[(_artyGroups select 0), [4336.15, 3874.5, 0], objNull, 1] call BIS_fnc_wpArtillery;
systemChat "end"; //this never gets reached
would doArtilleryFire be better?
the main reason I didnt use that is because it requires the weapon class name
I was hoping not to have to detect what the normal HE ammunition is for whatever artillery piece this is being applied to
hmmm... that's useful lmfao.
So I'm trying to block the use of NVGs and Thermals through a mission event handler, but I'm running into the issue of wanting certain players to be immune to the handler.
Is there way to set it up to where only certain folk are caught in the script? Can I flag them via a boolean in their init?
you can name them and use this variable, or setVariable a certain value on them
addEventHandler ["Draw3D",
{
if ((currentVisionMode player isEqualTo 2)||(currentVisionMode player isEqualTo 1)) then
{
if (isNil "A3W_thermalOffline") then
{
"A3W_thermalOffline" cutText ["HELMET SENSORS MALFUNCTIONING", "BLACK", 0.001, false];
A3W_thermalOffline = true;
};
}
else
{
if (!isNil "A3W_thermalOffline") then
{
"A3W_thermalOffline" cutText ["", "PLAIN", 0.001, false];
A3W_thermalOffline = nil;
};
};
}];
This is what I'm working off of right now.
If I'm understanding you correctly, I just need to add an and-not statement with the variable names of the immune folk
for example yes
why not "VisionModeChanged"?
cuz it's recent and unknown I bet!
This is the one I was able to understand by reading it, I haven't written my own code in about 6 years, and I just started relearning two weeks ago lol
I'm still in like the partial literacy stage
player addEventHandler ["VisionModeChanged", {
params ["_person", "_visionMode", "_TIindex", "_visionModePrev", "_TIindexPrev", "_vehicle", "_turret"];
player action ["nvGogglesOff", player];
}];
``` crude example of disabling nvg's whenever vision mode is changed
Will that disable NVGs enabled via helmet too?
yeah it's the same thing
i think the event handler fires when in a vehicle as well, but "nvGogglesOff" is only for infantry nvg's
if i recall correctly ^
Okay, and this is probably a dumb question but that will fire off if they cycle to thermals as well right?
yes
it will physically take off the nvg's like if the player cycled back to normal vision whenever the player changes vision mode
nvg might turn on for like one frame but that doesnt make a difference imo
Thank you, I was adapting the mission event handler version just based off some really old knowledge. I barely know java, I have zero idea right now how Arma's engine works. I really appreciate the help.
yw
Should this work if I paste it into the player's init just like this? I just tried that and had no success.
From unit init, try:
this addEventHandler ["VisionModeChanged", {
params ["_person", "_visionMode", "_TIindex", "_visionModePrev", "_TIindexPrev", "_vehicle", "_turret"];
_person action ["nvGogglesOff", _person];
}];
Copy, trying now but I'm also working on adapting the original mission event handler
Worked perfectly
What are you working towards?
So I'm part of an astartes group, and all the space marine helmets have NVGs and Thermals inbuilt, plus constantly having our NVG slot used for various modded equipment
For the sake of ambiance and not ruining my night missions for once, I'd like to have everyone but certain key slots be disabled from NVG/Thermal
That's why the string for this is talking about helmets malfunctioning
Oh and as far as adapting that mission event handler, I'm just dumb and trying to further my own learning to become not dumb.
Snap! π
Not sure if it's been mentioned, but that should be addMissionEventHandler not addEventHandler.
I just copy pasted it mid me trying to caveman it into working
It initially was addMissionEventHandler
Cool. Good to double check.
addMissionEventHandler ["Draw3D",
{
if (((currentVisionMode player isEqualTo 2)||(currentVisionMode player isEqualTo 1))!&&(object getVariable String) then
{
if (isNil "A3W_thermalOffline") then
{
"A3W_thermalOffline" cutText ["HELMET SENSORS MALFUNCTIONING", "BLACK", 0.001, false];
A3W_thermalOffline = true;
};
}
else
{
if (!isNil "A3W_thermalOffline") then
{
"A3W_thermalOffline" cutText ["", "PLAIN", 0.001, false];
A3W_thermalOffline = nil;
};
};
}];
This is what I was trying to figure out
That not-and is me trying to figure out how to check if a variable name returns as nothing
What is !&&(object getVariable String?
I think by staring at things so I just pasted the getVariable syntax in so I could visualize what I was trying to do
It's essentially just placeholder text
Ah. Just saw this and made sense of it. π€£
Is it needed here?
If I use this code I need to make sure that I'm checking for both vision modes, and making sure that it's not an object with a variable name
I dont really know how to do that though.
is there a way to get a sound to play after this? this addAction ["take down the shield","deletevehicle shield"]; I am wanting it to play a sound of a generator powering down with it deleting the block
rather new to scripting, so wouldnt even know where to look in the bi page
making sure that it's not an object with a variable name
I am so, so, sooooo lost.
Do you know the object name ( It's not "object" is it? ) and variable?
Did I mention I was lost yet?
Shouldn't the last A3W_thermalOffline be;
A3W_thermalOffline = false; ?
Theres a fair few object names in play.
As far as that last A3W, from what I can see no. It functions as intended, I'm just trying to change the activation parameters.
It's all good, I'm moving forward with this anyway so that I can plan out my op throughout the week. I appreciate you taking this time to help me.
No bother.
Let me know if you crack it, please.
Sure, I might come back to it in the future. I just will need a greater understanding of SQF
Is there a non-ui related alternative to htmlLoad?
I'd like to just get a string from an url
You can run play a sound after deleteVehicle shield;.
would that play it to everyone?
say3D may be easier
playSound3D you want to execute only on one machine, say3D you want to execute on every machine
either of those options will have everyone hear the sound
Could be. I recall one of the sound commands being bugged, wasn't sure what one. I've been away for a few months.
playSound3D will work in the addAction function without remoteExec
no idea. both of those commands work for me
so for everyone to hear it would look like playsay3D [getMissionPath "mySound.ogg", player]; ?
playSound3D* and yes so long as you want the player to emit the sound
but would everyone hear it?
yeah, the GE at the top of the page means Global Effect
Aye. Should do.
cool
this addAction ["take down the shield",{
private _terminal = _this # 0;
deleteVehicle shield;
playSound3D [getMissionPath "powerdown.ogg", _terminal];
}];
``` this will work without having to give the shield a variable name i.e. you can paste this in multiple init fields
lol i wrote playsay
Can you explain what you mean?
New command when?
Its gonna be a terminal that the players have to push to take down the shield across the map
do you need a 3D sound in that case if it's the entire map?
its only for the people near the terminal which the players should be gathered around
alright
my code will play the sound out of the object
as will yours if you replace the player with shield as the sound source
so it deletes the terminal instead of the shield, which part should I change to get it to delete the shield?
instead of the terminal?
I'm trying to pull a string from a url to be used in a script (the url of the game server), but I can only find htmlLoad and that loads it into a control, which would not be necessary in my case
works perfectly appreciate it dude, you know any good resources besides the wiki to learn how to do this stuff. cause this is magic to me
personally every once in a while I just go to random wiki pages and slap code in the console
and go oh, neat
there's an intro to scripting on the wiki
How are you getting the URL?
Can't you add it to a variable, like ABC_URL = "https://discord.gg/arma"; to use it elsewhere?
By chance are you using it in the briefing / diary?
I'm trying to retrieve the server ip/port which are in a simple html file which right now I'm trying to load with
dummyControl htmlLoad <URL>;
Ah. No idea then. Sorry.
Recently tried to open a URL from a briefing ( Discord & TeamSpeak ) but had no luck.
Had to stick with using copyToClipboard in briefing execute expression.
thanks anyway!
It just seems so weird to have a function to load it into a control, but not into a variable
Aye. There might be a way, but the people who may know are asleep. π€
Hmm, does not seem to be trivial to get text from RscHTML, tho :/
Might be outdated but maybe -> http://killzonekid.com/arma-extension-url_fetch-dll-v2-0/
Yeah I found that, too, but I'm worried it might not run on a dedicated server, cause I have no way of installing C++ redis there
could I use setMagazineTurretAmmo to assign an incompatible ammo type to a turret? for instance I want to set the uh60 miniguns to fire 12.7 slap rounds
or addMagazineTurret
i dont think its a pylonweapon
use addWeaponTurret first, then add the magazine
if you want to make http requests and read the result, you have to use an extension, no other way
Recently tried to open a URL from a briefing ( Discord & TeamSpeak ) but had no luck.
there is a way with cheating the ui by creating a dummy button, buttons have aurlattribute, which open a link in default browser
I have 2 blufor hostages, 1 independent scientist and at the start of the mission OPFOR guy kills all of them. Would be nice if he didn't
either set them all to civilian (can be done by setting them as captured BEFORE the mission starts), or change the relations between factions (although BLUEFOR vs OPFOR is always hostile)
or actually run https://community.bistudio.com/wiki/setCaptive on captives
works, although it could happen that the init is too slow and the OPFOR already starts shooting... seen it before
I believe my blufor guys are captive, they seat with hands tied behind their back
The independent science guy is supposed to work for OPFOR, it's just OPFOR doesn't have the right science skin
https://community.bistudio.com/wiki/forceAddUniform you can use this
The Editor arsenal (Edit Loadout) also has no side restrictions, you can just take a guy and give him whatever you like
During a mission, how would you switch player unit?
I was told to us "selectPlayer"
use*
Is this correct?
selectPlayer indeed. What's unclear?
The example it, selectPlayer bob;
Would I just use selectPlayer on any unit, or do I use "selectPlayer bob;" Do I need to specify the name?
Like change "Bob"
Or can I just use selectPlayer in the init
Either. In this context bob means an unit that bob declares, but you can use any variable that is a valid object
Hmmm selectPlayer isnt working in zeus
What is the context?
Im just trying to switch my Player unit over to another
But I would have to use zeus to do it, because its during a mission
I would just use "remote control" off of zeus but when you do that you are not able to get in and out of vehicles etc. it wont show the option.
Or is there anyway to add a unit to the "team switch"?
Bummer :/
it doesn't show the option because most likely the group leader/whatever doesn't allow you to
https://community.bistudio.com/wiki/openMap
openMap [false, false]
ty
That will have to do, is there a way to increase the fire rate then?
modding or set reload coef
example 2 for the latter
alright thank you, ill look into this
As an aside: I'm trying to have multiple players share a walking intro similar to the opening of the Camp Maxwell hub in the East Wind campaign. But I don't want players to see each other, before switching to their own characters.
Is it possible to script characters to be completely invisible to other players? Or perhaps just 100% invisible?
(Note: of course you can script camera moves. But they look thoroughly unnatural, also zero player input, no walking sounds; less immersive)
Is something with selectPlayer and createUnit possible?
You can use hideObject to make the other players invisible for each client
Doesn't hideObject also disable physics/simulation for target object?
nope
Ah: that's hideObjectGlobal and the hideObject module. I'll take a look at this, thank you.
hideObjectGlobal also does not disable physics or simulation
It disables collision (so an object that has been hidden can be walked through) but it's still simulated; units and vehicles can move, physics objects will fall if dropped etc
Hello, jus learnes that atom is going to be dropped, wich text editor similar to atom, or vs code can i use that is open source?
I still use Notepad++ π
You should still be able to use Atom, just no more updates
Thank you for clarifying. Collision β movement β physics simulation is something I confuse sometimes.
Can it be modifiet to easier reading for sqf and c or c++?
It comes with a C/C++ syntax highlighter, and there are SQF ones around (in varying states of up-to-date-ness).
But still, Atom isn't going to delete itself from your computer, it's just not being developed any more
sublime text is also nice
Well
It is because i like how VS code works
The closest is atom
But it is going donw
I'm not sure how many different ways I can say "you can still use Atom, just no new updates"
VSCode seems to work great, for any Arma game and basically any language/framework.
Atom is great for a quick edit, compared to Notepad π€£
Guess i can use it, still,i rather have something that wasnt stopped
The whole deal comes from the fact that i want a open sourced tool
is there a possible way to rotate a model's bone through sqf?
(want to rotate a human's head that is spawned through createVehicleLocal)
only simple objects with predefined animations
so no to that
tho if the controller is "user" non-simple objects may work too
not sure what that means
good idea
so
should I
_dir = getposworld _unit vectorfromto getposworld player;
is this how I obtain the proper direction?
that's one way yeah
most efficient one is?
depends what you want to do
because i probably will have it in a draw3d eh
since draw3d will work briefly to draw a laser for 5 seconds
want the laser to be coming out of the units eyes, so that's why i will set vector too
so is the the most efficient to be placed in draw3d?
want the laser to be coming out of the units eyes, so that's why i will set vector too
why? you can draw the laser from their eyes in their eyeDirection
I think it was called unitAnimPos or something like that
but I'm just concerned about setting the unit direction
well their heads drift anyway
is there a particular reason you have to use a fake shell of a character instead of just making a real one with createUnit? Then you could just use lookAt
so even if you set the direction there won't be any guarantee they'll look at you
setvelocityTransformation
as leo told me, its better to move local units with it
else if i create a unit and let the server handle the movement, it might lag
its a createvehicelocal, they don't rotate their head?
i know its a bit confusing, just making a bossfight
so while I'm drawing the laser using draw3d eh, i would like a good efficient form of setvectordir so that I can constantly set the dir of the laser emitting unit towards the player dir so its as if the unit is looking at the player
an efficient form in draw3d eh
How would one get the flashing lights to turn on a modded police vehicle?
just use BIS_fnc_rotateVector2D
- get vector dir from eye of boss to aim pos of player
- calculate the cross product with boss dir
A empty police vehicle
- if
cross#2 < 0-> rotate 90 deg CW, else CCW
For some vehicles, "start lights" may be available in the Virtual Garage (Edit Appearance in the Editor)
also measure the cos to set the dir instantly if the angle is too low
not sure about the cross product you are referring to (I'm very bad at vectors lol)
vectorCrossProduct
yeah he only needs to rotate 2d not 3d btw
I know
I said Z
not the whole vector
basically Z of cross product is called perp product
the other components are a waste but in SQF there's no faster way
Thank you
hey question
I need to set a player side to opfor when he picks up a CSAT terminal
I originally though of just using a trigger stating [player] joinSilent createGroup East;
but that would change every player side
any idea?
_dirTo = eyePos _boss vectorFromTo aimPos player;
_dirTo set [2, 0];
_dir = vectorDirVisual _boss;
if (_dir vectorCos _dirTo > 0.999) then {
_boss setVectorDir _dirTo
} else {
_cross = _dir vectorCrossProduct _dirTo;
_dir = [_dir, 5 * diag_deltaTime * accTime * ([1, -1] select (_cross#2 > 0))] call BIS_fnc_rotateVector2D;
_boss setVectorDir _dir
};
^^ something like that but not tested @drifting portal
@smoky verge That wouldn't change every player side unless you executed it on every client.
but how can it detect what player I'm talking about?
its activation condition is simply !Alive terminal
(terminal being the variable name of the object)
when he picks up a CSAT terminal
You probably want to use something like a Take or InventoryClosed event handler to detect that: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Take
its not in a container
its the placeable inventory object
I'm not sure if arma considers it a container
that's weird,
_dirvector = (eyepos Boss) vectorFromTo (aimPos target);
Boss setVectorDir _dirvector;
seems to be working fine, isn't this more efficient than what you wrote or not?
(they both have the same behavior)
Leo's one looks like a smoothed over-time rotation π€·ββοΈ
Capped at 5 of whatever the rotation function is using (radians, degrees, whatever) per second
yeah but for some reason sometimes the character doesn't rotate when suing leo's method
Hence the "untested" warning
Although looks algorithmically sane at first glance. Just make sure you run it every frame (while {true} loop, eachFrame EH, etc)
maybe rotateVector is CW?
I don't remember
not really sure as I'm not the best with vectors to be honest.
oh wait I wrote mine wrong 
change > 0 to < 0
also something I'm not 100% sure of is if diag_deltaTime stuff is needed
since vectorDirVisual is already visual 
I think if you do it like that it'll become slower
Isn't diag_deltaTime a frame normalization of speed, though?
speed?
angular velocity
idk what you mean 
the reason I added diag_deltaTime (which is 1 / diag_fps) is to make sure the rotation looks the same regardless of frame time (FPS)
but with vectorDIrVisual the frame time is already taken into account
[_dir, 5 * diag_deltaTime * accTime * ([1, -1] select (_cross#2 > 0))] call BIS_fnc_rotateVector2D; sounds an awful lot like "turn for whatever share/part of 5 degrees (radians) per second matches the time of previous frame"
so "turn at 5 whatevers per second independently of FPS". So "normalization"
well yeah you don't know the current frame time yet 
close enough until we learn to predict future. Or ArmA3 gets a rock stable framerates. First thing is more likely.
kill confirmed
it works, but could you explain why a longer process is more efficient than a smaller one ?
it's not "efficient". It's "fluent" and/or "natural"
oh
I'm more concerned about it being efficient, that boss is floating, so it is really hard to notice if he is being 'snapped' into the direction
the code itself is pretty much as fast as you can go with SQF tho (setDir one is faster but like I said it's laggy)
either way it'll be fast enough to not affect your FPS
_dirvector = (eyepos boss) vectorFromTo (aimPos target);
boss setVectorDir _dirvector;
I'm using this
_laserStart = boss selectionPosition 'pilot';
{
_laserStart set [_foreachindex, (_laserStart#_foreachindex) + _x ];
} forEach [0.013, 0.06 , -0.018];
_laserStart = boss modelToWorldVisualWorld _laserStart;
is this a good way of finding the eyepos? lol
(eyepos is not helping me mark the laser start, because it is a bit right or left or up or down for some reason)
{
_laserStart set [_foreachindex, (_laserStart#_foreachindex) + _x ];
} forEach [0.013, 0.06 , -0.018];
vectorAdd
||so the laser start looks awkward||
is your "boss" not ordinary Arma character?
hm the laser is now spawning inside his head
yeah it is
then eyePos should work fine 
and talking "real" numbers Leo's code is 0.067 ms per iteration on my decade-old CPU 
well at least use vectorAdd
you mean worst case?
or best case?
the "not close enough" case with more calculations
so worst case π
0.05 ms for "close enough" with fewer calcs. Literally nothing π€·ββοΈ
doesn't sound right
i'm still under impression that transmitting variables between SQF and engine is the time-consuming part here. Actual in-engine number crunching may very well be considered instant
well yeah
but the difference is not right at all
the "not close enough case with more calculations" should be 3-4 times slower
in my head (and for my CPU): 0.006ms for best case
~0.03 ms for worst case (not sure about BIS_fnc_rotateVector2D)
just BIS_fnc_rotateVector2D is 0.01 ms. Literal boss setVectorDir [1,0,0]; is 0.04 ms
that sounds too slow 
"boss" being global here as i've literally named a unit that
I mean boss setVectorDir [1,0,0];
maybe it's being a pawnee involves some extra cals, i don't know
for me it's 0.0012 ms
so yeah it's too slow for you 
yep, with an actual human being i get 0.0012 as well
note for myself: helicopters are slow to rotate π€£
wow my timings are so accurate π€£
0.0052 ms best
0.0186 worst
I'm a virtual SQF engine now π€£
actually why did I write 0.03 lol
I said 3-4x slower
. so 0.006 x 3 = 0.018... idk where I got 0.03 from...
You are advanced developer tools now
well, we've got from "literally nothing" to 4-10 times faster
I should stop making jokes
oh right I added extra error for BIS_fnc_rotateVector2D because I thought it uses matrices
it doesn't
I create custom bushes like that:_bush = createSimpleObject ["a3\plants_f\bush\b_ficusc1s_f.p3d",_pos];But if a player stay inside those bushes he don't get explosion damage.
This not happens with default map bushes, on those you are not protected against explosions.
Can i create map-like bushes?
I don't think there is a way to place a bush like a terrain placed one
any1 know where i can find info about trigger conditions.
Particually, im looking for info on checking all objects in a trigger are not moving.
thnks
thisList findIf {velocity _x > 5} == -1```I guess
Is there any way to populate the city with random civilians when players are around and delete them after players gone?
Hey, A friend of mine has made a unit capture an aircraft trajectory and fired with it, it works, only thing ai doesn't do is that it didn't change the range of the turret (machine gun on splitfire z7) so the shooting is different from captured movements. So is there a command to force a specific range or does he need to configure vehicles from a new turret/mg etc to change range?
I tried your code and got an error. Code is in trigger condition for reference.
error is "Error>; Type Array, expected Number, Not a Number"
velocity returns a vector. You can use speed instead (in km/h not m/s and only counts forward motion), or sometimes better: vectorMagnitude velocity _x
Oof yeah, I forgot to array to number conversion yeah. Try what John suggests
thank you, now to figure out the rest
Use the classname instead of model path
If it still doesn't work use createVehicle
There's nothing special about terrain objects when it comes to LODs
But still it doesn't make any sense
Penetration is controlled by fireGeometry LOD and its surfaces. So it should still work even if the object is super simple
Yes. But you have to do it yourself
Unit capture is very limited and it doesn't even capture all muzzles/turrets or even set the correct weapon sometimes
Good to know
how could I make this _allVarsUINamespace = allVariables uiNamespace; copy to clipboard
copyToClipboard str _allVarsUINamespace; like this?
yes
I tried doing it at once do I need to execute them separately?
no