9.13 Map object

Description

You can get/set the properties of the current map with the Map object. You can read generic informations (width, height, ...) or change the single chips (upper chip, lower chip).

List of methods/properties

NameTypeShort description
IDPropertyThe id of the map
WidthPropertyThe width of the map
HeightPropertyThe height of the map
HeroXPropertyThe x coordinate of the hero on the map
HeroYPropertyThe y coordinate of the hero on the map
ChipsetPropertyThe id of the map's used chipset
LowerPropertyThe lower chip at a specific position on the map
UpperPropertyThe upper chip at a specific position on the map
EventCountPropertyThe number of events on the map

ID

Description

This is the id used by the RPG-Maker 2000 to identify the current map.

Syntax

1
Map.ID

Data type

Dword

Type

Property, read-only

Example

1
2
$
v[1] = Map.ID
At the end v[1] whould contain the Id of the current map (in this case probably 1).

Width

Description

This is the width (in chips) of the current map.

Syntax

1
Map.Width

Data type

Dword

Type

Property, read-only

Example

1
2
$
v[1] = Map.Width
At the end v[1] whould contain the width of the current map (e. g. on a 20 x 15 sized map this whould be 20).

Height

Description

This is the height (in chips) of the current map.

Syntax

1
Map.Height

Data type

Dword

Type

Property, read-only

Example

1
2
$
v[1] = Map.Height
At the end v[1] whould contain the height of the current map (e. g. on a 20 x 15 sized map this whould be 15).

HeroX

Description

This is the current hero's x coordinate on the current map.

Syntax

1
Map.HeroX

Data type

Dword

Type

Property, read-only

Example

1
2
$
v[1] = Map.HeroX
At the end v[1] whould contain the current x coordinate of the hero.

HeroY

Description

This is the current hero's y coordinate on the current map.

Syntax

1
Map.HeroY

Data type

Dword

Type

Property, read-only

Example

1
2
$
v[1] = Map.HeroY
At the end v[1] whould contain the current y coordinate of the hero.

Chipset

Description

This is the id of the chipset which is used by the current map.

Syntax

1
Map.Chipset

Data type

Dword

Type

Property, read-only

Example

1
2
$
v[1] = Map.Chipset
At the end v[1] whould contain the chipset id of the current map.

Lower

Description

This is the lower chip at a specific position on the map. A two dimensional index is used to specify the position. The first value is the x coordinate an the second value is the y coordinate. Both values start at 0. The boundaries of the map may not be exceeded.

Syntax

1
Map.Lower[X, Y]

Data type

Word

Type

Property

Example

1
2
$
Map.Lower[0, 0] = 4333
At the end the lower chip in the upper left corner of the map (position 0, 0) whould be changed to a poisoned chip (depends on the chipset).

Upper

Description

This is the upper chip at a specific position on the map. A two dimensional index is used to specify the position. The first value is the x coordinate an the second value is the y coordinate. Both values start at 0. The boundaries of the map may not be exceeded.

Syntax

1
Map.Upper[X, Y]

Data type

Word

Type

Property

Example

1
2
$
Map.Upper[Map.Width - 1, 0] = 10000
At the end the upper chip in the upper right corner of the map whould be a clear chip (depends on the chipset).

EventCount

Description

This is the total number of events (excluding the hero and the vehicles) on the map. This property can be quite well combined for loops with the MapEvent object.

Syntax

1
Map.EventCount

Data type

Dword

Type

Property, read-only

Example

1
2
$
v[1] = Map.EventCount
At the end v[1] whould contain the number of events on the current map.