func_instance_io_proxy

From Source Entities
Jump to navigation Jump to search

Code classes:

Func instance parms.png

func_instance_io_proxy is a point entity present in all games since Asw.pngAlien Swarm. It is used to forward I/O between entities in an instance and entities outside it.

To send inputs to the instanced entities:

  1. Place one copy of this entity inside the instance.
  2. Use the OnProxyRelay output and specify the target entity (in the instance) and the input to fire.
  3. Then in the actual map, have the desired output target the func_instance itself, with the input matching this format: instance:Target;Input. ("Target" and "Input" should match with the ones specified in the proxy ent. Example: instance:button_relay;Trigger)
  4. When the map is compiled, VBSP will re-route all the I/O so that entities in the map will target the func_instance_io_proxy with inputs called OnProxyRelay1-16, which will fire outputs with matching names that will send the inputs which were first put into the proxy ent's Outputs tab. You can also send an input directly to the entity by simply targeting the post-fixup name.

Note: If developer has been set to 1, a warning will appear once the 16th relay input is sent, noting that the instance cannot take any more unique inputs. If you must send even more, the code can be modified to support more (for Asw.png), otherwise a workaround must be found.

To allow instanced outputs to target entities in the map (aside from direct references, e.g. @glados):

  1. Place one copy of this entity inside the instance (it can be the same one that's used for inputs).
  2. Have an output in the instance target the func_instance_io_proxy with ProxyRelay.
  3. In the actual map, go to the func_instance's Outputs tab and have the output follow this format: instance:Caller;Output. ("Caller" being the name of the entity in the instance that the "Output" comes from. Example: instance:instanced_nearby_trigger;OnTrigger) That "output" will now fire at the appropriate time in the game. From here, specify the target, input, etc as normal.

Bug: Entities that interact with proxies (inside or outside the instance) may only send inputs to that proxy. Other IO connections will be incorrectly rerouted or lost entirely.

Inputs[edit | edit source]

ProxyRelay <string>
Use to make an output be accessible to mappers while working outside of the instance. To do: What does the parameter do?

Outputs[edit | edit source]

OnProxyRelay
Use to forward inputs to entities inside the instance.