I have a question regarding adding note tags. I want to specifically add a note tag if we go to a particular setup. In Ace, we have this:
class RPG::Enemy < RPG::BaseItem def invisibility? self.note.include?("invisible") endendclass Game_Enemy < Game_Battler def invisiblity? enemy.invisibility? endendHow do you exactly convert this in js? Specifically also, what's the equivalent of self.note.include?() in RMMV's scripting?
Indeed it made it quite long. But specifically for the game enemy, how would you do it? I only want to check one note tag for the enemy.
I remember Yanfly used code like that in VXAce, and it avoided being a mess due to every script having it's own datamanager. Though it did seem to cause a little slowdown when a game was first loaded (1 - 2 seconds).
I see. One last problem, since I am testing the note tag of any enemy, what property should I do? Is it:
DataManager.invisibility.enemies.noteor is there a way to detect each enemy's note? Because enemy_id, lets us be specific which enemy that is, right?
Here's my try and problems are presented in comment:
DataManager.loadDatabase = (function(loadInvReq) { return function() { loadInvReq.apply(this, arguments); this.load_inv_requirements(); // Added };})(DataManager.loadDatabase);DataManager.load_inv_requirements = function() { // New this.inv_requirements = {}; // no clue how to do it on this part}; // data: The data to have its notetags read// type: The type of the dataDataManager.load_inv_requirements_tags = function(data, type) { // New // note tag check, how to do <invisible> var enemies = DataManager.invisibility.enemies; for (enemy_id in enemies) { if (enemies.hasOwnProperty(enemy_id) && typeof enemies[enemy_id] === "object") { enemies[enemy_id]; } }};basically what I need is for the Data then to check <invisible>, and if that enemy has that tag, then some thing will happen. Any clues?
i usually create a function... and then pass the object to that method...
then call it's note using
[replace object here].note
then do the things i want inside the function...
example:
Game_Interpreter.prototype.getDecorMap = function(item) { var mastermap = 0; comment = item.note; console.log(comment); if(comment.match(/<decor_map:\s*(\d+)?>/im)) var mastermap = Number(comment.match(/<decor_map:\s*(\d+)?>/im)[1]); return mastermap;};then when i want to grab item 10 <decor_map: x> notetags
i passed $dataItems[x] to that function and call it... (if you want easier way... don't place the function inside Game_Interpreter. but place it where they have $ variables such as $gameSystem, $gameMap, so it can be called anywhere. the example above just copy pasted from my plugin in development. and i need it inside Game_Interpreter...).