skymen

Veteran
Veteran
Joined
Aug 26, 2013
Messages
46
Reaction score
5
First Language
French
Primarily Uses
I would like to (in the script) retrieve the data from the event (like its name, litle note/description box besid the name box) that called the plugin command.

For exemple, I want to create an event that would call some plugin command.

The plugin would would test if the value is, for exemple, 1, then it would set the event's local switch A to true.
If the value is 2, it would tp the event elsewhere

If the value is 3, it would damage the player, and so on.

I mean, making some auto event thing using plug-ins.

What I wanna make with this is create some "local variable" for each event, instead of using global variables.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,812
Reaction score
889
First Language
German
Primarily Uses
RMMZ
Plugin commands are resolved using GameInterpreter.prototype.pluginCommand. The GameInterpreter itself has the current even id as

Code:
this._eventId;this.eventId();
and the event itself as
Code:
$gameMap.event(this._eventId)
 

skymen

Veteran
Veteran
Joined
Aug 26, 2013
Messages
46
Reaction score
5
First Language
French
Primarily Uses
Thanks! :D
If I get some issue, I'll tell you :3


EDIT: OK, from there, how do I actually retrieve the event's name and note?
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,812
Reaction score
889
First Language
German
Primarily Uses
RMMZ
You'll need to retrieve the actual event data first, like this:

Code:
var event = $gameMap.event(this.eventId()).event();var name = event.name;var note = event.note;
That's the intended version (i guess). For a bit less to write, you could also directly access the data object:
Code:
var event = $dataMap.events[this.eventId()];
 

Latest Threads

Latest Posts

Latest Profile Posts

A quarter of century ago, one astute frog man was born. :ninja:
All new MZ Weather & Title updates are also RETRO'able for MV! Updated RETRO project will be released on same day I'll release updated MZ demo -project!

retro.png
Just lost about half a day's worth of work because rpg maker crashed during playtesting and corrupted my file :kaolivid:
Boku.gif
advanced_puzzling.PNG
Having a lot of fun making different poses for my character sets! Open to suggestions/critique!

CSKttqh.png

Forum statistics

Threads
117,019
Messages
1,103,890
Members
152,926
Latest member
Whitecup
Top