Bonus Map Script

From ThinkingWithPortals

Jump to: navigation, search
This article is currently a Work In Progress.
Working on it. Leave me alone.


This is a list of information and tutorials about how to enable your custom maps to be loaded through the in-game Bonus Map menu option. This is an excellent feature for Portal, as it allows average Joe users to play maps without having to enable the console, and also allows you to create Challenge versions of your map much like the official Challenge maps.

Contents

Overview

Bonus Map scripts have two major uses.

  • They allow your maps to reach a broader audience by being able to be loaded through the Bonus Map menu option in Portal. People can keep your maps stored wherever they like and load them through the Import Maps interface.
  • They also allow you to create Challenge versions of your maps, where players can try to complete your map in challenges similar to the Challenge versions of Portal maps. You can choose which of the 3 challenges your map includes - Least Portals, Least Steps, and Least Time - and what values can be awarded for Bronze, Silver and Gold medals.

In addition to adding Import Map and Challenge functionality to your map, it allows users to organize and store your maps in whatever locations they prefer. Some people dislike having their /maps directory cluttered with random, unorganized maps with no description. You can also make sure your personal information - such as your name and website - stays attached with your maps.

Import Map Script

How to create the Import Map script files.

Challenge Script

Challenge scripts allow your map to have the Least Portals, Least Steps, or Least Time challenges added to your map. Each challenge type is optional, so it is not necessary to include all types if you do not want them.

Example Challenge Script

This is an example Challenge script, included in your mapname.bns file.

"comment"	"Challenges For Some Map"
"challenges"
{
	"Least Time Challenge"
	{
		"comment"	"I Hate Least Time Challenges"
		"type"		"2"

		"bronze"	"90"
		"silver"	"60"
		"gold"		"30"
	}

	"Least Portals Challenge"
	{
		"comment"	"Requires Lots of Thinking!"
		"type"		"0"

		"bronze"	"9"
		"silver"	"5"
		"gold"		"2"
	}
}

The first "comment" key defines the description to be listed in the Bonus Maps menu. Each key block under the "challenges" heading defines a new challenge type, proceeded by the description for it in quotes.

Don't forget to also add a prop_portal_stats_display elevator entity at the end of your map that will end the challenge show the player their scores.

Key Values

  • comment <string>
A short description for the challenge.
  • type <integer>
The type of challenge. 0 is Least Portals, 1 is Least Steps, and 2 is Least Time.
  • bronze <integer>
Number of Portals/Steps/Time needed to get a Bronze medal.
  • silver <integer>
Number of Portals/Steps/Time needed to get a Silver medal.
  • gold <integer>
Number of Portals/Steps/Time needed to get a Gold medal.

External Links

Personal tools