How do I add a specific amount of bonus damage depending on element?

shiny_mudkip7

Villager
Member
Joined
Aug 8, 2016
Messages
8
Reaction score
0
First Language
English
Primarily Uses
Update:  I initially wasn't sure if I should post this on script requests, but based on the dearth of replies on my thread it seems like it should probably go here.  My game is going well so far, but if I can't figure this out, I have to scrap the whole project!  The game mechanics and plot are anchored to this one function!  Can someone please help?!  It would be greatly appreciated.  All I need to do is add ONE bonus damage to attacks if the attacked enemy/class is weak element. 


Essentially, I need to find some way to add an exact amount of bonus damage when a condition is met, and a way to tag that condition in the enemies.  More details below:


Hello,


I had an idea to create a battle system that's kind of a combination of Paper Mario (1 or 2) and standard RPG formats with type effectiveness and such.  I will not bother you with the convoluted details, but essentially I used a motley combination scripts to achieve the battle system I wanted.  This system deals with small, definite numbers and NOT PERCENTAGES; for example if executed properly, Spell of Flames does 2 damage every time.  To accomplish this, I simply typed "2" into the formula box, which worked nicely.


However, I wanted to add a bonus damage effect of +1 to attacks that have a type advantage against their opponents, or -1 for resistance.  For example, Spell of Flames would do 3 damage against an opponent of the "Earth" element, and 1 damage to an opponent of the "Water" element.  RPG Maker VX Ace allows for percentage damage modifiers against opponents, but nothing for definable, exact numbers.  Because it has no way to tag certain enemies with specific elements, I downloaded Hime's "Task Manager" (although I'd rather try to find a workaround for this, since I can't use it for commercial games).  This allowed me to tag enemies with: <Tag_Cond: Element> (where Element is the element of the monster- water, air, etc.).  I then went into the damage formula and quickly googled an article to learn the mechanics of the damage formula box.  Thinking I had apparently learned sufficient scripting in 30 minutes, I then typed in:


if b.has_tag?(Earth); 3; else; 2; end


I planned to expand to cover resistance later. (something akin to if b.has_tag?(Earth); 3; else; if b.has_tag?(Water); 1; else; 2; end)


(has_tag is specified in Hime's script as the keyword when used in formulas)


Hypothetically, it should have done one more damage when the affected type was tagged with the Earth tag.  But to my dismay, while the "else" statement seemed to be working effectively, when the enemy DID have the specified tag, it merely said "Null," doing NO damage. 


It is also worth noting that I have already set variance to 0 and critical to No.


Could someone please help me figure this out?  I have been trying in vain for days to crack this but no matter how many scripts I look at or how much "Coding" I try, I can not figure it out.  It's so ironic that it seems so simple but I can NOT figure it out >.<


If you gave me a simple solution to this, you would be my FAVORITE PERSON.


Thanks so much!!!


Link to Hime's script explanation: http://himeworks.com/2013/03/tag-manager/


Link to Hime's tag script: http://himeworks.com/redirect.php?type=script&name=Tag_Manager


I see no reason why there should be compatibility issues with such a simple script, but just in case, my scripts are (warning, there are a lot):


Yanfly Battle


Yanfly Visual Battlers


Berk Hand Seals


V. M. of D.T.'s Basic Enemy HP Bars Lite v 1.1c


Galv Timed Button Attacks


Yanfly Element Absorb


Hime Tag Manager (Would rather not use if possible)


THANKS AGAIN IN ADVANCE!!!
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
Apparently tags are stored as an array of lowercase strings.


Casing and quotation probably doesn't matter when using note tag condition checks, but it certainly matters when calling the methods.


b.has_tag?('earth')


or


b.tags.include?('earth')


Either should work fine.
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,539
Members
137,834
Latest member
EverNoir
Top