RPG Maker VX Ace

RPG Maker VX Ace

View Stats:
LexCondran Dec 27, 2022 @ 3:24am
What is an easy way to set a 9999 damage cap?
-------i found this script in battler----
---------------------------------------

#--------------------------------------------------------------------------
# * Calculate Damage
#--------------------------------------------------------------------------
def make_damage_value(user, item)
value = item.damage.eval(user, self, $game_variables)
value *= item_element_rate(user, item)
value *= pdr if item.physical?
value *= mdr if item.magical?
value *= rec if item.damage.recover?
value = apply_critical(value) if @result.critical
value = apply_variance(value, item.damage.variance)
value = apply_guard(value)
@result.make_damage(value.to_i, item)
end

--------is there any way to just make sure my damage isnt hitting over 9999
kind of kills boss fights when i hit a bost with 14000 hp with a 12000 crit


https://steamcommunity.com/sharedfiles/filedetails/?id=2813904686
Last edited by LexCondran; Dec 27, 2022 @ 4:27am
Originally posted by DawoleQ:
Hey, I think i got the solution, I have not tested it though.

Just add "value = 9999 if value > 9999" like so:
#--------------------------------------------------------------------------
# * Calculate Damage
#--------------------------------------------------------------------------
def make_damage_value(user, item)
value = item.damage.eval(user, self, $game_variables)
value *= item_element_rate(user, item)
value *= pdr if item.physical?
value *= mdr if item.magical?
value *= rec if item.damage.recover?
value = apply_critical(value) if @result.critical
value = apply_variance(value, item.damage.variance)
value = apply_guard(value)
value = 9999 if value > 9999 <------------(add it in this line)
@result.make_damage(value.to_i, item)
end

I think this should work. I hope I helped
< >
Showing 1-6 of 6 comments
LexCondran Dec 27, 2022 @ 3:38am 
could be easy like the stat maximums

#--------------------------------------------------------------------------
# * Get Maximum Value of Parameter EDITED
#--------------------------------------------------------------------------
def param_max(param_id)
return 9999 if param_id == 0 # MHP
return 999 if param_id == 1 # MMP
return 510 if param_id == 2 # ATK
return 255 if param_id == 3 # DEF
return 510 if param_id == 4 # MAG
return 255 if param_id == 5 # MIN
return 510 if param_id == 6 # AGI
return 255 if param_id == 7 # LUK
return super
end

i just dont know where to code in the return 9999
since it probably has no default maximum
LexCondran Dec 27, 2022 @ 3:43am 
yeah no real cap in any form
i tested something and did 1,777,800,902 damage
The author of this thread has indicated that this post answers the original topic.
DawoleQ Dec 27, 2022 @ 4:03am 
Hey, I think i got the solution, I have not tested it though.

Just add "value = 9999 if value > 9999" like so:
#--------------------------------------------------------------------------
# * Calculate Damage
#--------------------------------------------------------------------------
def make_damage_value(user, item)
value = item.damage.eval(user, self, $game_variables)
value *= item_element_rate(user, item)
value *= pdr if item.physical?
value *= mdr if item.magical?
value *= rec if item.damage.recover?
value = apply_critical(value) if @result.critical
value = apply_variance(value, item.damage.variance)
value = apply_guard(value)
value = 9999 if value > 9999 <------------(add it in this line)
@result.make_damage(value.to_i, item)
end

I think this should work. I hope I helped
LexCondran Dec 27, 2022 @ 4:19am 
Originally posted by DawoleQ:
Hey, I think i got the solution, I have not tested it though.

Just add "value = 9999 if value > 9999" like so:
#--------------------------------------------------------------------------
# * Calculate Damage
#--------------------------------------------------------------------------
def make_damage_value(user, item)
value = item.damage.eval(user, self, $game_variables)
value *= item_element_rate(user, item)
value *= pdr if item.physical?
value *= mdr if item.magical?
value *= rec if item.damage.recover?
value = apply_critical(value) if @result.critical
value = apply_variance(value, item.damage.variance)
value = apply_guard(value)
value = 9999 if value > 9999 <------------(add it in this line)
@result.make_damage(value.to_i, item)
end

I think this should work. I hope I helped


Dude thank you, dealing 2 billion damage or something can ruin combat
caps just help to keep things challenging.

:steamthumbsup:
LexCondran Feb 15, 2023 @ 5:26pm 
i need a tank, that explodes.
DawoleQ Feb 17, 2023 @ 2:09am 
Originally posted by LexCondran:
i need a tank, that explodes.


You should post a new question, as this is not related to the original post
< >
Showing 1-6 of 6 comments
Per page: 1530 50