Home   Help Search Login Register  

Author Topic: HIT eventhandler  (Read 5121 times)

0 Members and 1 Guest are viewing this topic.

Offline Linker Split

  • Members
  • *
  • BHD MOD leader
    • BHD MOD site
Re: HIT eventhandler
« Reply #15 on: 12 Jan 2008, 11:33:28 »
ahhh Ok I'll try it...
any chance of getting smoke when you shot at the hummer with an AK for example? cause in mogadishu all the somalis got one...
Oh, in the script I posted, I left the exit after the first line _unit = _this select 0, sorry, I mistyped it.
btw your way works cause you didn't put the exit after the getDammage condition (IMO)

See: every time a grenade hit the hummer, it should start the script, and the condition that if the damage of the unit is >= to 0.6 then it doesn't continue, but skip to the #DAMAGED label, but if the damage is < 0.6, then it should exit cause at 0.1 there's no need to have smoke coming from the engine. That's what I want to obtain... :)

Thanks for your help -h btw...

@wolfrug

well, I don't know if you know anything about our MOD, but we are trying to achieve best results in all the addon making fields (modelling, scripting, island making and so on) of course we should need also other 3d-party scripts, that's right :)
But we are also making our own... and when we will decide what to do, we will ask permission to add them :)
ArmA: Black Hawk Down MOD website
Only the dead have seen the end of war (Plato)

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: HIT eventhandler
« Reply #16 on: 12 Jan 2008, 11:51:56 »
Quote
any chance of getting smoke when you shot at the hummer with an AK for example?
That's probably a bit hard to do because apparently even the .50 cal sniper rifle doesn't trigger the hit event  :blink:
So I guess it's down to the shotBullet (or whatever it was) simulation and that's hardcoded..
But this is all BIS stock humwee, I have no idea how your humwee armor values are set. It's possible though that the armor values don't even matter..

You could use a looping script (launched by the vehicle init) to monitor the vehicle damage and add smoke when damage reaches certain level.. :dunno:

Quote
btw your way works cause you didn't put the exit after the getDammage condition (IMO)
Didn't do anything about that, just removed the premature exit I was talking about and changed the first damage check to 0.15..

I fully realise what you're trying to obtain, I've been tinkering with a hit event based thing myself recently..
The problem lays in the way BIS have made the damage handling because getDammage/getDamage/damage returns only the overall damage of the vehicle, and not the partial damage which may cause the vehicle to explode :( ..
Which is why a vehicle with low overall damage may explode because the engine has full damage, or something like that..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Linker Split

  • Members
  • *
  • BHD MOD leader
    • BHD MOD site
Re: HIT eventhandler
« Reply #17 on: 12 Jan 2008, 11:57:50 »
Ok thanks h- I'll let you know... :)
ArmA: Black Hawk Down MOD website
Only the dead have seen the end of war (Plato)

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: HIT eventhandler
« Reply #18 on: 12 Jan 2008, 12:10:36 »
Just went and tested the loop stuff by modifying your script a bit and yes, that way it is possible to make the vehicle smoke after receiving certain amount of smalls arms fire.

Be carefull with the damage amounts though, 0.6 is maybe too much because I emptied all the mags a BIS default OPFOR carries and it didn't produce smoking.. A mag or two with the 'Barret' did the trick though.
Also I think the AI is very keen on exiting damaged vehicles so the 0.6 might too much for them too.. :scratch:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Linker Split

  • Members
  • *
  • BHD MOD leader
    • BHD MOD site
Re: HIT eventhandler
« Reply #19 on: 12 Jan 2008, 12:26:03 »
yes, not it works as you said  h-.
 I add 0.4 of damage to start the script.. :)
thanks all!

Anyway, I'll continue searching some solutions to the hit eventhandler... :)

Cya all guys!
Oh and download our BETA when it will be out (in a few weeks)  :whistle: :good:

ArmA: Black Hawk Down MOD website
Only the dead have seen the end of war (Plato)

Offline Sparky

  • Former Staff
  • ****
    • Hellenic Warfare Mod
Re: HIT eventhandler
« Reply #20 on: 27 Jan 2008, 17:10:20 »
ok, here is some tip of how you can do your effec depending where you got dammage.
We created this script for HWM_huey, for the indicators on the cockpit.
Hope that helps you to take an idea.

; **************************************************************
; **HWM script for damage indigators for Huey **      v1 1 Dec 2007
; **this is for HWM-HAC  USE**
; **DO NOT modify or use with out asking us, we like to know **
; **contact us at hac@unreal.gr **
; **************************************************************

_uh1h = _this select 0
;;##debug##
_section = _this select 1
_dmg = _this select 2


if (_section == "mala vrtule") then {goto "indic01"};
if (_section == "velka vrtule") then {goto "indic02"};
if (_section == "engine") then {goto "indic03"};
if (_section == "flaps") then {goto "indic04"};
if (_section == "electronics") then {goto "indic05"};
if (_section == "body") then {goto "indic06"};
if (_section == "deposit") then {goto "indic07"};
exit;

#indic01
code.....
exit;

#indic02
code.....
exit;

#indic03
code.....
exit;

#indic04
code.....
exit;

#indic05
code......
exit;

#indic06
code.......
exit;

#indic07
code.......
exit;


you can call it like this

dammaged = "_this exec ""\HWM_Core\scripts\dammage.sqs"";";

now what you should have...
in order to work correct each component should be defined with class hit inside the vehicles config.
class HitHull {
         armor = 1;
         material = 51;
         name = "body";
         visual = "body";
         passThrough = 1;
      };
      class HitEngine {
         armor = 0.5;
         material = 51;
         name = "engine";
         visual = "engine";
         passThrough = 1;
      };
      class HitAvionics {
         armor = 0.25;
         material = 51;
         name = "electronics";
         visual = "electronics";
         passThrough = 0;
      };
      class HitVRotor {
         armor = 0.3;
         material = 52;
         name = "mala vrtule";
         visual = "mala vrtule";
         passThrough = 0;
      };
      class HitHRotor {
         armor = 0.2;
         material = 52;
         name = "velka vrtule";
         visual = "velka vrtule";
         passThrough = 0;
      };
      class HitFuel {
         armor = 1.4;
         material = 51;
         name = "deposit";
         visual = "deposit";
         passThrough = 1;
      };
      class HitMissiles {
         armor = 0.4;
         material = 59;
         name = "flaps";
         visual = "flaps";
         passThrough = 0;
      };


also the appropriate selection should be made in the p3d.

NOTICE.
i've notice that damaged event handler is triggered for values above 0.5.
also you can use _dmg = _this select 2 line in the script, to check the value of damage that triggers the event handler.
example add to each code block, the line
hint format["section = %1 damage = %2",_section,_dmg];

anyway i know it sounds complicated but it's not, basicaly this way you can identify the section that is dammaged and do what you like.
for example the engine of the nummer.
PLUS BIS has already give the Hummer in MLOD together with the model.cfg file, so you can see the selection names in the config and adopt them in your script.