summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-07-17 08:37:49 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-07-17 08:37:49 -0400
commitd8c57580dbc0fc98f1275294a1c0fa115888f3ec (patch)
treed9f309923e9a2c1cac3c6e7b26c150e0c8f7a69a
parent579b65830759e0dbe1ba4adf2eb7147e3130e7a1 (diff)
return → endcallback
-rw-r--r--Improve-the-event-initialization-system.md6
-rw-r--r--Wall-to-wall-carpeting-in-your-room.md8
2 files changed, 7 insertions, 7 deletions
diff --git a/Improve-the-event-initialization-system.md b/Improve-the-event-initialization-system.md
index a4f0029..4c0225d 100644
--- a/Improve-the-event-initialization-system.md
+++ b/Improve-the-event-initialization-system.md
@@ -173,7 +173,7 @@ Edit [engine/events/std_scripts.asm](../blob/master/engine/events/std_scripts.as
- setevent EVENT_EARLS_ACADEMY_EARL
- ...
- setevent EVENT_INITIALIZED_EVENTS
-- return
+- endcallback
```
And edit [maps/PlayersHouse2F.asm](../blob/master/maps/PlayersHouse2F.asm):
@@ -185,10 +185,10 @@ And edit [maps/PlayersHouse2F.asm](../blob/master/maps/PlayersHouse2F.asm):
- checkevent EVENT_INITIALIZED_EVENTS
- iftrue .SkipInitialization
- jumpstd initializeevents
-- return
+- endcallback
-
-.SkipInitialization:
- return
+ endcallback
```
Now we have a system for initializing the game that's independent of the starting map, easy to find with the rest of the game data, and uses less space.
diff --git a/Wall-to-wall-carpeting-in-your-room.md b/Wall-to-wall-carpeting-in-your-room.md
index 6bfe133..660caa9 100644
--- a/Wall-to-wall-carpeting-in-your-room.md
+++ b/Wall-to-wall-carpeting-in-your-room.md
@@ -100,19 +100,19 @@ And edit [maps/PlayersHouse2F.asm](../blob/master/maps/PlayersHouse2F.asm):
checkevent EVENT_INITIALIZED_EVENTS
iftrue .SkipInitialization
jumpstd initializeevents
- return
+ endcallback
.SkipInitialization:
- return
+ endcallback
.SetSpawn:
special ToggleMaptileDecorations
- return
+ endcallback
- db 0, 0, 0 ; filler
+.RenderCarpet:
+ special CoverTilesWithCarpet
-+ return
++ endcallback
```
Each type of callback is called at a specific point in the map setup process. If a map defines a `MAPCALLBACK_TILES` callback, it gets called after the blocks are all loaded, and has the opportunity to change them. Here, the `.SetSpawn` callback needs to run at that point in order to change blocks, like replacing the bed or adding a potted plant. It's also responsible for changing the carpet blocks, but of course we're about to edit that.