Using Tags - Assigning Enemy Levels?

lord_steak

Veteran
Veteran
Joined
Nov 4, 2013
Messages
72
Reaction score
20
First Language
English
Primarily Uses
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?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,323
Reaction score
11,927
First Language
English
Primarily Uses
RMMV
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,036
Reaction score
6,693
First Language
German
Primarily Uses
RMMV
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...
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,323
Reaction score
11,927
First Language
English
Primarily Uses
RMMV
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.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,072
First Language
English
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/
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

The three if us sat to watch "The day India Burned" to take notes. 10 minutes in, one went to sleep. I wanted to finish it but I couldn't stop tearing up (yawning makes me cry) so after 40 minutes I gave up. But now I'm not sleepy anymore :0
OH... OKAY... Well, VX Ace certainly never did THAT before. :mad:
Been busy with non-RM stuff, can't wait to get back into making a game.
i'm not only drawing girls tbh
i like grubby old man
Kes wrote on Chef's profile.
I have deleted your profile post as our Rules are quite clear that you may not use them to advertise non-RM products, nor may you give a link to anything that solicits payment for you.

Forum statistics

Threads
93,609
Messages
913,902
Members
123,165
Latest member
peter16321
Top