mirror of https://github.com/pret/pokeemerald.git
Final bits of copying from the tutorial
parent
f6f0ae8d6b
commit
73d0a06843
|
@ -23,7 +23,9 @@ Table of Contents:
|
|||
- [Door Commands](#Door-Commands)
|
||||
- [Display Pokémon Sprite](#display-pok%C3%A9mon-sprite)
|
||||
- [Screen Fading Effects](#Screen-Fading-Effects)
|
||||
|
||||
- [Play Pokémon Cry](#play-pok%C3%A9mon-cry)
|
||||
- [Time-Based Scripts](#time-based-scripts)
|
||||
- [Sound Effects & Fanfares](#sound-effects--fanfares)
|
||||
|
||||
# Labelling
|
||||
|
||||
|
@ -844,4 +846,99 @@ Text_FadescreenExample:
|
|||
```
|
||||
|
||||
|
||||
# Play Pokémon Cry
|
||||
|
||||
Using Pokémon cries as a sound effect is another super easy thing to do, all you need is the playmoncry command:
|
||||
|
||||
```gas
|
||||
playmoncry [Pokémon], 0
|
||||
```
|
||||
Followed by `waitmoncry`, which doesn't have any arguments. Just as it looks, it simply means the script will continue after the cry has finished playing.
|
||||
|
||||
```gas
|
||||
Script_CryDemo::
|
||||
lock
|
||||
faceplayer
|
||||
playmoncry SPECIES_ARBOK, 0
|
||||
msgbox Text_CryDemo, MSGBOX_DEFAULT
|
||||
waitmoncry
|
||||
release
|
||||
end
|
||||
|
||||
Text_CryDemo:
|
||||
.string "Arbok: Hisssss!$"
|
||||
```
|
||||
|
||||
|
||||
# Time-based Scripts
|
||||
|
||||
The `gettime` command can be used to set the values of variables `VAR_0x8000`, `VAR_0x8001`, and `VAR_0x8002` to the in-game hour, minute, and second respectively. To make sure the time is up to date, you should also call `dotimebasedevents` before that. This is an example script for a NPC who gives different greetings depending on the hour:
|
||||
|
||||
```gas
|
||||
Script_HourDemonstration::
|
||||
lock
|
||||
faceplayer
|
||||
dotimebasedevents
|
||||
gettime
|
||||
compare VAR_0x8000, 4
|
||||
goto_if_le Script_Night
|
||||
compare VAR_0x8000, 12
|
||||
goto_if_lt Script_Morning
|
||||
compare VAR_0x8000, 18
|
||||
goto_if_ge Script_Night
|
||||
msgbox Text_Day, MSGBOX_DEFAULT
|
||||
release
|
||||
end
|
||||
|
||||
Script_Morning::
|
||||
msgbox Text_Morning, MSGBOX_DEFAULT
|
||||
release
|
||||
end
|
||||
|
||||
Script_Night::
|
||||
msgbox Text_Night, MSGBOX_DEFAULT
|
||||
release
|
||||
end
|
||||
|
||||
Text_Morning:
|
||||
.string "Good morning.$"
|
||||
|
||||
Text_Day:
|
||||
.string "Good day.$"
|
||||
|
||||
Text_Night:
|
||||
.string "Good evening.$"
|
||||
```
|
||||
|
||||
You could swap out the values to check for a particular minute or second too, if you wanted to run a very specific event that only occurs at a very specific time!
|
||||
|
||||
|
||||
# Sound Effects & Fanfares
|
||||
|
||||
Sound effects can bring a lot of life to overworld gameplay. To play sounds, use the following:
|
||||
|
||||
```gas
|
||||
playse [Label]
|
||||
```
|
||||
If you want to make the script wait for the sound to finish before continuing, you can add `waitse` if you want to. For example, if you'd have liked to use a sound effect for an exclamation point emote on your player:
|
||||
|
||||
```gas
|
||||
playse SE_PIN
|
||||
applymovement OBJ_EVENT_ID_PLAYER, Movement_Exclamation
|
||||
waitmovement
|
||||
```
|
||||
A fanfare is a short jingle, like the healing sound in Pokémon Centers. To use one in your script, use these commands:
|
||||
|
||||
```gas
|
||||
playfanfare [Label]
|
||||
waitfanfare
|
||||
```
|
||||
`waitfanfare` means the script will wait for the jingle to finish playing before continuing. So, let's say we wanted to play the fanfare sound for obtaining a Gym Badge:
|
||||
|
||||
```gas
|
||||
playfanfare MUS_OBTAIN_BADGE
|
||||
waitfanfare
|
||||
```
|
||||
|
||||
You can find a list of labels for sound effects and music in `include\constants\songs.h`.
|
||||
|
||||
|
|
Loading…
Reference in New Issue