Hey, folks. So I recently upgraded from RM2k to RMXP; I think I'm familiar with most of the basic Rpgmaker functions, but my scripting ability is severely lacking.
I'd like to change the scale - as well as the calculations - that're done to determine damage, evasion, etc, in the battle system, and in doing so change many basic assumptions. First:
--- Add 1/2 of Strength to attack power.
--- Add 1/2 of Dexterity to physical defense.
--- Add 1/2 of Intelligence to magical defense.
These seemed simple enough, so I tried tackling them on my own before asking for help. I just went into Game_Actor and added dex*0.5 to the end of the return for "Basic Physical Defense", and did the same for Int & magical defense. Things've gone splendidly, but when I did the same for attack, I got an error concerning the lack of a + method. So I fooled around with it drawing from my infinitesimal programming experience and made it into:
#--------------------------------------------------------------------------
# * Get Basic Attack Power
#--------------------------------------------------------------------------
def base_atk
weapon = $data_weapons[@weapon_id]
n = weapon != nil ? weapon.atk: 0
n2 = str*0.5
return n + n2
end
While this appears to work, I can only wonder if this "jury rig" coding might cause problems? I don't trust it. At all.
Next, the calculations. I'd like to make it so that:
--- One point of attack means one damage. One point of defense means one less damage. With variance and multipliers for elements, etc, but that basically being it. Damage can never be negative unless the base power is negative. If a skill is supposed to add 100% Intelligence to damage or a base number - such as 50 power - it only adds that much. (Some of these almost appear to be the case already, but I wanted to make sure...).
--- Base evasion chance = 20%, plus or minus one for every difference between attacker's Dexterity and defender's Agility. (So 60 Dex vs 50 Agility = 10% miss chance, and vice versa = 30% miss chance)
--- I read somewhere that a character will just about always act before another with 30 less agility than them; is this true?
Changing these seems like only a matter of mixing numbers around in the scripts, but looking at Game_Battler3 and trying to figure it out, all I managed to do was remove "attacker.str" from the basic damage calculation (so that when Strength *does* effect attack power, it won't effect damage -again-... right?) and make:
# Calculate basic damage
atk = [attacker.atk - self.pdef].max
self.damage = atk
My questions, then:
--- How would I go about making the above changes happen?
--- Have the things I've already done been horrible, horrible mistakes? Will complications arise (aside from having to carefully balance the attack/damage of everything in lieu of the new scale)? Will enemies be effected the same as actors? Am I silly for thinking this can work without a massive script addition? Will the code (and subsequently, my game) crash and burn in a brightly colored nova of apocalyptic destruction?
Thanks,
- Kriss
I'd like to change the scale - as well as the calculations - that're done to determine damage, evasion, etc, in the battle system, and in doing so change many basic assumptions. First:
--- Add 1/2 of Strength to attack power.
--- Add 1/2 of Dexterity to physical defense.
--- Add 1/2 of Intelligence to magical defense.
These seemed simple enough, so I tried tackling them on my own before asking for help. I just went into Game_Actor and added dex*0.5 to the end of the return for "Basic Physical Defense", and did the same for Int & magical defense. Things've gone splendidly, but when I did the same for attack, I got an error concerning the lack of a + method. So I fooled around with it drawing from my infinitesimal programming experience and made it into:
#--------------------------------------------------------------------------
# * Get Basic Attack Power
#--------------------------------------------------------------------------
def base_atk
weapon = $data_weapons[@weapon_id]
n = weapon != nil ? weapon.atk: 0
n2 = str*0.5
return n + n2
end
While this appears to work, I can only wonder if this "jury rig" coding might cause problems? I don't trust it. At all.
Next, the calculations. I'd like to make it so that:
--- One point of attack means one damage. One point of defense means one less damage. With variance and multipliers for elements, etc, but that basically being it. Damage can never be negative unless the base power is negative. If a skill is supposed to add 100% Intelligence to damage or a base number - such as 50 power - it only adds that much. (Some of these almost appear to be the case already, but I wanted to make sure...).
--- Base evasion chance = 20%, plus or minus one for every difference between attacker's Dexterity and defender's Agility. (So 60 Dex vs 50 Agility = 10% miss chance, and vice versa = 30% miss chance)
--- I read somewhere that a character will just about always act before another with 30 less agility than them; is this true?
Changing these seems like only a matter of mixing numbers around in the scripts, but looking at Game_Battler3 and trying to figure it out, all I managed to do was remove "attacker.str" from the basic damage calculation (so that when Strength *does* effect attack power, it won't effect damage -again-... right?) and make:
# Calculate basic damage
atk = [attacker.atk - self.pdef].max
self.damage = atk
My questions, then:
--- How would I go about making the above changes happen?
--- Have the things I've already done been horrible, horrible mistakes? Will complications arise (aside from having to carefully balance the attack/damage of everything in lieu of the new scale)? Will enemies be effected the same as actors? Am I silly for thinking this can work without a massive script addition? Will the code (and subsequently, my game) crash and burn in a brightly colored nova of apocalyptic destruction?
Thanks,
- Kriss