I swear it's been done...lower viewheight in water?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

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.

I swear it's been done...lower viewheight in water?

Postby rabidrage » Mon Apr 05, 2021 4:47 pm

I can't find or recall what mod it was in, but I swear there was one where your viewheight would be reduced if you were standing on a liquid texture, like you were actually standing in a deep liquid. I've studied the Terrain lump and the wiki, but I don't know how to implement it. Does anybody know how to do this?
rabidrage
 
Joined: 28 Oct 2014

Re: I swear it's been done...lower viewheight in water?

Postby Jarewill » Mon Apr 05, 2021 11:09 pm

TERRAIN lump is the way to do this. footclip property to be exact:
Code: Select allExpand view
terrain WaterClip //Define the terrain type
{
    footclip        12 //You can change 12 to any value you want
}
floor FWATER1 WaterClip Then you have to assign this value to all liquid flats, this only covers the liquid flats
floor FWATER2 WaterClip
floor FWATER3 WaterClip
floor FWATER4 WaterClip

Then you have to give the player the FLOORCLIP flag.
If you don't want to modify the player class, you can use a script to do it:
Code: Select allExpand view
Script "AssignFloorClip" ENTER
{
    SetActorFlag(0,"FLOORCLIP",1);
}
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: I swear it's been done...lower viewheight in water?

Postby rabidrage » Tue Apr 06, 2021 4:01 pm

Sounds like a lot if you're using the PBR liquids patch. Still, it'll be worth it. Thank you!
rabidrage
 
Joined: 28 Oct 2014

Re: I swear it's been done...lower viewheight in water?

Postby rabidrage » Tue Apr 06, 2021 4:09 pm

Okay, only thing is that it's coming up saying "unknown keyword 'floor'".
rabidrage
 
Joined: 28 Oct 2014

Re: I swear it's been done...lower viewheight in water?

Postby Jarewill » Tue Apr 06, 2021 11:41 pm

That's weird.
Could you show how you did it?
Is it in the TERRAIN lump?

I realised I somehow forgot to comment out the text after the first floor, it has to be removed if it was copied alongside the rest.
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: I swear it's been done...lower viewheight in water?

Postby rabidrage » Wed Apr 07, 2021 2:54 pm

Actually, I finally got it to work (or realized it was working, but very subtly). Not sure I get it entirely, but the version of the Terrain lump I have comes from a mod that includes it in both a lump in the PK3 and a lump in a WAD in the same PK3. They work together, kind of. It's weird.
rabidrage
 
Joined: 28 Oct 2014


Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests