Working with Instances

Avatar
msleeper
4,136 Posts
Admin
Posted May 16, 2011
Replied 5 hours later
I put this up on the VDC. Anyone who understands how this works, feel free to help expand or add examples, screenshots, etc.
Advertisement
Registered users don’t see ads! Register now!
Avatar
reepblue
894 Posts
Posted May 16, 2011
Replied 2 hours later

Mr. Happy wrote:
reepblue wrote:

I'm planning on making a how to/info post on my blog about instancing communication with pictures and junk. If I get the time tomorrow, I will work on it.

Are you sure about this?

I wish to do so, I just don't have the time. I got started on it though, so at least I did something. :razz:

Avatar
Interitus
145 Posts
Posted May 17, 2011
Replied 5 hours later
What about an instance like crusher_ceiling_01 ? I cant seem to get it do anything. I've got a trigger brush with the output:
OnStartTouch
target entities: Crusher1-crusher_in_relay
via this input: Trigger

Crusher1 being the fix-up name
For Target entities, I've tried Crusher1 , Crusher1-crusher_in_relay , Crusher1-proxy

The instance doesnt have any replaceable parameters.

Avatar
Hurricaaane
189 Posts
Posted May 18, 2011
Replied 1 day later
I'm not sure, but it seemed to me that there are legacy instances in the pack.

I mean, there are places where in-triggers are called via parameter variables replacements (logic_relay containing a $variable to replace), with absolutely no io_proxy, while they could've been using it.

To be honest, I've been having a hard time making instances/gameplay/floor_catwalk_128x256.vmf work, and I'd be frustrated to know if this is actually a legacy instance.

Other complexier instances like the multiple cube dropper (instances/gameplay/cube_dropper_multiple_normal.vmf) were butter to use compared to this. Except the fact that I couldn't find how to make a reflective cube dropper I had to duplicate this instance to change one tiny thing in the instance.

Avatar
ljdp
16 Posts
Posted May 18, 2011
Replied 3 hours later

There's a good tutorial over on that other wiki.

http://wiki.p2mods.com/index.php?title=Instances
I was going to copy it over to the vdc but don't want two tutorials on there but I also
don't want to overwrite the one already there.

Avatar
Interitus
145 Posts
Posted May 18, 2011
Replied 8 hours later

Hurricaaane wrote:
To be honest, I've been having a hard time making instances/gameplay/floor_catwalk_128x256.vmf work, and I'd be frustrated to know if this is actually a legacy instance.

Thats the one I got working in my map!
I made the value for $trigger_to_close_catwalk "close" and $trigger_to_open_catwalk "open", named the instance "Panel1"
Then directly on a prop_floor_button, set the output OnPressed Panel1-close Trigger for it to raise up
and same thing for Panel1-open to get it lower down.

With crusher_ceiling_01, it has no variables to replace, so I'm not sure what to do.

EDIT: Ok I got it working! Took at msleeper's instance examples and got it working. just gotta modify the instance now so its a quick crushing rather than slowly moving down.

Avatar
animerunt
17 Posts
Posted May 19, 2011
Replied 5 hours later
I hope you dont mind, but I liked the tweaks you made to the transitions instance, so I made my own.

I noticed in yours the end level text was static. You had a variable for changing it but you forgot to put the variable in the end level game text entity.

In mine I expanded on what you did and made the opening title, subtitle, and end text editable. I also added 3 boolean options to disable any of the 3 texts individually.

I hope you and others find this useful:
http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=466

Let me know if I should make a new thread for this.

Avatar
msleeper
4,136 Posts
Admin
Posted May 19, 2011
Replied 4 minutes later

animerunt wrote:
I hope you dont mind, but I liked the tweaks you made to the transitions instance, so I made my own.

I noticed in yours the end level text was static. You had a variable for changing it but you forgot to put the variable in the end level game text entity.

In mine I expanded on what you did and made the opening title, subtitle, and end text editable. I also added 3 boolean options to disable any of the 3 texts individually.

I hope you and others find this useful:
http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=466

Let me know if I should make a new thread for this.

Awesome! I think I was too worried about getting it released instead of fixing up the variables. I also didn't really understand how the variables worked at the time.

No need to make a new thread; uploading a file automatically creates the thread for you. Nice release!

Avatar
animerunt
17 Posts
Posted May 19, 2011
Replied 24 minutes later

msleeper wrote:
animerunt wrote:

I hope you dont mind, but I liked the tweaks you made to the transitions instance, so I made my own.

I noticed in yours the end level text was static. You had a variable for changing it but you forgot to put the variable in the end level game text entity.

In mine I expanded on what you did and made the opening title, subtitle, and end text editable. I also added 3 boolean options to disable any of the 3 texts individually.

I hope you and others find this useful:
http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=466

Let me know if I should make a new thread for this.

Awesome! I think I was too worried about getting it released instead of fixing up the variables. I also didn't really understand how the variables worked at the time.

No need to make a new thread; uploading a file automatically creates the thread for you. Nice release!

Awesome, thanks!

Incoming shameless self promotion.

If you get time you should check out my first map too. http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=467

Avatar
Interitus
145 Posts
Posted May 21, 2011
Replied 1 day later
I made my first instance today, just a simple test. I dont think you need to put in a func_instance, as stated in your wiki pages. The origin is the map origin 0,0,0. Or, if you want, you can place a "func_instance_origin" to be the pivot point. You can however, place instances inside your instances (yo dawg, I heard you like instances..), which would use func_instance.
Avatar
msleeper
4,136 Posts
Admin
Posted May 21, 2011
Replied 1 hour later

Interitus wrote:
I made my first instance today, just a simple test. I dont think you need to put in a func_instance, as stated in your wiki pages. The origin is the map origin 0,0,0. Or, if you want, you can place a "func_instance_origin" to be the pivot point. You can however, place instances inside your instances (yo dawg, I heard you like instances..), which would use func_instance.

Good catch. Would you mind updating that wiki article (if it hasn't been already)?

Avatar
Erich
2 Posts
Posted May 22, 2011
Replied 1 day later
What would cause the entrance elevator to ignore entities? No lights are working, nor is the elevator doing its thing. Not sure what i'm missing. Am I wrong to assume that instances are ready-to-go like prefabs would be?
Avatar
MrLawbreaker
11 Posts
Posted May 23, 2011
Replied 16 hours later
Is it allowed to post useful instances on TWP?
Avatar
msleeper
4,136 Posts
Admin
Posted May 23, 2011
Replied 10 minutes later
Sure, upload them to the "Other Files" of the Portal 2 section in the Download Database.

If we get enough instances I might just make a new category for them.

Avatar
Nidonocu
17 Posts
Posted May 23, 2011
Replied 51 minutes later
I've been reading a number of posts while building my first maps and running in to the fact that I'm getting the Potato gun instead of the regular Portal gun because of the default behaviour of the scripts. Could the same technique used to properly generate custom chamber signs be used to amend the transition script safely to set things like this properly?
Avatar
msleeper
4,136 Posts
Admin
Posted May 23, 2011
Replied 1 minutes later
Check out my Elevator example. I include a custom arrival_departure_transition_ents.vmf instance, which removes the potato gun (as well as handles a custom exit text).
Avatar
Nidonocu
17 Posts
Posted May 23, 2011
Replied 1 hour later
I have taken a look at that yes and it seems like a reasonable solution.
Avatar
WinstonSmith
940 Posts
Posted May 24, 2011
Replied 1 day later

Idolon over at mAL wrote this up in a similar "Instance Help" thread; with his permission I'm reposting it here, because it's the single thing that actually made me understand how to interact with instances in a map.

Idolon wrote:
All you do is put a func_instance_io_proxy somewhere in the instance's .vmf. Now, lets say you want to be able to trigger a relay from outside of the instance. To do this, you would just create an output on the func_instance_io_proxy like so:

OUTPUT: OnProxyRelay
TARGET ENTITY: relay (or whatever your relay's name is, or for that matter, ANY ENTITY in your instance's .vmf that has a name)
TARGET INPUT: Trigger

Then, when you put an instance in your map, you would do this to trigger something in it:

OUTPUT:
TARGET ENTITY:
TARGET INPUT:

The func_instance_io_proxy just serves as a link between the instance's .vmf and the map in which it is used, telling the func_instance which inputs can be fired for the map in which it is used.
If you need to add another available input to the instance, you can just click the Edit Instance button in the lower left corner of the Object Properties window.

Also, a word of warning: Valve's instances have ZERO documentation, so they are pretty hard to use.

Avatar
msleeper
4,136 Posts
Admin
Posted May 24, 2011
Replied 2 minutes later
:thumbup:
Advertisement
Registered users don’t see ads! Register now!
Avatar
EL POLLO LOCO
34 Posts
Posted May 24, 2011
Replied 15 minutes later
I seem to have a problem with mine. On my desktop computer (where I normally do my mapping) I try to make instances and whatever I do they never work. On my laptop (which I only use for mapping in this case since it cannot actually run P2) the instances work fine but as soon as I transfer the map files over to my desktop to test the map the instances don;t work at all.......anyone got any fixes for this?