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
Name | Type | Short description |
ID | Property | The id of the event |
MapID | Property | The id of the map where the event is placed |
X | Property | The x coordinate of the event |
Y | Property | The y coordinate of the event |
Dir1 | Property | The first part of the event's direction |
Dir2 | Property | The second part of the event's direction |
DirFlags | Property | The direction properties of the event |
Exists | Property | The clear state of the event |
ScreenX | Property | The x coordinate of the event on the screen |
ScreenY | Property | The y coordinate of the event on the screen |
Frame | Property | The current frame of the event |
Offset | Property | The current offset to the next field of the event |
Charset | Property | The name of the event's charset |
Frequency | Property | The movement frequency of the event |
Speed | Property | The movement speed of the event |
Transparency | Property | The transparency of the event |
FixDir | Property | The fixed direction property of the event |
Phasing | Property | The "walk trough walls" property of the event |
StopAnimation | Property | The "no walk animation" property of the event |
JumpTime | Property | The jump time value of the event |
Description
This is the id used to identify the event in the RPG-Maker.
Syntax
Data type
Dword
Type
Property, read-only
Example
At the end v[1] whould contain the id of the first event (in this case 1).
Description
This is the id of the map where the event is currently placed.
Syntax
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).
Description
This is the x coordinate (in chips) of the event on the current map.
Syntax
Data type
Dword
Type
Property
Example
Description
This is the y coordinate (in chips) of the event on the current map.
Syntax
Data type
Dword
Type
Property
Example
Description
This is the first part of the direction flags of the event.
Syntax
Data type
Byte
Type
Property
Example
1
2
$
v[1] = Event[1].Dir1
Description
This is the second part of the direction flags of the event.
Syntax
Data type
Byte
Type
Property
Example
1
2
$
Event[HERO].Dir2 = DIR_RIGHT
Description
This is the direction property of the event (this is a combination of Dir1 and Dir2).
Syntax
Data type
Word
Type
Property
Example
1
2
$
v[1] = Event[1].DirFlags
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
Data type
Switch
Type
Property
Example
1
2
$
Event[1].Exists = False
At the end the first event whould be cleared.
Description
This is the x coordinate of the event in pixel.
Syntax
Data type
Dword
Type
Property, read-only
Example
1
2
$
v[1] = Event[1].ScreenX
Description
This is the y coordinate of the event in pixel.
Syntax
Data type
Dword
Type
Property, read-only
Example
1
2
$
v[1] = Event[1].ScreenY
Description
This is the current
frame (a piece of the charset) of the event.
Syntax
Data type
Dword
Type
Property
Example
1
2
$
v[1] = Event[1].Frame
Description
This is the offset from the next field of the event in considering to its direction.
Syntax
Data type
Dword
Type
Property
Example
1
2
$
v[1] = Event[1].Offset
Description
This is the name of the event's currently used charset.
Syntax
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").
Description
This is the current movement frequency of the event. This value should be in the range of 1 to 8.
Syntax
Data type
Dword
Type
Property
Example
1
2
$
v[1] = Event[1].Frequency
Description
This is the current movement speed of the event. This value should be in the range of 1 to 8.
Syntax
Data type
Dword
Type
Property
Example
1
2
$
v[1] = Event[1].Speed
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
Description
This property decides whether the direction of the event is fixed (true means the direction is fixed)
Syntax
Data type
Switch
Type
Property
Example
1
2
$
Event[THIS].FixDir = True
At the end the direction of the current event whould be fixed.
Description
This property decides whether an event can walk trough walls, etc. (true means the event can walk through walls).
Syntax
Data type
Switch
Type
Property
Example
1
2
$
Event[THIS].Phasing = True
At the end the current event could walk trough walls.
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.
Description
This property contains the jump time of the event.
Syntax
Data type
Dword
Type
Property
Example
1
2
$
v[1] = Event[1].JumpTime