<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, simply 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>
<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>
<h2>Object Events<aclass="headerlink"href="#object-events"title="Permalink to this headline">¶</a></h2>
<p>Object events are typically used for NPCs (non-player-characters). More technically, it’s any event that has a sprite and the ability to move around. Object events are displayed using their assigned sprite, except for special cases. Any object event 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>
<dt>Id</dt><dd><p>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>.</p>
</dd>
<dt>Sprite</dt><dd><p>The sprite that is used by the object.</p>
</dd>
<dt>Movement</dt><dd><p>The movement type used by the object during normal gameplay.</p>
</dd>
<dt>Movement Radius X/Y</dt><dd><p>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.</p>
</dd>
<dt>Script</dt><dd><p>The script that executes when the player interacts with the object.</p>
</dd>
<dt>Event Flag</dt><dd><p>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”.</p>
<dt>Trainer Type</dt><dd><p>The trainer type used by the object. If the object is a trainer, <cite>TRAINER_TYPE_NORMAL</cite> means that the trainer will spot the player in the object’s line-of-sight.</p>
<dt>Sight Radius or Berry Tree ID</dt><dd><p>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.</p>
<dt>In Connection</dt><dd><p>Exclusive to pokefirered. Used to replace objects that are visible in a map’s connection with their corresponding object on the connecting map. When checked, these objects will make odd use of other fields; its trainer type value will be the connecting map number, its Sight Radius / Berry Tree Id will be the connecting map group, and its z coordinate will be the object’s local id on the connecting map.</p>
<spanid="event-warps"></span><h2>Warp Events<aclass="headerlink"href="#warp-events"title="Permalink to this headline">¶</a></h2>
<p>Warp events 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>
<h2>Trigger Events<aclass="headerlink"href="#trigger-events"title="Permalink to this headline">¶</a></h2>
<p>Trigger events 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>
<dt>Id</dt><dd><p>The local id of the trigger in the map. This value is not used for anything.</p>
</dd>
<dt>Script</dt><dd><p>The script that executes when the player walks over the trigger AND when the <cite>Var</cite> equals the <cite>Var Value</cite>.</p>
</dd>
<dt>Var</dt><dd><p>The variable used to determine if the trigger’s Script should execute.</p>
</dd>
<dt>Var Value</dt><dd><p>The value that the Var must equal for the trigger’s Script to execute.</p>
<p>Weather trigger events 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. This event type is unavailable for pokefirered projects; the functions to trigger weather changes were dummied out.</p>
<pclass="caption"><spanclass="caption-text">Weather Trigger Event Properties</span><aclass="headerlink"href="#id7"title="Permalink to this image">¶</a></p>
<h2>Sign Event<aclass="headerlink"href="#sign-event"title="Permalink to this headline">¶</a></h2>
<p>Sign events, 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>
<pclass="caption"><spanclass="caption-text">Hidden Item Event Properties</span><aclass="headerlink"href="#id9"title="Permalink to this image">¶</a></p>
<dt>Quantity</dt><dd><p>Exclusive to pokefirered. The number of items received when the item is picked up.</p>
</dd>
<dt>Requires Itemfinder</dt><dd><p>Exclusive to pokefirered. When checked, the hidden item can only be received by standing on it and using the Itemfinder.</p>
<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>).
This event type is unavailable for pokefirered projects; secret bases do not exist there.</p>
<imgalt="Secret Base Event Properties"src="../_images/event-secret-base.png"/>
<pclass="caption"><spanclass="caption-text">Secret Base Event Properties</span><aclass="headerlink"href="#id10"title="Permalink to this image">¶</a></p>
<h2>Heal Location / Healspots<aclass="headerlink"href="#heal-location-healspots"title="Permalink to this headline">¶</a></h2>
<p>This event is used to control where a player will arrive when they white out or fly to the map. The white out functions a little differently between game versions. For pokeemerald and pokeruby players will arrive at the event’s coordinates after a white out, while in pokefirered they will arrive on the map set in <codeclass="docutils literal notranslate"><spanclass="pre">Respawn</span><spanclass="pre">Map</span></code> and at hardcoded coordinates (see <codeclass="docutils literal notranslate"><spanclass="pre">SetWhiteoutRespawnWarpAndHealerNpc</span></code> in <codeclass="docutils literal notranslate"><spanclass="pre">src/heal_location.c</span></code>).</p>
<pclass="caption"><spanclass="caption-text">Heal Location Properties</span><aclass="headerlink"href="#id11"title="Permalink to this image">¶</a></p>
</div>
<dlclass="simple">
<dt>Respawn Map</dt><dd><p>Exclusive to pokefirered. The map where the player will arrive when they white out (e.g. inside the PokéCenter that the heal location is in front of).</p>
</dd>
<dt>Respawn NPC</dt><dd><p>Exclusive to pokefirered. The local id of the NPC the player will interact with when they white out.</p>
<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>.