Is it possible for a script to read something written in the Note field of an event? Say, for use in Conditional Branches. I know that it's possible to do so with the Database objects like Actors and Skills, but Events on map don't seem to have the Meta property.
Event Notetags
RPG Maker MZ SupportAs far as I can tell, events don't have a "note" section like maps and other things. But there is an option to add a comment and you can put a <comment tag> in those which basically functions like a notetag.
Hmm, Events have a section next to the Name field that is called Note, but it seems that they function differently from the Map/Database note fields.
Basically, to make it clearer just what I'm asking:
For database objects, you can write something in the Note field of an actor like:
Code:
<fame:12>
You can then make an event with a conditional branch, that looks like:
Code:
if ($dataActors[1].meta.fame >= '12') {
Show Text: Wow, you are so famous!
} else {
Show Text: Umm, who are you?
}
The game would then evaluate the notetag of the Actor with Id 1 and if his 'Fame' was 12 or more, it would should the first text box, if not, it would show the second text box.
Basically, I want to know if it's possible to do something similar when you write the notetag in the Note field of a map Event, with just script calls. I've tried things like:
Code:
$gameMap.event(5).fame == '12';
$gameMap.event(5).meta.fame == '12';
$gameMap.event(5).note.fame == '12';
All of them lead to an error 'Cannot read property 'fame' of undefined. So it seems it doesn't work similar to the database objects (which isn't surprising, honestly) or I am going about this the wrong way. I can't find anything in the code or debug console that would lead me to a property I can access that would store this information, so I'm wondering if this is possible?
You're right. The box is so small I never actually noticed it before.
I'm not very good with the coding end of things but it does seem like the note box in events doesn't perform the same way as other things. I think that's why they allow comment tags. Try just putting your tag in a comment in the event and see if that works. If not, hopefully somebody more javascript savvy can help you figure it out.
👋
To get the map data associated with a
$gameMap.event(x) gets the Game_Event instance of event ID x, i.e. the event data that is expected to change during gameplay (location, facing, image, etc).To get the map data associated with a
Game_Event, including its note and meta properties, use the event method, e.g.
JavaScript:
$gameMap.event(5).event().meta.fame
Ah, ok, figured it was something like this. Thanks a lot, it works now!
Original thread: https://forums.rpgmakerweb.com/threads/event-notetags.130726/