Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
r_rr

undulating water effect... possible?

Recommended Posts

I gotta hard one for ya. May not even be possible. :O

I'm working on a "boat" map. I am trying to get the effect of
undulating water. I first tried making a simple slope change it's incline in-game by changing the height of the floor it was aligned to, but I discovered that the slope does not change. Is it possible to change a slopes incline in-game?

Are there other ways of giving the illution of undulating water?

Share this post


Link to post

gggmork released a map on these forums of a few random things he'd been working on. one of the levels has a very convincing looking water/wave effect, check it out

Share this post


Link to post

I think he's using zdoom (in hexen format) though and floor waggle probably looks better/smoother for water than moving boom floors (and if I'm not mistaken it can be set to not make a lot of annoying noise).

You might try making long horizontal wave sectors:

222222222222222222222222222
3333333333333X3333333333333
444444444444XXX444444444444
555555555555XXX555555555555
666666666666XXX666666666666
777777777777XXX777777777777
222222's are a long horizontal sector. So are 3333's etc. X's is debris like a boat or whatever between them. (so 444's are merged to be same sector as 4444's on opposite side etc).

Then maybe code like this (but fiddle with it until it looks like water more I guess).
script 21 OPEN {
 while(1){
  floor_waggle(2,100,100,10,10);
  floor_waggle(3,100,100,15,10);
  floor_waggle(4,100,100,20,10);
  floor_waggle(5,100,100,25,10);
  floor_waggle(6,100,100,30,10);
  floor_waggle(7,100,100,35,10);
  delay(20);
 }
}



I tried to make slopes move in-game once and didn't work either. Also I don't think you can slope FROM a slope (like the next slope can't slope in 2 directions at once, or maybe I'm wrong).

Share this post


Link to post

Thanks guys. The floor waggle has a very realistic effect after I played around with the code for a while.

I also found another interesting thing:
I simply made 10 rooms (easy copypaste), each with an increasing slope (I used doombuilder's gradient floors for this). I then put mapspots in each room and a skybox viewpoint in one. I then used ACS script to move the viewpoint during gameplay.

script 1 OPEN
{
thing_move(1,2,1);
delay(5);
thing_move(1,3,1);
delay(5);
thing_move(1,4,1);
delay(5);
restart;
} 
This is a shortened code so I don't take up the whole page, but you can see where im going with it. Skybox viewpoint is tagged 1, I simply used thing_move to rapidly move the skybox viewpoint back and fourth through the rooms with increasing and decreasing slopes, almost like a movie. The more slope rooms I make, the smoother the slope will (appear) to move. This gives a "rocking ship" effect, even though the ship is not actually moving. I'll post some screenshotssoon

Share this post


Link to post

That's a cool idea. I tried but only got some half working HOM filled thing (I'm using teleport destinations to thing_move the camera.. and the camera moves up and down since the waves move up and down which seems to cause the HOMS).

Share this post


Link to post
r_rr said:

Thanks guys. The floor waggle has a very realistic effect after I played around with the code for a while.

I also found another interesting thing:
I simply made 10 rooms (easy copypaste), each with an increasing slope (I used doombuilder's gradient floors for this). I then put mapspots in each room and a skybox viewpoint in one. I then used ACS script to move the viewpoint during gameplay.

script 1 OPEN
{
thing_move(1,2,1);
delay(5);
thing_move(1,3,1);
delay(5);
thing_move(1,4,1);
delay(5);
restart;
} 
This is a shortened code so I don't take up the whole page, but you can see where im going with it. Skybox viewpoint is tagged 1, I simply used thing_move to rapidly move the skybox viewpoint back and fourth through the rooms with increasing and decreasing slopes, almost like a movie. The more slope rooms I make, the smoother the slope will (appear) to move. This gives a "rocking ship" effect, even though the ship is not actually moving. I'll post some screenshotssoon


I would love to see the actual level, though it's fine if you don't want to give too much away. Sounds like a really neat idea tho. Interested to see where this goes.

Share this post


Link to post

Here is what I've gotten to work so far.

It's nowhere near perfect, but it's a start. I only tested this in the latest version of Skulltag 98a.

I made the sky black like the night, because having a sky that is in a fixed position would take away from the "rocking" effect. I've used a "skybox within a skybox" kind of setup for this. I've simply move the skybox viewpoint like explained above, but I also have a bigger skybox for the "far out" part of the water. I put skybox pickers in all of the slope rooms I created.

Share this post


Link to post

On another note, this ship map that I'm working on is going to have a functional fog horn using a simple "thingsound" script. Is there a way to make it so players can only push the horn switch every 30 seconds or so? Or at least put a timeperiod where the script will not activate? (I don't want players spamming the hell out of the foghorn.)

Share this post


Link to post

There's probably a cleaner way to do it or something, but here's the code I used to prevent a sound effect in MAP06 of SPACEDM5 from playing in quick succession. You can adjust the delay time as desired.

#include "zcommon.acs"

int jetsice;

script 1 (void)
{
	if(jetsice == 0)
	{
		jetsice++;

		// *SLAP SLAP SLAP SLAP WOOBWOOBWOOBWOOBWOOB!*
		ActivatorSound("JetsIce", 128);

		delay(80);
		jetsice--;
	}
}
Though, actually, if the sound can only be triggered from one linedef, rather than several of them like in the setup I have, you could just do

#include "zcommon.acs"

script 1 (void)
{
	// *SLAP SLAP SLAP SLAP WOOBWOOBWOOBWOOBWOOB!*
	ActivatorSound("JetsIce", 128);

	delay(80);
	}
}
as long as you're using ACS_Execute rather than ACS_ExecuteAlways.

...or maybe it'd be the same even if you could activate it from multiple spots? I don't know, I wrote the code years ago and like I said it probably could have been done better. Either way, the simplified second setup there should work for your purposes, I think.

Share this post


Link to post

Works great, thanks. I just used the simple version since it's only one switch that can activate the sound.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×