Custom Sign Example + Source

Avatar
4,141 Posts
Admin
Posted May 20, 2011
Example of how to include a custom sp_lightboard_icons.txt without overwriting existing user data. The answer is easy - use a VPK!

File Name: Custom Sign Example.rar
File Size: 176.55 KiB

Advertisement
Registered users don’t see ads! Register now!
Avatar
4,141 Posts
Admin
Posted May 20, 2011
Replied 1 minutes later
There's not much more to it other than following this creating a VPK for Portal 2 article. Basically you include the modified sp_lightboard_icons.txt file and your map into the VPK, so that you do not overwrite any of the actual game data files. My example lightboard addition is as such:

      "custom_sign_example"
      {
         //Map data
         "level_number" "1"
         "total_levels" "33"
         "startup" "dirty_flicker_flicker"
         "dirt" "1"

         "icons"
         {
            "cube_drop" "0"
            "cube_bonk" "0"
            "paint_bounce" "0"
            "paint_speed" "0"
            "goop" "0"
            "turret" "0"
            "turret_burn" "0"
            "portal_fling" "0"
            "portal_fling_2" "0"
            "handoff" "0"
         }
      }

I can't seem to find any info on if files in a VPK overwrite existing game files on game startup or when a map is loaded from one. I am pretty sure it will still override the sp_lightboard_icons.txt present in the vscripts folder. So don't be a douchebag and release a VPK with a blank one of these to ruin someone's game.

I'll have to do some testing to see how it reacts when there are multiple VPKs with different lightboard files in it.

Avatar
294 Posts
Posted May 20, 2011
Replied 1 hour later
Excellent stuff :biggrin: . Certainly beats the VTF editing that had to be done back in the day.
Avatar
4,141 Posts
Admin
Posted May 20, 2011
Replied 6 hours later
Yeah seriously. My only complaint is that you can't add more things to it. Like where it says "None" when you don't enter the level_number and total_levels, I was hoping we could put text there (such as, "www.ThinkingWithPortals.com"). Could still do this with materials but eh, why do it the hard way.
Posted May 20, 2011
Replied 7 hours later
So if we do this for a custom map, we don't have to package materials/sounds/etc in the map?

Awesome.

Avatar
4,141 Posts
Admin
Posted May 20, 2011
Replied 1 hour later
Using a VPK is an alternative to using Pakrap or BSPZIP.
Posted May 22, 2011
Replied 1 day later
this is great and there will probably be a whole wave of singleplayer maps (doesn't work in co-op :sad: )
with custom lightboards. great work
Posted May 22, 2011
Replied 3 hours later
VPKs (and the lightboard files) are loaded at Game start, so this will have the same issues that replacing the file would, as the VPKs will override each other and whichever one the game gets to first will load. Whether this is alphabetical or by recency I don't know, but I can't see this working out well.
Posted May 23, 2011
Replied 20 hours later
I also have to point out that the script for the coop signs are in a different folder. They are in: Steam\steamapps\common\portal 2\portal2\scripts\vscripts\coop and is named coop_lightboard_icons. How they work? I am yet to know.

EDIT: I decompiled one of the coop maps and saw that they should have a instance for coop signs but they don't. So far I've been able to make a sign appear in coop-mode but all it's values are default, even though I did put code into it.

Looking into it...

Posted May 25, 2011
Replied 1 day later
Co-op custom signs obviously don't want to be made. I renamed a default co-op map and then renamed my map to it. The sign works but I still can't make any custom signs.

I don't know where they shoved in code to label the map one of the 5 courses and what Chamber number it is in the list. I looked through nearly every possible script, even files still in the pak_01.dir.
A mystery...

Posted Aug 04, 2011
Replied 2 months later

Quote:
I don't know where they shoved in code to label the map one of the 5 courses

Labels stored in file: resource/portal2_LANGUAGE.txt, "P2COOP_TrackName_X"

And if you put copy of this file to VPK with another lables, it will replace an official labels...

Posted Sep 15, 2011
Replied 1 month later
Is it possible to have unique multiple custom signs in a single level(bsp)?
Posted Sep 16, 2011
Replied 15 hours later

chimera201 wrote:
Is it possible to have unique multiple custom signs in a single level(bsp)?

Should be possible as I think there has to be more than one test chamber shoved in one map in Valve's maps.

...Decompile...

Avatar
1,080 Posts
Posted Sep 16, 2011
Replied 1 hour later
No, the only map with two has one that never enables.
Posted Sep 16, 2011
Replied 4 hours later
iWork925 is right and that is the reason why i asked. Is there a hacky way of doing it?
Advertisement
Registered users don’t see ads! Register now!
Posted Sep 18, 2011
Replied 1 day later
Yeah, but it takes a bit longer and it doesnt use scripts, heres the link to this guys awesome tutorial on how to do it:
http://forums.thinking.withportals.com/mapping-help/custom-chamber-signs-without-vscripts-t3663.html