Please or Register to create posts and topics.

Portal 2 Extras Menu Patcher 1.0

Page 1 of 3Next

Drag & drop custom maps to add them to the Portal 2 Extras menu (for easy loading without console)!

It is very easy to use: It will automatically get your portal2.exe path & map name in the folder where the patcher is. Just set the title and subtitle. You can also set a picture for your map (not necessary).

The program can save default settings to an ini file to make patching even easier. It also supports drag & dropping .bsp, .vtf, .txt and .exp files. .txt and .exp have to be in the example format. You can easily create such files with the program and release them with your maps.

It can also copy map files to the portal2maps folder. Try drag & dropping your map file onto the program to easily patch extras.txt and copy the map file to Portal 2!

The program will also notice if the map already exists in the extras.txt and will ask the user if he wants to update the information.

You can now also patch version 7.5 .vtf files to version 7.4!

The program is made using Visual C# 2010 Express so it'll need the .NET Runtime to be installed.

Thanks for reading & testing the program! Please report if you encounter any problems with it!

File Name: Portal2ExtrasPatcher.zip
File Size: 74.7 KiB
Click here to download Portal 2 Extras Menu Patcher

I'm different.

Great work so far, I think you should add another implementation.

Suggestion 1

You create a file format that map makers will use to create a custom text file that has the relevant map info (Map ID, filename, title, subtitle, picture etc). Therefore each map released could include one of these files.

You then drag + drop that text file, into your application. The app will then parse the new file type, grabbing relevant information. It will then open up the default extras.txt and add the new map data.

Suggestion 2

You create a folder in the Portal 2 directory called Extra Maps, inside of this will store each of the custom map extra files I described earlier. Your app will then loop through all the txt files within that folder and create a new extras.txt based on that information. This is incase you delete your extas.txt file, your app will still be able to generate a new one with the relevant map information.

Walking when you have a portal gun sucks.

Check out my Portal 2 map, Entrapment!
http://forums.thinking.withportals.com/community-releases/entrapment-1-1-1-t2323.html

I just started it up and was greeted with a fatal error.

Code: Select all
************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Portal2ExtrasMod.Form1.Form1_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Hello! This is the part where I kill you!

Do you have the .NET 3.0 runtimes installed?

Walking when you have a portal gun sucks.

Check out my Portal 2 map, Entrapment!
http://forums.thinking.withportals.com/community-releases/entrapment-1-1-1-t2323.html
Beer-Me wrote:
Do you have the .NET 3.0 runtimes installed?

Yes, I have .NET 3.0, as well as 3.5 and 4 for that matter.

Hello! This is the part where I kill you!

The error usually occurs when an array is accessed at an invalid index location, making it outside of the index's bounds.

Looking at the source code, the area that it is likely to occur is within:

Code: Select all
   string[] files = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.bsp");
   if (files != null)
   {
      files[0] = Path.GetFileName(files[0]);
      files[0] = files[0].Remove(files[0].Length - 4);
      this.txt_mapfile.Text = files[0];
      this.txt_ID.Text = files[0];
   }

He really needs to check whether files[0] is not empty (null). Hes checking to see if the array is empty, its not but the array elements are.

You should really use if (files.length > 0)

Walking when you have a portal gun sucks.

Check out my Portal 2 map, Entrapment!
http://forums.thinking.withportals.com/community-releases/entrapment-1-1-1-t2323.html
Beer-Me wrote:
The error usually occurs when an array is accessed at an invalid index location, making it outside of the index's bounds.

Looking at the source code, the area that it is likely to occur is within:

Code: Select all
   string[] files = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.bsp");
   if (files != null)
   {
      files[0] = Path.GetFileName(files[0]);
      files[0] = files[0].Remove(files[0].Length - 4);
      this.txt_mapfile.Text = files[0];
      this.txt_ID.Text = files[0];
   }

He really needs to check whether files[0] is not empty (null). Hes checking to see if the array is empty, its not but the array elements are.

You should really use if (files.length > 0)

Thanks for your replies! I think I've fixed it now.

I will try to make the implementations you mentioned earlier...

I'm different.

It would be cool if it was possible to click and drag a file like this:

Code: Select all
//include_maps:n5_sequential01.bsp:n5_sequential02.bsp:n5_sequential03.bsp
//include_materials/vgui/extras:n5_sequential01.vmt:n5_sequential01.vtf
   "n5_sequential01"
   {
      "title"      "Sequential"
      "subtitle"   "A custom map by Nightgunner5"
      "pic"      "vgui/extras/n5_sequential01"
      "map"      "n5_sequential01"
   }

Onto your program and have it automatically install everything that is needed.

Hello! This is the part where I kill you!
Nightgunner5 wrote:
It would be cool if it was possible to click and drag a file like this:

Code: Select all
//include_maps:n5_sequential01.bsp:n5_sequential02.bsp:n5_sequential03.bsp
//include_materials/vgui/extras:n5_sequential01.vmt:n5_sequential01.vtf
   "n5_sequential01"
   {
      "title"      "Sequential"
      "subtitle"   "A custom map by Nightgunner5"
      "pic"      "vgui/extras/n5_sequential01"
      "map"      "n5_sequential01"
   }

Onto your program and have it automatically install everything that is needed.

I'll try to make that possible.

What are those commented lines? Are those important?

I'm different.
Haapavuo wrote:
Nightgunner5 wrote:
It would be cool if it was possible to click and drag a file like this:

Code: Select all
//include_maps:n5_sequential01.bsp:n5_sequential02.bsp:n5_sequential03.bsp
//include_materials/vgui/extras:n5_sequential01.vmt:n5_sequential01.vtf
   "n5_sequential01"
   {
      "title"      "Sequential"
      "subtitle"   "A custom map by Nightgunner5"
      "pic"      "vgui/extras/n5_sequential01"
      "map"      "n5_sequential01"
   }

Onto your program and have it automatically install everything that is needed.

I'll try to make that possible.

What are those commented lines? Are those important?

That's actually a working configuration file for my patcher. The commented lines tell it files to copy.

Hello! This is the part where I kill you!
Page 1 of 3Next