Difference between revisions of "Talk:Switch"

From Valve Developer Community
Jump to: navigation, search
Line 51: Line 51:
 
Then you'd put in a logic_timer to refire the ticksound.  What do you think? --[[User:Volt|volt]] 00:20, 23 Nov 2007 (PST)
 
Then you'd put in a logic_timer to refire the ticksound.  What do you think? --[[User:Volt|volt]] 00:20, 23 Nov 2007 (PST)
  
won't the animation look kind of strange, repeating "down" all the time? how shall we do to keep it pushed down?
+
won't the animation look kind of strange, repeating "down" all the time? how shall we do to keep it pushed down? --unsigned
 +
:No, when the animation is finished, the model goes idle, maintaining the most recent frame that it processed in an animation.  In this case, the last frame of the "down" animation will be held until the model is given either another animation command, either "up" or "down".  Also please sign your comments with two dashes followed by four tildes.  --[[User:Volt|volt]] 16:18, 6 Dec 2007 (PST)

Revision as of 00:18, 7 December 2007

Not quite sure what this is supposed to be about. Is it supposed to be a tutorial on those push buttons? --Remmiz 00:17, 20 Nov 2007 (PST)

Yes. And I would write it, but I can't figure out how to make a ticking sound that is audible anywhere in the map. Using the flag "Play Everwhere" does not do it (it still fades out at distance, or if a wall comes between the entity location and player).
Anyway, what I do is: create a prop_dynamic with model switch001.mdl, and then make a 8x8x8 brush tied to entity func_button (flags: Don't Move, Use Activates). If you want a timed button, set the "delay before reset" to long enough to where it won't interfere with the sequence that the button triggers. A push-only-once button should have delay set to -1. Then I set outputs so that when it's pressed, it triggers a logic relay, which animates the switch down with SetAnimation down (as well as open a door, trigger other logics, etc). If it's a timed button I set the logic also to reset the button with SetAnimation up (also closing a door or triggering other logics).
But I definitely can't convince the button to trigger anything to tick continuously AND globally, while the button is pressed. Any help would be delightful --volt 02:51, 22 Nov 2007 (PST)
Just did some more work with it. I'm starting to think that "Play Everywhere" simply doesn't work in Portal. --volt 03:33, 22 Nov 2007 (PST)
I got this down pretty well, i'll work on a tutorial today. --Remmiz 12:30, 22 Nov 2007 (PST)
Looks good. For cases where the button and door are further apart, it may be helpful to some if this page described that the "Play Everywhere" flag of the tickloop doesn't function correctly if editing for Portal (or at the very least I can't get it to work, and I've tried everything). Alternate routes are to create more switch_sound_tick's or use a logic_choreographed_scene. --volt 23:57, 22 Nov 2007 (PST)
Ive noticed that if you leave the range on the ambient_genertic to the default, it will reach fairly far. You can also increase that if you so need to.--Remmiz 00:05, 23 Nov 2007 (PST)
Does the volume of the sound depend on if world geometry comes between the player and the sound? For example, my button requires that you press the button then fall down a deep hole with a portal at the bottom, which takes you across the map, launching across a chasm where you'll find the door that the trigger opened. See your talk page, Remmiz. --volt 00:20, 23 Nov 2007 (PST)

How about buttons that allow you to reset them while active by pressing again? It is probably a desired effect, but differs significantly from your walkthrough from what I understand. For mine, I have: (ex. 10sec timer)

func_button: delay before reset: 0

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnPressed switch_logic CancelPending <none> 0.00 No
Io11.png OnPressed switch_logic Trigger <none> 0.01 No
Io11.png OnPressed switch_logic Trigger <none> 0.01 No

switch_logic:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger switch SetAnimation down 0.00 No
Io11.png OnTrigger door_left Open <none> 0.00 No
Io11.png OnTrigger door_right Open <none> 0.00 No
Io11.png OnTrigger door_opensound PlaySound <none> 0.00 No
Io11.png OnTrigger switch_sound_tickloop Enable <none> 0.00 No
Io11.png OnTrigger switch SetAnimation up 10.00 No
Io11.png OnTrigger door_left Close <none> 10.00 No
Io11.png OnTrigger door_right Close <none> 10.00 No
Io11.png OnTrigger door_closesound PlaySound <none> 10.00 No
Io11.png OnTrigger switch_sound_tickloop Disable <none> 10.00 No

Then you'd put in a logic_timer to refire the ticksound. What do you think? --volt 00:20, 23 Nov 2007 (PST)

won't the animation look kind of strange, repeating "down" all the time? how shall we do to keep it pushed down? --unsigned

No, when the animation is finished, the model goes idle, maintaining the most recent frame that it processed in an animation. In this case, the last frame of the "down" animation will be held until the model is given either another animation command, either "up" or "down". Also please sign your comments with two dashes followed by four tildes. --volt 16:18, 6 Dec 2007 (PST)