lord_steak

Veteran
Veteran
Joined
Nov 4, 2013
Messages
72
Reaction score
21
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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,566
Reaction score
16,455
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
38,027
Reaction score
10,573
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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,566
Reaction score
16,455
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,921
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/
 

Latest Threads

Latest Posts

Latest Profile Posts

Shoot.gif
Because The Fury from Metal Gear Solid 3 is one of my favorite bosses of all time, I felt the need to make a somewhat similar boss for my own game. taking cues from both the Fury and another awesome astronaut boss, Captain Vladimir from No More Heroes 2.
RE4make almost had me with their demo until I got to the dog stuck in a bear trap and realized that he was dead and could no longer be saved. Just not the kind of reimagining I'm interested in.
Here's some dudes that I'm drawing for Jimmy's Quest!
autredo.png
Autism Acceptance Month 2023!


Did this randomly in my free time, I guess today is a good day to show it.

Forum statistics

Threads
130,023
Messages
1,207,102
Members
171,288
Latest member
oscerr
Top