Duke4.net Forums: RPG's & Explosive stuff push Enemy's towards you. - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

RPG's & Explosive stuff push Enemy's towards you.

#1

RPG's & Explosive stuff push Enemy's towards you.

I know this is a bug with the original Duke 3d and not Eduke32. I know I've see a post on this, or so some other duke forums that had a fix for it but can't find it now ( well i'm at lest 90% sure there was a fix). So can anyone tell me how to fix this or where to get the fix.Would have thought this would be fixed with Eduke32, but I guess there's been more important things to do.

This post has been edited by -=SomeThingEviL=-: 05 February 2014 - 03:44 AM

0

User is online   Danukem 

  • Duke Plus Developer

#2

View Post-=SomeThingEviL=-, on 04 February 2014 - 04:57 AM, said:

RPG's & Explosive stuff push Enemy's towards you.

I know this is a bug with the original Duke 3d and not Eduke32. I know I've see a post on this, or so some other duke forums that had a fix for it but can't find it now ( well i'm at lest 90% sure there was a fix). So can anyone tell me how to fix this or where to get the fix.Would have thought this would be fixed with Eduke32, but I guess there's been more important things to do.


Yeah, there is a fix for this that I use in my mods. The buggy behavior is a result of the xvel member of the sprite getting set to a positive value when the sprite takes damage from an explosive. What you have to do is have the actor's code check htextra and htpicnum. If htextra (damage) is >0 and htpicnum (weapon type) is either RPG or RADIUSEXPLOSION, then you reset xvel (velocity) to a new value. One simple method is to multiply xvel by -1, which will cause the actor to move backwards instead of forwards. Note that this all has to be done before the actor uses the ifhitweapon command, which will clear the htextra value.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #3

View PostTrooper Dan, on 05 February 2014 - 01:59 PM, said:

Note that this all has to be done before the actor uses the ifhitweapon command, which will clear the htextra value.

EVENT_PREGAME should work for this.
2

User is online   Danukem 

  • Duke Plus Developer

#4

View PostHendricks266, on 05 February 2014 - 06:50 PM, said:

EVENT_PREGAME should work for this.


Oh, that's good. I don't think that event existed the last time I was coding.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#5

View PostTrooper Dan, on 05 February 2014 - 01:59 PM, said:

Yeah, there is a fix for this that I use in my mods. The buggy behavior is a result of the xvel member of the sprite getting set to a positive value when the sprite takes damage from an explosive. What you have to do is have the actor's code check htextra and htpicnum. If htextra (damage) is >0 and htpicnum (weapon type) is either RPG or RADIUSEXPLOSION, then you reset xvel (velocity) to a new value. One simple method is to multiply xvel by -1, which will cause the actor to move backwards instead of forwards. Note that this all has to be done before the actor uses the ifhitweapon command, which will clear the htextra value.

(All weapon types can push enemies.) The actual problem is that the angle which the enemies is pushes away is the same it is facing. Instead movesprite should be used...

This post has been edited by Fox: 05 February 2014 - 08:45 PM

0

User is online   Danukem 

  • Duke Plus Developer

#6

View PostFox, on 05 February 2014 - 08:45 PM, said:

(All weapon types can push enemies.) The actual problem is that the angle which the enemies is pushes away is the same it is facing. Instead movesprite should be used...


That's good to know, but in practice the bug is only noticeable for explosives. I do actually use movesprite for knockback in some of my mods, but reversing xvel is a quick and dirty fix that gives acceptable results.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options