Func instance io proxy: Difference between revisions
TheLazyPanda (talk | contribs) (Usage (creating outputs for func_instance)) |
TheLazyPanda (talk | contribs) (→Usage: Handling Inputs) |
||
Line 17: | Line 17: | ||
: A message from outside can trigger this to cause something to happen in the instance. | : A message from outside can trigger this to cause something to happen in the instance. | ||
==Usage== | == Usage == | ||
=== Creating Outputs === | |||
Best used for holding outputs from entities inside an instance as if the outputs were originating from the instance itself. | Best used for holding outputs from entities inside an instance as if the outputs were originating from the instance itself. | ||
Line 25: | Line 26: | ||
:{| | border=1 cellpadding="2" cellspacing="1" | :{| | border=1 cellpadding="2" cellspacing="1" | ||
|- align=left style="background:#DCDCDC; color:black" | |- align=left style="background:#DCDCDC; color:black" | ||
|+ ''' | |+ '''detect_stuff_trigger - trigger_multiple''' | ||
! | ! | ||
! My Output > !! Target Entity !! Target Input !! Parameter !! Delay !! Only Once | ! My Output > !! Target Entity !! Target Input !! Parameter !! Delay !! Only Once | ||
Line 43: | Line 44: | ||
! My Output > !! Target Entity !! Target Input !! Parameter !! Delay !! Only Once | ! My Output > !! Target Entity !! Target Input !! Parameter !! Delay !! Only Once | ||
|- | |- | ||
| [[Image:Io11.png]] || instance: | | [[Image:Io11.png]] || instance:detect_stuff_trigger:OnStartTouch || zap_sound || playsound || || 0.00 || No | ||
|- | |- | ||
| [[Image:Io11.png]] || instance: | | [[Image:Io11.png]] || instance:detect_stuff_trigger:OnStartTouch || !activator || kill || || 2.00 || No | ||
|} | |} | ||
: | : | ||
You can add as many outputs to the proxy as you would like (presumably), wiith as many entities as you'd like. This essentially turns the func_instance into a wildcard entity that borrows outputs from pre-configured entities, and lets the mapper choose how to use them. | You can add as many outputs to the proxy as you would like (presumably), wiith as many entities as you'd like. This essentially turns the func_instance into a wildcard entity that borrows outputs from pre-configured entities, and lets the mapper choose how to use them. | ||
=== Handling Inputs === | |||
The instance proxy can predefine important inputs if desired. This is useful for hinting to other mappers what they can or ''should'' do with the instance. | |||
To add a predefined input to the instance, go to the proxy's outputs tab and add an output to one of the entities in your instance. It will look like this: | |||
:{| border=1 cellpadding="2" cellspacing="1" | |||
|- align=left style="background:#DCDCDC; color:black" | |||
|+ '''shaft_proxy - func_instance_io_proxy''' | |||
! | |||
! My Output > !! Target Entity !! Target Input !! Parameter !! Delay !! Only Once | |||
|- | |||
| [[Image:Io11.png]] || OnProxyRelay || detect_stuff_trigger || disable || || 0.00 || No | |||
|} | |||
: | |||
Now while you're configuring entities in other maps, you can go to their outputs tab and target the func_instance and add: | |||
:{| border=1 cellpadding="2" cellspacing="1" | |||
|- align=left style="background:#DCDCDC; color:black" | |||
|+ '''elevator_arriving_relay - logic_relay''' | |||
! | |||
! My Output > !! Target Entity !! Target Input !! Parameter !! Delay !! Only Once | |||
|- | |||
| [[Image:Io11.png]] || elevator_shaft_instance || instance:detect_stuff_trigger:disable || || || 0.00 || No | |||
|} | |||
: | |||
The first thing you'll notice is that there's no need to fill in the '''target input''' field. You may also notice that Hammer didn't show this connection as working, don't worry, it'll be fine. | |||
You should refrain from predefining large numbers of inputs for the instance, and only do so for the most important (and most intended to be used) functions. In other cases you may still send messages to the instance entities directly by using their real name (e.g. '''elevator_shaft-detect_stuff_trigger'''). This is the method you would use for things that wouldn't be duplicated very often, or were just too numerous (or too obvious) to justify configuring a proxy. e.g. rotated sections of a map using func_instance. | |||
==See also== | ==See also== | ||
*[[func_instance]] | *[[func_instance]] |
Revision as of 12:27, 23 May 2011
Template:As point It is also available in Portal 2.
Entity Description
Place one copy of this entity inside of an instance. Sending messages to entities inside the instance from the Proxy's OnProxyRelay output will allow you to trigger these entities from outside the instance by sending messages to the func_instance. Send the ProxyRelay message from entities inside the instance to the proxy and you will be able to use these events to send messages to other entities outside the instance from the func_instance.

KeyValues
- Name
<target_source>
- The name that other entities refer to this entity by.
Inputs
ProxyRelay
- This message will get relayed and will be available from the instance.
Outputs
OnProxyRelay
- A message from outside can trigger this to cause something to happen in the instance.
Usage
Creating Outputs
Best used for holding outputs from entities inside an instance as if the outputs were originating from the instance itself.
When entities inside the instance target the proxy with a ProxyRelay input, such as:
detect_stuff_trigger - trigger_multiple My Output > Target Entity Target Input Parameter Delay Only Once OnStartTouch door_proxy ProxyRelay 0.00 No
the func_instance used to import the instance will now be able use that output as if it were the original entity. If you go to the outputs tab for the func_instance and click add you'll now be able to select and configure outputs like:
You can add as many outputs to the proxy as you would like (presumably), wiith as many entities as you'd like. This essentially turns the func_instance into a wildcard entity that borrows outputs from pre-configured entities, and lets the mapper choose how to use them.
Handling Inputs
The instance proxy can predefine important inputs if desired. This is useful for hinting to other mappers what they can or should do with the instance.
To add a predefined input to the instance, go to the proxy's outputs tab and add an output to one of the entities in your instance. It will look like this:
shaft_proxy - func_instance_io_proxy My Output > Target Entity Target Input Parameter Delay Only Once OnProxyRelay detect_stuff_trigger disable 0.00 No
Now while you're configuring entities in other maps, you can go to their outputs tab and target the func_instance and add:
elevator_arriving_relay - logic_relay My Output > Target Entity Target Input Parameter Delay Only Once elevator_shaft_instance instance:detect_stuff_trigger:disable 0.00 No
The first thing you'll notice is that there's no need to fill in the target input field. You may also notice that Hammer didn't show this connection as working, don't worry, it'll be fine.
You should refrain from predefining large numbers of inputs for the instance, and only do so for the most important (and most intended to be used) functions. In other cases you may still send messages to the instance entities directly by using their real name (e.g. elevator_shaft-detect_stuff_trigger). This is the method you would use for things that wouldn't be duplicated very often, or were just too numerous (or too obvious) to justify configuring a proxy. e.g. rotated sections of a map using func_instance.
See also
- func_instance
- func_instance_parms - Entity to control parameters within instances.