summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2019-02-10 18:26:45 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2019-02-10 18:26:45 -0500
commit023597b42731c83b7bdf72bec72d0b6b6f32e2a5 (patch)
tree6fbcd97930ad78d6883ca9506f52e8341c85668b
parentcc874b8f73629fee0dd15cc03ee0c8f8700f81a9 (diff)
Pan camera
-rw-r--r--Tips-and-tricks.md46
-rw-r--r--Tutorials.md1
2 files changed, 46 insertions, 1 deletions
diff --git a/Tips-and-tricks.md b/Tips-and-tricks.md
index b64c013..01736ec 100644
--- a/Tips-and-tricks.md
+++ b/Tips-and-tricks.md
@@ -8,6 +8,7 @@ This page is for small hints about how to edit pokecrystal that don't need an en
- [Make overworld sprites darker at night](#make-overworld-sprites-darker-at-night)
- [Enemy trainers have maximum happiness for a powerful Return](#enemy-trainers-have-maximum-happiness-for-a-powerful-return)
- [Lowercasing Pokémon names cuts off their first letter](#lowercasing-pokémon-names-cuts-off-their-first-letter)
+- [Pan in cutscenes by making the player invisible](#pan-in-cutscenes-by-making-the-player-invisible)
- [Prevent NPCs' heads from flipping when they walk down](#prevent-NPCs-heads-from-flipping-when-they-walk-down)
@@ -87,6 +88,51 @@ Edit [engine/pokemon/move_mon.asm](../blob/master/engine/pokemon/move_mon.asm):
If you simply lowercase all the names in [data/pokemon/names.asm](../blob/master/data/pokemon/names.asm) and rebuild the ROM, the first letter of their names may be missing. The cause is changing `"FARFETCH'D"` to `"Farfetch'd"`, because `'d` is actually a single character. The fix is to pad its name to the same length as all the rest with an `@`, so that it becomes `"Farfetch'd@"`.
+## Pan in cutscenes by making the player invisible
+
+The player's object is always at the center of the screen. So if you want to pan the camera during a cutscene, you have to get around that. The key is the `show_person` and `hide_person` movement commands, which make an object visible or invisible.
+
+Let's say you have a map with two placeholder sprites: `YOURMAP_CHRIS_PLACEHOLDER`, an `object_event` which uses `SPRITE_CHRIS`, and `YOURMAP_KRIS_PLACEHOLDER`, which uses `SPRITE_KRIS`. Then define these movement scripts:
+
+```
+ShowPersonMovement:
+ show_person
+ step_end
+
+HidePersonMovement:
+ hide_person
+ step_end
+```
+
+In your cutscene script, to show the placeholder and make the player invisible:
+
+```
+ checkflag ENGINE_PLAYER_IS_FEMALE
+ iftrue .ShowGirlPlaceholder
+ appear YOURMAP_CHRIS_PLACEHOLDER
+ jump .HidePlayer
+.ShowGirlPlaceholder
+ appear YOURMAP_KRIS_PLACEHOLDER
+.HidePlayer
+ applymovement PLAYER, HidePersonMovement
+```
+
+And to make the player visible again and disappear the placeholder:
+
+```
+ applymovement PLAYER, ShowPersonMovement
+ checkflag ENGINE_PLAYER_IS_FEMALE
+ iftrue .HideGirlPlaceholder
+ disappear YOURMAP_CHRIS_PLACEHOLDER
+ jump .HidPlaceholder
+.HideGirlPlaceholder
+ disappear YOURMAP_KRIS_PLACEHOLDER
+.HidPlaceholder
+```
+
+In between those script snippets, you can move the player around to look like the camera is panning around the map.
+
+
## Prevent NPCs' heads from flipping when they walk down
When NPCs walk up or down, they flip horizontally every other frame to create the alternating left-right step animation. But for NPCs with asymmetrical faces, this can look awkward when they walk down.
diff --git a/Tutorials.md b/Tutorials.md
index 3a12021..b48b563 100644
--- a/Tutorials.md
+++ b/Tutorials.md
@@ -134,4 +134,3 @@ Feel free to contribute one of these!
- Show quantity already in Pack in Marts
- Instant text option
- Nuzlocke mode (an in-game enforced [Nuzlocke Challenge](https://bulbapedia.bulbagarden.net/wiki/Nuzlocke_Challenge))
-- Pan the camera for cutscenes by making the player invisible