watermark

Thinking of what to do next
Veteran
Joined
Dec 25, 2012
Messages
648
Reaction score
607
First Language
English
Primarily Uses
RMMV
Hi I need help. I can't seem to figure out how to use comment tags.

Can someone show me the basics by showing how to make this simple example:

1. In an event comment add the tag "<Charisma: 17>"
2. Events will now have a new variable called "charisma", and this particular event will have it set at 17.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,136
Reaction score
10,680
First Language
Czech
Primarily Uses
RMMV
You don't add these into event comments, you add them into the note field. Screenshot_127.png

I have made a video about notetags.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,633
Reaction score
2,007
First Language
EN
Primarily Uses
RMMZ
If you were talking about comment tags: they are typically used to give an event different values based on the active page. There's no shortcut of which I'm aware: you'll have to scan the event's command list for Comment commands, then parse the contents of each command in search of the appropriate notetag. Here's an example designed for use in a Script command:
Code:
var RX = /<tag:\s*(\d+)>/;    // regular expression for <tag: X> (+integer X)
var ev = this.character(0);   // this event
var res = ev.list().filter(function(c) {
  return c.code === 108;      // get comments (command 108, cf rpg_objects.js)
}).map(function(c) {
  var match = RX.exec(c.parameters[0]);
  return match ? match[1] : '';  // digit match or empty string
}).filter(function(c) {
  return !!c;                    // filter out empty strings
})[0] || '';                     // return first entry or empty string
ev.tag = parseInt(res, 10) || 0; // assign retrieved value as a property
For use in a plugin you'd probably want to replace the ev var with a this reference and insert the comment-parsing code in an alias of the setupPage method of Game_Event or something like that~
 

Latest Threads

Latest Posts

Latest Profile Posts

having anxiety during all this virus stuff is the absolute worst. I'm the only one missing out on my friend's wedding in Sept. because I can't be in large groups of people anymore due to anxiety.
Well... I just spent most of the day making something I cant even use xD

Hero_1.png
The idea was to look at the original but at a medium distance.
In hindsight, I might as well have just edited the original lol... I didn't intend for it to end up so similar.
does anyone else feel tired after completing a sprite?
Fun fact: I always lower every tileset saturation (about 15%-25% of it) in my projects.

Forum statistics

Threads
113,903
Messages
1,078,316
Members
148,002
Latest member
Silvernimbus
Top