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
895
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
895
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

Just finished watching the last of the Final Destination movies. I'm digging every last water bottle out of that old van :p
Put off learning to drive for so long, I hope I don't run into any of-fences ..... (quietly leaves)
I introduced a new character to Mintabelle's Wonderland. Fufu the Raccoon! She's supposed to be a motherly daycare attendant, but when the power goes out, she becomes a monster. Rumor among kids says she causes these outages herself...
After an entire year, finally made new story cutscenes. Ones that take place after the current last boss. Praise be.
That moment when you're getting a new update ready, deploy it for the final round of testing (gotta make sure the deployed version runs, ya know?) andddddd there's a visual blip :ysrs: Doesn't impact gameplay. It's only on-screen for a few seconds. But you can't leave it there.
So now you have to fix it, then redeploy, then retest. Why do I do this to myself.

Forum statistics

Threads
129,802
Messages
1,205,303
Members
170,908
Latest member
DarrelOdin
Top