[DECORATE] Underwater options

Moderator: GZDoom Developers

Post Reply
User avatar
Daniel
Posts: 811
Joined: Sun Jul 04, 2004 3:21 pm
Contact:

[DECORATE] Underwater options

Post by Daniel »

Hello,

I've tried to make some objects which change behaviour on undewater using A_JumpIf, but I miss some global variables that should help the editing. With the actual code, we must make objects that call A_JumpIf always. So, the idea is creating some Underwater options, maybe to put into the MAPINFO lump (or DECORATE, if you do prefer, then we could do different configs to varius objects). Here they are:

UnderwaterEffect = [x]
can be 0, 1, 2, 3 according to how much the object is submerge (just like in A_JumpIf)
UnderwaterFlags = [flags]
we could add some flags, such as FLOATBOB or LOWGRAVITY, to make some desired effects.
UnderwaterGravity = [factor]
the multiplied gravity factor for underwater effect (0.5 for example)

With this, we could make monsters that float only underwater (for example: a fish)

Hope this should help!

EDIT: or the addition of the following flags should also help:
+UNDERWATER.FLOATBOB
+UNDERWATER.LOWGRAVITY
etc.
So, the only variable to be added should be UnderwaterEffect [x]
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [DECORATE] Underwater options

Post by Graf Zahl »

The only thing here that might have a chance is the gravity. The rest is 'no'd.
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Re: [DECORATE] Underwater options

Post by Cutmanmike »

Actually that's a good idea, but how does gravity work underwater right now? I.e if I dropped an imp in the water he wouldn't sink to the bottom would he?
User avatar
FuzzballFox
Posts: 1905
Joined: Thu Jan 24, 2008 10:19 am
Location: Hampshire UK

Re: [DECORATE] Underwater options

Post by FuzzballFox »

Cutmanmike wrote:Actually that's a good idea, but how does gravity work underwater right now? I.e if I dropped an imp in the water he wouldn't sink to the bottom would he?
Could be used for different viscosities in liquids..."Blood is thicker than water" as the saying goes...;D
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [DECORATE] Underwater options

Post by Graf Zahl »

Cutmanmike wrote:Actually that's a good idea, but how does gravity work underwater right now? I.e if I dropped an imp in the water he wouldn't sink to the bottom would he?

It doesn't use gravity but a different (hardcoded) value called SINK_SPEED.
User avatar
Daniel
Posts: 811
Joined: Sun Jul 04, 2004 3:21 pm
Contact:

Re: [DECORATE] Underwater options

Post by Daniel »

If underwater gravity is a negative value, the object will move up, I guess... so, when it surpass the water surface, it will be affected by normal gravity... so it would be like the real force on water, woudn't?
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Re: [DECORATE] Underwater options

Post by CaptainToenail »

Are you trying to make objects such as boxes and barrels float in water? If so, you could use ThrustThingZ in combination with A_JumpIf(waterlevel and possibly A_Stop when it reaches the surface
User avatar
Daniel
Posts: 811
Joined: Sun Jul 04, 2004 3:21 pm
Contact:

Re: [DECORATE] Underwater options

Post by Daniel »

Yes, but the problem is if we make this on monsters, A_JumpIf should be used every time; it will interrupt the monster activity for sure. For barrels it is quite easy. Thanks for the tip anyway.
User avatar
David Ferstat
Posts: 1113
Joined: Wed Jul 16, 2003 8:53 am
Location: Perth, Western Australia
Contact:

Re: [DECORATE] Underwater options

Post by David Ferstat »

Graf Zahl wrote:
Cutmanmike wrote:Actually that's a good idea, but how does gravity work underwater right now? I.e if I dropped an imp in the water he wouldn't sink to the bottom would he?

It doesn't use gravity but a different (hardcoded) value called SINK_SPEED.
Graf, what's involved in exposing SINK_SPEED to ACS?
User avatar
David Ferstat
Posts: 1113
Joined: Wed Jul 16, 2003 8:53 am
Location: Perth, Western Australia
Contact:

Re: [DECORATE] Underwater options

Post by David Ferstat »

Sorry for the bump, but I think Graf missed my question.:

Graf, what's involved in exposing SINK_SPEED to ACS?
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”