How to Access "Note" Box?

SumRndmDde

Follower of RNGesus
Veteran
Joined
Jul 30, 2013
Messages
225
Reaction score
423
First Language
English
Primarily Uses
RMMV
Pretty much what I want to do is access the "Note" box that you can write comments or notes that is shown in various tabs of the Database.

For example, let's say I have a plugin that changes the color of the text of a Skill/Item/Weapon/Armor based on the color specified in their Note:

<Set Color: 2>

How can I access the string that is in the Notes?

Please use as much detail in your answer! Thanks!  ;)  
 
Last edited by a moderator:

Mr. Trivel

Glasses
Veteran
Joined
Jun 9, 2014
Messages
284
Reaction score
469
First Language
Lithuanian
Primarily Uses
Example.

Objects with notes have meta variable.

So if you have object item and you had <set_color: 2> in the item's note field. You'd access it with:

Code:
item.meta.set_color;
 
Last edited by a moderator:

SumRndmDde

Follower of RNGesus
Veteran
Joined
Jul 30, 2013
Messages
225
Reaction score
423
First Language
English
Primarily Uses
RMMV
Example.

Objects with notes have meta variable.

So if you have object item and you had <set_color: 2> in the item's note field. You'd access it with:

item.meta.set_color;
I got really excited when I saw how simple it was...

...but it didn't work.

I directly input your example plugin and it also didn't work...

So....yeah....

;_;
 

Mr. Trivel

Glasses
Veteran
Joined
Jun 9, 2014
Messages
284
Reaction score
469
First Language
Lithuanian
Primarily Uses
@SumRndmDude,

What didn't work for you? Did it crash? Or did it simply not show any coloring? On an empty project it should work fine.

 

SumRndmDde

Follower of RNGesus
Veteran
Joined
Jul 30, 2013
Messages
225
Reaction score
423
First Language
English
Primarily Uses
RMMV
@SumRndmDude,

What didn't work for you? Did it crash? Or did it simply not show any coloring? On an empty project it should work fine.

Sorry about that, it turns out yours works fine.

I was setting it to "2," which in mine turns it to red since the colors are based off of the Window.png, but on yours turns the text to white.

So I got a little confused.

However, mine still doesn't work.

Here's what I have:

Window_Base.prototype.drawItemName = function(item, x, y, width) {    width = width || 312;    if (item) {        var iconBoxWidth = Window_Base._iconWidth + 4;        if(item.meta.Set_Color)        {            this.changeTextColor(this.textColor(item.meta.Set_Color);        }        else        {            this.resetTextColor();        }        this.drawIcon(item.iconIndex, x + 2, y + 2);        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);    }};I've checked to make sure everything is perfect in the Notes and that the plugin is turned on, but I cannot figure out why my text colors do not change...
 
Last edited by a moderator:

Mr. Trivel

Glasses
Veteran
Joined
Jun 9, 2014
Messages
284
Reaction score
469
First Language
Lithuanian
Primarily Uses
In note field,

is it <Set_Color: 2> or <Set Color: 2>?

(It has to be <Set_Color: 2>)
 

kiriseo

Veteran
Veteran
Joined
Oct 27, 2015
Messages
245
Reaction score
82
First Language
German
I used your script and run it through firefox's dev tools.

There is a syntax error. You forgot a ")" here

this.changeTextColor(this.textColor(item.meta.Set_Color));

That's why your script isn't running in the first place.
 
Last edited by a moderator:

SumRndmDde

Follower of RNGesus
Veteran
Joined
Jul 30, 2013
Messages
225
Reaction score
423
First Language
English
Primarily Uses
RMMV
In note field,

is it <Set_Color: 2> or <Set Color: 2>?

(It has to be <Set_Color: 2>)
Yeah, it's there.

Thanks for your previous advice!

I used your script and run it through firefox's dev tools.

There is a syntax error. You forgot a ")" here

this.changeTextColor(this.textColor(item.meta.Set_Color));

That's why your script isn't running in the first place.
:o

I see! 

I never thought about that. Thanks so much!

It works now.

Now the question I must ask now is:

How do I make it so I can do <Set Color: 2> without using the underscore?
 

DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
on the enemy object there is a note or noteBox element. You can access it with that.
 

kiriseo

Veteran
Veteran
Joined
Oct 27, 2015
Messages
245
Reaction score
82
First Language
German
Now the question I must ask now is:

How do I make it so I can do <Set Color: 2> without using the underscore?
If it must be "Set Color" instead of "Set_Color" (or even "SetColor"),

my guess would be that you have to use regular expressions.
 

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

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,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top