Display Popup Action: Difference between revisions

From Pummel Party Mod Documentation
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 7: Line 7:


A preview is shown within the action editor to give a rough idea of what the popup will look like in-game. This preview is only a guide, make sure to view it in play mode to ensure the text displays as expected.
A preview is shown within the action editor to give a rough idea of what the popup will look like in-game. This preview is only a guide, make sure to view it in play mode to ensure the text displays as expected.
[[File:DisplayPopupIngameExample.png|thumb|600px|right|How the example above appears ingame.]]


The buttons shown on the popup consist of the close button and 0, 1, 2, 3 or 4 choice buttons. The close button is always free to use and will simply close the popup. it can be disabled if you want to force the player to make a choice. The choice buttons can be used to run a set of actions when selected. They can be made to cost some resources to press. If the player doesn't have enough of the selected resource, they are unable to select the button. Choice buttons can also be free to press.
The buttons shown on the popup consist of the close button and 0, 1, 2, 3 or 4 choice buttons. The close button is always free to use and will simply close the popup. it can be disabled if you want to force the player to make a choice. The choice buttons can be used to run a set of actions when selected. They can be made to cost some resources to press. If the player doesn't have enough of the selected resource, they are unable to select the button. Choice buttons can also be free to press.


A choice button cannot be made to cost two types of resources to press. Only a single type of resource can be set as the cost of each button, but multiple of that same resource can be added. Eg. A button can't be made to cost 1 trophy and 1 key, but it can be made to cost 5 keys.
A choice button cannot be made to cost two types of resources to press. Only a single type of resource can be set as the cost of each button, but multiple of that same resource can be added. E.g. A button can't be made to cost 1 trophy and 1 key, but it can be made to cost 5 keys.


When a choice button is given a cost, an image of the currency (keys, health, trophy, etc) is shown beside the button text with an amount shown in the bottom corner. Eg if a button costs 10 keys to press, it will show the keys icon with a small "x10" text in the bottom corner. When an item is required to press a choice button, the icon for that specific item is shown.
When a choice button is given a cost, an image of the currency (keys, health, trophy, etc) is shown beside the button text with an amount shown in the bottom corner. Eg if a button costs 10 keys to press, it will show the keys icon with a small "x10" text in the bottom corner. When an item is required to press a choice button, the icon for that specific item is shown.
Line 69: Line 71:


== Actions ==
== Actions ==
Each button can be given a set of actions to run when the player selects it. More Display Popup actions can be added to each button to create a simple, one-way dialogue tree.
Each button can be given a set of actions to run when the player selects it. This is done by adding actions to the "On Select" event of each choice. [[Display Popup Action]]s can be nested within these events, allowing for the creation of a simple, one-way dialogue tree.  


If there are more actions to run below a Display Popup action in the action list, those actions will run after the popup has closed and any actions run by that popup have been completed.
If a popup is opened within a set of actions, the actions after the [[Display Popup Action]] will wait until the popup is closed before they are run.
If a popup is opened within a set of actions, the actions after the [[Display Popup Action]] will wait until the popup is closed before they are run.
== Example Usage ==
This action can be used to create a basic shop by showing a number of buttons that each cost some number of keys or other resources and run a [[Give Item Action]] when pressed.
Another use is to enable or disable paths through the board based on the player's choice. This could involve having a choice that uses a [[Set Connection Active Action]] to enable a new path just ahead of the player. Then once the player progresses into the new path, a separate Set Connection Active Action could disable the path behind them so that other players cannot follow.
A simpler implementation might use the [[Move To Space Action]] to simply teleport the player to a different space if they choose to.
Finally, a popup could be used that asks the player if they want to damage any players on a given set of spaces. This can force players to choose if they want to harm their friends or not, which is always a fun choice to make and can make the game more memorable!
[[Category:Actions]]

Latest revision as of 05:03, 15 August 2023

NOTICE: This content is planned for a future update. Everything on this page is subject to change or may not be added at all.

The Display Popup action in the Action Editor.

An action to display a popup window during a player's turn that they must interact with.

Should be used on a Board Space Event Component. Can only be used in Board Mods.

A preview is shown within the action editor to give a rough idea of what the popup will look like in-game. This preview is only a guide, make sure to view it in play mode to ensure the text displays as expected.

How the example above appears ingame.

The buttons shown on the popup consist of the close button and 0, 1, 2, 3 or 4 choice buttons. The close button is always free to use and will simply close the popup. it can be disabled if you want to force the player to make a choice. The choice buttons can be used to run a set of actions when selected. They can be made to cost some resources to press. If the player doesn't have enough of the selected resource, they are unable to select the button. Choice buttons can also be free to press.

A choice button cannot be made to cost two types of resources to press. Only a single type of resource can be set as the cost of each button, but multiple of that same resource can be added. E.g. A button can't be made to cost 1 trophy and 1 key, but it can be made to cost 5 keys.

When a choice button is given a cost, an image of the currency (keys, health, trophy, etc) is shown beside the button text with an amount shown in the bottom corner. Eg if a button costs 10 keys to press, it will show the keys icon with a small "x10" text in the bottom corner. When an item is required to press a choice button, the icon for that specific item is shown.

Customisation

The popup can be customised in various ways to suit the custom board. Attributes that can be set include:

  • The title of the popup
  • The description/content of the popup
  • The square speaker image on the popup
  • Whether to show the close button or not
  • The text on the close button
  • The number of other buttons to display (up to 4)
  • The text on the other buttons
  • The cost to press the other buttons
  • The small image icon that appears on each of the other buttons
Property Description
Title/Speaker Name The text shown along the top of the popup. Use this to represent the title of the popup, or the name of the speaker if it's meant to represent a dialogue box.
Body Text The text shown within the main area of the popup. use this to explain something to the player.
Speaker Icon A texture representing the speaker or some other information related to the popup. The texture is shown in a square area so it should be a square image.
Choice buttons The number of buttons the player is shown (in addition to the close button if enabled).
Choice # Label The text to display on the button. Keep this text short as there isn't much room.
Cost of Choice # The weapon fires discrete hitscan projectiles.
None The player is free to select this button. It will always be enabled.
Key The player must have and spend some number of keys to select this button.
Cost (Key) The cost in keys to select this button.
Health The player must have and spend some number of health points to select this button.
Cost (Health) How much HP to remove from the player when they press this button.
Item The player must have and spend some number of a given item to select this button.
Item Cost The specific item that the player must pay to press this button.
Cost (Item) How many of the chosen item must be spent to press this button.
Trophy The player must have and spend trophies to select this button.
Cost (Trophy) The cost in trophies to select this button.
Show Close Button Whether or not to use the close button on this popup.
Close Button Text The text to display on the close button. Examples would be things like "Close", "Cancel", "No thanks", etc depending on the context of the popup.

Actions

Each button can be given a set of actions to run when the player selects it. This is done by adding actions to the "On Select" event of each choice. Display Popup Actions can be nested within these events, allowing for the creation of a simple, one-way dialogue tree.

If there are more actions to run below a Display Popup action in the action list, those actions will run after the popup has closed and any actions run by that popup have been completed. If a popup is opened within a set of actions, the actions after the Display Popup Action will wait until the popup is closed before they are run.

Example Usage

This action can be used to create a basic shop by showing a number of buttons that each cost some number of keys or other resources and run a Give Item Action when pressed.

Another use is to enable or disable paths through the board based on the player's choice. This could involve having a choice that uses a Set Connection Active Action to enable a new path just ahead of the player. Then once the player progresses into the new path, a separate Set Connection Active Action could disable the path behind them so that other players cannot follow.

A simpler implementation might use the Move To Space Action to simply teleport the player to a different space if they choose to.

Finally, a popup could be used that asks the player if they want to damage any players on a given set of spaces. This can force players to choose if they want to harm their friends or not, which is always a fun choice to make and can make the game more memorable!