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?
"Tilt" complete level?
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.
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.
-
- Admin
- Posts: 6191
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
Re: "Tilt" complete level?
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.
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.
-
- Posts: 13549
- Joined: Wed Jul 16, 2003 3:52 am
-
-
- Posts: 596
- Joined: Thu Jul 05, 2007 6:13 pm
- Location: my laboratory
Re: "Tilt" complete level?
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:
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.
Code: Select all
if(true_pitch < -0.25) {
true_pitch = -0.25;
}
else if(0.25 < true_pitch) {
true_pitch = 0.25;
}
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.
-
- Posts: 2033
- Joined: Sun Aug 22, 2010 10:59 pm
- Location: Tubarão, Brasil
Re: "Tilt" complete level?
(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
Ok, it doesn't help at all. Sorry! :B
-
- Posts: 13549
- Joined: Wed Jul 16, 2003 3:52 am
Re: "Tilt" complete level?
Where do I need to put that?KeksDose wrote:There's a small bug.
@Ravick - Well, one thing I can tell you: It's not for the ship