Page 1 of 1

another n00b question

Posted: Sat Dec 06, 2003 5:58 am
by Machu
Ok, how can you make two trigger-use's execute the same thing in a script. For example: if you wanted to make an elevator and there were two buttons (trigger-use's) one at the top and one at the bottom. You would want the trigger on the bottom to do the exact same thing as the trigger on the top. I tried giving both triggers the same targetname, but that didn't work...Any help would be great :oops:

tnx in advance

trigger

Posted: Sat Dec 06, 2003 7:15 am
by tltrude
Just make the trigger brush real long, ha ha. If it is a simple two floor elevator, you can also make it out of a func_door. Doing it that way requires no scripting at all. The open and close door sounds can be changed to elevator motor sounds--like "lighthouse_run".

Both of these tutorial maps have elevators made from func_doors.

http://pages.sbcglobal.net/tltrude/Temp/door2.zip
http://pages.sbcglobal.net/tltrude/Temp/altelevator.zip

Image

Posted: Sat Dec 06, 2003 12:44 pm
by Machu
Actually I was using the elevator as an example. I'm making something that needs the trigger in totally different places that can't be done with just one trigger brush. :D

ok

Posted: Sat Dec 06, 2003 3:17 pm
by tltrude
Ok, make two triggers with different targetname. Then post your script thread here.

One way is by using two threads.

first_thread:
$trigger1 waittill trigger
$trigger2 nottriggerable
$wiget moveto $spot2
$wiget waitmove
wait 10
$wiget moveto $spot1
$wiget waitmove
$trigger2 triggerable
goto first_thread
end

second_thread:
$trigger2 waittill trigger
$trigger1 nottriggerable
$wiget moveto $spot2
$wiget waitmove
wait 10
$wiget moveto $spot1
$wiget waitmove
$trigger1 triggerable
goto second_thread
end

Posted: Sat Dec 06, 2003 7:03 pm
by Machu
Here's the script. There are two trigger-use's one is called "button" and one is called "button2". I'm not sure how I would put button two into the script. The script works perfectly so far, I just need that second button. It is basicly a hollow box with a door and windows that moves on a track from the attic of a house to an elevator that brings it to ground level. It's kinda pointless, but it looks nifty and iz good practice.

Code: Select all

//TRANSPORT//

transport_mover:

$transport time 20
$attic_door time 3

$button waittill trigger

$attic_door moveEast 172
$attic_door waitmove
$transport moveNorth -1552
$transport waitmove
wait 2
$attic_door moveEast -172
$attic_door move

goto transport_elevator_mover

end

transport_return_mover:

$transport time 20
$attic_door time 3

$transport moveNorth 1552
$transport move
wait 10
$attic_door moveEast 172
$attic_door waitmove
wait 7
$attic_door moveEast -172
$attic_door waitmove

goto transport_mover

end


transport_elevator_mover:

$transport time 8
$transport_elevator time 8

$transport movedown 376
$transport move
$transport_elevator movedown 376
$transport_elevator waitmove

$button waittill trigger

$transport moveup 376
$transport move
$transport_elevator moveup 376
$transport_elevator waitmove

goto transport_return_mover

end
I'll try out the method you suggested
Here are some pics of it:

Image
(I need the second trigger on the cement base)
Image

Image

tnx a lot for your help :D

buttons

Posted: Sat Dec 06, 2003 10:53 pm
by tltrude
Hmmm, well here is one way. You can "bind" the trigger to the transport. Then it will move with it. As you can see, I combined your three threads into one and added a preperation thread. Change the line that starts it to "thread transport_prep".

Code: Select all

//TRANSPORT//

transport_prep:

	$transport time 20 
	$attic_door time 3
	$transport_elevator time 8
	$button bind $transport
	goto transport_mover

end

transport_mover: 

 

	$button waittill trigger 

	$attic_door moveEast 172 
	$attic_door waitmove
	$transport loopsound lighthouse_run
	$transport moveNorth -1552 
	$transport waitmove 
	wait 2 
	$attic_door moveEast -172 
	$attic_door move 

	$transport time 8 

	$transport movedown 376 
	$transport move 
	$transport_elevator movedown 376 
	$transport_elevator waitmove 
	$transport stoploopsound

	$button waittill trigger 

	$transport loopsound lighthouse_run
	$transport moveup 376 
	$transport move 
	$transport_elevator moveup 376 
	$transport_elevator waitmove   

	$transport time 20 

	$transport moveNorth 1552 
	$transport move 
	wait 10 
	$attic_door moveEast 172 
	$attic_door waitmove 
	wait 7 
	$attic_door moveEast -172 
	$attic_door waitmove
	$transport stoploopsound 

	goto transport_mover 

end  
But, I can't figure out where you have the buttons and what you want them to do. The way you have it, the player has to run back to the house and push the button to bring the transport back--right?

You can also "bind" and "unbind" the transport to the elevator. Then you would only have to move the elevator and the travel time for the transport would not have to be changed to 8 and back to 20.

Posted: Sun Dec 07, 2003 4:36 am
by Machu
Aight, I fixed it up. I decided it would be simpler and easier to bind the trigger to the transport. Works nicely now. Tnx for your time. :D