#arma3_scripting
1 messages ยท Page 456 of 1
random question, as i was reading the optimisation page:
how does
private _myVar = [33, 66] select (false);```
compare to
```sqf
private _myVar = [33, 66] select (0);```
?
Well I would guess the index zero of the second one would be 33?
yeah
and uh? False?
@inner swallow same
i mean in terms of perf
@gleaming oyster Usually you can substitute 0 with false
second one faster because 0 is a constant
Alt syntax
oh, so false isn't a constant? ๐
aha
@thorn saffron Not always
so uh...should that be added to the code optimisation page ๐ค
i was under the impression that they're boolean values and faster, i use them quite a bit lol
Probably yeah. Just a note that true/false/nil aren't constants. That should also be added to the forEach vs count because count is slower if you need to add true/false/nil to make it work.
@winter rose ^
now, how much are they faster? around 1%?
@still forum Thanks
for this simple example I'd say a little more than 1%
Probably more if you compare them side by side, but since false is a pretty fast operator it's almost neglectable. 99% of 0.00001 seconds is still nearly nothing
[33, 66] select (false) 0.0017ms
[33, 66] select (0) 0.0012ms
Another question I have is, when a player is Unconscious, and I use setUnconscious false on the player he still has those grey scale camera effects, how can I remove those?
@Dedmen Interesting, should definitely be added to the code optimisation page
I have a question im working on a simple sector control game mode but im having trouble when it comes to getting a objective to give me a side like east, west, or independent. i know the code looks like this--A getVariable side-- but every time i use it on the sector module it give me LOGIC. does anyone know how to make it give me a proper side?
well the side of the sector logic is LOGIC...
but anyways, this could help you: https://forums.bohemia.net/forums/topic/197426-checking-the-ownership-of-a-sector-defined-by-the-sector-module/
thanks man
is "execFSM" the only way to execute an FSM?
//--- initServer.sqf
TAG_fnc_initSector = {
params ["_sector"];
private _owner = _sector getVariable ["owner",[]];
if (_owner in [west,east,resistance]) then {
/* something */
};
};
[<sector_name>,"ownerchanged",{<sector_name> call TAG_fnc_initSector}] call bis_fnc_addScriptedEventHandler;
@flat eagle
well you can, sector modules have expression field, but
wait a bit
params ["_sector", "_owner", "_oldOwner"];
on top of that script ^
so _owner < who captured _oldOwner < who was owner before sector was captured
_sector < module sector
Is it possible to have a linebreak in the establishing shot text?
now what im trying to do is based on who holds the objective the objective spawns support i.e. a tank, helicopter support extra. and the script you just gave is just checking for the side and who last had the side right? or can it do more?
yes and yes ๐
sweet
alright so for instance how you get B_MBT_01_cannon_F to spawn at mrk1?
when west hold objective A
how would I run my script locally on every player's pc? I'm trying ["params"] remoteExec ["tasks.sqf", 0]; but it's not doing anything at all
this is task.sqf
##task.sqf
params ["_name", "_title", "_description", "_goal"];
[player,[_name],[_description, _title, str(_goal)],getPos _goal,1,2,true] call BIS_fnc_taskCreate;
you can remoteExec execVM or put your code into a function
okay.. it's not as easy as remoteExec[["task", "testtaak", "hier moet je heen!", final] execVM ["tasks.sqf", 0]];, and I don't see any examples on the wiki page so how should I do that?
Execute the execVM command. And pass the parameters that it wants
as you've shown above. You know how to pass parameters.
BIS_fnc_execVM < also for RE
["task", "testtaak", "hier moet je heen!", final] remoteExec ["execVM "tasks.sqf", 0] ..? @still forum
Say i have a nested array like this:
megaArray = [
[[_A1],[_A2]], //A
[[_B1],[_B2]], //B
[[_C1],[_C2]] //C
];```
Now I want to edit the B sub array, would this replace the whole B subarray?
```sqf
megaArray select 1 = [[_G1],[_G2]];
@steady terrace Why don't you see that?
Just look at
["task", "testtaak", "hier moet je heen!", final] remoteExec ["execVM "tasks.sqf", 0]
Can you see the error?
Also the command is execVM. Not execVM "tasks.sqf
@thorn saffron you cannot use = if you want to edit arrays by reference
you need to use set/append/deleteAt/deleteRange/pushBack
I want to replace the subarray completely
in that case you probably want set then
But I do not want to it one by one value, I have a repalcement array ready and i just want to replace the subarray in one go
so
megArray set [2, _outputArray]:
will replace the C Subarray completely with my new _outputArray right?
ye
is there a way to get a units helment? ik u can use unitBackpack to get the backpack I wasnt able to find one for like unitHelmet or something
headgear
๐คฆ I cry
headgear will only return the headgear class; backpack too for the backpack.
unitBackpack only exists to get the actual object so you can add items etc. to it
makes sense
also hmd != goggles !!11
yeah between glasses, scarves, goggles, masks, facewear, the terms are more than covered ><
whats a hmd?
oh
so when using uniform is there a way to return the object rather then the class name?
Object? How do you mean?
welll
You mean like uniformContainer?
What im doing right now is just changing the color of a units uniform,vest,backpack and helmet to like say the VR entity texture and material , just for shits and giggles. I can change the vest and backpack becuase of the following
//vest
_this setObjectMaterial [0,"a3\characters_f_bootcamp\common\data\vrarmoremmisive.rvmat"];
_this setObjectTexture[0,"#(argb,8,8,3)color(0.0,0.6,1.0,1,ca)"] ;
//backpack
(unitBackpack _this) setObjectMaterial [0,"a3\characters_f_bootcamp\common\data\vrarmoremmisive.rvmat"];
(unitBackpack _this) setObjectTexture[0,"#(argb,8,8,3)color(0.0,0.6,1.0,1,ca)"] ;
_inputArray = [["30Rnd_65x39_caseless_mag","16Rnd_9x21_Mag","11Rnd_45ACP_Mag","30Rnd_45ACP_Mag_SMG_01","100Rnd_65x39_caseless_mag","30Rnd_556x45_Stanag","9Rnd_45ACP_Mag","200Rnd_556x45_Box_Red_F","30Rnd_9x21_Mag"],[8,1,1,1,2,8,1,2,1]];
private _categoryToRecount = [[],[]];
{
(_categoryToRecount select 0) append ((_inputArray select 0) select _x);
(_categoryToRecount select 1) append ((_inputArray select 1) select _x);
} forEach (_inputArray select 0);
This gives me this error:
20:56:16 Error in expression <elect 0) append ((_inputArray select 0) select _x);
(_categoryToRecount select 1>
20:56:16 Error position: <select _x);
(_categoryToRecount select 1>
20:56:16 Error select: Type String, expected Number,Bool,Array,code```
I'm trying to append the ``_categoryToRecount `` with stuff from input array ``_inputArray ``. I do not know why I get error like this as
```sqf
((_inputArray select 0) select 3)```
does return ``"30Rnd_45ACP_Mag_SMG_01"`` I do not remember having troubles with appending arrays with classnames like this
Derp, it was easier then I made it to be:
(_categoryToRecount select 0) append (_inputArray select 0);
(_categoryToRecount select 1) append (_inputArray select 1);```
you cannot select x on a string
your forEach iterates through the arrays in _inputArray
meaning the forEach iterates through two arrays
your first _x has an array of strings. Your second _x has an array of numbers
you cannot select with an array of strings
I originally made this for a life server because a friend of mine asked me to (Yes I know a life server, holy crap I'm an idiot) but I'm thinking of publically releasing it for everyone who wants it, any recommendations on how I should improve the design? Thanks. https://www.youtube.com/watch?v=btpsCfuw2p8
BTW: whats the maximum length for an array?
@thorn saffron I wonder ๐
https://community.bistudio.com/wiki/Array
longer than you will ever need
10M -1 elements yup ๐
๐ I sometimes completely suck at seeing stuff. I was looking for "length" or "size"
are nested arrays count as combined or not? Like if you have 2 arrays where both of them have 10000 values, does it count as a 20000 long array or just 2?
please tell me this is just for fuckery
Just curious
@thorn saffron no
each array has a limit, but the SQF police won't check your trunk to see if you have more bags inside your bags ๐ ๐
๐ hides
Bags inside bags inside bags inside bags inside bags
Turns out, you have one bag that equals many
#define BAG (random 2500) * (random 2500)
how is LnBAddRow used
tried to follow the Wiki but didnt work
Hello, is there anyway i can get the texture used on a vehicle ?
tried https://community.bistudio.com/wiki/getObjectTextures, but it returns me all of the textures the vehicle can have. thanks you
@molten folio are you sure you need the nbox version? or just normal listbox. just makin sure
u need RscListNBox
k. what does your code look like though? hard to say without seeing it
anyone able to help me out with this? init.sqf: ```sqf
waitUntil {time > 2};
_vehicle = [
"C_Hatchback_01_F",
"C_Heli_Light_01_blue_F",
"C_Offroad_01_white_F",
"C_Quadbike_01_black_F",
"C_SUV_01_F",
"C_Truck_02_box_F",
"C_Truck_02_covered_F",
"C_Truck_02_fuel_F",
"C_Truck_02_transport_f"
];
_stand = [
car_stand_1
];
_spawn = [
car_spawn_1
];
{
_standVar = _x;
{
_spawnPos = getPos _x;
_spawnDir = getDir _x;
} forEach _spawn;
sleep 0.5;
{
_formatString = "Spawn Vehicle: %1.";
_vehicleVar = _x;
hint format["%1",_x];
sleep 0.5;
_standVar addAction [format [_formatString, _vehicleVar], {
_vehicleSpawn = _vehicleVar createVehicle position _spawnPos;
_vehicleSpawn setDir _spawnDir;
hint format ["Vehicle: %1. Has been successfull spawned at: %2", _vehicleVar, _spawnPos];
}];
} forEach _vehicle;
} forEach _stand;```
fix it!
@drowsy axle
1/ tell us what the problem is
2/ if you want to respawn at the original pos, be sure to store it before the vehicle moves.
3/
{
_spawnPos = getPos _x;
_spawnDir = getDir _x;
} forEach _spawn;
^ wrong design
4/ quit reassigning _x?
5/ why _stand and _spawnโฆ
_spawnPos and _spawnDir are never really defined. They are deleted immediately after.
And you cannot access local variables inside addAction code because that's a different script. You have to pass them as arguments to addAction
I'm quite sure I explained you the same stuff atleast 3 times already ^^
Hmm okay. I see that now thank you @still forum and @winter rose
reassigning _x for _standVar is required so you can access it in the inside. But _vehicleVar is not required. But still nice for readability
advice:
write down in human language what you want to accomplish, then when you have the logical steps in mind, write them in code
{
_spawnPos = getPos _x;
_spawnDir = getDir _x;
} forEach _spawn;
That code doesn't make sense either way, logically.
If you intended the variables to be accessible from outside. Then you would always just get the last entry of the _spawn array. So why not just select the last entry if you only want that?
reminds me of the recent https://community.bistudio.com/wiki/Code_Optimisation ๐
What do you mean @still forum
I mean what I wrote...
Even if you fix the variables not being accessible. the loop will still not make sense
let's say you have 100 elements in _spawn. You loop through all of them and throw all of them away except the last one. Why even loop if you only want the last one? Just take the last directly
And why take an array if you only want a single value
That's not what I am trying to achieve.
I'm trying to get each one (_spawn & _vehicle), and place it into the addaction, which is in a stand.
then you have to put that inside the loop
They are... aren;t they?
{
_spawnPos = getPos _x;
_spawnDir = getDir _x;
} forEach _spawn;
Well...
There are two lines inside that loop.
I don't know where you see the addAction in there but I don't
this is better? ```sqf
{
_standVar = _x;
{
_spawnPos = getPos _x;
_spawnDir = getDir _x;
{
_vehicleVar = _x;
_vehicleName = getText (configfile >> "CfgVehicles" >> _vehicleVar >> "displayName");
_standVar addAction [format ["Spawn Vehicle: %1.", _vehicleName], {
(_this select 3) = (_this select 4) createVehicle position (_this select 5);
(_this select 3) setDir (_this select 6);
hint format ["Vehicle: %1. Has been successfully spawned at: %2", (_this select 6), (_this select 5)];
}, _vehicleSpawn _vehicleVar _spawnPos _spawnDir _vehicleName];
} forEach _vehicle;
} forEach _spawn;
} forEach _stand;```
Now you only have to pass the variables to the addAction and get them back out from _this
for that see:
So, the addaction is wrong..?
The code inside it
Okay.
Which I already told you. But apparently you didn't read that
And you cannot access local variables inside addAction code because that's a different script. You have to pass them as arguments to addAction
arguments... okay. One second.
Check above. ^
How can I change the local vars, or are they allowed as arguments? @still forum
https://community.bistudio.com/wiki/addAction
pass them in an array and retrieve them with _this
Anyone know where I could look at the source code for Triggers? Couldn't find any in the pbos. They have some UI overlays I can't find anywhere else, ex the 'video glitch'
afaik you can't, triggers hardcoded
Alternative, do you know how I could use the 'Video Glitch' and similar RscTitles already in Arma? Couldn't find their videos anywhere.
'Video Glitch' ? ๐ค
That's the name of it. Static effect that flickers on the screen. You've probably seen it before.
BIS_fnc_playVideo, or BIS_fnc_VRintro (or something like that)
[] spawn BIS_fnc_VRFadeIn; ? this one ๐ค
That does the trick, thanks.
/*
Author: Josef Zemanek
Description:
Fade In effect for VR.
Parameter(s):
NONE
Returns:
Nothing
*/
titleCut ["", "BLACK IN", 1];
titleRsc ["RscStatic","PLAIN"];
playSound "RscDisplayCurator_visionMode";
ok
The trigger must just use that, rather than an RscCut. Which is odd, since it has the Bohemia splashscreens available too, and those are RscCuts.
i have no idea about trigger effects tbh
Bonus: BIS_fnc_VRTimer. Counts up, but could change it to count down. Nifty little gui bit
<string> callExtension [<string>] would this be allowed or not?
wiki is not clear about this
whats the diffrence between #define BUFFER 1.053 and _buffer = 1.053;?
I still dont get that, what does it mean to preprocess?
I guess it also extends to my lack of knowledge of compile preprocessFileLineNumbers
pretty much the following: preprocessor processes a file and manipulates it
#define DMG 0.053
player setDamage DMG ```
will get to
```sqf
player setDamage 0.053```
I see
{_x setTaskState "Succeeded"} forEach ({simpleTasks _x} forEach allplayers);
This does not give a hint when the task is set to Succeeded, any fix for that?
it is a damn wonder that is not throwing errors around you
or more luck`
simpleTasks returns an array
forEach returns whatever was the result of the LAST iteration
what you want to archive here already is done wrong thus with the {simpleTasks _x} forEach allplayers
{_x setTaskState "Succeeded"} forEach ({simpleTasks _x} apply allplayers);```
this is the first fix you should use
and it might fix your second one too
nop, generic error
ye ... because i was kinda stupid here?
or more an oversight*
{simpleTasks _x} apply allplayers```
returns `[[...], [...], ...]`
thus your lefthandside code is still wrong
[Task Secure Civlilian:C Alpha 2-1:1 (id 0),Task Secure Civlilian:C Alpha 1-3:1 (id 1),Task Secure Civlilian:C Alpha 3-6:1 (id 2),Task Defuse Bomb:C Alpha 4-6:1 (id 3),Task Defuse Bomb:C Alpha 4-5:1 (id 4),Task Defuse Bomb:B Alpha 3-6:1 (id 5),Task Defuse Bomb:B Alpha 4-4:1 (id 6),Task Secure Civlilian:C Alpha 4-5:1 (id 7),Task Secure Civlilian:C Bravo 1-6:1 (id 8),Task Secure Civlilian:C Bravo 2-4:1 (id 9)]
hum...
best way to do it afaic is:
_arr = [];
{
_arr pushBack simpleTasks _x;
} forEach allPlayers;
{
_x setTaskState "Succeeded";
} forEach _arr;```
my ({simpleTasks _x} forEach allplayers) return the aray like this
https://community.bistudio.com/wiki/forEach
Return Value: Anything - will return the value of last executed statement
using {simpleTasks _x} apply allplayers gives a generic error
check above for the reasoning
missed out the fact that simpleTasks returns an array
posted correct code afterwards
your code just handles the last player in allPlayers
_arr = [];
{
_arr pushBack simpleTasks _x;
} forEach allPlayers;
_arr
Returns
[[Task Secure Civlilian:C Alpha 2-1:1 (id 0),Task Secure Civlilian:C Alpha 1-3:1 (id 1),Task Secure Civlilian:C Alpha 3-6:1 (id 2),Task Defuse Bomb:C Alpha 4-6:1 (id 3),Task Defuse Bomb:C Alpha 4-5:1 (id 4),Task Defuse Bomb:B Alpha 3-6:1 (id 5),Task Defuse Bomb:B Alpha 4-4:1 (id 6),Task Secure Civlilian:C Alpha 4-5:1 (id 7),Task Secure Civlilian:C Bravo 1-6:1 (id 8),Task Secure Civlilian:C Bravo 2-4:1 (id 9)]]
and wastes some time on the other players there
correct
which is exactly what your other method expects
or ... no ... wait
gah ... should catch some sleep finally
sorry, obviously wrong ๐
i did not what to be rude
Nah, its ok, you do help me when i need too.
_arr = [];
{
_arr append simpleTasks _x;
} forEach allPlayers;
{
_x setTaskState "Succeeded";
} forEach _arr;```
though, what about the notifications
this time*
that does the same as it do with my one, i just need the notification
no, it does not as i said
forEach just returns the last result
while this really takes all players tasks
your missing notification is nothing i can help with tbh
not even sure what notification you are talking about
"Task completed : NameOft"
darn
though
({simpleTasks _x} forEach allplayers)
Retuns
[Task Secure Civlilian:C Alpha 2-1:1 (id 0),Task Secure Civlilian:C Alpha 1-3:1 (id 1),Task Secure Civlilian:C Alpha 3-6:1 (id 2),Task Defuse Bomb:C Alpha 4-6:1 (id 3),Task Defuse Bomb:C Alpha 4-5:1 (id 4),Task Defuse Bomb:B Alpha 3-6:1 (id 5),Task Defuse Bomb:B Alpha 4-4:1 (id 6),Task Secure Civlilian:C Alpha 4-5:1 (id 7),Task Secure Civlilian:C Bravo 1-6:1 (id 8),Task Secure Civlilian:C Bravo 2-4:1 (id 9)]
and read the return
if allPlayers is > 1 then the return value will be wrong
_arr1 = {simpleTasks _x} forEach allplayers;
_arr2 = simpleTasks (allPlayers select (count allPlayers - 1));
_arr1 isEqualTo _arr2; //true
That means its going to screw up for me if in MP with other players?
yes
because that is not what the command was designed for
though ... you should not just blindly close all tasks assigned anyways
{ { _x setTaskState "succeeded"; } forEach _x; } forEach allPlayers```
there you go
will not get simpler
does the same as the sqf _arr = []; { _arr append simpleTasks _x; } forEach allPlayers; { _x setTaskState "Succeeded"; } forEach _arr; code
besides that the latter is using an extra array
Better i test that with a second arma opem before work with this, aka fuck my PC
yup, not mp compatible
{ { _x setTaskState "succeeded"; } forEach _x; } forEach allPlayers //generic error
_arr = [];
{
_arr append simpleTasks _x;
} forEach allPlayers;
{
_x setTaskState "Succeeded";
} forEach _arr;
/\ worked for the pc that called it but not for the second player, he still have the task
neither my worked, same as above
{_x setTaskState "Succeeded"} forEach ({simpleTasks _x} forEach allplayers);
{{_x setTaskState "Succeeded"} forEach (simpleTasks player);} remoteExec ["bis_fnc_call", 0];
This one worked, all players got all tasks set to succeeded
sldt1ck - Last Wednesday at 22:12
{
if (toLower taskstate _x in ["created","assigned"]) then {_x settaskstate "succeeded"};
} foreach simpletasks player;
@astral tendon
{
{
if (toLower taskstate _x in ["created","assigned"]) then {_x settaskstate "succeeded"}
} foreach simpletasks player;
} remoteExec ["bis_fnc_call"];
also targets (Optional): [default: 0 = everyone]
params [
["_seconds", 0, [0]]
];
private _hours = floor ((_seconds % 86400) / 3600);
private _minutes = floor ((_seconds % 3600) / 60);
private _seconds = floor ((_seconds % 60));
switch true do {
case (_hours isEqualTo 0 && {_minutes isEqualTo 0}): {format ["%1 seconds", _seconds]};
case (_hours isEqualTo 0): {format ["%1 minutes, %2 seconds", _minutes, _seconds]};
case (_minutes isEqualTo 0): {format ["%1 hours, %2 minutes, %3 seconds", _hours, _minutes, _seconds]};
default {format ["%1 hours, %2 minutes, %3 seconds", _hours, _minutes, _seconds]};
};
Any idea why this returns the incorrect amount of hours when seconds of hours over 24 are provided?
is there a limit on how many Task can be created?
TAG_fnc_initSector = {
params ["A"];
private _owner = A getVariable "owner";
if (_owner in [WEST]) then {tank setPos [7412.082,8377.723,0]
};
};
[A,"ownerchanged",{A call TAG_fnc_initSector}] call bis_fnc_addScriptedEventHandler;
can some one tell me what im doing wrong here?
TFW ur tryna make cool particle effects,and think u find a particle effects list, but https://community.bistudio.com/wiki/Category:ParticleShape ๐ญ
is empty ๐ญ
does arma have an infity character I can use in text?
@warm gorge because your (_seconds % 86400) does nothing until 24 hours. After that it cut's off 24 hours and returns the rest.
the modulo divides by the number and always returns the rest.
1 hour is 3600 seconds. % divides by 86400. result is 0, leftover is 3600, it returns 3600.
You then divide by 3600 and out you get one hour.
Let's say you have 24 hours which is 86400 seconds.
% divides by 86400. Result is 1, rest is 0. It returns the rest.
Then you divide 0/3600 which is 0. Result is 0 hours.
@still forum Fixed it by just changing the hours calculation to floor (_time / 3600)
Cheers for the help
{
if (ITEM_VALUE(configName _x) > 0) then {
_inv lbAdd format ["%1x - %2",ITEM_VALUE(configName _x),localize (getText(_x >> "displayName"))];
_inv lbSetData [(lbSize _inv)-1,configName _x];
_icon = M_CONFIG(getText,"VirtualItems",configName _x,"icon");
if (!(_icon isEqualTo "")) then {
_inv lbSetPicture [(lbSize _inv)-1,_icon];
};
};
} forEach ("true" configClasses (missionConfigFile >> "VirtualItems"));
``` is it possible to increase the text size when the Item is added to the List?
exist elseif or else if in sqf? Trying to make a if statement.
switch/case ,
if (โฆ) exitWith {},
or if () then {} else { if () then {} };
no else if nor elseif
Thanks! ๐
๐
TAG_fnc_initSector = {
params ["A"];
private _owner = A getVariable "owner";
if (_owner in [WEST]) then {tank setPos [7412.082,8377.723,0]
};
};
[A,"ownerchanged",{A call TAG_fnc_initSector}] call bis_fnc_addScriptedEventHandler;
does some one know what im doing wrong here?
@flat eagle please format your sqf with
```sqf
// your sqf here
```
// your sqf here
A is not a valid local variable
alright
Can't use it in params
A โ _a
ok
or better, name it properly _unit
A is an objective
_objectiveA
I dunno your code, so suit yourself ๐
Also if owner in [west]
Just do owner isEqualTo west
Only 1 element, no point for using in
elseif exists but not in vanilla arma
Hey guys, does anyone know whatโs the difference between the function camCommit, and camCommitPrepared ?
camCommitPrepared commits prepared changes and camCommit commits normal changes... Man that's not.. One sec
It seems like it would do the exact same thing? ๐
if you do camPrepareTarget for example. camCommit won't set the target but camCommitPrepared will.
If you use camSetTarget camCommit and camCommitPrepared will set the target.
There is like a internal buffer of "prepared" parameters. camCommit ignores these and commits the actual parameters.
camCommitPrepared moves the "prepared" parameters from the internal buffer to the actual parameters, and then executes normal camCommit
prepared things are like https://community.bistudio.com/wiki/camPrepareTarget https://community.bistudio.com/wiki/camPreparePos https://community.bistudio.com/wiki/camPrepareFov
Just search for camPrepare on https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
so you could like.. Have two sets of parameters. Set one and commit it. Then prepare the others and when ready commit when ready.
((configFile >> "cfgWeapons") call BIS_fnc_getCfgSubClasses);
Im trying to sort weapons by rifles, lauchers, pistols, explosives etc. or any other possible way to sort, you guys got any idea.
sort?
bis_fnc_itemType?
is there already a function to filter input fields (like you want to allow only numbers/floats)
@astral tendon definitely use engine-based
https://community.bistudio.com/wiki/configClasses
you can setup your filter in it
"isnil getText (_x >> 'access')" configClasses (configFile >> "cfgWeapons");
returns
[bin\config.bin/CfgWeapons/Default,bin\config.bin/CfgWeapons/PistolCore,bin\config.bin/CfgWeapons/RifleCore,bin\config.bin/....
How to set that back to strings?
str? getText?
you obtained config entries; from this you should use getText
getText (_oneEntry >> "displayName");
again, do not hesitate to read the wiki
https://community.bistudio.com/wiki/getText
maybe className too
it's for a location according to wiki ๐ค quite a generic nameโฆ
location is a value type
Oh. Yeah. But I actually meant configName
๐ค
is that a hand shake or thumb fight?
trap card has a different meaning nowadays than it had 5 years ago
I realised that while typingโฆ it's old-schooler way ๐
https://youtu.be/4F4qzPbcFiA (It's a trap)
expected rick roll.
Trust me, I considered it.
is there already a function to filter input fields (like you want to allow only numbers/floats)
also very confused with this one:
diag_log [_display,_idcOffset,_parameterName];
_sliderControl ctrlAddEventHandler
[
"SliderPosChanged",
format ["[_this,%1,%2,%3] call Test_fnc_sliderChangedOnBottomBox",_display,_idcOffset,_parameterName]
];```
returns:
[Display #4711,0,"apertureMin"]
["Test_fnc_sliderChangedOnBottomBox",[[Control #3003,27.8132],any,0,any]]
like it seems only certain variables can be passed to the ctrlEH
BI is doing stuff like
_ctrlButtonNext ctrladdeventhandler ["buttonclick",format ["[%1,%2,nil,finddisplay %3] spawn bis_fnc_3dentutorial",_path,_index + 1,_displayIDD]];
_ctrlButtonExit ctrladdeventhandler [
"buttonclick",
format [
"
_completed = profilenamespace getvariable ['display3DENTutorial_completed',[]];
if !(%1 in _completed) then {
_completed pushback %1;
profilenamespace setvariable ['display3DENTutorial_completed',_completed];
saveprofilenamespace;
uinamespace setvariable ['display3DENTutorial_select',%1];
};
_display = finddisplay %2;
[nil,nil,nil,_display] spawn bis_fnc_3dentutorial;
if (ctrlidd _display == 313) then {
_display createdisplay 'Display3DENTutorial';
};
",
_path,
_displayIDD
]```
seems only numbers can be passed on
like it seems only certain variables can be passed to the ctrlEH you are not passing stuff to the ctrlEH
you are turning things into strings and expect them to magically turn back to what they were when compiled
_parameterName is a string in the first place
if you turn a number into string it becomes
0
What happens when you execute 0? Right. It returns the number 0.
for the display
Display #4711
What happens whe n you run that? It uses the global variable Display and then selects the 4711'th element out of the Array inside Display.
the display is different yes, however i would still expect not to return just any
parameterName is a string yes.
What happens when you format that?
format ["[%1]", "string"]
turns into "[string]" which is code
string
which is the variable string. Which is not defined. Thus any
thanks fixed
Do clients ever get any cached information from a server mod?
I want to be able to ban / kick automatically without any exposure of the server command passwore
since I know the mission gets cached alongside mp anim data
no
Okay, excellent.
it appears that
showGPS true;
is ineffective, does anyone know of a workaround ?
Do you have a gps? :p
yes all linked and everything ๐
it does appear as though there may be a ticket out on the subject, but id like to avoid a scripted minimap and use the vanilla
Am trying to make an interactive dialog appear in Eden. 'createDialog' works but allows background objects to be selected, can I stop this and lock focus to the dialog in any way? Very new to GUIs!
I am no expert, but my hacky mind would think of a big invisible background element that would grab all clicks outside his controls ๐
note that this may not be the good solution ๐
open debug console in eden (tools> debug console) and paste this
0 spawn {
disableSerialization;
private _display = findDisplay 313 createDisplay "RscDisplayEmpty";
private _control = _display ctrlCreate ["RscButton", -1];
_control ctrlSetPosition [0.35,0.5,0.25,0.1];
_control ctrlCommit 0;
_control ctrlSetText "CLICK IT !!!";
_control ctrlAddEventHandler ["ButtonClick", {
params ["_control"];
ctrlParent _control closeDisplay 0;
}];
};
@runic rose
@meager heart Amazing! Many thanks โค
is there away to get the config path if I have the class name?
Do you know what kind of classname it is? Aka if it's a weapon or a vehicle?
what would backpacks be classified as?
vehicles
https://community.bistudio.com/wiki/BIS_fnc_classWeapon
https://community.bistudio.com/wiki/BIS_fnc_classMagazine
^ for guns and ammunition, but not for vehicle (none I know)
Surely BI didn't do
params["_blah"];
_return = configFile >> "CfgVehicles" >> _blah
it's always some convaluted over complicated fnc
addAction isn't JIP compatible, is it?
Local effects
Great, thanks for the information!
global args but local effects <<
What will happen if I will queue it for jip with remoteExec and then delete object?
Should I take care of removing action via remoteExec too when deleting object?
nothing, as far as I know? you can remove the remoteExec JIP action yes, it's preferable
Good. We're rewritting KP Liberation currently and I'm trying to get as simple code as possible. ๐
When Object or Group is deleted and becomes objNull or grpNull, the persistent remoteExecCall statement is automatically removed from JIP queue.
from https://community.bistudio.com/wiki/remoteExecCall
// removes a message identified by "IamUnique" from the JIP queue
remoteExecCall ["", "IamUnique"];
does anyone know the difference between position (location) and locationPosition?
https://community.bistudio.com/wiki/position_location
https://community.bistudio.com/wiki/locationPosition
hello, is there any way to disable the fire when car, tank etc blow up? I want to get only wreck without fire.
ohhh wow
locationPosition < object position (if attached)
position <location> < location position (if attached/if not attached)
(description says it) @winter rose
so there is option to disable it global?
effects for setDamage command are global... if that what you mean
no, i think when the vehicle is spawned by someone like buyed and spawned vehicle is there option to disable fire when the vehicle blow up?
@meager heart had trouble splitting the two info at the time, thanks
how does the game know whenever you press a button what action to do. Like say i have something like Shift+L bound for like 2 mods, how does the game determine which action to do?
just curious how arma handles controls
Shift+L bound for like 2 mods
you can't bind buttons to mods in Arma
if you mean "configure addon controls" that's CBA, not Arma
Can you attach a vehicle that is your CursorTarget to you? My attempts just crash my server. The only way I have been able to attach the vehicle was using a addAction to the car for anyone with a var on the spawn of the car.
Is there any way to launch the editor vรญa script in main menu rather than with "playMission"
Is there a way to edit an individual units ACE fatigue params through script?
I tried player setVariable ["ace_advanced_fatigue_recoveryFactor",5] and it doesn't seem to work
This is not working either [] spawn {ctrlActivate ((findDisplay 0) displayCtrl 142);};
when I press ok on map selection it does nothing... only close selection dialog
@radiant needle It is, since its a mission event handler and its tied to a mission, not a player.
Oh wait so if I do onSingleMapClick, it changes behaviour for all players?
@radiant needle No, AFAIK all mission event handlers all stricly local to an instigating PC.
Is it possible to edit the depth of field setting via scripts? I want to try making a script where DoF is enabled when you use weapon sights, but otherwise DoF will be off.
Splendid camera and look into ace33 nvg
Is it possible to edit ace settings for individual units?
Like if I execute missionNameSpace setVariable ["VarName",0] will it only apply for the player it's executed on, or everybody?
it only applies to the player the command is executed on.
@willow rover it's possible it's creating a strange race condition because the cursor Target changes? Dunno. Something you may want to report to @ Dwarden#6450 btw
@radiant needle variables you set locally will only be set locally.
How to put icons/text over a object? like in king of the hill were you have words on the base
probably drawIcon3D
Hey guys do you know of a way to overwrite the default texture of a p3d object in arma without making a new mod and without using the global texture setter?
So... You want to overwrite the texture without using any of the ways to overwrite the texture?
I don't think that'll work
I will give you example. I want to overwrite the texture of a default outfit in Arma. However the problem with setTextureGlobal is that if you take that item and place it on the ground than pick it up it will change the texture again to default. The only way i know to overcome this is with a thread that can periodically set the texture to keep it the one you want but that is not worth the processing power just to have a pretty uniform.
you need a mod for that
I have a memory that arma released a way to custom set your vehicle accelaration handling and so on. I was kinda hoping that i can use that to alter default texture setting as well
If i remember right, setObjectTextureGlobal have an example, to keep texture on uniform
With a thread it will work but its not worth spawning a thread for the sake of having a pretty uniform
@earnest path I do a InventoryClosed check, but only for human players, to reset the uniform:
player addEventHandler ["InventoryClosed", {
params ["_unit", "_targetContainer"];
private _curUniform = uniformContainer _unit;
if (_curUniform != MF_fnc_setUnitInsignia_lastUniform) then {
MF_fnc_setUnitInsignia_lastUniform = _curUniform;
if (not (isNull _curUniform)) then {
[_unit, "REFRESH", true] call MF_fnc_setUnitInsigniaGlobal;
};
};
}];```
Plus that command is going to add traffic to JIP
@errant jasper Ok so you set the texture with global and than you keep on doing a sync every time inventory is closed
Well sort of. I run my global command, which itself only runs the local setObjectTexture because my insignia image is in the mission folder, and setObjectTextureGlobal does not work properly then. And then yes I check each inventory close, but no traffic is sent unless a change is made.
@errant jasper => https://community.bistudio.com/wiki/Talk:setObjectTextureGlobal
This will help you fix your problem with the not working ObjectTextureGlobal
I like your solution
@earnest path You are going to have to be more specific about how that fixes my problem? My problem is specifically, that if you try to set a texture using setObjectTextureGlobal, that works fine if the texture is in an addon. But if you try to set it to a texture in the mission, then first constructs a path that is correct on your machine, and then tries to apply it to other machines where it fails.
One thing I haven't though of about my solution, is whether or not you can swap your uniform with one on the ground, without opening inventory.
Good point
Oh, I see you mean Pierre top comment on remoteExec. Well that is basically the solution I use.
should I ask here for cfgRemoteExec?
Don't see any problem with that. Ask away.
searched better on the wiki, thanks anyway
Is there any way to launch the editor vรญa script in main menu rather than with "playMission" This is not working either [] spawn {ctrlActivate ((findDisplay 0) displayCtrl 142);};
when I press ok on map selection it does nothing... only close selection dialog
Is there a way to know if player is in Cutcene?
apparently MPKilled does not fire when vehicle is sunken (testing on vanilla huron), what is most graceful way to check if vehicle is destroyed by water?
Should I also use MPHit event and check if unit is in water and damage > xx ?
Strange that it works for B_Slingload_01_Cargo_F. For both alive x returns false ๐ค
Do you guys know, why this not working:
fn_test1.sqf:
[2] call Client_fnc_test2;
fn_test2.sqf:
params ["_test"];
if(_test == 2) then {
hint "working";
};
That not my problem. If i remove my if statement and just making a "hint", it's works.
I can't use my params...
it's the proper syntax yeah
2 call Client_fnc_test2
or
[2] call Client_fnc_test2 should work
try, in the fn_test2.sqf file, to hint str _this and see what you get.
do you have showScriptErrors activated in the launcher?
@winter rose Thanks.
hint str _test show the number. I don't know why it's not working, and I didn't know anything about "showScriptErrors". I will try that ๐
somewhere, the rest of the file may have a script error preventing the whole file to be used
@winter rose
My sqf file:
_shopNumber = str _shop;
if(_shopNumber == 1) then {
_name = ((missionConfigFile >> "shops" >> "generalstore" >> "shopName") call BIS_fnc_getCfgData);
_items = ((missionConfigFile >> "shops" >> "generalstore" >> "buyItems") call BIS_fnc_getCfgData);
} else {
_name = ((missionConfigFile >> "shops" >> "drugdealer" >> "shopName") call BIS_fnc_getCfgData);
_items = ((missionConfigFile >> "shops" >> "drugdealer" >> "buyItems") call BIS_fnc_getCfgData);
};```
Logs error:
``` 18:49:18 Error in expression <shopNumber = str _shop;
if(_shopNumber == 1) then {
_name = ((missionConfigFile>
18:49:18 Error position: <== 1) then {
_name = ((missionConfigFile>
18:49:18 Error Generic error in expression
18:49:18 File Functions\modules\ShopSystem\fn_openVirtualShop.sqf [ClientModules_fnc_openVirtualShop], line 30 ```
_shopNumber is a string. 1 is a number
โ @modern snow
systemChat format ["_shop = %1 (type %2)", _shop, typeName _shop];
@winter rose Output _shop = 1 (type SCALAR)
so it's perfect. btw, restart your game with showScriptErrors if it's not the case already
I don't understand. It's a number and my if statement is not working..:
_name = ((missionConfigFile >> "shops" >> "generalstore" >> "shopName") call BIS_fnc_getCfgData);
_items = ((missionConfigFile >> "shops" >> "generalstore" >> "buyItems") call BIS_fnc_getCfgData);
}; ```
_name undefined, last line
how would you design a filter for an input box (RscEdit) that is meant to allow only numbers between 0-255, or in another case floats from 0 to 15.00 (2 digits)
have a keyUp EH on the control, convert the context to array, drop all non valid characters and refresh the display with the remaining valid ones?
yeah my name is also undefined because my if statement. _name being created in my if statement.
@velvet merlin on lost focus/form confirmation
@modern snow your _name var, if defined in an if-then, is destroyed as soon as the if-then closes.
private "_name";
if (true) then { _name = "name"; };
hint _name; // will work
well thats somewhat annoying as the input would cause live screen updates - so to change focus first would be an inconvenience
if it's an input, someone may make a mistake while writing (like typing ! instead of 1)
I'd hate the input text to reset to 0 in that case :3 a UX designer I know would agree
@winter rose You are the best! I love you ๐
I know ๐ ๐ Thanks, glad I could help ;-)
@velvet merlin or make the input read-only with +/- buttons :p
why would one need to reset? you can just drop an invalid character when entered?
let's imagine you type 3, then 5, then 5 - would the last 5 be refused?
yes or you would set the input to 255/maxValue
I don't know, it's really up to you (depending on what you wantโฆ)
what is the context for this interface?
GUI to tweak terrain lighting live: https://i.imgur.com/25veQLr.jpg
Any tool to convert jpg to PAA than ImageToPaa? its gives me error "has an incorrect file size"
@velvet merlin oh, I though some IP hacking device ๐ well in this case I wouldโฆ either stick to what BI does in A3 video settings menu (can you type text, does it update when leaving?)
or your own method then: onKeyDown, if newValue is alphanumerical, keep currentValue, if newValue > 255, top it to 255 yes
@astral tendon then your file is most likely to an incorrect size
2^n ร 2^o ?
yip
dimensions?
1920x1080
โฆ
no.
1920 is not a power of 2.
1080 is not a power of 2.
128, 256, 512, 1024, 2048, 4096 are power of 2.
strange, usualy if i put in the game those images get a blue tint
if they are not power of 2
stretch/resize it to 2048ร1024 and it will be as swift as a fart on satin sheets
Checking file list...
Checking 'Storage' - Appears to be valid.
File list checked.
Processing Storage (218 KB)...
Fail to process Storage
Failed to convert 1 file(s)
Rip
soo, any other tool?
what size is your picture?
1024x512
jpg?
yes
send it to me in pm
(please)
ImageToPAA refused to process a file that was gladly converted by TexView2 ๐
Is anyone willing to come into a voice channel with me and help me with getting this moving unit marker to work properly with multiple units.
Please don't try and explain it by text, I have dyslexia and it will just end up confusing, I learn better if I am walked through it by voice.
Thank you
...
Is anyone going to help me with this, I though this was a Discord that helps people
People have lives too
and its saturday night
God damit
Pretty good spelling for someone with dyslexia
Clearly you do not know how Dyslexia effects people differently then do you
Either
A.) The important people have lives
or
B.) Code doesn't work well when dealing with hearing comprehension
Hold your tongue before you say something ingnorant
Good for you, be ignorant child
Child ? now you are just being rude.
oof, lets not get hasty now.
If nobody can help lets just wait for someone who can.
I was going to help him
In my brain calling someone a ignorant child is rude.
I wasn't being rude by saying you have good spelling for someone with dyslexia, its was a compliment, but whatever.
No you said it like this Pretty good spelling for someone with dyslexia, that to me, is you being cynical
But ok
maybe next time you should think before you act.
I'd like to reiterate that not all tone of voice can be carried through text....
Im not a rude person sorry. I try to help people as much as I can, but as you got rude. Im not going too.
I tell you what then, you go away, because clearly, you are not going to help, so stop ok.
Calm down, and go back to whatever it is that you was doing, thank you
o/
don't be ignorant says the guy asking for help ๐
not everyone is here for your blue eyes champ, so take a chill pill and wait for someone to answer. Personally I think I could help with your script, but I am not at ease with voice explanation. Also, I am not invited due to your displayed lack of patience.
why not just pastebin that script, will be more chances for some help... ๐คท
Ignorant, would be somone who did not bother to search, or there own research before asking for help.
Can see here some people still live at home, logic clearly does not apply to some of you
welp, If I didn't live at home , where would I live ?
maybe you should think over your insults twice before you use them
correct. I live at home. Where else?
In a house.
if I setVariable a player, will he lose the variable upon respawn?
afaik no. But don't quote me on that
I live at home become it's not far from my place
Anybody here helps with scripting?
nah, we just chat here about... things
this <this
well
yes
0 = [this] spawn aa_fnc_code; < try this
undefined variable this
in object init field ?
this addaction ["<t color=""#37ad3b"">" + "Enter", "0 = [this] spawn rb_fnc_enter;"];
the easy fix is using the object variable
just courious why this is not working
this needs to be parsed as parameter
action_id = this addaction ["<t color=""#37ad3b"">" + "Enter", {
/*[target, caller, ID, arguments]*/ //--- what you need from that ?
}];
its just an action that fires a script that takes an object as parameter
ans the object should be the object in wich the addaction is assigned
so i should use _this select 0
yes
as its the object'
object who used action or object where action is added ?
object that action is added
the addaction has its own scope
so "this"
is outside
solved hahaha
this addaction ["<t color=""#37ad3b"">" + "Enter", "0 = [_this select 0] spawn rb_fnc_enter;"];
that should work
action_id = this addaction ["<t color=""#37ad3b"">" + "Enter", {
params ["_target"];
[_target] spawn aa_fnc_code;
}];
```sqf
code
```
btw maybe you will check this https://community.bistudio.com/wiki/addAction
also "<t color=""#37ad3b"">" + "Enter" โ "<t color='#37ad3b'>Enter</t>" ๐
_TitleText_Meme ctrlSetFont "PuristaBold";
_TitleText_Meme ctrlSetBackgroundColor [0,0,0,0];
_TitleText_Meme ctrlSetText "Working";``` is there a way to increase the text size?
ctrlSetFontHeight ๐ค
\๐ผ
@molten folio at best you already Set the desired Text size Config level
Anybody has an ideas of how do you snap a 2D-object in Arma to something like a building wall, so it doesn't "dig" in its surface? Something like a painting or image on the wall.
@still forum can you help me?
how do i increase the Text Size in CtrlSetText
anyone plz?
๐
with lineIntersectsSurfaces maybe, @unborn ether
(surfaceNormal < from return)
@molten folio ctrlSetFontHeight for RscText and <t size='0.8'>YourText</t> for RscStructuredText
Ty @unborn ether
lol
Still getting the hang of ARMA Scripting but
diag_log [_id, _uid, _name];
}] call BIS_fnc_addStackedEventHandler;
onPlayerConnected {diag_log [_id, _uid, _name]};```
Both produce the same result. Should one be preferred over the other?
Other than the top one not triggering when its not a JIP event, Im looking more if there is some performance difference? Or if one of them is the old way of doing it and considered legacy
the second one can only have a single eventhandler
so if someone else uses it yours will be removed
actually both of them are deprecated
the first one is only useful to pass additional parameters
You should use https://community.bistudio.com/wiki/addMissionEventHandler
if you have many handlers the BIS_fnc_addStackedEventHandler has better performance. Because addMissionEH recompiles the script before every execution.
Ok, thanks
vectors commands list is so magnificent
How would I go about checking what interface size a player is on?
Anyone know how to make this stack and not replace an existing option? I'd like it to keep adding them so I can call them as needed rather than it replace an existing radio support.
_radio_2 = createTrigger["EmptyDetector",[0,0]];
_radio_2 setTriggerActivation["Bravo","PRESENT",false];
_radio_2 setTriggerStatements["this","execVM 'Cargo_Airdrops_GF\GF_Cargo_Airdrops_Request.sqf'",""];
2 setRadioMsg "Airdrop";
Who is the killer if UAV attack our side ? The UAV is created by script like this, and controlled by player.
_air1_array = [_spawnmark, 180, _uav, (side player)] call BIS_fnc_spawnVehicle;
_air1 = _air1_array select 0;
player connectTerminalToUav _air1; //connect player to uav
When UAV attack our side for test. the killer is AI, not the controller(player), like this chatting msg:
barnes was incapaciated by Wilson(AI) (friendly fire)
EH 'HandleDamage' also say '_source' is the AI, not the controller. So how can I identify the player killer? p.s. Do I have to check the '_instigator' of EH 'HandleDamage' ?
AFAIK any Arma kills lies to a vehicle "DRIVER" role (car or uav for example) or its owner, if it has no "DRIVER" seat (bullet?). _instigator should return it properly, but I've never tested that with UAV. End solution might be using UAVControl which returns all the info about that very UAV. @barnes#7447
Thx, I'll check the uavControl p.s. I found uavControl has the uav operator, but how can I confirm that the friendly fire is caused by the uav operator?
Is it possible to open Arsenal on a solider you are looking at in order to customize his gear (not yours)?
@thorn saffron No, that requires some scripting of your own
Eh, zeus can do it so why not us? Lemme look it up real quick
Snippet from the zeus module to add arsenal on a unit that is not a player/not in group sidelogic and not in avehicle etc,
["Open",[true,nil,_unit]] call bis_fnc_arsenal;
So in Taro's case, they just need to look at someone (preferably not a player) and call this
["Open",[true,nil,cursorobject]] call bis_fnc_arsenal;
@unborn ether When I say interface size, I mean the interface size setting in the video game settings e.g small large very large. Unless getResolution can do that?
hello, how can i get units array of group player?
i try'ed group player but get number
units group player
@warm gorge would be nice if you could just read the command description
Oh wow im stupid, I didn't even notice that
So, I've got this:
Orca addeventhandler ["Handledamage",{
if (_this select 2 > 0.9) then {
Orca allowdamage false;
};
}];```
Which stops the Orca from being destroyed from a gentle fucking landing. But it is OP and not immersive.
I want to figure out how to make it basically be:
```sqf
Orca addeventhandler ["Handledamage",{
if (_this select 2 > 0.9) then {
Orca_Hull allowdamage false;
};
}];```
But I don't know how to tell it to reference that hitpoint. I know "hull_hit" is a hitpoint, but just don't know how to grab it. Anyone have advice?
Any way to post a picture to fix the issue I am having in game?
[BIS_fnc_activateaddons] The function can be activated only during the mission init.
Now I put this into the init.sqf file.
_addons = activatedAddons;
and this
/*
Description:
Activate addons upon mission start.
Doesn't work when the mission is already running.
Parameter(s):
0: ARRAY of STRINGs - addon clases from CfgPatches or object classes from CfgVehicles
Returns:
ARRAY of STRINGS - activated addons
// Descrip
But it still keeps popping up
If anyone could help me with this, it would be much appreciated
i would say the init.sqf is too late to use that function
https://community.bistudio.com/wiki/Functions_Library_(Arma_3)#Attributes
So copy this one yeah?
class CfgFunctions
{
class myTag
{
class myCategory
{
class myFunction
{
preInit = 1; //(formerly known as "forced") 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
postInit = 1; //1 to call the function upon mission start, after objects are initialized. Passed arguments are ["postInit", didJIP]
preStart = 1; //1 to call the function upon game start, before title screen, but after all addons are loaded (config.cpp only)
ext = ".fsm"; //Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
headerType = -1; //Set function header type: -1 - no header; 0 - default header; 1 - system header.
recompile = 1; //1 to recompile the function upon mission start (config.cpp only; functions in description.ext are compiled upon mission start already)
};
};
};
};
@shadow sapphire handledamage seems to have a param for hitpoint available https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
@inner swallow, that's very interesting. Thank you.
However, if allowdamage is object wide, then it doesn't do me any good.
I still need to know how to call those hitpoints, because my workaround might be to set the damage of each hitpoint excluding the hull to one.
Like this:
Orca addeventhandler ["Handledamage",{
if (_this select 2 > 0.9) then {
Orca allowdamage false;
Orca setdamage "fuel_hit" 1;
Orca setdamage "avionics_hit" 1;
Orca setdamage "engine_1_hit" 1;
Orca setdamage "engine_2_hit" 1;
Orca setdamage "engine_hit" 1;
Orca setdamage "main_rotor_hit" 1;
};
}];```
Oh, perfect! Thank ya!
No problem ๐
if you see the additional information, there are a bunch of others
Indeed.
I fixed my issue I had, no need to worry
Jeez, that HandleDamage disrespect.
@shadow sapphire HandleDamage returns a final hitpoint damage before it is applied to the EVH argument (unit, vehicle whatever). So basically, if you get the last hitpoint damage with getHitIndex and set it as return, no damage will be applied. The only thing to remember is that your orca should be local to you.
I don't understand.
Im trying to use agents to do animations but they are moving laggy, any idea?
@shadow sapphire
HandleDamage has this params:
params ["_unit","_part","_damage","_source","_projectile","_hitindex","_instigator","_hitpoint"];
And it triggers for every hitpoint of a damaged object, so in your case it is simple to override it with something like this:
orca addEventHandler ['HandleDamage',{
params ["_object","_part","_damage","_source","_projectile","_hitindex","_instigator","_hitpoint"];
if (_hitindex isEqualTo 2) then {_damage = _object getHitIndex _hitindex};
_damage
}];
Where your 2 index is an actual part, you can also use a hitpoint name instead
I was trying to make it where helicopters using advanced flight model won't blow up by tipping twenty degrees on the helipad. It's impossible. Even disabling damage completely doesn't stop the helicopters from being destroyed when tipping them on the ground.
I wanted to allow it to crash, but just stop it from killing everyone aboard instantly for slowly tipping over, but it just doesn't work anyway.
FixAPC synchronizeObjectsAdd [player];
synchronizedObjects FixAPC; //returns empty array
why is it?
private _ehId = Orca addEventHandler ["Dammaged", {
params ["_object", "", "_damage", "", "_hitPoint"];
if (_damage >= 0.8) then {
_object setHitPointDamage [_hitPoint, 1];
} else {
_object setDamage _damage;
};
}];
```try this ^ @shadow sapphire
edited ^
This will kill any hitpoint and most likely destroy the helicopter even faster
urg HD eh
Wait a minute this addEventHandler ["Dammaged", {.. They repeated the ****** spelling mistake for the event handler too? Can't believe I never noticed. Why they not add one with no error spelling then, it it is fine for the commands?
sorry commy (forgot about gyazo issues lol)
The typo is "intentional": it is Dammaged with two "m".
ยฏ_(ใ)_/ยฏ
from the wiki ^
I know. But they could at least add an internal alias for it, so we don't have to "intentionally remember" the spelling error like they did with setDamage/setDammage.
afaik both works also ๐
That's something. Lol, wonder if I can use "HandleDammage" ๐
seems no ๐ https://imgur.com/9tXZttk
https://gyazo.com/d996fd58695d653ed034b448f8d2bdd0 still a little bit of work to do.
_dynRange = if (_town getVariable "wfbe_active" || _town getVariable "wfbe_active_air") then {_range_detect_active} else {_range_detect};
_detected = (_town nearEntities [["Man","Car","Motorcycle","Tank","Air","Ship"],_dynRange]) unitsBelowHeight 20;
_enemies = [_detected, _side] Call WFBE_CO_FNC_GetAreaEnemiesCount;
WFBE_CO_FNC_GetAreaEnemiesCount:
/*
Get enemies in area according to sides.
Parameters:
- Units/Objects array.
- Friendly Side.
- {Ignored sides}
*/
Private ["_count","_sides","_sideFriendly","_sideIgnored","_units"];
_units = _this select 0;
_sideFriendly = _this select 1;
_sideIgnored = if (count _this > 2) then {_this select 2} else {[]};
_sides = [west, east, resistance, sideEnemy] - [_sideFriendly] - _sideIgnored;
_count = 0;
{_count = _count + (_x countSide _units)} forEach _sides;
_count
The function returns 0 enemy units, when there are enemies in the area
_dynRange is 600
And the units are closer than 600 meters from the point, so they should be in the area
So what goes wrong here?
โฆwhy unitsBelowHeight?
also, use params, it reaaally helps
_sideIgnored = if (count _this > 2) then {_this select 2} else {[]};
literally turns unto ["_sideIgnored", []]
@winter rose Also aerial units are counted if they're at lower altitude than given threshold
are there units in _detected?
oh right, "Air" I missed that
@still forum There should be, but can't be absolutely sure
Why don't you like.. check?
For example, if there's a man standing 300 meters from the point when
_dynrange = 600;
I think it should be included
I'll test it ASAP
@still forum It returns enemy units that are in the area
Like it should
21:34:56 "[WFBE (INFORMATION)] [frameno:29940 | ticktime:613.008 | fps:46.5116] server_town_ai.sqf: Value of _detected: [B 1-1-A:1 (Damage) REMOTE]"
So the array is not empty
and the enemy side is not in _side by accident?
Correction: _side is the side of the town, so if eg. BLUFOR has captured the town, it returns BLUFOR / west
Does anyone know off hand of a simple way to script an AI group to crouch or prone?
Like the group version of SQF Leader (_G1) setunitpos "Middle";
@still forum Yes, and the BLUFOR unit is in town controlled by OPFOR
So why does the function return "0 enemies in the area"? I have no idea, but I guess the error must be in that function. Are the array commands correct?
@shadow sapphire well that's about that
{ _x setUnitPos "Middle"; } forEach units _G1;
@winter rose, thanks!
๐
Maybe this line is faulty?
_sides = [west, east, resistance, sideEnemy] - [_sideFriendly] - _sideIgnored;
Is the syntax correct?
[] for both pls
_sides = [west, east, resistance, sideEnemy] - [_sideFriendly, _sideIgnored];
โ
Rip _sides
It still returns 0! What kind of sorcery is this ๐
22:02:36 "[WFBE (INFORMATION)] [frameno:12102 | ticktime:224.473 | fps:45.977] server_town_ai.sqf: Value of _detected: [B 1-1-A:1 (Net_2) REMOTE,O 1-1-A:1 (Miksuu) REMOTE]"
22:02:36 "[WFBE (INFORMATION)] [frameno:12102 | ticktime:224.473 | fps:45.977] server_town_ai.sqf: 0 enemies counted in the area."
So there's both B = BLUFOR and O = OPFOR unit in a town controlled by BLUFOR, so it should count 1 enemy in the area
But it doesn't. How? ๐
Bad script.
Here's the function counting the enemies @little eagle
/*
Get enemies in area according to sides.
Parameters:
- Units/Objects array.
- Friendly Side.
- {Ignored sides}
*/
Private ["_count","_sides","_sideFriendly","_sideIgnored","_units"];
_units = _this select 0;
_sideFriendly = _this select 1;
_sideIgnored = if (count _this > 2) then {_this select 2} else {[]};
_sides = [west, east, resistance, sideEnemy] - [_sideFriendly, _sideIgnored];
_count = 0;
{_count = _count + (_x countSide _units)} forEach _sides;
_count
Or just scroll up
The code calling it is
_enemies = [_detected, _side] Call WFBE_CO_FNC_GetAreaEnemiesCount;
and the value of _enemies at the time of calling the function is:
_detected: [B 1-1-A:1 (Net_2) REMOTE,O 1-1-A:1 (Miksuu) REMOTE]
Well, I don't want to sound like an ass, but it is indeed a bad script imo.
Not done by me, so go on ๐
Do you have any idea what might cause the issue? I'm totally out of ideas
private []
๐คข
I would help you, but I can't even tell what the script is supposed to do.
Like, the functions header is completely useless.
It's supposed to count enemies in given area (in given distance from given point)
Enemies of what?
Scroll up if you want to see the explanation
Everyone is born an enemy to millions thanks to politics and religion.
Units of enemy side
So if eg. OPFOR holds an area 600 m from given point (town), BLUFOR unit entering that area should trigger the script to burp out _count with value higher than 0
Scrap that function, write your own.
lol, I see
It's a one liner, maybe 5 max.
Aight, I'll try to write my own
@tender fossil
commy_fnc_isEnemyNearby = {
params ["_position", "_radius", "_side"];
if (_side isEqualType objNull) then {
_side = side group _side;
};
allUnits findIf {
_x distance2D _position < _radius && {
[side group _x, _side] call BIS_fnc_sideIsEnemy;
} // return
} != -1 // return
};
// enemies to player on position of the player with 500m radius
[getPosWorld player, 500, player] call commy_fnc_isEnemyNearby;
untested
params [
["_units", [], [[]]],
["_sideFriendly", "", [""]],
["_sideIgnored", [], [[]]]
];
private _sides = [west, east, resistance, sideEnemy] - [_sideFriendly, _sideIgnored];
_enemyUnits = ((side _x) in _sides) count _units;
_enemyUnits;
``` maybe ?
What is _units? That makes no sense to me in this script,.
It's supposed to find the nearby enemies, no? Or at least report if there are any.
idk maybe he is passing the units in an area through to this script
That's very strange, I like my idea more.
yea use a center position, and radius xD
commy_fnc_isEnemyNearby = {
params ["_side", "_position", "_radius"];
if (_side isEqualType objNull) then {
_side = side group _side;
};
private _enemySides = [west, east, resistance, sideEnemy] select {
[_x, _side] call BIS_fnc_sideIsEnemy;
};
allUnits inAreaArray [_position, _radius, _radius] findIf {
side _x in _enemySides // return
} != -1 // return
};
// enemies to player on position of the player with 500m radius
[player, getPosWorld player, 500] call commy_fnc_isEnemyNearby;
There.
Nah, what I posted beats all versions.
Ye, looks more performant as findIf will exit after first unit found.
Good to know!
nearEntities has the problem that it only picks up entites, and units inside vehicles are no entities.
I wish there was a page where there would be performance comparison for things that are commonly scripted in sqf.
Uhm.. There is ๐
entities*
I've read it few times already.
the near units thing is not on there. But good idea to add that
it better be ๐ Was alot of work
Lou will be glad to hear that ๐
he is
Why does everyone have to always throw compliments at Lou
xD
Lou you are too good. people can't cope
sorry. won't do that again. ._.
Btw we are currently rewriting KP Liberation from scratch. So if anyone experienced likes this mission and would like to track development and hint us what could be written better or more performant we would gladly receive some constructive criticism.
Hello Lou
https://github.com/KillahPotatoes/KP-Liberation/tree/v0.97 shameless plug.
but it's a lot of teamwork for benchmarks, suggestions & all, so @still forum & @cosmic lichen you deserve your fair share of compliments too (and @meager heart and @gleaming oyster , and maybe I forgot some)
btw is the kp liberation finally getting a complete rewrite?
it is.
@tough abyss hi!
nice.
@winter rose do you know how radio actions work off hand?
Old inherited code was a mess. ๐
@little eagle "What is _units? That makes no sense to me in this script,."
_units is an array containing every unit in certain radius (here: 600 m) from given point
I'll test your code
@hollow thistle yeah. Have been saying the same ^^
Like radio supports
So as I have no big sqf background prepare yourself for stupid questions soon!
you are working on the rewrite without big sqf background? :u
didn't say that's a bad idea ^^
the code from you that I have seen so far looks better than what the average sqf dev writes
Average sqf dev copy pastes stuff from forum sadly.
copy pastes 5 year old outdated crap*
๐
You just called them above average. Dedmen.
What is the most performant way to addAction to player when he is area? In Lib we have fobs and when player is in fob he can recycle stuff, build, redeploy etc.
Old lib had a loop that checked if a player is in any fob and added actions to him when he was in area... this is obviously BAD.
you mean most performant way to check if he is in area or not?
most performant is to not have the action when he is not there
no that is not obviously bad
a scheduled loop that checks all 10 seconds or so is quite good
that's probably what I'd do. Just in unscheduled cuz I'm too lazy
Old liberation had scheduled loop for everything.
Well i guess reasonable amount of loops is fine.
They're nice, except that they stop working after half an hour.
But how it compares to eg. trigger created via scripting?
Both shit.
I experienced scheduled scripts on insurgency yesterday. Enemies spawning in front of me. Then the code that should teleport them away get's scheduled and doesn't run for like 20 seconds..
End result. A full enemy group spawns right in my face. Notices me. Kills me and then teleports away
ยฏ_(ใ)_/ยฏ
Noob
But hey! scheduled is cool right?
Dedmen, you can never go back, right???
CBA pfh every 10 seconds to check if you are in FOB zone. Makes sure it really checks every 10 seconds. And... Doesn't kill perf in any way
Remember that AGM was scripted in scheduled in large parts.
but you probably don't have CBA right?
We wanted to have vanilla compatiblity.
you could rewrite CBA pfh on your own. It's script only
But CBA is used by almost everyone anyway I guess.
If folks can't install CBA they should delete arma
If folks can't write CBA, they should delete Arma.
Damn
I would need to talk about it with rest of the team. (Wyqer)
nowadays you can even run CBA serverside only. But the FOB check script would run clientside..
bye then =/
deletes arma.
but again. Scheduled loop with 10 sec sleep is probably fine for that
if it takes 20 instead of 10 seconds that's still fine
Or.....
You add the action to the FOB building
for stuff like arsenal or that window to select missions that would work fine
So I guess our sector monitor would be better unscheduled too?
https://github.com/KillahPotatoes/KP-Liberation/blob/v0.97/Missionframework/modules/01_core/scripts/server/sectorMonitor/sectorMonitor.sqf
I really hate it in liberation when the sector takes too long to activate
but I'd say not a gameplay killer
Nah that code looks fine in scheduled
It can be annoying if it activates so long you are already landing helicopter and then shilka spawns in front. ๐
no one's gonna get hurt if a sector get's activated a couple seconds late.
But remember my thing about units spawning in your face and not teleporting away right away ๐
Also big advantage for unscheduled.. You can use my script profiler ๐ ๐
In lib there is only propability of spawning right in your face. No teleporting away from crime scene ;>
Hey guys i have a little script that i run on initPlayer.sqf of my mission but it does not work and i cant figure out why
player addEventHandler ["GetInMan",
{
params ["_unit", "_role", "_vehicle", "_turret"];
Hint "You entered a vehicle";
_unit = _this select 0;
_role = _this select 1;
_vehicle = _this select 2;
_turret = _this select 3;
_vehicle setPlateNumber "CEY ROLLO";
true
}];
Why are you getting the input variables twice?
params and this select 0 ?
Don't see any error in that besides that weirdness
So to create unscheduled loop and not kill performance it should be throttled with usage of CBA or by writing it by ourselves?
I would recommend to re-implement the CBA PFH stuff yourself
well, besides not using the parameters except vehicle
It'll definetly be useful later on
There's no reason not to write your own PFH thingy, except time.
Do you know if there is only one handler attached to GetInMan or you can have many that stack?
many.
Also, don't replace every loop with a pfh.
Like all addEventHandler
Event based code.
We will write our own copy of CBA custom events propably too.
As I want to achieve easier customization of mission without tinkering in core code.
You know what they do, but have no experience in SQF?
Kinda.
๐ ๐ด ๐ ๐ค
gn8
gn8
gn8, thanks for answers.
player addEventHandler ["GetInMan",
{
params ["_unit", "_role", "_vehicle", "_turret"];
_vehicle setPlateNumber "CEY ROLLO";
true
}];
I changed the script to this and if i execute it trough debug console
It works
But in playerInit it doesnt ๐ฆ
Hey guys i have a little script that i run on initPlayer.sqf
i think you can try:
rename yourinitPlayer.sqfto โinitPlayerLocal.sqf
and for the script
player addEventHandler ["GetInMan", {
params ["_unit", "_role", "_vehicle"];
hint "You entered a vehicle";
_vehicle setPlateNumber "CEY ROLLO";
}];
``` ๐
@earnest path
Yes it is initPlayerLocal.sqf sorry for the missleading
Maybe the Exile mod removes all even handlers when you spawn.
i have no idea about Exile mod and what it will remove, sorry
@earnest path Does it work in vanilla ("empty" mission I mean)? According to BIKI the argument has to be local, maybe it is only local shortly after the handler runs, and not before? Also locality only transfers to the driver I believe (though this might be a desirable effect in your case - but just to clarify, getting in as non-driver will almost certainly result in running the command with a non-local target in MP).
Trying to get group respawn going on respawn_ASQL, scenario was that Bravo would rescue alpha from their alimo. When bravo get within x distance of the alpha respawn the code deleteMarker Respawn_ASQL; will run. Moving alphas default qrf back to respawn_west. Is there anyway to get over JIP issues with that. Meaning people in alpha continually spawning at a marker that is deleted for the rest of the side. Obvious solution is to just move the marker to the new respawn location, but is there any other solution?
respawn templates maybe https://community.bistudio.com/wiki/Arma_3_Respawn
MenuPosition in your case
How can you add a unit as a high command commander in a middle of a mission? I tried synchronizeObjectsAdd but it seems to have no effect
Donโt use a menu currently. Breaks immersion, being able to choose where a squad can respawn as well. Disregarding the fact there is actually respawns and how that effects immersion.
@modest rapidszleflash#7409 GetInMan is only applied to a unit, not a vehicle. Since player is strictly local to you (in case if its not null) - this EVH will trigger constantly.
Discord cmon
GetInMan would also fire for remote units.
hey all, wanted to ask about some avionic commands used in ArmA 3. So am I right in understanding that I can use 1. 'velocity' to get the speed of a vehicle, 2. 'vectorDir' to get the roll/pitch of an aircraft, 3. 'getPos' or 'getPosAsl' to get the height of the vehicle for altitude, 4. 'getDir' for the heading on a compass and 5. 'rotorsRpmRTD' to get the torque or RPM value of the rotor speed? Need to figure these out before I start planning any flight instruments.
please correct me if any of these are wrong, or if there are specific instrumentation commands that the flight model uses to return values.
speed refers to a scalar usually, while velocity is a vector with the speed as length. Ingame speed command also is in km/h instead of m/s and can report negative values for moving backwards.
vectorDir reports the direction the vehicle is heading. The direction alone is insufficient to tell the roll, but I guess you can get heading and pitch from it.
getPos/ASL/ATL report the same X,Y and only the Z is different.
getPos - AGLS format, z=0 is the first walkable surface including objects and terrain below the object and at this X,Y.
getPosASL - ASL format, z=0 is the constant sea level / normal null.
getPosASLW - ASLW format, z=0 is the current height of the waves at this X,Y and time.
getPosATL - ATL format, z=0 is the terrain surface at this X,Y.
ASLToAGL getPosASL - AGL format, z=0 is above land the same as ATL, and above sea the same as ASLW. This is the most common format used by other commands, despite having no getPosX-variant directly.
getPosWorld - ASL format, is the same as ASL, but reports the height above z=0 not from the lowest point of the object, but the object center.
Note that setPos uses AGL, but getPos reports AGLS, which means that these are not bijective iff there is a walkable surface other than the terrain below the object.
Also note that only ASL has a constant z=0, so vector math can be done accurately only in ASL format.
You can use vectorCrossProduct between two vectors (vehicle center + some part of helicopter) to get some kind of a roll.
"ASLW" and "AGL over sea" format are time sensitive, as the waves move.
Yeah, you usually use vectorDir and vectorUp to retrieve the heading/pitch/bank of a plane.
AGLS format also can never be bijective, because there are multiple z=0 at every X,Y - each walkable surface. Only the first one below the object is considered, but without object, it's not clear which one that is.
Is that getPosASLVisual that counts any interference over a terrain into its return?
getPosASLVisual is exactly the same as getPosASL. The only difference is, that XVisual reads the position from the render thread instead of the simulation thread, so it reports where the object is drawn, not actually exists (including hitbox and geometry).
drawn position is interpolated between simulated position and updated more frequently, so the game looks smooth.
So there is no command that is able to count height of any object over terrain/sea?
๐ค
Ah nvm, just thinking of how you lock that object, according to that you can't know whats it exactly. I think just make a 90 degree interesection ray, but that might be not accurate..
You want the direction vector from one object to another?
No, kinda find some object(s) below you (from a helicopter for example) and check if you have a space to land.
Probably best to do some raycasts using lineIntersectsSurface.
GEOM LOD.
To cover all objects inside, nearObjects plus nearTerrainObjects I'd say.
Idk how one would determine the slope at a position. Probably some math using the four edges and maybe the center and halfway points between the sides etc.
Definitely not the BIS function. That one sucks.
Yeah..
Oh.
heading = yaw = direction
pitch
bank = roll
These are my conventions and everyone else can fuck off.
!!!!
Is it actually impossible to use a script to close the canopy on the Black Wasp while it's empty, or am I just dumb? I spent the last two hours trying to figure it out, but the only animation available in the config relating to the canopy is canopy_hide, which is for ejection and simply removes it.
if virtual garage can do it then script can do it too
probably some animation yeah. Doesn't have to be shown in config
so how did they get the runtimes of the code from https://community.bistudio.com/wiki/Code_Optimisation ? Would https://community.bistudio.com/wiki/diag_codePerformance work just as fine?
exactly that.
hello, trying to use setMarkerTextLocal but is not working, i no idea why, could you help me please?
trying this
"markernamesd" setMarkerTextLocal "[EASY] ะงะธััะพ";
"markernamesd" setMarkerShapeLocal "ELLIPSE";
"markernamesd" setMarkerBrushLocal "Border";
"markernamesd" setMarkerColorLocal "ColorBlue";
"markernamesd" setMarkerSizeLocal [100,100];```
but no text on marker
only the text not working? Are the other things working?
- You dont have a
setMarkerTypeLocalfor it to display - Only
setMarkerShapeof type"ICON"support text AFAIK.
@still forum yes, all another is working
You can just simply go with 2 separate markers, one elliptic, one icon.
@unborn ether ty, will try
still not working ๐ฆ
createMarkerLocal ["markertextsd",player];
"markertextsd" setMarkerTypeLocal "hd_marker";
"markertextsd" setMarkerShapeLocal "ICON";
"markertextsd" setMarkerTextLocal "[EASY] ะงะธััะพ";
"markernamesd123" setMarkerShapeLocal "ELLIPSE";
"markernamesd123" setMarkerBrushLocal "Border";
"markernamesd123" setMarkerColorLocal "ColorBlue";
"markernamesd123" setMarkerSizeLocal [150,150];```
my guess is on the russian text. Try with just some latin characters
changed text to eng, still not working
You dont have setMarkerSizeLocal for a text marker
There are few conditions for markers to be visible on the map, that one is in it i think.
private _marker = createMarkerLocal ["markernamesd123", player];
_marker setMarkerTextLocal "[EASY] ะงะธััะพ";
๐ค
also afaik russian text works
Yes, arma supports cyrillic
Arma supports everything besides null characters
also
<Key ID="STR_sector_name">
<English>ย FOBย </English> //--- white space alt code
works
(for the marker name)
Only thing that's limited is what the fonts can display. for example they can't display emoji afaik. But using emoji in strings like variable names still works fine
i saw only one emoji โ < this one ๐
there is
class ScenarioData
{
author="Tom_48_97 โ ";
};
๐
missionNamespace setvariable works in preinit, rite?
ye
thanks
@unborn ether @little eagle Earlier about, about GetInMan. My comments on locality was about setPlateNumber which requires the argument (the vehicle) be local, and how I am not sure whether the vehicle become local before or after the event handler runs (and only when getting in as driver).
@still forum thanks you for answering me about camPrepareCommit, just saw ur answer !
Wasn't that like a week ago? ^^
It was 4 days ago yea ๐
can you detach your cursorTarget from a different script then the one you use attachTo?
you can detach stuff in scripts yes..
so if I attachTo myself In one script, I can call a detach from another?
okay thanks
@still forum do you work with, or use a headless client ?
i read that itโs possible to have multiple HC
private _units = [];
allUnits select {
private _man = _x;
if (({{_x isEqualTo _man} count crew _x > 0} count allUnitsUav) isEqualTo 0) then {
_units pushBackUnique _x;
};
};
what's the if-clause mean?
yes I do @compact maple I usually run two or 3
@quasi rover first of. That if is useless and dumb
oh thatโs nice, the perf are getting better with them ?
if player1 is equal to player1 ? lol
that code checks that the units are not in UAV's
Well. The AI reacts faster and doesn't lag as much
If that's what you mean by perf
hm Kay I was more wondering about fps in game
no then.
okay
@quasi rover that code is in general completly stupid.
private _units = allUnits select {
private _man = _x;
{_man in crew _x} count allUnitsUav == 0
};
There.
in human:
select all Units that are not inside a UAV.
Thx, if the unit is player, player can be inside a UAV? UAV is unmanned.... sorry.
uhhhh
first time I check #arma3_scripting in weeks, I see this....
yes a player can be inside a uav.
How can a human be inside a unmanned vehicle? That doesn't make sense
And he can't if you want the script to do what it was made for. Because the script clearly checks that he is NOT inside a UAV
"Breaking news: A man was seen sitting in a unmanned vehicle, was he a woman? Click now to find out"
Dunno about, Arma 3, but pretty damn sure that UAVs ported from Arma 2 still uses the old AI driver/gunner to move about.
I distinctly remember, even once fooling around in the editor to order one of them out. Like a clown car thing a dude popped out of a Pchela.
By the way, when I was killed by UAV that is operated by our side-player, I got this team-kill msg:
barnes was incapaciated by Wilson(AI) (friendly fire)
why this happened? the UAV is operated by our side player.
friendly fire is when someone from your side kills you
that's what happened.. That's what the message also says.
UAV is operated by an AI, and the AI is remoteControlled by the player
so it seems the kill got to the AI
Aha! so i was killed by the AI who is remoteControlled by the player. wow.. but actually the player pulled the trigger = LMB click.
yep, dunno much more
thx guys.
@quasi rover check this page too
https://community.bistudio.com/wiki/remoteControl
UAV open terminal has the role maybe.
This has probably been tried, however would it be possible to script a manual gearbox?
Instead of the game engine changing gears, the player has to press a button for it to continue?
2014
Okay so I can attachTo an NPC but once it is attached, it is a Null-Object. Anyone got any idea why?
you attach to the NPC. or you attachTo the NPC to something else?
I attached the NPC to my Pelvis and everything was fine in Eden but now on server its a Null Object after attaching it.