Hello everyone, I'm new to the community, just picked up VX Ace during the recent Steam sale.
Let me start by explaining what I'm trying to do. I assume once I get this figured out, I can generalize that knowledge to more advanced notetagging.
So, anyone who's played Final Fantasy VI knows that leveling up doesn't increase a character's attributes, rather, a character's level seems to figure directly into various calculations, like damage. Now, I can actually already plug in a battler's level into the damage formula for skills, including the base attack, and it works just fine for heroes, as Actors have a "level" variable. However, this results in monsters doing NULL damage, as Enemies don't have a "level" variable. I imagine all I really need to do is add a class variable @level to Game_Enemy, and notetags seem like the ideal way to assign a value to that variable.
I understand notetags on a conceptual level: they add metadata to objects that can be read and interpretted by scripts. What I'm having trouble with is how to go about applying this. I did a bit of searching, and my first few attempts threw an error stating that there was no known method "note". Now it doesn't appear that my script is doing anything at all. I've checked the script for various objects, including Game_BaseItem, and I don't see anything in the code about notes, so I'm somewhat at a loss as to how to get the data I need from the notes.
Here's what my script currently looks like:
class Game_Enemy < Game_Battler attr_accessor :level # Add levels to monsters alias monster_initialize initialize def monster_initialize(index, enemy_id) # Call the original initialize method monster_initialized(index, enemy_id) # Check notetags to get the monster's level if @note =~ /<level:\s*(\d*)>/i @level = $1.to_i else @level = 1 # The default if no notetag is present end p @level # Print level to see if it's working endendThis post helped (in fact, I modified some of the example code here), but I still can't seem to get it working: http://forums.rpgmakerweb.com/index.php?/topic/1686-a-guide-to-notetagging/
Let me start by explaining what I'm trying to do. I assume once I get this figured out, I can generalize that knowledge to more advanced notetagging.
So, anyone who's played Final Fantasy VI knows that leveling up doesn't increase a character's attributes, rather, a character's level seems to figure directly into various calculations, like damage. Now, I can actually already plug in a battler's level into the damage formula for skills, including the base attack, and it works just fine for heroes, as Actors have a "level" variable. However, this results in monsters doing NULL damage, as Enemies don't have a "level" variable. I imagine all I really need to do is add a class variable @level to Game_Enemy, and notetags seem like the ideal way to assign a value to that variable.
I understand notetags on a conceptual level: they add metadata to objects that can be read and interpretted by scripts. What I'm having trouble with is how to go about applying this. I did a bit of searching, and my first few attempts threw an error stating that there was no known method "note". Now it doesn't appear that my script is doing anything at all. I've checked the script for various objects, including Game_BaseItem, and I don't see anything in the code about notes, so I'm somewhat at a loss as to how to get the data I need from the notes.
Here's what my script currently looks like:
class Game_Enemy < Game_Battler attr_accessor :level # Add levels to monsters alias monster_initialize initialize def monster_initialize(index, enemy_id) # Call the original initialize method monster_initialized(index, enemy_id) # Check notetags to get the monster's level if @note =~ /<level:\s*(\d*)>/i @level = $1.to_i else @level = 1 # The default if no notetag is present end p @level # Print level to see if it's working endendThis post helped (in fact, I modified some of the example code here), but I still can't seem to get it working: http://forums.rpgmakerweb.com/index.php?/topic/1686-a-guide-to-notetagging/