Skip to content

Latest commit

 

History

History
178 lines (102 loc) · 10.1 KB

MAPPING_GUIDE.md

File metadata and controls

178 lines (102 loc) · 10.1 KB

Mapping for Minigolf

The mapper has full control of the minigolf tracks using the scripted entities (SENTs) specified in the chapter below.

Example of a minigolf_hole_start and minigolf_trigger_oob brush

Mapping Reference

In order to quickly add the below entities you can include the minigolf.fgd in Hammer (Tools > Options > Game Configurations > Game Data Files > Add).

minigolf_hole_start

Describes where players start to play on a minigolf track (by pressing USE on it). The hole and description are displayed on the players' GUI.

Available Properties:

  • targetname: You need to give every start entity a unique name. One or more minigolf_hole_end will point to this.

  • par: average amount of strokes players should aim for (default: 3)

  • hole: the name of this hole (required)

  • course: the name of the course this hole is on, for when there are multiple courses on one map (default: "", (an empty string))

  • order: number used for ordering holes on the scoreboard (lower numbers appear higher)

  • limit: how long players can take on the hole in seconds (default: 60)

  • description: a description for the hole

  • maxStrokes: how many strokes are allowed before the game ends automatically (default: 12)

  • maxPitch: how many degrees pitch a player can make a lob shot at, don't specify or set as 0 to indicate no lob shots allowed (default: 0)

  • maxRetriesAfterCompleting: how many times a player can retry this hole after completing it. -1 for infinite, 0 for no retries until all holes have been finished

  • maxRetriesAfterTimeLimit: how many times a player can retry this hole after reaching the time limit. -1 for infinite, 0 for no retries until all holes have been finished

  • maxRetriesAfterMaxStrokes: how many times a player can retry this hole after reaching the maximum amount of strokes. -1 for infinite, 0 for no retries until all holes have been finished

Hammer Instructions:

  1. In hammer spawn a new Point Entity and select it

  2. Open the object properties by pressing Ctrl + Enter

If you are not using the minigolf.fgd:

  1. In the Class dropdown select all text and remove it, typing minigolf_hole_start instead. The entity will always have the Obsolete icon

  2. Turn of SmartEdit by clicking the button

  3. Click Add

  4. Now type in the properties listed above under Key.

  5. Give your desired value under Value then click OK to finalize your configuration.

If you are using the minigolf.fgd:

  1. Select the minigolf_hole_start from the Class dropdown

  2. Configure the available properties

When the map is loaded by the gamemode these values are stored in memory.

minigolf_hole_end

Specifies the end/goal/hole. When the ball touches this brush the player will have reached the end in as many strokes as they have up to that point.

Because of this design, in theory it's possible (untested) to have a hole with a single start and multiple valid ends (that all point to the same start.)

Available Properties:

  • start_hole: The targetname of a minigolf_hole_start that is associated with this end.

Hammer Instructions:

  1. Create one or multiple brushes in Hammer, along the edges and over the top of the minigolf track.

  2. Give these brushes the 'trigger' material on all faces.

  3. Now press Ctrl + T to tie it to an entity

  4. Choose minigolf_hole_start as the entity type by typing it into the class name (or selecting it if you are using the minigolf.fgd).

  5. Edit the start_hole (Start Hole) property using the eyedropper tool.

  6. Click the minigolf_hole_start that is associated with this end: Using the eyedropper to select the associated start entity You need to have made sure that the minigolf_hole_start has a name (targetname property).

minigolf_hole_flag

This entity adds a flag to a hole. When the player comes near the flag it will raise, allowing them to see the ball better around the hole area.

Hammer Instructions:

  1. Create a point entity with the class minigolf_hole_flag

  2. Rotate the entity in the object properties menu to change the rotation of the flag relative to the top(x/y) view:

    Showing the direction relative to the top view

  3. Make sure the entity is touching the related minigolf_hole_end

minigolf_trigger_oob

When the ball touches this brush the ball is considered Out-Of-Bounds. The ball will be reset to the last valid position There are no properties for this entity.

Hammer Instructions:

  1. Create one or multiple brushes in Hammer, along the edges and over the top of the minigolf track.

  2. Give these brushes the 'trigger' material on all faces.

  3. Now press Ctrl + T to tie it to an entity

  4. Choose minigolf_trigger_oob as the entity type by typing it into the class name (or selecting it if you are using the minigolf.fgd).

minigolf_config

A point entity that dictates how the addon should behave. It can set default information for all holes. There should be only one of this entity on a map.

Available Properties:

  • defaultMaxRetriesAfterCompleting: How many times a player can retry any hole after completing it. The maxRetriesAfterCompleting property on a hole overrides this. -1 for infinite, 0 for no retries until all holes have been finished (default: 0)

  • defaultMaxRetriesAfterTimeLimit: How many times a player can retry any hole after reaching the time limit. The maxRetriesAfterTimeLimit property on a hole overrides this. -1 for infinite, 0 for no retries until all holes have been finished (default: 0)

  • defaultMaxRetriesAfterMaxStrokes: How many times a player can retry any hole after reaching the maximum amount of strokes. The maxRetriesAfterMaxStrokes property on a hole overrides this. -1 for infinite, 0 for no retries until all holes have been finished (default: 0)

Additional properties

You can control more behaviour by applying any of the following properties to any point and/or brush entities.

  • (Key) minigolfCollide
    • Useful for func_physboxes that should only interact with balls or other physboxes
    • Possible values:
      • except_players: Collide with everything, except players
      • only_balls: Collide only with minigolf balls
      • only_others: Collide only with other entities that have only_others (or balls_and_others) as a value for this property
      • balls_and_others: Collide with balls and entities with only_others or balls_and_others as a value for this property

Examples

Tips & Problems

Prevent your compile time from skyrocketing

Source Engine is great at optimizing games for computers with non-ideal hardware. Some of this optimizing is done before-hand, for example when compiling the map. If you notice that compilation is taking longer than half a minute you should check the following.

  1. Compile your map (File > Run Map)
  2. In Hammer, go to Map > Load Portal File Loading a portal file
  3. A simple healthy map looks like this: Simple empty map
  4. Let's create a minigolf hole in it, compile and then reload our portal file: Complex portals due to minigolf hole
  5. To fix this we will tie the brushes that make up the minigolf track to a func_detail entity (select all those brushes and press Ctrl + T): Complex portals due to minigolf hole
  6. After we compile again and re-load our portal file we see that it has helped to reduce portals: Simple portals again

Click here to read more about how these portals optimize the game, as well as to see why we don't need them around our minigolf tracks