Snarkpit Articles


Ok, this tutorial is not for those unfamiliar with entity set-ups. No pictures at the moment as I can't really see them doing anything but confusing you. I used a system just like this in my map Overfloater. What it does is create a teleport that systematically drops players off at a bunch of info_teleport_destinations, as well as firing off effects at each end of the teleport. Players will not get stuck inside each other by chasing each other through the teleport. Entities you should be familiar with: trigger_teleport, trigger_multiple, multisource, multi_manager, ambient_generic, info_teleport_destination, trigger_relay, trigger_changetarget.

Ok, let's start off by making your teleport and all your teleport destinations. Simple enough:

trigger_teleport
target: teletarget1
targetname: tele
master: telemaster

info_teleport_destination
targetname: teletarget1

info_teleport_destination
targetname: teletarget2

Repeat for however many destinations you have!

You'll notice I gave the trigger_teleport a master: this is because it is going to be controlled by a multisource. The teleport will only be active when the multisource is on. Let's make that now.

multisource
targetname: telemaster

That's all you need there. Now we need a way to trigger the teleport on and off, the best way is to use a trigger_multiple. Set it up to fill the exact same space as the trigger_teleport. Here's the properties:

trigger_multiple
target: telemult
wait: .1 (reset time)

Now that's set up to target a multi_manager that can trigger the teleport on and off:

multi_manager
targetname: telemult
teletrig: 0
telemaster: 0
telemaster#1: .05

The #1 allows it to trigger the same thing twice with one multi_manager- VHE/Worldcraft does this automatically, but in QuArK you have to add it yourself. Now, this is going to turn the master on at time 0, then the teleport will teleport the player, and at time .05 the master is triggered again, turning it off, and so the teleport closes off. This is short enough to prevent someone from following someone else through! Please note how the trigger_multiple's reset time is longer than the time it takes for the master to cycle.

Anyway, that's the working on/off teleporter, time to do the dirty work You'll notice the multi_manager targets teletrig, this is where all the trigger_changetarget-ing is gonna come from. But since we want to use different changetargets every time, so that things keep cycling around, first we're going to have to pass this through a trigger_relay:

t_relay
targetname: teletrig
target: teleat1
delay: .08

The name I chose for the target there just helps me out by knowing where the player is currently being teleported to. The delay means this occurs after the multisource has cycled, but before the trigger_multiple has reset. Here come the changetargets...

t_changetarget
targetname: teleat1
target: tele
m_isznewtarget: teletarget2

This one simply points the teleporter at the next destination. Now if we left it at this, the system would constantly hit this trigger_changetarget, constantly changing the trigger_teleport to point at teletarget2, which is no good. So we have to create another trigger_changetarget that will make the trigger_relay point at a different set of trigger_changetargets. This trigger_changetarget only fires at the same time as the previous, so I'm going to name them the same.

trigger_changetarget
targetname: teleat1
target: teletrig
m_isznewtarget: teleat2

This tells the trigger_relay the teleport is now facing destination two. Continue making these pairs of trigger_changetargets for every destination you have, like so:

trigger_changetarget
targetname: teleat2
target: tele
m_isznewtarget: teletarget3

trigger_changetarget
targetname: teleat2
target: teletrig
m_isznewtarget: teleat3

And so on...

trigger_changetarget
targetname: teleat3
target: tele
m_isznewtarget: teletarget4

trigger_changetarget
targetname: teleat3
target: teletrig
m_isznewtarget: teleat4

Let's say you only have 4 destinations. Time to point back at destination number one:

trigger_changetarget
targetname: teleat4
target: tele
m_isznewtarget: teletarget1

trigger_changetarget
targetname: teleat4
target: teletrig
m_isznewtarget: teleat1

I've you made it this far, congratulate yourself. Your teleport should be working perfectly. The only thing missing right now is some effects to go with the teleporter. I chose to use the ambient_generic, you can use any other effect you feel like, whether it involves an env_laser or perhaps an env_shake or whatever...

First, the ambient_generic from where you're leaving. Since you always leave from the same spot, no need to put it in the crazy changetarget sequence. Let's name it the same as the multi_manager, since that always gets fired:

ambient_generic
targetname: telemult
message: debris/beamstart11.wav (i liked this one)
health: 5
Flags: Medium radius, Not toggled, Start silent

Ok, now whenever you take off, people at the ground will hear this sound. Now put an ambient_generic by each of your destinations. The targetname for each one will be teleat$, where $ is the destination it's at. This way, it will get fired when the trigger_changetargets get fired, which is already specific to which destination the player just tele'd too. So for the one at teletarget1 would be:

ambient_generic
targetname: teleat1
message: debris/beamstart11.wav
health: 5
Flags: Medium radius, Not toggled, Start silent

Now, wasn't that easy?

Bonus points: a no-clients trigger_hurt set to damage of 1 in the vicinity of the teleport destination will prevent tripmines from being planted there, while not harming players.


Post ReplyView Topic
Discussion
0 starsPosted by 7dk2h4md720ih on Fri Jan 9th 2004 at 4:32am

You can afford to be arrogant Gollum... although it did take you years to make a rock roll... *runs* Nice tutorial, well structured.
0 starsPosted by Gollum on Sat Jan 3rd 2004 at 12:53pm

Comprehensive and useful. The "bonus points" remark at the end taught me something new and interesting about entities (a very rare event these days, arrogance notwithstanding).
Post ReplyView Topic