How to connect two func_instances?

Posted Nov 16, 2013
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?

Advertisement
Registered users don’t see ads! Register now!
Avatar
630 Posts
Posted Nov 16, 2013
Replied 57 minutes later
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 :biggrin:

Avatar
1,183 Posts
Posted Nov 17, 2013
Replied 9 hours later
Can't you just use an I/O proxy relay?
Posted Nov 17, 2013
Replied 2 hours later
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...?

Posted Nov 17, 2013
Replied 20 minutes later
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.
Posted Nov 17, 2013
Replied 1 hour later
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?
Avatar
1,183 Posts
Posted Nov 17, 2013
Replied 26 minutes later
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.

Avatar
630 Posts
Posted Nov 17, 2013
Replied 22 minutes later
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.

Posted Nov 17, 2013
Replied 1 minute later
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.
Avatar
630 Posts
Posted Nov 17, 2013
Replied 1 minutes later
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

Posted Nov 18, 2013
Replied 18 hours later
Thanks for your tipps but the problem seems to be much easier than I thought. I solved it this way:

The turret in the func_instance will react by OnPickUpPhysGun and the Target Entity for my unknown music_instance has the name $music.

My music_instance has a name with an @ in my map. Then I put the name (with the @) into the parm_field of my turret_instance which replaces the $music and everything works. That's the customization I want. =)

Maybe your gave me the solution on a plate but I didn't see it. =/

Avatar
630 Posts
Posted Nov 18, 2013
Replied 5 hours later
that is that i try to say :biggrin:
Posted Nov 18, 2013
Replied 6 hours later
Oh good, well I'm not at the end. ^_^

Is there a way to set the "FLAG" of an entity by a func_parms field? It would make things a lot easier than what I do actually. =/

Avatar
630 Posts
Posted Nov 18, 2013
Replied 3 hours later
Which kind of Flag do you mean? ^^
Advertisement
Registered users don’t see ads! Register now!
Posted Nov 18, 2013
Replied 35 minutes later
He means a spawnflag. And there is, but it's really difficult and requires editing your FGD files and doing bitwise arithmetic every time you make the instance. Trust me, it's not worth it.