is there a possible script where that skills costs HP in percentages?
a script that where skill costs HP percentage costs
RGSS Script RequestsYanfly's Skill Cost Manager allows you to use HP as a skill cost, either as a percentage or as a straight number. Use the GitHub link on this web page to get it, the other link doesn't work.
But @Kes, this is RMXP request
A quick google search led me to https://rpgmaker.net/scripts/186/code/
@KK20 yeah, i know about the HP Sacrifice script but i don't know HOW it works nor how to USE IT exactly...
Oops!! Sorry, didn't notice that this was XP.
@TheoAllen Thanks for the heads up.
@TheoAllen Thanks for the heads up.
The instructions are in the script with examples.
Shown in the script are examples for skill 28 & 30. So when those skills are used those effects are processed. KK20 will know if that is correct.
OK i think i get how this script works, thanks!
bump.
how do i make the HP Sacrifice Script take HP on only the allies and not the enemies
how do i make the HP Sacrifice Script take HP on only the allies and not the enemies
In the methods make_skill_action_result and make_item_action_result, you just have to add a single line:
immediately after the aliased method is called.
e.g.
Code:
return if @active_battler.is_a?(Game_Enemy)
e.g.
Code:
alias make_skill_action_result_hp_sacrifice make_skill_action_result
def make_skill_action_result
make_skill_action_result_hp_sacrifice
return if @active_battler.is_a?(Game_Enemy) # <== add this line here
# redacting rest of code for brevity ...
looks like it worked. thanks.
awoooooga bump!
i have modified the Window_Skill script
and have made this!
pretty great, isn't it?
although i don't know how to make the skills that tell you the HP cost
here is an example of this:
this has to be connected with the HP Sacrifice Script
if anyone has any idea on how to do that, let me know.
i have modified the Window_Skill script
Ruby:
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.font.name = "Times New Roman"
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
if @actor.skill_can_use?(skill.id)
self.contents.font.color = sp_color
else
self.contents.font.color = disabledmagic_color
end
self.contents.font.name = "TF2 Build"
self.contents.draw_text(x + 204, y, 48, 32, skill.sp_cost.to_s, 2)
self.contents.draw_text(x + 232, y, 48, 32, "SP", 2)
end
and have made this!
pretty great, isn't it?
although i don't know how to make the skills that tell you the HP cost
here is an example of this:
this has to be connected with the HP Sacrifice Script
if anyone has any idea on how to do that, let me know.
The answer would be using the following code:
Later you can print it the same way you did with SP cost.
Edited!
Code:
hp_cost = HP_Sacrifice_Action['Skill'][skill.id][2]
Edited!
where am i supposed to insert that code?
Consider it already done, Mario.
Code:
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.font.name = "Times New Roman"
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
if @actor.skill_can_use?(skill.id)
self.contents.font.color = sp_color
else
self.contents.font.color = disabledmagic_color
end
self.contents.font.name = "TF2 Build"
hp_cost_data = HP_Sacrifice_Action['Skill'][skill.id]
if hp_cost_data
text = hp_cost_data[2].to_s
type_label = "HP"
else
text = skill.sp_cost.to_s
type_label = "SP"
end
self.contents.draw_text(x + 204, y, 48, 32, text, 2)
self.contents.draw_text(x + 232, y, 48, 32, type_label, 2)
end
ummmmmmmm
Right, I forgot to add its module name LockeZ...
Use this version instead.
Use this version instead.
Code:
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.font.name = "Times New Roman"
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
if @actor.skill_can_use?(skill.id)
self.contents.font.color = sp_color
else
self.contents.font.color = disabledmagic_color
end
self.contents.font.name = "TF2 Build"
hp_cost_data = LockeZ::HP_Sacrifice_Action['Skill'][skill.id]
if hp_cost_data
text = hp_cost_data[2].to_s
type_label = "HP"
else
text = skill.sp_cost.to_s
type_label = "SP"
end
self.contents.draw_text(x + 204, y, 48, 32, text, 2)
self.contents.draw_text(x + 232, y, 48, 32, type_label, 2)
end
ok, getting close.
it says "7 HP" as in 7% of the user HP
there is a difference of percentage cost and set cost
and HP cost are just like that in Persona.
it says "7 HP" as in 7% of the user HP
there is a difference of percentage cost and set cost
and HP cost are just like that in Persona.
Where it says...
...it should be:
But that'll show you 7% of MAXHP. If you need the hero's current HP, then use hp instead of maxhp there.
Code:
if hp_cost_data
text = hp_cost_data[2].to_s
...it should be:
Code:
if hp_cost_data
percent = (hp_cost_data[2] * @actor.maxhp / 100).round
text = percent.to_s
Original thread: https://forums.rpgmakerweb.com/threads/a-script-that-where-skill-costs-hp-percentage-costs.121800/