-
Notifications
You must be signed in to change notification settings - Fork 912
Add a new spawn point
EXGomora edited this page Aug 6, 2023
·
6 revisions
This tutorial is for how to add a new spawn point for Fly, Teleport, whiting out, etc. We will continue off of the Global Terminal map we created in the map and landmark tutorial.
First, define two new constants in constants/map_data_constants.asm:
; johto
const SPAWN_NEW_BARK
...
const SPAWN_GOLDENROD
+ const SPAWN_GLOBALTERMINAL
...
; johto
DEF JOHTO_FLYPOINT EQU const_value
const FLY_NEW_BARK
...
const FLY_GOLDENROD
+ const FLY_GLOBALTERMINALThen, edit data/maps/spawn_points.asm:
SpawnPoints:
...
spawn GOLDENROD_CITY, 15, 28
+ spawn GLOBAL_TERMINAL_OUTSIDE, 8, 10The first value is the map to spawn at, and the latter two values are the coordinates of the spawn point. This is similar to map objects, warps, etc.
Next, edit data/maps/flypoints.asm:
Flypoints:
...
; Johto
...
flypoint GOLDENROD, GOLDENROD_CITY
+ flypoint GLOBALTERMINAL, GLOBAL_TERMINALThen, modify constants/engine_flags.asm:
...
; wVisitedSpawns
const ENGINE_FLYPOINT_GOLDENROD
+ const ENGINE_FLYPOINT_GLOBALTERMINALNext, modify data/events/engine_flags.asm:
EngineFlags:
...
; fly
...
engine_flag wVisitedSpawns, SPAWN_GOLDENROD
+ engine_flag wVisitedSpawns, SPAWN_GLOBALTERMINALFinally, edit maps/GlobalTerminalOutside.asm:
...
def_callbacks
+ callback MAPCALLBACK_NEWMAP, .Flypoint
+.Flypoint:
+ setflag ENGINE_FLYPOINT_GLOBALTERMINAL
+ returnThese last three changes allow the player to fly to the Global Terminal after they reach it on foot.