is there a simple way to determine in the current map has a note tag

blurymind

Veteran
Veteran
Joined
May 5, 2016
Messages
62
Reaction score
17
Primarily Uses
and how?

All could find everywhere were giant confusing loops to scan though very specific stuff.

Does rpg maker mv really not have a simple function for checking basic stuff like that?
:o

Check if the current event has a note tag, check if the current map has a note tag?

If its not a part of the engine (crazyyy!),is there a plugin that makes those checks easier?

This is really NOT an easy engine for scripting. Godot and even Unity have way better documented API and well defined helper methods and functions. I feel crippled without basic access to that stuff
 
Last edited:

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
Hmm, well, you could use RegExp and $dataMap (data of the current map) to check for a particular note tag. Or you could use the 'meta' object in $dataMap (note tags are automatically parsed and put into 'meta' when the map is loaded).
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
For the event it is the "meta" object in events in $dataMap.
 

blurymind

Veteran
Veteran
Joined
May 5, 2016
Messages
62
Reaction score
17
Primarily Uses
ok then, how (in script) do you check if the current map contains a note tag called <testme>? for example..
Please, give me some example code/method

Right now both replies are telling me to write my own and I have been trying and failing to do that for the last hour

so what is it? Is there really no
if $dataMap.events.meta.hasNoteTag('testme'){//do stuff}
method?
Something reusable and general purpose that returns true or false- something to use in conditional branches in the editor?
Getting to the data is like pulling teeth
 
Last edited:

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
I do not believe there is a native way to check for a note tag, no. I could be wrong, however.

You could use the following, though :

Code:
/<testme>/.test($dataMap.note);
// Returns 'true' if '<testme> is in the note tag of the map

/<testme:(.*)>/.test($dataMap.note);
// Returns 'true' if '<testme:whatnot>' is in the note tag of the map
// You can also use RegExp.$1 to grab the first match. In this instance that would be 'whatnot'.
 

blurymind

Veteran
Veteran
Joined
May 5, 2016
Messages
62
Reaction score
17
Primarily Uses
can I just do
if $dataMap.meta =='testme'{
console.log('voala')
}

OSSRA, thank you, I will give that a try. Whydoesnt someone make a general purpose plugin for that? It will make the editor much more accessible and flexible
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
Sure. Though to avoid the script exploding, you would want to make certain $dataMap.meta.testme exists first.

Code:
if ($dataMap.meta.testme) {
  console.log($dataMap.meta.testme);
}

EDIT: To be honest, I think someone did create a plugin for that. But it is probably buried in the forums somewhere. o:
 

blurymind

Veteran
Veteran
Joined
May 5, 2016
Messages
62
Reaction score
17
Primarily Uses
I came up with this:

Code:
if ('testme' in $dataMap.meta){
console.log('>>>>>'+$dataMap.meta)
};
not sure if its the best idea, do you think it might explode?

Would be nice if we could find that plugin or get a good builtin solution for this. It is such a common thing when doing well anything really- anything with assigning custom variables to events and maps
 
Last edited:

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
It will explode, because there is nothing as "in" in javascript.

Using $dataMap.meta.testme as mentioned above is enough. It won't explode as long as $gameMap is defined.
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
There is an 'in' operator, though. o:

EDIT: As long as what you are attempting to do comes after 'meta' is populated on map load, you should be fine.
 

blurymind

Veteran
Veteran
Joined
May 5, 2016
Messages
62
Reaction score
17
Primarily Uses
@Poryg it seems to work for me. I followed up on
https://stackoverflow.com/questions/18922965/check-if-object-key-exists-within-array
The in operator works and is great for associative arrays like the ones rpg maker is using

but the one @Ossra provided seems like a cleaner syntax

Why do most plugin developers write complicated functions that scan through all the metadata and capture with regex?
For many cases all you need really is some data from the currently active map or the currently active event...

For event management, can you not do their code in an object oriented way? Like attaching custom functions as variables? It seems all so frustrating when I read the existing code. I am still trying to wrap my head around it
 
Last edited:

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
I see. When I try to use "in" in anything, it explodes on me... Looks like I don't use it correctly xD

Why do most plugin developers write complicated functions that scan through all the metadata and capture with regex?
For many cases all you need really is some data from the currently active map or the currently active event...
ask them xD
Soulpour talks about it in one video I think.

For event management, can you not do their code in an object oriented way?
You definitely can, there is nothing wrong with it.
 

blurymind

Veteran
Veteran
Joined
May 5, 2016
Messages
62
Reaction score
17
Primarily Uses
Not saying it's wrong.. its just seeing it as THE example everywhere paints the first impression of the engine as a pain in the arse to script- if data access is like pulling teeth, then it wont be fun to play with the data
xD
It will be great if we could get a proper API doc. I know there is one on google docs and I saw it - it is very incomplete and scattered. It did not help me in this instance

Thank you for the help guys. I am going to play with what i learned tomorrow. Its getting really late here now =_=
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
ikr xD 3:02 am :D
Actually, pulling data out of the engine is pretty easy once you get the hang of it. Console is your best friend in this task.
 

blurymind

Veteran
Veteran
Joined
May 5, 2016
Messages
62
Reaction score
17
Primarily Uses
well Idk about that, but we will see.
The engine IS a pain in the ass for scripting. Especially compared to godot.
Godot has a better code editor, debugger, api, better everything.
The only reason I am trying to use this engine is the damned license on the awesome tilesets wont allow me to use the tilesets in godot

This forum has awesome community made tilesets, but unfortunately they are all tied with a license to be used only in rpg maker

I bought rpg maker, because i do like it as an engine- but really wish I could use the tilesets somewhere else where I can do more interesting things with them easier

For now I guess it wont hurt to learn the poorly documented rmmv api and try to do things with it. Thanks to you guys I am still here and learning
 

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,847
Messages
1,016,972
Members
137,561
Latest member
JaCrispy85
Top