- Joined
- Jan 26, 2014
- Messages
- 1,281
- Reaction score
- 106
- First Language
- Irish
- Primarily Uses
- N/A
I want to detect if an actor has this note tag:
/<(?:METRONOME|metronome):[ ]*(\d+)([%%])>/iand from the answers I've learned, I did something like this:
Game_Actor.prototype.getMetronome= function() { this._metronome = /<(?:METRONOME|metronome):[ ]*(\d+)([%%])>/i; this.note.split(/[\r\n]+/g).forEach(function (line) { line.match(/<metronome:[ ]*(\d+)>/ig); var metronomeValue = 1; if (match) { metronomeValue = Number(match[0] || 0); } } }Is this correct? Or is there a better implementation? Because I want to get the note tag
<metronome: 10>and then give that value from the note tag of the actor to a variable, which I can call later.
/<(?:METRONOME|metronome):[ ]*(\d+)([%%])>/iand from the answers I've learned, I did something like this:
Game_Actor.prototype.getMetronome= function() { this._metronome = /<(?:METRONOME|metronome):[ ]*(\d+)([%%])>/i; this.note.split(/[\r\n]+/g).forEach(function (line) { line.match(/<metronome:[ ]*(\d+)>/ig); var metronomeValue = 1; if (match) { metronomeValue = Number(match[0] || 0); } } }Is this correct? Or is there a better implementation? Because I want to get the note tag
<metronome: 10>and then give that value from the note tag of the actor to a variable, which I can call later.

