Custom Board Space

From Pummel Party Mod Documentation
Revision as of 03:46, 30 November 2022 by RBDev (talk | contribs) (Initial content)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Custom board spaces are board spaces that are created through the mod editor and stored as a Prefab Asset.

Overview

Two custom board spaces in a board mod.

Board Mods can be built using the main board space types found in the base game. They also contain a special board type Custom. By using this type you can then specifiy a custom prefab to use for that board space. You can assign your own Actions to this space using a Board Space Event Component to define what happens when a player lands on the custom space.

Creating Custom Board Spaces

Creating the prefab

Custom board spaces need to be stored in a prefab to be used. Create a new prefab asset. This is all that is required but your board space would be invisible and do nothing. You are responsible for creating the visual component of the board space. If you want to use a board space that you can adjust that fits the style of the rest, a custom board space prop is provided.

Using the custom space prop

Using a custom material on the custom board space prop to create a new board space.

Open the prefab and add a new child containing a prop. For the prop model, search for the prop named "CustomBoardSpace". This space is black with a green pummel character on it. You can use this, or you can modify the color and icon on the space. To do this, create a new Material Asset using the Asset Browser. Select the new material and in the Inspector Window change the Shader to "Custom Board Space Shader". You can see what each of the available options do here

Using other props

Custom board spaces made without using the provided custom space prop.

There is nothing stopping you from making a custom board space that uses entirely different props or visuals to the existing board spaces. You could even build a board mod entirely from custom spaces by recreating many of the provided spaces logic using Actions (excluding the start space and graveyard space, those are required).

Adding Actions to the board space

To make the board space do something when the user lands on it, it needs a set of actions. Without this the board space will do nothing and act as a free space. Open the prefab containing the board space and select the root gameobject. This is the gameobject at the top of the prefab hierarchy. Add a Board Space Event Component to this gameobject; if added to any other gameobject this component won't work. This component will fire events whenever the space is landed on by a player. Using the inspector you can add Actions to this component.

Adding the prefab to the mod settings

The final step before you can start adding the board space to the board is to add it to the Mod Settings. This will make it appear as a selectable custom type when using a Board Space Component set to the type Custom. Open the mod settings by clicking the yellow/orange "⚙️ Board Settings" object at the top of the object hierarchy in the Hierarchy Window. This opens the mod settings in the inspector. Expand the section titled "Custom Board Spaces" and add a new entry to the list. Fill the new entry with a reference to the prefab you created for the board space.

Using a custom board space

Place a new board space gameobject/component or find an existing one you wish to change. in the inspector for the component set the Type to Custom. From the Custom Node Type dropdown below this, set the Prefab to that of the custom board space you wish to use. The board space is now your custom board space.