"Tilt" complete level?

Ask about mapping, UDMF, using DoomBuilder/editor of choice, etc, 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.
User avatar
Tormentor667
Posts: 13549
Joined: Wed Jul 16, 2003 3:52 am

"Tilt" complete level?

Post by Tormentor667 »

Hey Doomers, I have a very specific idea for a map and I need some help scriptwise with it: Would it be possible to somehow generate the illusion of a slowly sinking ship, that tilts while sinking by using the camera roll/pitch of the player camera? I think the special thing about it is, that it also needs to consider the direction, the player is turning, so the tilting always gets adjusted.

Anyone an idea on how to do that?
User avatar
Caligari87
Admin
Posts: 6191
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: "Tilt" complete level?

Post by Caligari87 »

I actually did that exact thing here: viewtopic.php?f=3&t=50334

It's a very rough proof-of-concept, but it should be enough to go on. While I used a fixed angle/pitch for the tilt, you could easily adapt this to use a changing pitch/angle to gradually increase the amount of tilt, or even make an oscillating tilt for waves or something.

8-)
User avatar
Tormentor667
Posts: 13549
Joined: Wed Jul 16, 2003 3:52 am

Re: "Tilt" complete level?

Post by Tormentor667 »

Hah, perfect, exactly what I need :) Thanks kindly man!

download/file.php?id=24543
User avatar
KeksDose
 
 
Posts: 596
Joined: Thu Jul 05, 2007 6:13 pm
Location: my laboratory

Re: "Tilt" complete level?

Post by KeksDose »

There's a small bug. You can look "very far" up and lock your view until you look down enough. It's just the true_pitch variable going out of the -0.25 to 0.25 range, so clamp it like this:

Code: Select all

if(true_pitch < -0.25) {
   true_pitch = -0.25;
}

else if(0.25 < true_pitch) {
   true_pitch = 0.25;
}
and it should work nicely (except probably software, but it also probably doesn't matter :p).

Also note it won't work in multiplayer, but that's easily fixed by making true_pitch local and just copying the GetPlayerInput line over to the other script.
User avatar
Ravick
Posts: 2033
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil

Re: "Tilt" complete level?

Post by Ravick »

(LOL, it was kinda funny, because I've just left this this thread, wich is about a problem in a map in wich I use CALIGARI_87's script to do exactly the same fake effect of a sinking ship! Coincidence! XD )

Ok, it doesn't help at all. Sorry! :B
User avatar
Tormentor667
Posts: 13549
Joined: Wed Jul 16, 2003 3:52 am

Re: "Tilt" complete level?

Post by Tormentor667 »

KeksDose wrote:There's a small bug.
Where do I need to put that? :)

@Ravick - Well, one thing I can tell you: It's not for the ship :-D

Return to “Mapping”