In zscript I have a projectile based on VolcanoBlast. It has gravity 0.125 and almost all of the same properties. This is a standard projectile with gravity, not a bouncey projectile.
I want it to disappear if it hits water.
My understanding is that removing the related water flag (-EXPLODEONWATER) only works if it is considered a bounce projectile.
So my question is: how do I get this projectile to explode on floors but disappear in water?
Thanks!
Non bounce projectile disappear in water
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: 407
- Joined: Fri Feb 07, 2014 6:45 am
-
- Posts: 407
- Joined: Fri Feb 07, 2014 6:45 am
Re: Non bounce projectile disappear in water
As an update, I am using a workaround. It is now a bouncey projectile, but I have it emulate a normal projectile impact
Spoiler:
-
- Posts: 95
- Joined: Wed Dec 15, 2021 8:38 pm
- Graphics Processor: nVidia (Modern GZDoom)
Re: Non bounce projectile disappear in water
There is a variable "waterlevel" that you can use to check if the projectile is underwater, and if true, you can have it make your projectile disappear.
Code: Select all
VFBL A 0
{
if (waterlevel > 0)
{
return ResolveState("Disappear");
}
return ResolveState(null);
}
Re: Non bounce projectile disappear in water
I usually go for a slightly simply syntax:
For what it's worth, this page explains the values for waterlevel:
https://zdoom.org/wiki/Swimming#Waterlevel
However, I note that the original query says "I want it to disappear if it hits water", although the title says "in water". So, if peewee_RotA wants the projectile to disappear when it hits regular non-deep water (like the liquids in vanilla Doom maps) I don't think waterlevel will help.
Code: Select all
FLRE A 0 A_JumpIf(waterlevel > 0, "Spent"); //jump straight to spent if under water
https://zdoom.org/wiki/Swimming#Waterlevel
However, I note that the original query says "I want it to disappear if it hits water", although the title says "in water". So, if peewee_RotA wants the projectile to disappear when it hits regular non-deep water (like the liquids in vanilla Doom maps) I don't think waterlevel will help.
-
- Posts: 407
- Joined: Fri Feb 07, 2014 6:45 am
Re: Non bounce projectile disappear in water
That's for the info.
I'm targeting vanilla heretic maps. I'll give it a try.
I'm targeting vanilla heretic maps. I'll give it a try.