Please or Register to create posts and topics.

How to connect two func_instances?

Page 1 of 2Next

Is it possible to connect two func_instances over one map only by reference?

For example: there is one func_instance A with three relays to use: a1, a2, a3 and one func_instance B with one relay which takes advantage of func_instance A.

The only way they are connected is in one map over the params of func_instance B.

_____map__________
| |
| A <--- B (parm: A) |
|__________________|

Is this possibly?

In the first Instance you put (for example) a Logic_relay with the name: @Example_Rl

The " @ " Means that the name of the Entitys dont get changed when you compile your level.

And in Instance 2 you (for example) fire an Output " OnTrigger -> @Example_Rl -> Trigger"

So, if you put these 2 INstances in your map, and Instance number 2 fires the output, then the " @Example_Rl " in Instance 1 get triggered.

Understand?

EDIT: Ouh i see, with Parms.

- Put a Logic_Relay in Instance 1.
- Set an Output: " OnTrigger -> $relay_name -> Trigger "
- Put a Func_instance_parms in Instance 1.

- In Instance 2 you make a Relay, Maybe named " @Test_Rl "

Now if you place Instance 1 in your map, you set the parm $relay_name to the Relay name of your Instance 2.

Sry for my English spelling, hope you understand what i mean :D

Can't you just use an I/O proxy relay?

Thanks for the replys. I've tested the @-functions and they work really fine, but if I want to customize the inputs, then I would need parms for this case.

The thing is that I have one func_instance which just takes advantage of a whole func_instance I build before and I just want to refer them with one parameter of the new one. What data type need I to choose ? Targed_name_or_class, String, instance_variable, instance_file...?

It doesn't really matter which data type you use. I'd recommend using a func_instance_io_proxy for this purpose, though. Put one proxy in each item and name it "proxy". In instance A add an output that triggers the ProxyRelay input (this outputting entity cannot have any other outputs, use a logic_relay to split outputs if necessary). In instance B add the OnProxyRelay output to the proxy and have this trigger something else, usually a logic_relay. Then in the actual map, you can send an output from the func_instance for A to the func_instance for B. Sending multiple inputs to ProxyRelay or multiple outputs from OnProxyRelay will cause them to all become different inputs/outputs for the proxy.

My stuff:
[spoiler]- BEE2 Addons | (BEE2)
- Hammer Addons
Maps:
- Crushed Gel
- Gel is Not Always Helpful[/spoiler]

To descripe the problem, I'm using a func_instance with a turret. If the turret gets pick up by the player the music will change. This music change is handled by another func_instance with a few logic_relays. How can I set a func_proxy output by the turret_instance if the only thing is the pickup/drop function?

Turret: OnPickup> Proxy> proxyrelay
OnDrop (or whatever that output is)> "> "

That's the instance. On the func_instance, the output is instance:OnPickup or something, but why can't you just use the turret without an instance for this? It's not a large amount of outputs required.

Instance turret:
Turret: " OnPickup -> $target -> Trigger"
Func_instance_parms: " Variable: $target " And in " Value " you enter the relay name of the "Instance Music" you wish.

INstance Music: For example: @Relay: OnTrigger -> Music -> Playsound
Another Example @Relay_Dark: Ontrigger -> Music_dark -> Playsound

In Instance_Turret you just change the Value of $target to "@Relay", or "@Relay_dark" or something else

Thats so simple.

The reason why I need a whole func_instance with a turret inside is that I want to detect if the turret is tipped over so the music change will not happen again, if you pickup the tipped-turret again.

Then: in Instance Music:

@Relay: "Ontrigger -> !self -> kill -> Delay 0.10"
(Or you just check " Fire once only"

And now the music will only started once.
When im later home i will make you an example vmf

Page 1 of 2Next