1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
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](https://github.com/pret/pokecrystal/wiki/Add-a-new-map-and-landmark).
First, define a new constant in [constants/map_data_constants.asm](../blob/master/constants/map_data_constants.asm):
```diff
; johto
const SPAWN_NEW_BARK
...
const SPAWN_GOLDENROD
+ const SPAWN_GLOBALTERMINAL
```
Then, edit [data/maps/spawn_points.asm](../blob/master/data/maps/spawn_points.asm):
```diff
SpawnPoints:
...
spawn GOLDENROD_CITY, 15, 28
+ spawn GLOBAL_TERMINAL_OUTSIDE, 8, 10
```
The 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](../blob/master/data/maps/flypoints.asm):
```diff
Flypoints:
...
; Johto
...
flypoint GOLDENROD, GOLDENROD_CITY
+ flypoint GLOBALTERMINAL, GLOBAL_TERMINAL
```
Then, modify [constants/engine_flags.asm](../blob/master/constants/engine_flags.asm):
```diff
...
; wVisitedSpawns
const ENGINE_FLYPOINT_GOLDENROD
+ const ENGINE_FLYPOINT_GLOBALTERMINAL
```
Next, modify [data/engine_flags.asm](../blob/master/data/engine_flags.asm):
```diff
EngineFlags:
...
; fly
...
engine_flag wVisitedSpawns, SPAWN_GOLDENROD
+ engine_flag wVisitedSpawns, SPAWN_GLOBALTERMINAL
```
Finally, edit **maps/GlobalTerminalOutside.asm**:
```diff
...
def_callbacks
+ callback MAPCALLBACK_NEWMAP, .Flypoint
+.Flypoint:
+ setflag ENGINE_FLYPOINT_GLOBALTERMINAL
+ return
```
These last three changes allow the player to fly to the Global Terminal after they reach it on foot.
|