Using Tags - Assigning Enemy Levels?

Giving Tsukihime's Tag Manager a whirl, and thus far results are highly positive.  Had the thought that *maybe* I could use the tag system to assign enemy levels, since I'm planning to use to the attacker's level as a huge part of damage dealt, and really, really would like to avoid having to make a metric @!$#-ton of duplicate techs for different enemies of different levels.  Not looking at having enemies level with the party, just wanting to assign a level hard-and-fast to a given enemy.  Knew I'd need to define a means to return a value, so...trying tucking this in under "class Game_Enemy < Game_Battler," thinking m'self clever:

def level

  return [level]

end

And then tried dropping <level: 99> in the slime's notes, and tested.  Still hitting as if Level 0.  Tried switching to <tag: level: 99>, to the same result.

Clearly doing something wrong, though not sure what.  A little help, please?
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


Is this something that's already built in to the tag manager? Can you provide a link to the script please?


Game_Enemy is a bit funny - Game_Enemy is not a duplication of RPG::Enemy (which is what's in the Enemies tab in the database). Instead, when a Game_Enemy is created, it gets a variable, enemy which is the RPG::Enemy that's in the database.


As a pure guess, try referencing enemy.level (that may not be the appropriate syntax). Or put your method into the RPG::Enemy class and not into the Game_Enemy class, and reference it as x.enemy.level where x is your enemy object.
FYI:

The notefields were originally intended as non-functional text fields where the developer can place notes on what was planned with the object.

Notetags were created by the scripter community as a method to transfer data from the database to the scripts.

That means, a notetag has only a function if there is a script that reads and analyses the notefields as a text string - just placing something in the notefield without writing a dozen script commands to read that will not do anything.

I haven't worked with the tag manager, but I think you need more than those three lines in the script to return the level number...
Absolutely - if you're recording something in notes, then you need to have a script that knows to look for it. You can't just say "I'm going to put the actor's birthday here" and suddenly be able to add a $game_actors[1].birthday variable. You actually have to write the script to do something with it once it's in there. That's kind of what I meant when I asked if it was already something built in to the tag manager.
The "tags" provided by the Tag Manager are just strings.


The only purpose is to query whether an object has certain tags or not.


Unfortunately, the Tag Manager won't allow you to basically define your own attributes, nor do I have plans to do so with that script.


If you don't want to deal with regular expressions and want an "easy" way to handle note-tags, you can consider this script


http://www.rpgmakervxace.net/topic/10545-est-simple-notetags-grabber/

Original thread: https://forums.rpgmakerweb.com/threads/using-tags-assigning-enemy-levels.19880/