summaryrefslogtreecommitdiff
path: root/Add-a-new-scene-script.md
diff options
context:
space:
mode:
Diffstat (limited to 'Add-a-new-scene-script.md')
-rw-r--r--Add-a-new-scene-script.md33
1 files changed, 24 insertions, 9 deletions
diff --git a/Add-a-new-scene-script.md b/Add-a-new-scene-script.md
index d74bc48..bb1399b 100644
--- a/Add-a-new-scene-script.md
+++ b/Add-a-new-scene-script.md
@@ -1,13 +1,18 @@
This tutorial is for adding a scene event to a map. We'll be Using Azalea Gym as an example.
+
## Contents
+
1. [Define SceneID in WRAM](#1-define-sceneid-in-wram)
2. [Define scene_var](#2-define-scene_var)
3. [Define the Scene](#3-define-the-scene)
4. [Add the Scene to Azalea Gym](#4-add-the-scene-to-azalea-gym)
+
## 1. Define SceneID in WRAM
+
Azalea Town Doesn't have a SceneID yet, so we need to define it. Edit [wram.asm](../blob/master/wram.asm):
+
```diff
INCLUDE "constants.asm"
@@ -25,20 +30,24 @@ If you add more Scene Ids in the future you'll have to decrement the number afte
## 2. Define scene_var
+
Edit [data/maps/scenes.asm](../blob/master/data/maps/scenes.asm):
+
```diff
scene_var: MACRO
; map, variable
...
scene_var MOBILE_BATTLE_ROOM, wMobileBattleRoomSceneID
-+ scene_var AZALEA_GYM, wAzaleaGymSceneID
++ scene_var AZALEA_GYM, wAzaleaGymSceneID
db -1 ; end
```
## 3. Define the scene
+
Edit [constants/scene_constants.asm](../blob/master/constants/scene_constants.asm):
+
```diff
; See data/maps/scenes.asm for which maps have scene variables.
; Each scene_script and coord_event is associated with a current scene ID.
@@ -49,26 +58,32 @@ Edit [constants/scene_constants.asm](../blob/master/constants/scene_constants.as
const SCENE_FASTSHIP1F_MEET_GRANDPA ; 2
+; wAzaleaGymSceneID
-+ const_def
-+ const SCENE_AZALEAGYM_NOTHING
-+ const SCENE_AZALEAGYM_SCENE
++ const_def
++ const SCENE_AZALEAGYM_NOTHING
++ const SCENE_AZALEAGYM_SCENE
```
+
+
## 4. Add the Scene to Azalea Gym
+
Edit [maps/AzaleaGym.asm](../blob/master/maps/AzaleaGym.asm):
+
```diff
object_const_def ; object_event constants
const AZALEAGYM_BUGSY
...
AzaleaGym_MapScripts:
-- db 0 ; scene scripts
-+ db 2 ; scene scripts
-+ scene_script .DummyScene0 ; SCENE_AZALEAGYM_NOTHING
+ def_scene_scripts
++ scene_script .DummyScene0 ; SCENE_AZALEAGYM_NOTHING
+ scene_script .DummyScene1 ; SCENE_AZALEAGYM_SCENE
- db 0 ; callbacks
+ def_callbacks
+.DummyScene0
+.DummyScene1
+ end
```
-That's it! Now you can use these scenes for a Coord event. \ No newline at end of file
+
+(Before August 2020, maps did not have `def_*` macros, so they had to manually declare their quantities of `scene_script`s, `callback`s, etc. So instead of `def_scene_scripts` they used to have `db 0 ; scene scripts`, which you would change here to `db 2`.)
+
+That's it! Now you can use these scenes for a Coord event.