Please or Register to create posts and topics.

Trigger on/off

Page 1 of 3Next

Heya there,

I was wondering if there was a way I could set up a trigger (which I know how to do). but have it enabled/disabled depending on if a box is on a button?

I need the trigger to play a line from Glados (I know where to get the lines).

This is because I want to play a different line from Glados depending on if the player has the cube on the button.

Some of my Portal 2 maps || Mini-Faith || Careful Cube || Vertical Reach ||

|| Need help uploading a map...new user? Read my Map Uploading Guide ||
|| Want to play custom maps, but don't know how? Read my Playing Portal 2 Custom Maps Guide ||

Just name the trigger and send it inputs on Enable or Disable. That easy! ...I hope. :)

Image
ImageImageImageImage

Yes. If you name your trigger "trigger1", here are your outputs from the button. "OnPressed -> trigger1 -> Enable" and "OnUnpressed -> trigger1 -> Disable"

My Maps:
[spoiler][SP] Alternate[/spoiler]

This might be solved better if you use a math_counter or logic_branches then the disabled/enable thingo.

OnButtonPress > math_counter > Add > 1
OnTrigger > math_counter > Add > 1
OnHitMax > ...play glados line... however you do that

Image
PortalStories.com
"Oh, in case you got covered in that repulsion gel, here's some advice the lab boys gave me: DO NOT get covered in the repulsion gel."

Here's my way of doing what you need to do. Pretty simple:

1) Make the button.
2) Make two triggers in the same place named (example) glados1trigger and glados2trigger and make the first one start enabled, while the second starts disabled (if you want the sound to play more than once, every time the player goes into it, make it a trigger multiple, if you want it to play once, make it a trigger_once)
3) Make the outputs for the button:

- OnPressed - glados1trigger - enable
- OnPressed - glados2trigger - disable
- OnUnpressed - glados1trigger - disable
- OnUnpressed - glados2trigger - enable

4) Next, make 2 ambient_generic entities, with the flags "start silent" and "play everywhere" checked. Put your glados line for when the button is not pressed in the ambient_generic called (example) gladosline1 and the line for when the button is pressed in an ambient_generic called (example) gladosline2.
5) Here are the outputs for your triggers:

Glados1trigger:

- OnTrigger - gladosline1 - PlaySound

Glados2trigger:

- OnTrigger - gladosline2 - PlaySound

That's how you do it in the simplest way possible. I hope that helps, and if it doesn't, just ask for more help.

My Maps:
[spoiler][SP] Alternate[/spoiler]

Or alternatively you could use math_counter or logic_branches as your supposed to.

Image
PortalStories.com
"Oh, in case you got covered in that repulsion gel, here's some advice the lab boys gave me: DO NOT get covered in the repulsion gel."
iWork925 wrote:
This might be solved better if you use a math_counter or logic_branches then the disabled/enable thingo.

OnButtonPress > math_counter > Add > 1
OnTrigger > math_counter > Add > 1
OnHitMax > ...play glados line... however you do that

I need the trigger to disable/enable dependant on the button being pressed or not. Then when the player passes through the first trigger (when button is not pressed) it plays a sound, then when the button is pressed I need that first trigger to enable and when the player passes through, play another sound.

@Vordwann - I set it up exactly how you described, however when the button is not pressed, it plays both sounds. When the button is pressed it plays nothing.

I have checked and re-checked my outputs and names etc on everything, to make sure it's correct. I don't know why it's playing both the sounds when the button is unpressed, and nothing when it is.

Some of my Portal 2 maps || Mini-Faith || Careful Cube || Vertical Reach ||

|| Need help uploading a map...new user? Read my Map Uploading Guide ||
|| Want to play custom maps, but don't know how? Read my Playing Portal 2 Custom Maps Guide ||

can you PM me the map?

My Maps:
[spoiler][SP] Alternate[/spoiler]

I have fixed it. Just forgot to set the other trigger to 'start disabled'. Completely overlooked this earlier. xD

Some of my Portal 2 maps || Mini-Faith || Careful Cube || Vertical Reach ||

|| Need help uploading a map...new user? Read my Map Uploading Guide ||
|| Want to play custom maps, but don't know how? Read my Playing Portal 2 Custom Maps Guide ||

Well as long as my elaborate plan worked, that's good :D

My Maps:
[spoiler][SP] Alternate[/spoiler]
Page 1 of 3Next