pokecrystal/docs/map_event_scripts.md

206 lines
3.2 KiB
Markdown
Raw Normal View History

2018-01-31 03:44:44 +00:00
# Map Event Scripts
2017-12-12 02:40:21 +00:00
2018-01-31 16:11:09 +00:00
## Contents
- [Object constants](#object-constants)
- [Map scripts](#map-scripts)
- [Scene scripts](#scene-scripts)
- [Callbacks](#callbacks)
- [Callback types](#callback-types)
- [Event scripts](#event-scripts)
- [Text](#text)
- [Movement data](#movement-data)
- [Map events](#map-events)
- [Warp events](#warp-events)
- [Coord events](#coord-events)
- [BG events](#bg-events)
- [BG event types](#bg-event-types)
- [Object events](#object-events)
- [Movement types](#movement-types)
- [Object types](#object-types)
2018-01-31 16:08:47 +00:00
## Object constants
2017-12-12 02:40:21 +00:00
<pre>
2018-01-31 16:08:47 +00:00
const_value set 2 ; object constants
const <i>MAPNAME</i>_<i>OBJECTNAME</i>
</pre>
2018-01-31 03:38:00 +00:00
## Map scripts
<pre>
<i>MapName</i>_MapScripts:
</pre>
2018-01-31 03:38:00 +00:00
### Scene scripts
<pre>
2018-01-31 03:38:00 +00:00
db <i>N</i> ; scene scripts
scene_script <i>script</i>
</pre>
2018-01-31 03:38:00 +00:00
### Callbacks
<pre>
2018-01-31 03:38:00 +00:00
db <i>N</i> ; callbacks
callback <i>type</i>, <i>script</i>
</pre>
2018-01-31 16:11:09 +00:00
#### Callback types
2017-12-12 18:56:17 +00:00
- `MAPCALLBACK_NEWMAP`
2017-12-12 18:56:17 +00:00
- `MAPCALLBACK_TILES`
2017-12-12 18:56:17 +00:00
- `MAPCALLBACK_OBJECTS`
2017-12-12 18:56:17 +00:00
- `MAPCALLBACK_SPRITES`
2017-12-12 18:56:17 +00:00
- `MAPCALLBACK_CMDQUEUE`
2017-12-12 18:56:17 +00:00
<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 18:56:17 +00:00
## Event scripts
2017-12-12 18:51:58 +00:00
[Event commands](event_commands.md)
2017-12-12 17:18:11 +00:00
## Text
2017-12-12 18:51:58 +00:00
[Text commands](text_commands.md)
## Movement data
2017-12-12 18:51:58 +00:00
[Movement commands](movement_commands.md)
2018-01-31 03:38:00 +00:00
## Map events
2018-01-31 03:38:00 +00:00
<pre>
<i>MapName</i>_MapEvents:
db 0, 0 ; filler
2018-01-31 03:38:00 +00:00
</pre>
2018-01-31 03:38:00 +00:00
### Warp events
<pre>
2018-01-31 03:38:00 +00:00
db <i>N</i> ; warp events
warp_event <i>x</i>, <i>y</i>, <i>warp_id</i>, <i>map</i>
</pre>
2018-01-31 03:38:00 +00:00
### Coord events
<pre>
2018-01-31 03:38:00 +00:00
db <i>N</i> ; coord events
coord_event <i>x</i>, <i>y</i>, <i>scene_id</i>, <i>script</i>
</pre>
2018-01-31 03:38:00 +00:00
### BG events
<pre>
2018-01-31 03:38:00 +00:00
db <i>N</i> ; bg events
bg_event <i>x</i>, <i>y</i>, <i>type</i>, <i>script</i>
</pre>
2018-01-31 16:11:09 +00:00
#### BG event types
- `BGEVENT_READ`
- `BGEVENT_UP/DOWN/LEFT/RIGHT`
- `BGEVENT_IFSET/IFNOTSET`
<pre>
conditional_event <i>event_flag</i>, <i>script</i>
</pre>
- `BGEVENT_ITEM`
<pre>
hiddenitem <i>item_id</i>, <i>event_flag</i>
</pre>
- `BGEVENT_COPY`
2018-01-31 03:38:00 +00:00
### Object events
<pre>
2018-01-31 03:38:00 +00:00
db <i>N</i> ; object events
2018-01-17 19:50:34 +00:00
object_event <i>x</i>, <i>y</i>, <i>sprite</i>, <i>movement</i>, <i>rx</i>, <i>ry</i>, <i>h1</i>, <i>h2</i>, <i>palette</i>, <i>type</i>, <i>range</i>, <i>script</i>, <i>event_flag</i>
</pre>
2018-01-31 16:11:09 +00:00
#### Movement types
- `SPRITEMOVEDATA_STILL`
- `SPRITEMOVEDATA_WANDER`
- `SPRITEMOVEDATA_SPINRANDOM_SLOW`
- `SPRITEMOVEDATA_WALK_UP_DOWN`
- `SPRITEMOVEDATA_WALK_LEFT_RIGHT`
- `SPRITEMOVEDATA_STANDING_UP/DOWN/LEFT/RIGHT`
- `SPRITEMOVEDATA_SPINRANDOM_FAST`
- `SPRITEMOVEDATA_BIGDOLLSYM`
- `SPRITEMOVEDATA_POKEMON`
2017-12-12 02:40:21 +00:00
- `SPRITEMOVEDATA_SUDOWOODO`
2017-12-12 02:40:21 +00:00
- `SPRITEMOVEDATA_SMASHABLE_ROCK`
2017-12-12 02:40:21 +00:00
- `SPRITEMOVEDATA_STRENGTH_BOULDER`
2017-12-12 02:40:21 +00:00
- `SPRITEMOVEDATA_SPINCOUNTERCLOCKWISE`
2017-12-12 02:40:21 +00:00
- `SPRITEMOVEDATA_SPINCLOCKWISE`
2017-12-12 02:40:21 +00:00
- `SPRITEMOVEDATA_BIGDOLLASYM`
- `SPRITEMOVEDATA_BIGDOLL`
2017-12-12 02:40:21 +00:00
- `SPRITEMOVEDATA_SWIM_WANDER`
2017-12-12 02:40:21 +00:00
2018-01-31 16:11:09 +00:00
#### Object types
2017-12-12 02:40:21 +00:00
- `OBJECTTYPE_SCRIPT`
2017-12-12 02:40:21 +00:00
- `OBJECTTYPE_ITEMBALL`
2017-12-12 02:40:21 +00:00
<pre>
itemball <i>item_id</i>[, <i>quantity</i>=1]
</pre>
2017-12-12 02:40:21 +00:00
- `OBJECTTYPE_TRAINER`
2017-12-12 02:40:21 +00:00
<pre>
trainer <i>group_id</i>, <i>trainer_id</i>, <i>event_flag</i>, <i>seen_text</i>, <i>beaten_text</i>, <i>loss_text</i>, <i>script</i>
</pre>