Projectiles that inherit FastProjectile don't bounce
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
- Posts: 324
- Joined: Wed Aug 02, 2017 3:01 pm
- Location: Illinois
Projectiles that inherit FastProjectile don't bounce
I don't know if it is a bug or if it is a 'feature', but bouncing doesn't work if FastProjectile is inherited. In the demo I made, you can see that the blue fireball will not bounce!
You do not have the required permissions to view the files attached to this post.
-
- Posts: 393
- Joined: Fri Feb 07, 2014 6:45 am
Re: Projectiles that inherit FastProjectile don't bounce
I think the culprit is that fast projectiles attempt to move in Tick. They also do extra collision detection and remove themselves.
I ran into this once because I wanted a bouncing ripper projectile. I ended up removing fast projectile and just having a high velocity. (And since made it slower)
Anyway, you can probably find a way to work around it. If you just need trails you can always just spawn them in Tick in a similar way
I ran into this once because I wanted a bouncing ripper projectile. I ended up removing fast projectile and just having a high velocity. (And since made it slower)
Anyway, you can probably find a way to work around it. If you just need trails you can always just spawn them in Tick in a similar way
-
- Posts: 393
- Joined: Fri Feb 07, 2014 6:45 am
Re: Projectiles that inherit FastProjectile don't bounce
Oh, one particularly lame animation trick used in some games in the past is to make the actual effect a hitscan, apply your damage and everything, then use whatever you want to animate after the fact.
For example shoot a hitscan, and fire a really fast +NOBLOCKMAP collision projectile behind it to simulate the effect.
For example shoot a hitscan, and fire a really fast +NOBLOCKMAP collision projectile behind it to simulate the effect.
-
- Posts: 324
- Joined: Wed Aug 02, 2017 3:01 pm
- Location: Illinois
Re: Projectiles that inherit FastProjectile don't bounce
That isn't really good enough though. There should be a proper means of fixing this.
-
- Posts: 393
- Joined: Fri Feb 07, 2014 6:45 am
Re: Projectiles that inherit FastProjectile don't bounce
Since it's designed not to bounce, the proper approach would be to copy the fast projectile code and write in some exceptions. The risk of doing it any other way is that at the core of every 3d engine, collision can be affected if things move too fast. Sometimes you absolutely have to hitscan between position 1 and position 2 to make sure it works. (Or simulate movement slowly another way)
Generating a new projectile at a mirrored angle on a collision event will be your fastest path forward.
Generating a new projectile at a mirrored angle on a collision event will be your fastest path forward.
-
- Posts: 324
- Joined: Wed Aug 02, 2017 3:01 pm
- Location: Illinois
Re: Projectiles that inherit FastProjectile don't bounce
I just noticed that the wiki says bouncing doesn't work.
The zscript code for fastprojectile is one complicated piece of work! I found that coding a simpler bounce is somewhat possible. Using A_SpawnProjectile in the death state of the fastprojectile and spawning something like this (see code) works with only one problem: The projectile will noclip through targets if they are too close. Since they wouldn't ever get hit with a bounce otherwise, it is a small improvement.
The zscript code for fastprojectile is one complicated piece of work! I found that coding a simpler bounce is somewhat possible. Using A_SpawnProjectile in the death state of the fastprojectile and spawning something like this (see code) works with only one problem: The projectile will noclip through targets if they are too close. Since they wouldn't ever get hit with a bounce otherwise, it is a small improvement.
Code: Select all
ACTOR Rebound : ArachnotronPlasma {
+NOCLIP
States {
Spawn:
APLS A 0 { bNOCLIP = FALSE; }
APLS AB 5 BRIGHT
Loop
}
}
-
- Posts: 393
- Joined: Fri Feb 07, 2014 6:45 am
Re: Projectiles that inherit FastProjectile don't bounce
Awesome! Glad you have some progress.
Would reducing the radius help that problem by chance? Oh, and possibly having noclip on when it first spawns causes an unexpected sideffect.
Some projectiles have spawning issues, like Hexen's Ice Shards and the Hammer of Retribution so they do do special logic before attempting to spawn.
Would reducing the radius help that problem by chance? Oh, and possibly having noclip on when it first spawns causes an unexpected sideffect.
Some projectiles have spawning issues, like Hexen's Ice Shards and the Hammer of Retribution so they do do special logic before attempting to spawn.