Water

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Indianajones
Colour Sergeant
Posts: 86
Joined: Sat Aug 20, 2005 1:14 pm

Water

Post by Indianajones »

How do I make the water on this map flow round a corner this is how it looks at the moment. :cry:

Image

the water is rising up the side and then flows level, do I need to join the 2 water textures together????
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Only texture the top and bottom of water volumes with a water texture, and place nodraw on the sides. And to make a bend, I'd suggest this, but replace the road texture with a water texture.
Also, as it is problematic to make a water volume with patch mesh: place a waterskip textured brush under it.
Admin .MAP Forums
Image
Head above heels.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

45

Post by tltrude »

You could also cut those two water brushes at 45 degrees--use common/nodraw on the side faces, but not on the top and bottom faces. One of the face textures will have to be rotated to get the flow direction correct. Also, remember that the water brushes should extend below the bottom of the canal floor--the bottom of the water brush should not be seen, but still textured. It is ok to overlap surrounding brushes with water brushes.

__________
|.\................
|...\________
|....|
|....|
|....|
|....|
Tom Trude,

Image
User avatar
Indianajones
Colour Sergeant
Posts: 86
Joined: Sat Aug 20, 2005 1:14 pm

Post by Indianajones »

also how can I make it so when you fall in the water you drown.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Create a file named death_water.scr and place it in the global folder. Then follow the instructions in the comments.

Code: Select all

//*************************************************
//*** death_water script
//*** modifed version of the MOHAA minefield
//*** modifed by Duncan Weir May 2002
//*** The player enters the water, and within 10 secs
//*** if he's still in the water he'll start to drown.
//
//*** The main thread is called by this script and should not be called by the
//*** level script itsself.  Use "exec global/death_water.scr::deathwater_setup"
//*** in your level script and place this script in global.
//
//*** syntax ------------------------------------
//
//	trigger_multiple settings
//	targetname = deathwater<index number for the array of deathwater triggers>
//	#startdrowntime = set to number of seconds a player can be in the water
//                                         before drowning starts // default 10
//	#timetodrown = set to number of seconds a player takes to 
//                                     drown // default 10
//*************************************************
deathwater local.index:

	thread debugtext ("THREAD: deathwater = " + local.index)

	if ($deathwater[local.index].startdrowntime == NIL)
		local.startdrowntime = 10
	else
		local.startdrowntime = $deathwater[local.index].startdrowntime

	if ($deathwater[local.index].timetodrown == NIL)
		local.timetodrown = 10
	else
		local.timetodrown = $deathwater[local.index].timetodrown

	local.radius = 40 // radius of the damage - only in local player area
	thread debugtext ("  Radius = " + local.radius)
	local.damage = 100 / local.timetodrown // calculate damage per second
	thread debugtext ("  Damage = " + local.damage)

	deathwater_loop:
		thread debugtext "THREAD: deathwater_loop"
		$deathwater[local.index] waittill trigger 
		local.sucker = parm.other // gets the player info
		thread debugtext "  deathwater triggered"
		thread debugtext ("  local.sucker = " + local.sucker)
		wait ( local.startdrowntime ) 
		deathwater_drown_loop:
			if (local.sucker istouching $deathwater[local.index] == 1)
			{
				thread debugtext "  Player is drowning"
        			radiusdamage local.sucker.origin local.damage local.radius
				wait 1 // wait 1 second
				goto deathwater_drown_loop
			}
			goto deathwater_loop
	thread debugtext ("END THREAD: deathwater = " + local.index)
end

//*************************************************
//*** setup the deathwater(s)
//*** the level scripts should call this thread
//*************************************************
deathwater_setup:

	thread debugtext "THREAD: deathwater_setup"

	if ($deathwater == NULL)
	{
		thread debugtext "  There is no deathwater in the map!!!"
		local.deathwaters = 0
		goto deathwater_setup_end
	}
	else
		local.deathwaters = $deathwater.size

	thread debugtext ("  There are " + local.deathwaters + " deathwaters in this map")

	for (local.i = 1 ; local.i <= $deathwater.size ; local.i ++)
	{
		thread deathwater local.i
	}
	deathwater_setup_end:

	thread debugtext "END THREAD: deathwater_setup"
end

// text only output if debug mode is turned on
debugtext local.text:

	if (level.debug == 1)
		println local.text
end
Admin .MAP Forums
Image
Head above heels.
Kiko
Major
Posts: 303
Joined: Mon Aug 29, 2005 8:58 pm
Location: US
Contact:

Post by Kiko »

That is why I love you Bjarne!!! Your my mapping idol!

(\_/)
(O.o)
This is Bunny. Copy Bunny
(> <)
to help him achieve world domination.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

:shock: :D :oops:
Admin .MAP Forums
Image
Head above heels.
User avatar
Axion
Major General
Posts: 683
Joined: Mon Sep 29, 2003 5:14 am
Location: Northern California
Contact:

Post by Axion »

For more information on causing damage to players through triggers, read up on this tutorial that covers volume damage:

http://dynamic.gamespy.com/%7Emap/mohaa/t.php?id=46
"The work of a thousand years is nothing but rubble."
- Dr. Carl Goerdeler (1943)
Visit my mapping site: http://www.freewebs.com/axion9
Image
Post Reply