pokecrystal-board/docs/map_event_scripts.md

3.2 KiB

Map Event Scripts

Contents

Object constants

	object_const_def ; object_event constants
	const MAPNAME_OBJECTNAME

Map scripts

MapName_MapScripts:

Scene scripts

	db N ; scene scripts
	scene_script script

Callbacks

	db N ; callbacks
	callback type, script

Callback types

  • MAPCALLBACK_NEWMAP

  • MAPCALLBACK_TILES

  • MAPCALLBACK_OBJECTS

  • MAPCALLBACK_SPRITES

  • MAPCALLBACK_CMDQUEUE

	callback MAPCALLBACK_CMDQUEUE, .Boulders

.Boulders:
	writecmdqueue .BoulderCmdQueue
	return

.BoulderCmdQueue:
	cmdqueue CMDQUEUE_STONETABLE, .BoulderTable

.BoulderTable:
	stonetable warp_id, person, script
	db -1 ; end

Event scripts

Event commands

Text

Text commands

Movement data

Movement commands

Map events

MapName_MapEvents:
	db 0, 0 ; filler

Warp events

	db N ; warp events
	warp_event x, y, map, warp_id

Coord events

	db N ; coord events
	coord_event x, y, scene_id, script

BG events

	db N ; bg events
	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 item_id, event_flag
  • BGEVENT_COPY

Object events

	db N ; object events
	object_event x, y, sprite, movement, rx, ry, h1, h2, palette, type, range, script, event_flag

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

  • SPRITEMOVEDATA_SUDOWOODO

  • SPRITEMOVEDATA_SMASHABLE_ROCK

  • SPRITEMOVEDATA_STRENGTH_BOULDER

  • SPRITEMOVEDATA_SPINCOUNTERCLOCKWISE

  • SPRITEMOVEDATA_SPINCLOCKWISE

  • SPRITEMOVEDATA_BIGDOLLASYM

  • SPRITEMOVEDATA_BIGDOLL

  • SPRITEMOVEDATA_SWIM_WANDER

Object types

  • OBJECTTYPE_SCRIPT

  • OBJECTTYPE_ITEMBALL

	itemball item_id[, quantity=1]
  • OBJECTTYPE_TRAINER
	trainer group_id, trainer_id, event_flag, seen_text, beaten_text, loss_text, script