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.md74
1 files changed, 74 insertions, 0 deletions
diff --git a/Add-a-new-scene-script.md b/Add-a-new-scene-script.md
new file mode 100644
index 0000000..d74bc48
--- /dev/null
+++ b/Add-a-new-scene-script.md
@@ -0,0 +1,74 @@
+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"
+
+INCLUDE "macros/wram.asm"
+...
+wMobileTradeRoomSceneID:: db ; d9bf
+wMobileBattleRoomSceneID:: db ; d9c0
++wAzaleaGymSceneID:: db ; d9c1
+
+- ds 49
++ ds 48
+
+```
+If you add more Scene Ids in the future you'll have to decrement the number after `ds` accordingly
+
+
+## 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
+ 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.
+...
+; wFastShip1FSceneID
+ const_def 1
+ const SCENE_FASTSHIP1F_ENTER_SHIP ; 1
+ const SCENE_FASTSHIP1F_MEET_GRANDPA ; 2
+
++; wAzaleaGymSceneID
++ 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
++ scene_script .DummyScene1 ; SCENE_AZALEAGYM_SCENE
+
+ db 0 ; callbacks
+
++.DummyScene0
++.DummyScene1
++ end
+```
+That's it! Now you can use these scenes for a Coord event. \ No newline at end of file