Can you turn a trigger_teleport on and off?
Post Reply
Quote
Re: Can you turn a trigger_teleport on and off?
Posted by [RDC]Twitch on Thu May 12th at 7:43pm 2011


Can you turn a trigger_teleport on and off? I was hoping you could activate the trigger_teleport with a button and then it turns off after a quick delay. Is this possible?


web
Half-Life, Half-Life 2, and Q3 engine mapping



Quote
Re: Can you turn a trigger_teleport on and off?
Posted by Crono on Thu May 12th at 7:56pm 2011


Might want to look at this
http://developer.valvesoftware.com/wiki/Info_teleporter_countdown

And in the trigger entity events, there's a disable/enable flag. So, you can enable it and disable it remotely (from a timer entity).

Just mess with it, I guess ... there's four entities related to teleports.

http://developer.valvesoftware.com/wiki/List_of_entities



Blame it on Microsoft, God does.



Quote
Re: Can you turn a trigger_teleport on and off?
Posted by Degenatron on Thu May 12th at 8:12pm 2011


Accepted Answer
Absolutely. Use a multisource.

The button triggers the multimanager that targets a multisource. The Trigger_teleprt has the multisource listed as its master, so the teleport only works as long as the multisource is on.

The multimanager calls the multisource twice, the first entry turns the multisource on, the second entry turns the multisource back off. Set the values for each multisource call to set the time the teleporter is active.

You can also use the same multimanager to turn on effects like a teleport sound and sprite and then turn them back off.

D-Gen




Quote
Re: Can you turn a trigger_teleport on and off?
Posted by Degenatron on Thu May 12th at 8:13pm 2011


Quoting Crono
Might want to look at this
http://developer.valvesoftware.com/wiki/Info_teleporter_countdown

And in the trigger entity events, there's a disable/enable flag. So, you can enable it and disable it remotely (from a timer entity).

Just mess with it, I guess ... there's four entities related to teleports.

http://developer.valvesoftware.com/wiki/List_of_entities


That's for Source editing, not Gold Source.

D-Gen




Quote
Re: Can you turn a trigger_teleport on and off?
Posted by Crono on Thu May 12th at 8:22pm 2011


I didn't even notice. It was just under new posts >_>


Blame it on Microsoft, God does.



Quote
Re: Can you turn a trigger_teleport on and off?
Posted by [RDC]Twitch on Thu May 12th at 8:44pm 2011


Perfect! Thanks smiley


web
Half-Life, Half-Life 2, and Q3 engine mapping



Quote
Re: Can you turn a trigger_teleport on and off?
Posted by [RDC]Twitch on Thu May 12th at 8:47pm 2011


One more question fellas. For the multi source, do I put the teleport name as the target or the "Global State Master" ?


web
Half-Life, Half-Life 2, and Q3 engine mapping



Quote
Re: Can you turn a trigger_teleport on and off?
Posted by [RDC]Twitch on Thu May 12th at 9:58pm 2011


One more thing needed in order for it to work. You have to have an env_global. You need the env_global to control the multisource


web
Half-Life, Half-Life 2, and Q3 engine mapping



Quote
Re: Can you turn a trigger_teleport on and off?
Posted by Degenatron on Fri May 13th at 12:16pm 2011


Quoting Twitch
One more question fellas. For the multi source, do I put the teleport name as the target or the "Global State Master" ?


No. Global State Master should be blank for the multisource. Put the name of the multisource in the "Master" field on the trigger_teleport.

Quoting Twitch
One more thing needed in order for it to work. You have to have an env_global. You need the env_global to control the multisource


Hmmm. Env_global is for passing settings from one level to the next. It allows the game to remember trigger states inbetween level transitions. You SHOULDN'T need one, but on the other hand, if it's working for you, I say go for it.

D-Gen




Quote
Re: Can you turn a trigger_teleport on and off?
Posted by [RDC]Twitch on Fri May 13th at 3:47pm 2011


Here is what I did that works every time so far. I need to do more testing. I used a multisource, multi_manager, trigger_teleport, and env_global. Use whatever you want to trigger the whole process. I chose a button for my purposes. You would need something like a func_button to target the multi_manager in order to turn the teleport (via env_global) on and off. I hope this makes sense. I am new to the more complicated entity stuff and to most goldsrc mappers, this idea is probably extremely simple, lol. I still don't understand it completely!

trigger_teleport
name = tele
master = telsource

env_global
Name = telglobal
Global state to set = tele
Trigger mode = toggle
Initial state = off
Tick flag for 'set initial state'

multisource
Name = telsource
Target = blank (nothing)
Global State Master = tele

multi_manager
name = tele_mm
telglobal .001
telglobal#1 1

Use a func_button targeting tele_mm (multi_manager). The multimanager targets the env_global (telglobal) once to turn it on and again to turn it off.



web
Half-Life, Half-Life 2, and Q3 engine mapping



Quote
Re: Can you turn a trigger_teleport on and off?
Posted by Degenatron on Mon May 16th at 1:43pm 2011


Accepted Answer
Quoting [RDC
Twitch]Here is what I did that works every time so far. I need to do more testing. I used a multisource, multi_manager, trigger_teleport, and env_global. Use whatever you want to trigger the whole process. I chose a button for my purposes. You would need something like a func_button to target the multi_manager in order to turn the teleport (via env_global) on and off. I hope this makes sense. I am new to the more complicated entity stuff and to most goldsrc mappers, this idea is probably extremely simple, lol. I still don't understand it completely!

trigger_teleport
name = tele
master = telsource

env_global
Name = telglobal
Global state to set = tele
Trigger mode = toggle
Initial state = off
Tick flag for 'set initial state'

multisource
Name = telsource
Target = blank (nothing)
Global State Master = tele

multi_manager
name = tele_mm
telglobal .001
telglobal#1 1

Use a func_button targeting tele_mm (multi_manager). The multimanager targets the env_global (telglobal) once to turn it on and again to turn it off.


Yep, I see what you are doing there. A couple of things to remember are:
> a multisource starts in an "off" position already
> a trigger can target a multisource directly with a "toggle"

Try this:
> Make a copy of your map
> On the test copy - Delete the env_global
> set the tele_mm to target "telsource" instead of "telglobal"
> and remove the Global State Master from "telsource"

It should operate exactly the same.

The reason why goes back to "best preactices". If you continue to build devices like this, with an unneeded additional entity, you may find yourself running up against the entity limit when working on large, complicated maps.

On the other hand, you've got it working the way you want and there is no problem with continuing on with the map. Just file this advice away for the next time.

D-Gen




Quote
Re: Can you turn a trigger_teleport on and off?
Posted by [RDC]Twitch on Mon May 16th at 5:22pm 2011


I'm all about best practice and doing things efficiently! Thanks for the hel. I will test this later tonight and I'm better you are right. And yeah, my entity list is right on the edge of too much smiley Anything helps.


web
Half-Life, Half-Life 2, and Q3 engine mapping



Quote
Re: Can you turn a trigger_teleport on and off?
Posted by [RDC]Twitch on Mon May 16th at 9:50pm 2011


Thanks again for the advice. Works like a champ!


web
Half-Life, Half-Life 2, and Q3 engine mapping




Post Reply