Creating the perfect elevator with doors ?!?

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
mcunha98
Lieutenant Colonel
Posts: 384
Joined: Sat Jan 17, 2004 1:52 am
Location: Brasil
Contact:

Creating the perfect elevator with doors ?!?

Post by mcunha98 »

Ok boys, in this site and others we see tutorials explaining how make a elevator using a brush with DOOR function.

All samples working perfect, but al samples have a little problem, the sound !

When a trigger->use start the job of elevator (to up or down) he play a common door sound, and dont enter into a loop of a sound to create effect of elevator working.

I see many tutorials like :
More functional :
/t.php?id=91 and
More complex, but with best result:
http://dynamic6.gamespy.com/~rjukanproj ... e=Elevator


My question, is possible manipulate sound together elevator "life cycle work" ????
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Re: Creating the perfect elevator with doors ?!?

Post by wacko »

mcunha98 wrote:My question, is possible manipulate sound together elevator "life cycle work" ????
What did u have in mind in detail? Your 2nd example link (which by the way does NOT use a func_door) got lots of sound commands in the script. You can easily change, add or delete them.
You might also want to check out TlTrude's tutorial maps altelevator and testpointer @ http://smallsumo.leveledit.com/tltrude/index.html, which show some other elevators 8-)
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Maybe have a look at this thread as well

/forum/viewtopic.php?t=9824&highlight=
Image
User avatar
mcunha98
Lieutenant Colonel
Posts: 384
Joined: Sat Jan 17, 2004 1:52 am
Location: Brasil
Contact:

Re: Creating the perfect elevator with doors ?!?

Post by mcunha98 »

Wacko wrote:You might also want to check out TlTrude's tutorial maps altelevator and testpointer @ http://smallsumo.leveledit.com/tltrude/index.html, which show some other elevators 8-)
Really the test pointer of TLTrude its a great and beautiful sample of potencial of MOH Engine. But the sample of TLTrude use a scripted object, and no never he work correctly.

My question relative of door to elevator function is:

1) How setup the sound of start, during and end elevator job ?
2) The door function force the object to return in original position, is possible change this parameter to never return, only with interaction of user into a trigger->use to move into point A to B
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Re: Creating the perfect elevator with doors ?!?

Post by wacko »

1) How setup the sound of start, during and end elevator job ?
I think, u can just use standard door sounds for elevators made out of doors and without using a script

2) The door function force the object to return in original position, is possible change this parameter to never return, only with interaction of user into a trigger->use to move into point A to B
Try to check the 'toggle' checkbox in the door's entity inspector
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

script_origin

Post by tltrude »

For one of the elevators in the map "Gotterdammerung" I used script origins to trigger the hatch doors. The distance the two script_origins are apart is checked continuously using the while loop in the thread shown below.

Image

Code: Select all

ele7_hatch:

	$ele7_hatch_left time .2
	$ele7_hatch_right time .2
	$e7_bar_origin bind $ele7_bar
	$ele7_bar bind $ele7
	level.e7hp = 0

	while (1)
	{
		if ((vector_length ($e7_bar_origin.origin - $e7_hatch_origin.origin) < 128) && (level.e7hp == 0))
		{
			$ele7_hatch_left openportal
			$ele7_hatch_left playsound stardoor_snd
			$ele7_hatch_right rotateZup -90
			$ele7_hatch_left rotateZup 90
			$ele7_hatch_right move
			$ele7_hatch_left waitmove
			level.e7hp = 1
		}

		if ((vector_length ($e7_bar_origin.origin - $e7_hatch_origin.origin) > 128) && (level.e7hp == 1))
		{
			$ele7_hatch_left playsound stardoor_snd
			$ele7_hatch_right rotateZup 90
			$ele7_hatch_left rotateZup -90
			$ele7_hatch_right move
			$ele7_hatch_left waitmove
			$ele7_hatch_left closeportal
			level.e7hp = 0
		}
	wait .01
	}
	waitframe

end
Tom Trude,

Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Re: script_origin

Post by wacko »

tltrude wrote:For one of the elevators in the map "Gotterdammerung" I used script origins to trigger the hatch doors. The distance the two script_origins are apart is checked continuously using the while loop in the thread shown below.
hehe, nice one :wink: would have done it with an istouching...
but I think that's way more than mcunha wants :wink:
u surely could explain to him though, how to use the stopsound and movesound keys in his door entity. That's something he might want to use :wink:
btw, doesn't this elevator lead to the room I can see through the glass floor? If so, what is the 'closeportal' for?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

hatch

Post by tltrude »

Look for the post with the same image in this thread, Wacko.

/forum/viewtopic.php?t=6823
Tom Trude,

Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Re: hatch

Post by wacko »

tltrude wrote:Look for the post with the same image in this thread, Wacko.
/forum/viewtopic.php?t=6823
errr, yes!? both rooms in area A, so an areaportal is obsolete there!? Oh my, forget it, doesn't matter anyway and I didn't plan to hijack this thread :wink:
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

no

Post by tltrude »

No, the elevator leads to another room--not the same room as the one below the glass. The glass is a breakable window.
Tom Trude,

Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

So mcunha98, what you want is to loop a sound until the elevator has completed its run, right? In my tutorial I used sounds that had the correct length, so there was no need to stop it. But for a looping sound, the trick is to know when the sound should be stopped.

So, first start the sound in a loop with this command:

Code: Select all

loopsound( String soundName, [ Float volume ], [ String minimum_distance ] )

      play a looped-sound with a certain volume and minimum_distance
      which is attached to the current entity.
...Then stop it with this:

Code: Select all

stoploopsound

      Stop the looped-sound on this entity.
Now when to stop it? Well: you just set this command on the elevator ( it tells it how long it should take to move to the destination ):

Code: Select all

time( Float traveltime )

      Sets the time it takes to do move commands applied to the entity.
...and then you can delay the call to the stoploopsound command the same amount of time that you specified in the time command using this command:

Code: Select all

commanddelay( Float delay, String command, [ String [arg1] ], [ String [arg2] ], [ String [arg3] ], [ String [arg4] ], [ String [arg5] ], [ String [arg6] ] )

      executes a command after the given delay
( He he... command executing a command... funny :) )

If you dont have a lot of experience in scripting, this may be a bit complex, so just ask away if you need to.
Admin .MAP Forums
Image
Head above heels.
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

if its not for a stock map you can always do

Key/Value

lip(how high it goes*)/-248
sound_open_start/lighthouse_run
sound_open_end/snd_step_paper
sound_close_start/lighthouse_run
sound_close_end/snd_step_paper
time/3.00

this is more for a 2 floor elevator,not multiple floors.

in another thread this was talked about and wacko made a nice lil elevator script for multiple floors.i would guess do a search for elevator.
Image
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

thats for a door-vator .. i think he wants a regualr one :P
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
User avatar
mcunha98
Lieutenant Colonel
Posts: 384
Joined: Sat Jan 17, 2004 1:52 am
Location: Brasil
Contact:

Post by mcunha98 »

Well,

Reading all post, i see the subject is very very cool.
Of all replys, the "prefab" of bdbodger its the best way, putting the .scr file into global and passing parameters like he need, is possible using a full elevator with door including sound.

I will try use the script of bdbodger in my map to test, thanks a lot for all to replys !!!!

TLTrude, without questions, your script and sample is very usefull, but, my machine dont is a exactly the best PC to test more of 3 times a map. :oops:
Post Reply