9.14 Event object

Description

You can get/set the properties of an event with the Event object. The Event object requires an index to specify which event shall be responded. This index is the event id used in the RPG-Maker. Because the event id is not continuous numbered this object is not capable for loops. If you want to access events in loops then you should use the MapEvent object. If you want to access a special event (this, hero, boat, ship or airship) you can use the special event constants as index.

List of methods/properties

NameTypeShort description
IDPropertyThe id of the event
MapIDPropertyThe id of the map where the event is placed
XPropertyThe x coordinate of the event
YPropertyThe y coordinate of the event
Dir1PropertyThe first part of the event's direction
Dir2PropertyThe second part of the event's direction
DirFlagsPropertyThe direction properties of the event
ExistsPropertyThe clear state of the event
ScreenXPropertyThe x coordinate of the event on the screen
ScreenYPropertyThe y coordinate of the event on the screen
FramePropertyThe current frame of the event
OffsetPropertyThe current offset to the next field of the event
CharsetPropertyThe name of the event's charset
FrequencyPropertyThe movement frequency of the event
SpeedPropertyThe movement speed of the event
TransparencyPropertyThe transparency of the event
FixDirPropertyThe fixed direction property of the event
PhasingPropertyThe "walk trough walls" property of the event
StopAnimationPropertyThe "no walk animation" property of the event
JumpTimePropertyThe jump time value of the event

ID

Description

This is the id used to identify the event in the RPG-Maker.

Syntax

1
Event[Index].ID

Data type

Dword

Type

Property, read-only

Example

1
2
$
v[1] = Event[1].ID
At the end v[1] whould contain the id of the first event (in this case 1).

MapID

Description

This is the id of the map where the event is currently placed.

Syntax

1
Event[Index].MapID

Data type

Dword

Type

Property, read-only

Example

1
2
$
v[1] = Event[1].MapID
At the end v[1] whould be the first event's map id (in this case probably 1).

X

Description

This is the x coordinate (in chips) of the event on the current map.

Syntax

1
Event[Index].X

Data type

Dword

Type

Property

Example

1
2
$
v[1] = Event[1].X

Y

Description

This is the y coordinate (in chips) of the event on the current map.

Syntax

1
Event[Index].Y

Data type

Dword

Type

Property

Example

1
2
$
v[1] = Event[1].Y

Dir1

Description

This is the first part of the direction flags of the event.

Syntax

1
Event[Index].Dir1

Data type

Byte

Type

Property

Example

1
2
$
v[1] = Event[1].Dir1

Dir2

Description

This is the second part of the direction flags of the event.

Syntax

1
Event[Index].Dir2

Data type

Byte

Type

Property

Example

1
2
$
Event[HERO].Dir2 = DIR_RIGHT

DirFlags

Description

This is the direction property of the event (this is a combination of Dir1 and Dir2).

Syntax

1
Event[Index].DirFlags

Data type

Word

Type

Property

Example

1
2
$
v[1] = Event[1].DirFlags

Exists

Description

This property is true whether the event does "exist". If this value is false then the event has been cleared (e. g. with the "clear timer" from the RPG-Maker).

Syntax

1
Event[Index].Exists

Data type

Switch

Type

Property

Example

1
2
$
Event[1].Exists = False
At the end the first event whould be cleared.

ScreenX

Description

This is the x coordinate of the event in pixel.

Syntax

1
Event[Index].ScreenX

Data type

Dword

Type

Property, read-only

Example

1
2
$
v[1] = Event[1].ScreenX

ScreenY

Description

This is the y coordinate of the event in pixel.

Syntax

1
Event[Index].ScreenY

Data type

Dword

Type

Property, read-only

Example

1
2
$
v[1] = Event[1].ScreenY

Frame

Description

This is the current frame (a piece of the charset) of the event.

Syntax

1
Event[Index].Frame

Data type

Dword

Type

Property

Example

1
2
$
v[1] = Event[1].Frame

Offset

Description

This is the offset from the next field of the event in considering to its direction.

Syntax

1
Event[Index].Offset

Data type

Dword

Type

Property

Example

1
2
$
v[1] = Event[1].Offset

Charset

Description

This is the name of the event's currently used charset.

Syntax

1
Event[Index].Charset

Data type

Dword

Type

Property

Example

1
2
$
a[1] = Event[1].Charset
At the end a[1] whould contain the used charset of the first event (e. g. "CROWN7" for the RTP file "CROWN7.png").

Frequency

Description

This is the current movement frequency of the event. This value should be in the range of 1 to 8.

Syntax

1
Event[Index].Frequency

Data type

Dword

Type

Property

Example

1
2
$
v[1] = Event[1].Frequency

Speed

Description

This is the current movement speed of the event. This value should be in the range of 1 to 8.

Syntax

1
Event[Index].Speed

Data type

Dword

Type

Property

Example

1
2
$
v[1] = Event[1].Speed

Transparency

Description

This is the current transparency of the event. This value should be in the range of 0 to 8.

Syntax

1
Event[Index].Transparency

Data type

Dword

Type

Property

Example

1
2
$
v[1] = Event[1].Transparency

FixDir

Description

This property decides whether the direction of the event is fixed (true means the direction is fixed)

Syntax

1
Event[Index].FixDir

Data type

Switch

Type

Property

Example

1
2
$
Event[THIS].FixDir = True
At the end the direction of the current event whould be fixed.

Phasing

Description

This property decides whether an event can walk trough walls, etc. (true means the event can walk through walls).

Syntax

1
Event[Index].Phasing

Data type

Switch

Type

Property

Example

1
2
$
Event[THIS].Phasing = True
At the end the current event could walk trough walls.

StopAnimation

Description

This property decides whether an event has a movement animation. (true means the event has no walking animation).

Syntax

1
Event[Index].StopAnimation

Data type

Switch

Type

Property

Example

1
2
$
Event[THIS].StopAnimation = True
At the end the current event whouldn't have a walking animation.

JumpTime

Description

This property contains the jump time of the event.

Syntax

1
Event[Index].JumpTime

Data type

Dword

Type

Property

Example

1
2
$
v[1] = Event[1].JumpTime