Search the Community
Showing results for tags 'ewk'.
Found 2 results
-
Trouble WIth EventHandler and model animation.
mrewok posted a topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Unwanted Double post sorry... Moderators can you delete this topic please (or tell me how to delete it). -
Hello there i'm having issues with BIS_fnc_relativeDirTo (the purpose is to create a boomerang system that will have a animated led 3d model in my HMMWV's like my crewduke) , my problem is that it is spamming some random 90, 180, 270 values... (maybe not random but i don't get why i got those values) here is a video (don't mind the generic error i've added a sleep in a unscheduled environment but the detection weirdly seems to work better (Probably just a placebo effect i think^^)) As you can see i have some random values coming in... Video showing my problem For now the script is init by a module (Will add action to add it and activate it later): /* sys_boomerang_animate.sqf Author(s): MrEwok Description: This Animate (for now) the boomerang system and run Boomerang script collection. Note : None. FilePath: \EWK_Boomerang_System\Scripts\sys_boomerang_animate.sqf */ _car = _this select 0; _car animate ["SYS_boomerang", 0]; ////////////////////////////////////////////For Boomerang System/////////////////////////////////////// [_car] execVM "\EWK_Boomerang_System\Scripts\Ewk_Boomerang_Eh.sqf"; waitUntil {!alive _car}; _car animate ["SYS_boomerang", 1]; [_car] execVM "EWK_Boomerang_System\Module\boomerang\sys_boomerang_animate.sqf"; And then it run this script : /* Ewk_Boomerang_Eh.sqf Author(s): MrEwok Description: This Apply FiredNearEH for Boomerang detection. Note : None. FilePath: \EWK_Boomerang_System\Scripts\Ewk_Boomerang_Eh.sqf */ ///////////////////////////////////////////For Boomerang System/////////////////////////////////////// /* this addEventHandler ["FiredNear", { params ["_unit", "_firer", "_distance", "_weapon", "_muzzle", "_mode" , "_ammo", "_gunner"]; }]; */ vclBoomerang = _this select 0; vclBoomerang addEventHandler ["FiredNear", { if ((_this select 2) < 100/*Need To Adjust*/) then { _Shooter = _this select 0; _gunner = _this select 7; hint str _gunner; { _relDir = [_Shooter, vclBoomerang] call BIS_fnc_relativeDirTo; if ( _relDir > (_x select 0) && _relDir < (_x select 1) ) then { sleep 0.5; // This is the Generic error in the video... systemChat format["Shooter is at %1 from the Vehicle",(_x select 2)]; systemChat str _relDir; }; }forEach [ ///////////////////////////////////////////This Was Working but not precise enough/////////////////////////////////////////// /* !!!Basic detection system decrepited!!! [45, 135, "to the right of"], [135, 225, "behind"], [225, 315, "to the left of"], [315, 360, "infront"], [0, 45, "infront"] */ ///////////////////////////////////////////This Was Working END/////////////////////////////////////////// [0, 15, "12 oclock"], [-0, -15, "12 oclock"], //0 = 12 donc 0 a 15 [15, 45, "1 oclock"], [-15, -45, "1 oclock"], //30 = 1 donc 15 a 45 [45, 75, "2 oclock"], [-45, -75, "2 oclock"], //60 = 2 donc 45 a 75 [75, 105, "3 oclock"], [-75, -105, "3 oclock"], //90 = 3 donc 75 a 105 [105, 135, "4 oclock"], [-105, -135, "4 oclock"], //120 = 4 donc 105 a 135 [135, 165, "5 oclock"], [-135, -165, "5 oclock"], //150 = 5 donc 135 a 165 [165, 195, "6 oclock"], [-165, -195, "6 oclock"], //180 = 6 donc 165 a 195 [195, 225, "7 oclock"], [-195, -225, "7 oclock"], //210 = 7 donc 195 a 225 [225, 255, "8 oclock"], [-225, -255, "8 oclock"], //240 = 8 donc 225 a 255 [255, 285, "9 oclock"], [-255, -285, "9 oclock"], //270 = 9 donc 255 a 285 [285, 315, "10 oclock"], [-285, -315, "10 oclock"], //300 = 10 donc 285 a 315 [315, 345, "11 oclock"], [-315, -345, "11 oclock"], //330 = 11 donc 315 a 345 [345, 360, "12 oclock"], [-345, -360, "12 oclock"] //360 = 12 donc 345 a 360 ]; }; }]; Please help me! I don't wan't to release my mod without that feature even if it's a little bit harsh (in fact i could already add the boomerang v2 and say "it's the V2 V3 is better ... but i wan't to add a real V3 and make an alternative version for V2 that's add some kind of randomness if some mission maker want to make it harder ). I can provide more info if needed (config or basic models with cfg and cpp to reproduce...)...
- 11 replies
-
- bis_fnc_relativedirto
- ewk
- (and 6 more)