<p>Events are what bring your maps to life. They include NPCs, signposts, warps, scripts, and more. Open the <em>Events</em> tab above the map area, and let’s dissect what’s going on.</p>
<p>All of the events are visible on the map. The Event Details window on the right displays the properties of the currently-selected event. If you look closely, you’ll see that the woman NPC near the Pokémon Center has a pink border around it because it’s selected. To select a different event, simple click on an event in the map area. Alternatively, you can use the spinner at the top of the event properties window. Multiple events can be selected at the same time by holding <codeclass="docutils literal notranslate"><spanclass="pre">Ctrl</span></code> and clicking another event.</p>
<imgalt="Event Id Spinner"src="../_images/event-id-spinner.png"/>
<pclass="caption"><spanclass="caption-text">Event Id Spinner</span></p>
</div>
<divclass="admonition warning">
<pclass="first admonition-title">Warning</p>
<pclass="last">There is currently no undo/redo functionality when editing events! Use Git version control!</p>
</div>
<divclass="section"id="events-positions">
<h2>Events Positions<aclass="headerlink"href="#events-positions"title="Permalink to this headline">¶</a></h2>
<p>All events have X/Y coordinates. To move an Event, click and drag it to a new position on the map. Alternatively, you can use the X and Y spinners in the event properties.</p>
<p>Events also have an elevation, also known as Z coordinates (see image above). Elevations are explained in detail in the <aclass="reference internal"href="editing-map-collisions.html#collision-types"><spanclass="std std-ref">Collision Types</span></a> section.</p>
<p>Next, we’ll cover each type of event in detail.</p>
</div>
<divclass="section"id="event-objects">
<h2>Event Objects<aclass="headerlink"href="#event-objects"title="Permalink to this headline">¶</a></h2>
<p>Event objects are typically used for NPCs (non-player-characters). More technically, it’s any event that has a sprite and the ability to move around. Event objects are displayed using their assigned sprite, except for special cases. Any event object that uses a dynamic sprite will be displayed as a blue square with an <cite>N</cite><imgalt="dynamic-sprite"src="../_images/dynamic-sprite.png"/>. Some examples of dynamic sprites are the player’s rival and berry trees.</p>
<dd>This is the local id of the object in the map. Some script values use this local id to specify object when using scripting commands such as <cite>applymovement</cite>.</dd>
<dt>Sprite</dt>
<dd>The sprite that is used by the object.</dd>
<dt>Movement</dt>
<dd>The movement type used by the object during normal gameplay.</dd>
<dt>Movement Radius X/Y</dt>
<dd>Movement types that involves walking or moving around the map can be bounded by a radius. The ensures that the object is always within the specified range from its original position.</dd>
<dt>Script</dt>
<dd>The script that executes when the player interacts with the object.</dd>
<dt>Event Flag</dt>
<dd>The flag value that controls if the object is visible. If the flag is set (equal to 1), then the object will be invisible. If the Event Flag is set to <cite>0</cite>, then the object will always be visible because <cite>0</cite> means “no flag”.</dd>
<dt>Trainer Type</dt>
<dd><cite>NONE</cite>, <cite>NORMAL</cite>, or <cite>SEE ALL DIRECTIONS</cite>. If the object is a trainer, <cite>NORMAL</cite> means that the trainer will spot the player in the object’s line-of-sight.</dd>
<dt>Sight Radius or Berry Tree ID</dt>
<dd>If the object is a trainer, this property control how many tiles the trainer can see to spot the player for battle. If the object is a berry tree, this specifies the global id of the berry tree. Each berry tree in the game has a unique berry tree id.</dd>
<p>Event warps are how the player is able to warp to other maps, such as entering a building. Double-clicking on a warp will automatically open the destination map and select the destination warp. This makes it very easy to navigate around in Porymap.</p>
<dd>This is the local id of the warp in the map. This is used when setting the Destination Warp property for another warp.</dd>
<dt>Destination Map</dt>
<dd>The destination map name.</dd>
<dt>Destination Warp</dt>
<dd>The Id of the warp in the destination map.</dd>
</dl>
</div>
<divclass="section"id="event-triggers">
<h2>Event Triggers<aclass="headerlink"href="#event-triggers"title="Permalink to this headline">¶</a></h2>
<p>Event triggers are scripts that execute when the player walks over them. However, they only execute when a variable is equal some value. Typically, they execute once, set the variable’s value to something else, and then never execute again because the variable’s value no longer matches.</p>
<dd>The local id of the trigger in the map. This value is not used for anything.</dd>
<dt>Script</dt>
<dd>The script that executes when the player walks over the trigger AND when the <cite>Var</cite> equals the <cite>Var Value</cite>.</dd>
<dt>Var</dt>
<dd>The variable used to determine if the trigger’s Script should execute.</dd>
<dt>Var Value</dt>
<dd>The value that the Var must equal for the trigger’s Script to execute.</dd>
</dl>
</div>
<divclass="section"id="event-weather-triggers">
<h2>Event Weather Triggers<aclass="headerlink"href="#event-weather-triggers"title="Permalink to this headline">¶</a></h2>
<p>Event weather triggers are a very specific type of trigger. When the player walks over a weather trigger, the overworld’s weather will transition to the specified weather type.</p>
<dd>The local id of the trigger in the map. This value is not used for anything.</dd>
<dt>Weather</dt>
<dd>The type of weather to transition to.</dd>
</dl>
</div>
<divclass="section"id="event-signs">
<h2>Event Signs<aclass="headerlink"href="#event-signs"title="Permalink to this headline">¶</a></h2>
<p>Event signs, or signposts, are simple interactable scripts. They are typically used for things like signs in front of buildings. The player’s facing direction can be required to be a certain direction in order to interact with the sign. Signs are the first of three “BG” event types.</p>
<dd>The local id of the BG event in the map. This value is not used for anything.</dd>
<dt>Item</dt>
<dd>The item the player will receive when interacting with this hidden item.</dd>
<dt>Flag</dt>
<dd>This flag is set when the player receives the hidden item.</dd>
</dl>
</div>
<divclass="section"id="event-secret-base">
<h2>Event Secret Base<aclass="headerlink"href="#event-secret-base"title="Permalink to this headline">¶</a></h2>
<p>This is the event used to mark entrances to secret bases. This event will only be functional on certain metatiles. Unfortunately, they are hardcoded into the game’s engine (see <codeclass="docutils literal notranslate"><spanclass="pre">sSecretBaseEntranceMetatiles</span></code> in <codeclass="docutils literal notranslate"><spanclass="pre">src/secret_base.c</span></code>).</p>
<imgalt="Event Secret Base Properties"src="../_images/event-secret-base.png"/>
<pclass="caption"><spanclass="caption-text">Event Secret Base Properties</span></p>
</div>
<dlclass="docutils">
<dt>Id</dt>
<dd>The local id of the BG event in the map. This value is not used for anything.</dd>
<dt>Secret Base Id</dt>
<dd>The id of the destination secret base.</dd>
</dl>
</div>
<divclass="section"id="adding-deleting-events">
<h2>Adding & Deleting Events<aclass="headerlink"href="#adding-deleting-events"title="Permalink to this headline">¶</a></h2>
<p>To add a new event, press the green plus button. <imgalt="add-event-button"src="../_images/add-event-button.png"/> You can choose between the different types of events by clicking the small arrow on the right.</p>
<p>To delete the selected event, press the delete button. <imgalt="delete-event-button"src="../_images/delete-event-button.png"/></p>
</div>
<divclass="section"id="open-map-scripts">
<h2>Open Map Scripts<aclass="headerlink"href="#open-map-scripts"title="Permalink to this headline">¶</a></h2>
<p>Clicking the <codeclass="docutils literal notranslate"><spanclass="pre">Open</span><spanclass="pre">Map</span><spanclass="pre">Scripts</span></code> button <imgalt="open-map-scripts-button"src="../_images/open-map-scripts-button.png"/> will open the map’s scripts file in your default text editor. If nothing happens when this button is clicked, you may need to associate a text editor with the <cite>.inc</cite> file extension.</p>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.