Unit hit detection
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Unit hit detection
Is there any way for a script to know when a unit has been hit by a weapon?
I think it would be kinda neat to script in a rocking effect for when unit are hit by large damageweapons.
I think it would be kinda neat to script in a rocking effect for when unit are hit by large damageweapons.
Re: Unit hit detection
- HitByWeaponId(z,x,id,damage) will be called instead of HitByWeapon if it exist
In the changelog, it works, you just have to define ids for your weapons.
In the changelog, it works, you just have to define ids for your weapons.
Re: Unit hit detection
Note that multiple weapons can have the same ID;
e.g. All S44 Armour-Piercing rounds have id=100
e.g. All S44 Armour-Piercing rounds have id=100
Re: Unit hit detection
BTW, you can just use RockUnit like the OTA units do, the engine will call that by itself.
Re: Unit hit detection
Are the pseudo angles in RockUnit right for weapon hits? RockUnit gets called whenever a weapon is fired too btw.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Unit hit detection
yar rockunit would work just fine. Thanks guys!
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
Re: Unit hit detection
I wonder if it would be possible to somehow use rockunit while the unit is firing to make it rock in the appropriate direction from kickback...
Re: Unit hit detection
im pretty sure some of the CA units do this already
- clumsy_culhane
- Posts: 370
- Joined: 30 Jul 2007, 10:27
Re: Unit hit detection
t1 artillery in CA uses it.
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
Re: Unit hit detection
That was possible in good old TA ZsinjWarlord Zsinj wrote:I wonder if it would be possible to somehow use rockunit while the unit is firing to make it rock in the appropriate direction from kickback...

-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
Re: Unit hit detection
Indeed, I know it was in OTA, but I hadn't seen any mods use it in Spring.
Re: Unit hit detection
I stopped using it because the "angles" are useless for tanks, unless you are fine with them wiggling in the wrong direction, and I was too lazy to write my own script which takes body and turret rotation into account. Though I think S44 got it right.