Page 1 of 1

Creating the perfect elevator with doors ?!?

Posted: Sun Feb 20, 2005 6:20 am
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" ????

Re: Creating the perfect elevator with doors ?!?

Posted: Sun Feb 20, 2005 9:07 am
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-)

Posted: Sun Feb 20, 2005 12:15 pm
by bdbodger
Maybe have a look at this thread as well

/forum/viewtopic.php?t=9824&highlight=

Re: Creating the perfect elevator with doors ?!?

Posted: Sun Feb 20, 2005 7:27 pm
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

Re: Creating the perfect elevator with doors ?!?

Posted: Sun Feb 20, 2005 9:49 pm
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

script_origin

Posted: Sun Feb 20, 2005 10:07 pm
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

Re: script_origin

Posted: Sun Feb 20, 2005 10:43 pm
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?

hatch

Posted: Sun Feb 20, 2005 11:01 pm
by tltrude
Look for the post with the same image in this thread, Wacko.

/forum/viewtopic.php?t=6823

Re: hatch

Posted: Sun Feb 20, 2005 11:08 pm
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:

no

Posted: Sun Feb 20, 2005 11:13 pm
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.

Posted: Mon Feb 21, 2005 9:51 am
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.

Posted: Mon Feb 21, 2005 2:57 pm
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.

Posted: Mon Feb 21, 2005 3:17 pm
by Master-Of-Fungus-Foo-D
thats for a door-vator .. i think he wants a regualr one :P

Posted: Mon Feb 21, 2005 3:46 pm
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: