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
(Created page with "thumb|220x220px This article describes how to create '''item balls''', objects on a map that the player can pick up. This article covers visible item ba...")
Tag: Visual edit
 
Maruno (talk | contribs)
No edit summary
Tag: Source edit
(One intermediate revision by the same user not shown)
Line 1: Line 1:
[[File:ItemBall.png|thumb|220x220px]]
+
[[Image:ItemBall.png|right|256px|thumb|An item ball.]]
This article describes how to create '''item balls''', objects on a map that the player can pick up. This article covers visible item balls, hidden items, and balls containing Pokémon.
+
This page describes how to create '''item balls''', objects on a map that the player can pick up. This article covers visible item balls, hidden items, and balls containing Pokémon.
   
 
== Item balls ==
 
== Item balls ==
[[File:ItemBallEvent.png|thumb|220x220px]]
+
[[Image:ItemBallEvent.png|right|256px|thumb|Page 1 of an item ball event.]]
  +
To create an item that can be picked up, create a new event with the name "<code>Item:XXX</code>", where "<code>XXX</code>" is the internal name of the item (e.g. "<code>Item:POTION</code>"). When the game is [[Compiler|compiled]], this event will be edited automatically to turn it into a proper item ball, complete with graphic.
   
To create an item that can be picked up, create a new event with the name "<code>Item:XXX</code>", where "XXX" is the internal name of the item (e.g. "<code>Item:POTION</code>"). When the game is compiled, this event will be edited automatically to turn it into a proper item ball, complete with graphic.
+
The item's name is only important for turning the item into a proper item ball when compiling the game. Once this has been done, the item's name is not important. However, it should not be renamed back to "<code>Item:XXX</code>" then, because when the game is next compiled, the event will be edited again, potentially overwriting any changes you may have made to the item ball.
 
The item's name is only important for turning the item into a proper item ball when compiling the game. Once this has been done, the item's name is not important. However, it should not be renamed "<code>Item:XXX</code>" then, because when the game is next compiled, the event will be edited again, potentially overwriting any changes you may have made to the item ball.
 
   
 
=== Item ball event ===
 
=== Item ball event ===
  +
 
Item ball events have two event pages. The first page has an "Action Button" trigger and looks like this:
 
Item ball events have two event pages. The first page has an "Action Button" trigger and looks like this:
  +
@>Conditional Branch: Script: Kernel.pbItemBall(PBItems::POTION)
+
@>Conditional Branch: Script: pbItemBall(:POTION)
 
@>Control Self Switch: A =ON
 
@>Control Self Switch: A =ON
@>
 
 : Else
 
 
@>
 
@>
 
 : Branch End
 
 : Branch End
 
@>
 
@>
  +
 
The second event page is blank, and depends on the event's Self Switch A being ON.
 
The second event page is blank, and depends on the event's Self Switch A being ON.
   
The def <code>Kernel.pbItemBall</code> displays two messages: the first is that the player has found the item, and the second is that the player has put it in a particular pocket of their Bag (or that their Bag is full, in which case the item is not picked up).
+
The <code>def pbItemBall</code> displays two messages: the first is that the player has found the item, and the second is that the player has put it in a particular pocket of their [[Bag]] (or that their [[Bag]] is full, in which case the item is not picked up). This is described a little more on the page [[Manipulating items]].
   
 
== Hidden items ==
 
== Hidden items ==
[[File:HiddenItemEvent.png|thumb|220x220px]]
+
[[Image:HiddenItemEvent.png|right|256px|thumb|Page 1 of a hidden item event.]]
 
Hidden items are identical to regular item balls, with three exceptions: they are invisible, the player can walk over them, and they can be detected by an [[Itemfinder]].
   
  +
To create a hidden item, create a new event with the name "<code>HiddenItem:XXX</code>", where "<code>XXX</code>" is the internal name of the item (e.g. "<code>HiddenItem:NUGGET</code>"). When the game is compiled, this event will be edited automatically to turn it into a proper hidden item.
Hidden items are identical to regular item balls, with three exceptions: they are invisible, the player can walk over them, and they can be detected by an Itemfinder.
 
   
To create a hidden item, create a new event with the name "<code>HiddenItem:XXX</code>", where "XXX" is the internal name of the item (e.g. "<code>HiddenItem:NUGGET</code>"). When the game is compiled, this event will be edited automatically to turn it into a proper hidden item.
+
Unlike regular item balls, hidden items ''must'' have the exact name "<code>HiddenItem</code>". This is because the [[Itemfinder]] looks for nearby events with that name, and reacts if there are any. The name above that includes "<code>XXX</code>" is automatically changed to this when the game is compiled.
 
Unlike regular item balls, hidden items ''must'' have the exact name "<code>HiddenItem</code>". This is because the Itemfinder looks for nearby events with that name, and reacts if here are any. The name above is automatically changed to this when the game is compiled.
 
   
 
=== Hidden item event ===
 
=== Hidden item event ===
  +
 
The structure of hidden item events is just the same as for regular item ball events, with two exceptions: the first page has no graphic (to make it invisible), and it has the "Through" option checked (to allow the player to walk over it).
 
The structure of hidden item events is just the same as for regular item ball events, with two exceptions: the first page has no graphic (to make it invisible), and it has the "Through" option checked (to allow the player to walk over it).
   
 
== Pokémon balls ==
 
== Pokémon balls ==
  +
[[Image:PokemonBallEvent.png|right|256px|thumb|Page 1 of a Pokémon ball event.]]
These are item balls that, rather than giving an item, give a Pokémon instead. Creating a Pokémon ball is slightly more difficult than creating an item ball - you will need to edit the event's structure (see the image on the right).
+
These are item balls that, rather than giving an item, [[Manipulating Pokémon|give a Pokémon]] instead. Creating a Pokémon ball is slightly more difficult than creating an item ball - you will need to edit the event's structure (see the image on the right).
   
 
Rather than having to make a Pokémon ball from scratch (although it is easy to do), you can instead create an item ball (it doesn't matter what item it is), compile the game, and then modify the event as described below.
 
Rather than having to make a Pokémon ball from scratch (although it is easy to do), you can instead create an item ball (it doesn't matter what item it is), compile the game, and then modify the event as described below.
   
 
=== Pokémon ball event ===
 
=== Pokémon ball event ===
  +
 
The structure of Pokémon ball events are identical to item ball events, except the Conditional Branch script in the first page is different, e.g.
 
The structure of Pokémon ball events are identical to item ball events, except the Conditional Branch script in the first page is different, e.g.
  +
@>Conditional Branch: Script: Kernel.pbAddPokemon(:MEW,20)
+
@>Conditional Branch: Script: pbAddPokemon(:MEW,20)
 
@>Control Self Switch: A =ON
 
@>Control Self Switch: A =ON
@>
 
 : Else
 
 
@>
 
@>
 
 : Branch End
 
 : Branch End
 
@>
 
@>
  +
This will give the player a Level 20 Mew, but only if the player has an empty spot in their party. See the article Manipulating Pokémon for how the def <code>pbAddPokemon</code> works.
+
This will give the player a Level 20 Mew, but only if the player has an empty spot in their party. See [[Manipulating Pokémon]] for how <code>def pbAddPokemon</code> works.
   
 
Remember that Pokémon ball events still need a second, blank page, just like the other item ball events.
 
Remember that Pokémon ball events still need a second, blank page, just like the other item ball events.

Revision as of 21:19, 11 October 2020

ItemBall

An item ball.

This page describes how to create item balls, objects on a map that the player can pick up. This article covers visible item balls, hidden items, and balls containing Pokémon.

Item balls

ItemBallEvent

Page 1 of an item ball event.

To create an item that can be picked up, create a new event with the name "Item:XXX", where "XXX" is the internal name of the item (e.g. "Item:POTION"). When the game is compiled, this event will be edited automatically to turn it into a proper item ball, complete with graphic.

The item's name is only important for turning the item into a proper item ball when compiling the game. Once this has been done, the item's name is not important. However, it should not be renamed back to "Item:XXX" then, because when the game is next compiled, the event will be edited again, potentially overwriting any changes you may have made to the item ball.

Item ball event

Item ball events have two event pages. The first page has an "Action Button" trigger and looks like this:

@>Conditional Branch: Script: pbItemBall(:POTION)
  @>Control Self Switch: A =ON
  @>
 : Branch End
@>

The second event page is blank, and depends on the event's Self Switch A being ON.

The def pbItemBall displays two messages: the first is that the player has found the item, and the second is that the player has put it in a particular pocket of their Bag (or that their Bag is full, in which case the item is not picked up). This is described a little more on the page Manipulating items.

Hidden items

HiddenItemEvent

Page 1 of a hidden item event.

Hidden items are identical to regular item balls, with three exceptions: they are invisible, the player can walk over them, and they can be detected by an Itemfinder.

To create a hidden item, create a new event with the name "HiddenItem:XXX", where "XXX" is the internal name of the item (e.g. "HiddenItem:NUGGET"). When the game is compiled, this event will be edited automatically to turn it into a proper hidden item.

Unlike regular item balls, hidden items must have the exact name "HiddenItem". This is because the Itemfinder looks for nearby events with that name, and reacts if there are any. The name above that includes "XXX" is automatically changed to this when the game is compiled.

Hidden item event

The structure of hidden item events is just the same as for regular item ball events, with two exceptions: the first page has no graphic (to make it invisible), and it has the "Through" option checked (to allow the player to walk over it).

Pokémon balls

PokemonBallEvent

Page 1 of a Pokémon ball event.

These are item balls that, rather than giving an item, give a Pokémon instead. Creating a Pokémon ball is slightly more difficult than creating an item ball - you will need to edit the event's structure (see the image on the right).

Rather than having to make a Pokémon ball from scratch (although it is easy to do), you can instead create an item ball (it doesn't matter what item it is), compile the game, and then modify the event as described below.

Pokémon ball event

The structure of Pokémon ball events are identical to item ball events, except the Conditional Branch script in the first page is different, e.g.

@>Conditional Branch: Script: pbAddPokemon(:MEW,20)
  @>Control Self Switch: A =ON
  @>
 : Branch End
@>

This will give the player a Level 20 Mew, but only if the player has an empty spot in their party. See Manipulating Pokémon for how def pbAddPokemon works.

Remember that Pokémon ball events still need a second, blank page, just like the other item ball events.