So I've seen a few people ask about this in the forums but no one seems to ask the question quite the way I needed.
I know that you have to make some function to read notes. As such I used the following template
So as of right now this should do nothing more than load the note tags and search for a specific <Command1: someTexthere> & turn that text into all caps or <Command2: someNumberhere> and turn the numerical String value into a Number value.
So my questions are
1. At what point or how do I call a function to react to the commands?
2. At what point are the note tags read?
I read that map notes are read upon entering the map. If that is so then would skill & item note tags only be read upon using the skill or item? Would armor and weapon ones ONLY be read upon equipping the item? That's the kind of thing I'm wondering.
Also, no I don't have any specific code yet which is why this is all very template like. I'm looking into creating a new plugin and I really want to use note tags to make it cleaner than my last one.
I know that you have to make some function to read notes. As such I used the following template
alias.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
DataManager.isDatabaseLoaded = function() {
if (!alias.DataManager_isDatabaseLoaded.call(this)) {
return false
}
if (!alias._loadedDatabase) {
this.loadSkillNoteTags($dataSkills);
alias._loadedDatabase = true;
}
return true;
};
DataManager.loadSkillNoteTags(datatype){
for (var n = 1; n < datatype.length; n++) {
var object = datatype[n];
var dataNotes = object.note.split(/[\r\n]+/);
object.propertyONE = {};
object.propertyTWO = {};
for (var i = 0; i < dataNotes.length; i++) {
var line = dataNotes;
if (line.match(/Command1:[ ](.*)>/i)) {
var Value = String(RegExp.$1).toUpperCase().trim();
obj.propertyONE[Value] = 'Call A';
} else if (line.match(/Command2:[ ](.*)>/i)) {
var Value = parseInt(RegExp.$1, 10);
}
}
};
DataManager.isDatabaseLoaded = function() {
if (!alias.DataManager_isDatabaseLoaded.call(this)) {
return false
}
if (!alias._loadedDatabase) {
this.loadSkillNoteTags($dataSkills);
alias._loadedDatabase = true;
}
return true;
};
DataManager.loadSkillNoteTags(datatype){
for (var n = 1; n < datatype.length; n++) {
var object = datatype[n];
var dataNotes = object.note.split(/[\r\n]+/);
object.propertyONE = {};
object.propertyTWO = {};
for (var i = 0; i < dataNotes.length; i++) {
var line = dataNotes;
if (line.match(/Command1:[ ](.*)>/i)) {
var Value = String(RegExp.$1).toUpperCase().trim();
obj.propertyONE[Value] = 'Call A';
} else if (line.match(/Command2:[ ](.*)>/i)) {
var Value = parseInt(RegExp.$1, 10);
}
}
};
So as of right now this should do nothing more than load the note tags and search for a specific <Command1: someTexthere> & turn that text into all caps or <Command2: someNumberhere> and turn the numerical String value into a Number value.
So my questions are
1. At what point or how do I call a function to react to the commands?
2. At what point are the note tags read?
I read that map notes are read upon entering the map. If that is so then would skill & item note tags only be read upon using the skill or item? Would armor and weapon ones ONLY be read upon equipping the item? That's the kind of thing I'm wondering.
Also, no I don't have any specific code yet which is why this is all very template like. I'm looking into creating a new plugin and I really want to use note tags to make it cleaner than my last one.