Please or Register to create posts and topics.

Custom Sign Example + Source

Page 1 of 2Next

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
Click here to download Custom Sign Example + Source

[Important Threads] Forum Rules | Welcome to the new Thinking With Portals
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.

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:

Code: Select all
      "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.

[Important Threads] Forum Rules | Welcome to the new Thinking With Portals
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.

Excellent stuff :D . Certainly beats the VTF editing that had to be done back in the day.

New tracks every Saturday!
http://www.soundcloud.com/jomonay
"Anything that you do, just be THE best at it" - Kanye West

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.

[Important Threads] Forum Rules | Welcome to the new Thinking With Portals
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.

So if we do this for a custom map, we don't have to package materials/sounds/etc in the map?

Awesome.

Using a VPK is an alternative to using Pakrap or BSPZIP.

[Important Threads] Forum Rules | Welcome to the new Thinking With Portals
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.

this is great and there will probably be a whole wave of singleplayer maps (doesn't work in co-op :( )
with custom lightboards. great work

you know who i am?! i'm the man who's gonna burn your map down, with the lemons, im gonna get my coders to create a combustible lemons, that burns your map down!

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.

I also have to point out that the script for the coop signs are in a different folder. They are in: Steamsteamappscommonportal 2portal2scriptsvscriptscoop 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...

?????????????????????????????TWP Releases | My Workshop

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...

?????????????????????????????TWP Releases | My Workshop
Page 1 of 2Next