Talk:User Inputs and Outputs

From Valve Developer Community
Revision as of 00:53, 4 July 2008 by Brandished (talk | contribs) (better example and does main ariticle still need lock?)
Jump to navigation Jump to search

I was trying to use UserInputs to setup a logic_relay for the purpose of controlling a light so that when the light was shot out, it would stop functioning. I connected a logic_switch to fire either User1 or User2 on the relay to set the light on or off respectively, and setup the OnUser1 and OnUser2 to turn on/off the light and appropriate models.

This all works, but when I tried to connect the OnBreak or OnHealthChanged output of the light models (prop_dynamic_override) to trigger and disable the relay, it compiles fine, but I get an error in the game engine saying there is a mismatch on the connections:

!! ERROR: bad input/output link: !! logic_relay(se_relay,FireUser2) doesn't match type from prop_dynamic(light_se_on)


This same technique works fine if I setup two logic_relays, and only use the Trigger inputs instead of the User inputs. Any ideas?

Coopbmt



There is an easier way, place a box of func_breakable in nodraw texture around the light. Set the health at whatever, and aadd a trigger: OnBreak, [name of your light entity], Turn off, No delay Also, if there is a switch you should add another to lock it.

Here's a tutorial if your still confused

Interloper_tutorial

(Also sign your comments with four tildles ~ )

Spiritslayr 12:56, 11 Jun 2008 (PDT)


Better Example?

I found the main article somewhat difficult to understand, so I reworded it a bit and added what I think is a clearer example then the one in the main article. I've attached my edit below, as the main article is currently locked.--Brandished 00:53, 4 Jul 2008 (PDT)


The FireUser1-4 inputs and OnUser1-4 outputs are available on every entity that can receive Inputs and Outputs. This set of controls are specially linked to work together. Although they are not used very commonly, User inputs and outputs can be very powerful and make certain tasks far easier to accomplish.

The OnUserN output simply stores an action that is not performed until it is activated by a corresponding FireUserN input. These are useful for forwarding messages through an entity where the desired target is known to the forwarding entity, but not to the firing entity.

An example can be found in the Valve map, "sdk_d3_citadel_01.vmf", found in the "sourcesdk_content\hl2\mapsrc" folder.

A func_tracktrain (zapperpod1_train) with a func_door_rotating (zapperpod1_rotator) parented to it moves along a path_track (pod_bay_zapper_track).


In the "func_tracktrain" entity's Outputs tab, there's 2 settings:

  • My Output named: OnUser1
  • Target entities named: zapperpod1_rotator
  • Via this input: Open

And

  • My Output named: OnUser1
  • Target entities named: zapperpod1_rotator
  • Via this input: Close
  • After a delay in seconds of: 5.00


So basically, when User1 is fired, the "func_door_rotating" will open and, after a 5 second delay, close. To fire this output, one of the "path track" entities, "pod_bay_zapper_track4", has an output of:

  • My Output named: OnPass
  • Target entities named: !activator
  • Via this input: FireUser1
  • After a delay in seconds of: 0.10


When the "func_tracktrain" passes the "path track" entity, it becomes the !activator and it's User1 output listed above is fired.