Damage Impact

Post your example zscripts/ACS scripts/etc here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Damage Impact

Post by Hey Doomer »

Another minimalist suggestion... This isn't realistic (unless Hollywood is accurate or one considers lower gravity off-Earth) but creates an opposite partial thrust based on damage, angle of attack, and mass (a monster can be punched out of the way or blown halfway across a room):

Code: Select all

class di_EventHandler : EventHandler
{
  override
  void WorldThingDamaged(WorldEvent e)
  {
	if (e.thing)
	{
		e.thing.Thrust(e.damage * 0.5 * (100 / e.thing.mass), e.damageangle);
	}
  }
}
The arbitrary 0.5 multiplier seems to work.

It does look a bit silly with infighters skating about. I haven't extensively tested this to see if a player would get stuck in a map from being pushed around by attacks. I suppose that is possible.
User avatar
WARCHILD_89
Posts: 452
Joined: Sun Nov 17, 2013 12:27 pm
Graphics Processor: nVidia with Vulkan support
Location: MIA between doomed dimensions

Re: Damage Impact

Post by WARCHILD_89 »

hint: when getting hit by a rocket, the actor always gets blown to the east, no matter from which side he gets hit.
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Damage Impact

Post by Hey Doomer »

WARCHILD_89 wrote:hint: when getting hit by a rocket, the actor always gets blown to the east, no matter from which side he gets hit.
Hmm. I wonder, is that a bug? Not sure.

Return to “Script Library”