Note Tags into Variables?

I'm trying to simplify some templates I use in several common events. Hoping for 2 things.
 
 
Is there a way to pull a notetag integer from an item's note box and turn it into a specific variable without adding a script?
Something that might possibly look like this:

  • $data_items[id].notetag[n]
 
And also, is it possible to assign a color to a variable? I've been trying stuff like:

  • $game_variables[n] += $window_base.change_color(text_color(10))
  • $game_variables[n].change_color(text_color(10))
  • $game_variables[n].change_color(knockout_color)
But I keep running into errors. I'm not even sure if window_base can even be referenced.
 
The way I have it setup now, for each CE, I have to manually enter in what I want the variables to change to. Being able to just enter it into the notetags allows me to reuse the same template without having to alter each of them.
 
And then, if it requires a specific amount each from 4 different items, I currently use a text box for each possible outcome displaying in red if there isn't enough of a certain item.
 

  • 0/3 required.
  • 2/3 required.
  • 3/3 required.
  • 1/3 required.
 
With 4 items, that's 15 possible combinations. With \C[n], I have to make 15 separate text boxes, but if I could add a color to a variable, those 15 text boxes becomes 2. One for if there's enough, and another if there's not.

4 simple conditional branches to check quantities, assign red to a variable to those that are less than required, 1 text box to display the results.

Thanks!
This is not "directly" possible, because note tags are literally meaningless words, as the note section was only meant to help remind forgetful developers, about what things do. It's scripters who use the note section to get around limitations that would either prevent them from being able to do something, who make a script that Isn't very user friendly.

I'm not going to say It's impossible to do(although it might as well be), but such a script would have to be custom made, to be based around all the scripts in your game, that use note tags.
Okay. That's what I thought. Figured it was a long shot, but still had to ask. Thanks for the quick response.

Now I just need to find out how to add a color to a variable.
Please check this topic.


I haven't been able to check the solutions and scripts myself due to planning changes, but it should do what you want:


http://forums.rpgmakerweb.com/index.php?/topic/40620-script-to-transfer-notetag-data-to-variables-and-switches/
When using the "change color" tag in messages, you can pass a variable instead of a static number:
\c[\v[20]]

would pick the color stored in variable 20 for example.

Edit: Andar already posted a better solution for the following.

A quick way to extract a number from a notebox would be this:
$data_items[10].note[/<
XYZ 🙁 .*?)>/i, 1].to_i

This command searches for a tag like

<XYZ: 102>

within item 10. XYZ can be replaced by another term. If the item does not contain such a tag, the result is 0.
Omg. I've been trying so hard to add a color to the variable input for the past few hours, that I hadn't even considered that. And even more embarrassing, I've used that method before with icons and variables. Never considered it for the control colors.

Thank you for that, Fen! Now I can finally go to bed... despite that it's 5:30 AM on the USA west coast... I'm tired.

Original thread: https://forums.rpgmakerweb.com/threads/note-tags-into-variables.50941/