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

hmm one of those days where there's a lot to work on with my game... annnnnd I have no idea what I wanna do. most of it tho, involves drawing lol. either enemies or NPCs.
I'm going back to the default RTP, in the interest of getting it done. FSM is lovely but slow to work with and has tall doors. And switching to tall sprites would mean a lot of franking, and also the horses will be small.
I think I developed a stalker trauma (stalkerfobia?) because of my previous work publishing games on Steam. :(
RIP, MeatLoaf :( Hot patootie, bless his soul, he really loved that rock 'n roll.
Psychronics Games is doing a livestream about my game in a bit... And I will do a video about his game after that.
Watch their stream with us on youtube!

Forum statistics

Threads
118,574
Messages
1,117,062
Members
155,632
Latest member
GhostFrog
Top