PART 1: Setting up hammer to fix func_instance + portal 2
If you're using a custom .fgd to map for portal 2 atm, and you've tried to place some func_instances you will without a doubt have noticed that it's kinda broken.
All portal 2 entities will spawn at 0,0,0 on compile (and leak if that is outside the level). Which makes it impossible to instance any of the new stuff.
Well. Randdalf and I have been working on trying to get this fixed for a couple of days now, and we've found some interesting stuff. Mainly that it actually does in fact work.
How to get instances working in your portal 2 sdk:
1) Get http://dl.dropbox.com/u/1085379/swarm.fgd and put it in your Steam/Steamapps/common/alien swarm/bin/ folder (you may want to backup the existing one, just in case).
You should not change the name of this file.
2) go to Steam/Steamapps/common/Portal 2/Portal2/ Open gameinfo.txt and make sure that it says:
3) Open hammer and set it to load only your new swarm.fgd and nothing else.
Save and restart the SDK just to be sure.
And that should be it, you should be able to continue mapping for portal just as you did before these changes, but now func_instance works with portal entities too.
================================================
PART 2: How to use instances
Go to where ever you keep your vmf files. Usually a folder called "mapsrc" but this may vary. Unzip this small instance sample archive http://dl.dropbox.com/u/1281220/instances_sample.zip into that folder. You should now have a new folder called "instances" with a couple of vmf files inside it.
Next, go into hammer, place a func_instance and set the "VMF filename" keyvalue to for example "instances/cube_dropper_clean.vmf" (minus quote marks). There's a browse button there, but it rarely works so just type manually.
Set the "Fix Up Name" keyvalue to whatever you like. This will act as the regular targetname (or Name) you see on other entities.
Leave the rest as default.
Hit apply and close the properties window. If you don't have a massive cube dropper in your map now, you have either put the vmf files in the wrong place, or not typed in the path to it correctly on the VMF filename.
Your map must also be saved before instances can be loaded into it!
If you do have a massive cube dropper, congratulations.
Here's an example logic_auto set up to target the instance that I set the fix up name of to "cubedropper1". It tells it to drop one cube, and then continue to drop a cube when the current one gets dissolved/fizzled.
They work, they just look like broken outputs.
================================================
I'm working on getting more instances ready. Most importantly the elevators and level transition entities. I have most of it working, but still some parts that are being uncooperative.
If you have problems with/suggestions for this guide please leave a message and I'll try to help.
If you're using a custom .fgd to map for portal 2 atm, and you've tried to place some func_instances you will without a doubt have noticed that it's kinda broken.
All portal 2 entities will spawn at 0,0,0 on compile (and leak if that is outside the level). Which makes it impossible to instance any of the new stuff.
Well. Randdalf and I have been working on trying to get this fixed for a couple of days now, and we've found some interesting stuff. Mainly that it actually does in fact work.
How to get instances working in your portal 2 sdk:
1) Get http://dl.dropbox.com/u/1085379/swarm.fgd and put it in your Steam/Steamapps/common/alien swarm/bin/ folder (you may want to backup the existing one, just in case).
You should not change the name of this file.
2) go to Steam/Steamapps/common/Portal 2/Portal2/ Open gameinfo.txt and make sure that it says:
near the top of the file (line 5).GameData "swarm.fgd"
3) Open hammer and set it to load only your new swarm.fgd and nothing else.
Save and restart the SDK just to be sure.
And that should be it, you should be able to continue mapping for portal just as you did before these changes, but now func_instance works with portal entities too.
================================================
PART 2: How to use instances
Go to where ever you keep your vmf files. Usually a folder called "mapsrc" but this may vary. Unzip this small instance sample archive http://dl.dropbox.com/u/1281220/instances_sample.zip into that folder. You should now have a new folder called "instances" with a couple of vmf files inside it.
Next, go into hammer, place a func_instance and set the "VMF filename" keyvalue to for example "instances/cube_dropper_clean.vmf" (minus quote marks). There's a browse button there, but it rarely works so just type manually.
Set the "Fix Up Name" keyvalue to whatever you like. This will act as the regular targetname (or Name) you see on other entities.
Leave the rest as default.
Hit apply and close the properties window. If you don't have a massive cube dropper in your map now, you have either put the vmf files in the wrong place, or not typed in the path to it correctly on the VMF filename.
Your map must also be saved before instances can be loaded into it!
If you do have a massive cube dropper, congratulations.
Here's an example logic_auto set up to target the instance that I set the fix up name of to "cubedropper1". It tells it to drop one cube, and then continue to drop a cube when the current one gets dissolved/fizzled.

They work, they just look like broken outputs.
================================================
I'm working on getting more instances ready. Most importantly the elevators and level transition entities. I have most of it working, but still some parts that are being uncooperative.
If you have problems with/suggestions for this guide please leave a message and I'll try to help.
Last edited: