pokecrystal-board/docs/map_scripts.md

152 lines
2.4 KiB
Markdown
Raw Normal View History

2017-12-11 18:40:21 -08:00
# Map Scripts
2017-12-11 18:40:21 -08:00
## `const_value set 2`
- **`const` *`MAPNAME_OBJECTNAME`***
## `MapName_MapScriptHeader:`
## `.SceneScripts: db` *N*
- **`scene_script` *script***
2017-12-11 20:11:58 -08:00
## `.MapCallbacks: db` *N*
- **`callback` *type*, *script***
2017-12-12 10:56:17 -08:00
Callback types:
- **`MAPCALLBACK_NEWMAP`**
- **`MAPCALLBACK_TILES`**
- **`MAPCALLBACK_OBJECTS`**
- **`MAPCALLBACK_SPRITES`**
- **`MAPCALLBACK_CMDQUEUE`**
<!-- need pre tags here; can't use inline bold/italic formatting in Markdown code blocks -->
<pre>
callback MAPCALLBACK_CMDQUEUE, .Boulders
.Boulders:
writecmdqueue .BoulderCmdQueue
return
.BoulderCmdQueue:
cmdqueue CMDQUEUE_STONETABLE, .BoulderTable
.BoulderTable:
stonetable <i>warp_id</i>, <i>person</i>, <i>script</i>
db -1 ; end
</pre>
2017-12-12 10:56:17 -08:00
## Event scripts
2017-12-12 10:51:58 -08:00
[Event commands](event_commands.md)
2017-12-12 09:18:11 -08:00
## Text
2017-12-12 10:51:58 -08:00
[Text commands](text_commands.md)
## Movement data
2017-12-12 10:51:58 -08:00
[Movement commands](movement_commands.md)
## `MapName_MapEventHeader:`
```asm
; filler
db 0, 0
```
2017-12-11 20:11:58 -08:00
## `.Warps: db` *N*
- **`warp_def` *x*, *y*, *warp_id*, *map***
## `.CoordEvents: db` *N*
- **`coord_event` *x*, *y*, *scene_id*, *script***
## `.BGEvents: db` *N*
- **`bg_event` *x*, *y*, *type*, *script***
BG event types:
- **`BGEVENT_READ`**
- **`BGEVENT_UP/DOWN/LEFT/RIGHT`**
- **`BGEVENT_IFSET/IFNOTSET`**
**`conditional_event` *event_flag*, *script***
- **`BGEVENT_ITEM`**
**`hiddenitem` *event_flag*, *item_id***
- **`BGEVENT_COPY`**
## `.ObjectEvents: db` *N*
- **`object_event` *x*, *y*, *sprite*, *movement*, *rx*, *ry*, *h1*, *h2*, *palette*, *type*, *range*, *script*, *event_flag***
2017-12-12 09:18:11 -08:00
Movement types:
- **`SPRITEMOVEDATA_ITEM_TREE`**
- **`SPRITEMOVEDATA_WANDER`**
- **`SPRITEMOVEDATA_SPINRANDOM_SLOW`**
- **`SPRITEMOVEDATA_WALK_UP_DOWN`**
- **`SPRITEMOVEDATA_WALK_LEFT_RIGHT`**
- **`SPRITEMOVEDATA_STANDING_UP/DOWN/LEFT/RIGHT`**
- **`SPRITEMOVEDATA_SPINRANDOM_FAST`**
- **`SPRITEMOVEDATA_SNORLAX`**
- **`SPRITEMOVEDATA_POKEMON`**
2017-12-11 18:40:21 -08:00
- **`SPRITEMOVEDATA_SUDOWOODO`**
2017-12-11 18:40:21 -08:00
- **`SPRITEMOVEDATA_SMASHABLE_ROCK`**
2017-12-11 18:40:21 -08:00
- **`SPRITEMOVEDATA_STRENGTH_BOULDER`**
2017-12-11 18:40:21 -08:00
- **`SPRITEMOVEDATA_SPINCOUNTERCLOCKWISE`**
2017-12-11 18:40:21 -08:00
- **`SPRITEMOVEDATA_SPINCLOCKWISE`**
2017-12-11 18:40:21 -08:00
- **`SPRITEMOVEDATA_BIGDOLL`**
2017-12-11 18:40:21 -08:00
- **`SPRITEMOVEDATA_LAPRAS`**
2017-12-11 18:40:21 -08:00
Object types:
2017-12-11 18:40:21 -08:00
- **`OBJECTTYPE_SCRIPT`**
2017-12-11 18:40:21 -08:00
- **`OBJECTTYPE_ITEMBALL`**
2017-12-11 18:40:21 -08:00
2017-12-11 20:11:58 -08:00
**`itemball` *item_id***
2017-12-11 18:40:21 -08:00
- **`OBJECTTYPE_TRAINER`**
2017-12-11 18:40:21 -08:00
2017-12-11 20:11:58 -08:00
**`trainer` *event_flag*, *group_id*, *trainer_id*, *seen_text*, *beaten_text*, *loss_text*, *script***