Hello. I'm facing a strange phenomenon related to FallandSink. The goal is making a non-monster actor that can be damaged and float on the water.
This code works for all monster actors as well, so I thought it also works for frozen actors, then it didn't work like monsters.
It's strange that the frozen actor keeps height and floats on the water when it's far from the player, but when the player closes to the frozen actor, suddenly it starts bobbing. I have no idea why its behavior changes by the player's position from the actor.
Probably the float bob isn't the reason for this problem. If the cause is FLOATBOB or FloatBobStrength, then it must bob continually.
I've never seen overridden FallandSink code as far as I know, so any help or hint appreciated!
[EDIT] Aha... I found the bobbing speed is affected by FloatSpeed's value. Still don't know why the frozen actor bobs only when the player closes to it. Not sure though, the frozen actor starts bobbing within approximately 100 units of the center of the frozen actor.
[SOLVED]FallAndSink question[zscript]
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!)
[SOLVED]FallAndSink question[zscript]
Last edited by Laskow on Fri Dec 13, 2024 5:57 am, edited 2 times in total.
Re: FallAndSink question[zscript]
Agh, another hard-coded underwater physics... The cause is this code in p_mobj.cpp.
https://github.com/ZDoom/gzdoom/blob/ma ... .cpp#L2401
https://github.com/ZDoom/gzdoom/blob/ma ... .cpp#L2401
Last edited by Laskow on Fri Dec 13, 2024 5:57 am, edited 1 time in total.
Re: [SOLVED]FallAndSink question[zscript]
That's some very oddly-specific hardcoded behavior. I wonder why was that added...
-
- Posts: 256
- Joined: Mon Jan 09, 2023 2:02 am
- Graphics Processor: nVidia (Modern GZDoom)
Re: [SOLVED]FallAndSink question[zscript]
That fragment is the original implementation for the MF_FLOAT flag, but it looks like it never got any handling added for dealing with the case where a dead item is suspended in mid-air/water and no gravity being applied.