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
39,969
Reaction score
13,603
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
30,953
Reaction score
7,465
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
39,969
Reaction score
13,603
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,564
Reaction score
3,839
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

We are truly intellectuals.
Without using violence without weapons
Our group has as many as 1.3 million people and more than 1 hundred thousand talks.
We gathered in an hour, more than 4.5 Half a hundred thousand



I got a Sword.
I got an Axe.
I got two Swords.
Nothing to see here, just walking with my dog.
I haven’t worked on my game in a while. Tomorrow might be the day.
*squeals* :kaoblush:


I've been experimenting with improved memory management again, which allowed me to include items to increase player path length. These are both 44 grid spaces long, and stable. :LZSexcite:
I FINALLY DID IT! 5 years making my very first game and I just officially released it on STEAM..... OMG..... I can say I finished a game! The feelings!!!!!

Forum statistics

Threads
104,463
Messages
1,006,474
Members
135,971
Latest member
Akasheee
Top