MapEvent()

new MapEvent()

The constructor for a new map event.

Methods

addCommand(pageId, command, parameters)

Parameters:
Name Type Description
pageId *
command *
parameters *

addCommandAfterIndex(index, command, pageIndex)

add

Parameters:
Name Type Description
index *

the index in the list of commands to add this command after

command *

the command obj to add

pageIndex int

the page index of the page to add the command to

addMoveRoute(pageId, route)

add the move route command to a page

Parameters:
Name Type Description
pageId *

the id of the page to add the command to

route *

the id of the action

addPage()

Add a new page for the event's actions.

addSpokenText(pageId, text)

add text command to page with a speaker

Parameters:
Name Type Description
pageId *
text *

addSpriteToTilemap(sprite)

Add a sprite to the current scene's Tilemap.

Parameters:
Name Type Description
sprite

(Sprite_Character)

addText(pageId, text)

add text command to page

Parameters:
Name Type Description
pageId *
text *

addTintScreen(pageId, tint, frames)

Parameters:
Name Type Description
pageId *

the page Id to add the command to

tint *

the tint object

frames *

who many frames to tint for

addWait(pageId, frames)

add a wait command to a page

Parameters:
Name Type Description
pageId *

the page id to add the command to

frames *

the number of frames to wait

checkSelfSwitch(letter) → {boolean}

check a self switch of this event

Parameters:
Name Type Description
letter *

the letter of the self switch

Returns:
boolean -

whether the switch is true or false

copyActionsFromCommonEvent(id)

Copy actions from a Common Event with the specified id.

Parameters:
Name Type Description
id

(int)

copyActionsFromEvent(id)

Copy actions from another event on the same map with the specified id.

Parameters:
Name Type Description
id

(int)

copyActionsFromEventOnMap(id, mapId)

Copy actions from another event on map with the specified id.

Parameters:
Name Type Description
id

(int)

mapId

(int)

Returns:
-

self for cmd chaining

createCharacterSprite(event)

Create a new Sprite_Character and store it in the current scene's Spriteset_Map.

Parameters:
Name Type Description
event

(Game_Event)

Returns:
-

the event or an empty event if something went wrong

createCommand(command, parameters, indent) → {rm.types.Event}

create a command obj from these params

Parameters:
Name Type Default Description
command *

the command code

parameters *

array of params

indent * 0

optional

Returns:
rm.types.Event

createGameEvent()

Create a new Game_Event object and store it in $gameMap.

getLastEvent()

Get the last Event object stored in $dataMap.

getListOfCommandCodesOnPage(page)

return an array of all command codes on page

Parameters:
Name Type Description
page *

page index

indexOfCommandOnPage(commandCode, page)

returns the index of the first occurence of the command code on the page

Parameters:
Name Type Description
commandCode *

command code

page *

page index

setChar(pageId, name)

change the charecter of a page

Parameters:
Name Type Description
pageId *
name string

string

setDefaultConditions()

Set the default event conditions for a page of actions.

setDefaultMoveRoute()

Set the default move route for a page of actions.

setDefaultPage()

Returns:
-

the default page objectt

setId()

Automatically set the id for the event.

setImage(pageId, imageObj)

change the image of a page

Parameters:
Name Type Description
pageId *
imageObj *

setName(name)

Set the name of the event.

Parameters:
Name Type Description
name

(string)

setNote(note)

Set the note of the event.

Parameters:
Name Type Description
note

(string)

setPosition(x, y)

Set the map coordinates of the event.

Parameters:
Name Type Description
x

(int)

y

(int)

spawn(x, y)

Place the event on the map at the specified coordinates.

Parameters:
Name Type Description
x

(int)

y

(int)

static generateImage(index, name, dir, pattern, tile)

Parameters:
Name Type Description
index *

the index of the char, 3 cols per index

name *

the name of the char sheet to use

dir *

the dir they are facing, 2,4,6,8

pattern *
tile *

tile id not sure

Returns:
-

obj

static setDefaultImage()

Set the default event image for a page of actions.