Duke4.net Forums: moving sprites getting tossed by explosions is there a code to make it not get tossed? - Duke4.net Forums

Jump to content

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

moving sprites getting tossed by explosions is there a code to make it not get tossed?

User is offline   Zaxtor 

#1

You know if any sprites has move NAME getv etc.
Rather it has ifhitweapon or not it doesn't make any difference.
They get tossed a short distance depending on explosion force if you hit them with RPG, PIPEBOMB etc.

it will get tossed (thrown) from an explosion while is moving but not tossed if not moving.

Is there a code to put in a custom moving sprite so it doesn't get tossed when it get hit by exploding projectiles?
0

User is offline   Danukem 

  • Duke Plus Developer

#2

I still don't know which sprites are you talking about. Can you give some examples?
0

User is offline   Mark 

#3

I'm sure you have way more con coding knowledge than I do but I'll offer a suggestion anyway. :)

add the line move stayput 0

In the area of code where you check for weapon hits

ifhitweapon
{
ifwasweapon RADIUSEXPLOSION
{
move stayput
}
else .....

You probably have other lines and brackets in and after the ifwasweapon line but I kept it short for the example. I haven't tried it but it might work. Maybe its all for nothing if hardcoded behavoir overwrites this.

EDIT: It might work because I tried it out on a custom enemy of mine that would move away when getting kicked. Now it stays in place while I'm kicking.

This post has been edited by Mark.: 30 May 2014 - 12:38 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#4

I reread the OP and I understand the problem now. Mark's solution will make the sprite stop moving after the explosion. That might not be what he wants, since the problem involves sprites that are already moving...he might want them to continue their motion without being affected by the explosion.
0

User is offline   Zaxtor 

#5

View PostTrooper Dan, on 30 May 2014 - 01:53 PM, said:

I reread the OP and I understand the problem now. Mark's solution will make the sprite stop moving after the explosion. That might not be what he wants, since the problem involves sprites that are already moving...he might want them to continue their motion without being affected by the explosion.


What if it get hit during when it moves up or down will it get stopped?

Thing is I want so when it get hit while it moves, it continue moving but doesn't get tossed away from the radius.
0

User is offline   Mark 

#6

My simple move solution only stops horizontal movement. Because your sprite is moving vertically it might work. Its simple enough to easily try.

This post has been edited by Mark.: 30 May 2014 - 04:20 PM

0

User is offline   Zaxtor 

#7

View PostMark., on 30 May 2014 - 04:19 PM, said:

My simple move solution only stops horizontal movement. Because your sprite is moving vertically it might work. Its simple enough to easily try.


Ok I'll try since my thing strictly goes vert up and vert down.

PS
tried and it doesn't work.

This post has been edited by Zaxtor: 30 May 2014 - 07:30 PM

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