Essentials Docs Wiki

The Essentials wiki has moved and is now at: Essentials Engine wiki

This wiki will no longer be updated.

READ MORE

Essentials Docs Wiki
Advertisement
BugCatchingContest

A Bug-Catching Contest being judged.

This page describes the Bug-Catching Contest, a competition in which trainers compete against each other by catching the best Bug-type Pokémon.

Bug-Catching Contest code[]

class BugContestState contains various pieces of information about the state of a Bug-Catching Contest, along with several methods that make one work. There is only one instance of this class throughout a game, which can be obtained with pbBugContestState.

Notable methods in class BugContestState are:

Method Description
pbContestHeld? Returns whether the player has participated in a Bug-Catching Contest within the last 24 hours. Used in a conditional branch to prevent the player from participating in more than one Contest per day.

The 24 hour check is acceptable, as the Bug-Catching Contest typically only occurs on Tuesdays, Thursdays and Saturdays (i.e. non-consecutive days).

pbSetJudgingPoint(map_id, x, y) The map and coordinates the player is teleported to at the end of the Contest, where the results are announced. There is an optional fourth parameter which is the direction the player will be made to face, which is 8 (up) by default.
pbSetReception("BugContestReception") Set a map metadata flag; any map with this flag in their map metadata will be considered a reception map. Reception maps are ones the player can reach just by walking from the Contest map, e.g. gatehouses surrounding the park in which the Contest takes place. The Bug-Catching Contest is not cancelled if the player enters a reception map, but events in those maps should ask whether the player wants to end the Contest early and, if not, return them to the map that the Contest takes place on.

This method allows multiple flags to be used, and also allows map ID numbers instead/as well as flags. Using a single flag should suffice, though.

pbSetContestMap("BugContest") Set a map metadata flag; any map with this flag in their map metadata is a map in which the Bug-Catching Contest takes place. If the player goes to a different map (that isn't a reception map), the Contest is cancelled. The Pokémon caught by the other contestants are randomly chosen from what is encounterable on the Contest map(s).

This method allows multiple flags to be used, and also allows map ID numbers instead/as well as flags. Using a single flag should suffice, though.

pbSetPokemon(party_index) Designates a single Pokémon in the player's party (at index party_index) to be the Pokémon used by the player during the Contest. This is typically `pbGet(1)`, which returns a party index number previously chosen via pbChooseAblePokemon(1, 2) (its party index is stored in Game Variable 1 and its name in Game Variable 2).
pbStart(num_balls) Starts the Bug-Catching Content. num_balls is the number of Sport Balls the player starts with.
pbStartJudging Judges all the contestants, and transfers the player to the judging point.
pbGetPlaceInfo(place) At the end of the Bug-Catching Contest, this method puts the name of a contestant in Game Variable 1, the name of the Pokémon they caught in Game Variable 2, and that Pokémon's score in Game Variable 3. The contestant is the one who finished in first place (if place is 0), second place (if place is 1) or third place (if place is 2).
place The place that the player ended up in (0 is first place, 1 is second place, 2 is third place, 3 is any other place).
pbEnd Ends the Bug-Catching Contest.

In addition, there are two methods that are used as Script Switches:

Method Description
pbBugContestUndecided? Returns whether the Bug-Catching Contest is underway but has not yet finished. Used to ask whether the player wants to finish the Contest early if they enter a reception map.
pbBugContestDecided? Returns whether the Bug-Catching Contest is over. Used to begin the ending ceremony in which the winners are announced and prizes awarded.

Creating a Bug-Catching Contest[]

Content not yet written.

Advertisement