No pop-ups when party heals via skill

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,725
Reaction score
923
First Language
Dutch
Primarily Uses
N/A
I have a skill that attacks all enemies and heals all allies based on the damage healed. While the skill works, the pop-ups for the healing do not: they only show on the character that used the skill, but not on the rest of the party, leading my players to think that the skill didn't work.
Is this something that can be fixed with one of Yanfly's scripts?

The skill is written like so:


Code:

c=a.atk*1.6-b.def;d=$game_party.alive_members;d.each{|f|f.hp+=(c*2.7).to_i};c

and no note tag, aside from battle symphony tags.
Is there any way to show pop-ups forit? Doesn't matter if I need to apply a notetag or a seperate script, as long as it works.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,373
Reaction score
1,549
First Language
English
Primarily Uses
RMMV
Maybe try f.change_hp((c*2.7).to_i, false)?
 

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,725
Reaction score
923
First Language
Dutch
Primarily Uses
N/A
That gave me an error:

 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,373
Reaction score
1,549
First Language
English
Primarily Uses
RMMV
Can you paste your formula as it is now with that change in it?
 

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,725
Reaction score
923
First Language
Dutch
Primarily Uses
N/A
c=a.atk*1.6-b.def;d=$game_party.alive_members;d.each{|f|f.change_hp((c*2.7).to_i, false)
I also tried
c=a.atk*1.6-b.def;d=$game_party.alive_members;d.each{|f|f.change_hp((c*2.7).to_i, false);c
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,373
Reaction score
1,549
First Language
English
Primarily Uses
RMMV
You've missed the } on the end.

c=a.atk*1.6-b.def;d=$game_party.alive_members;d.each{|f|f.change_hp((c*2.7).to_i, false)};c
 

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,725
Reaction score
923
First Language
Dutch
Primarily Uses
N/A
Sadly still only the pop-up for the user shows up.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,373
Reaction score
1,549
First Language
English
Primarily Uses
RMMV
Hmm, can you do a search in your script editor for "damage_popup"?
 

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,725
Reaction score
923
First Language
Dutch
Primarily Uses
N/A
I have YEA Battle engine that handles this stuff.



Code:
  def make_damage_popups(user)
    if @result.hp_drain != 0
      text = YEA::BATTLE::POPUP_SETTINGS[:drained]
      rules = "DRAIN"
      user.create_popup(text, rules)
      setting = :hp_dmg  if @result.hp_drain < 0
      setting = :hp_heal if @result.hp_drain > 0
      rules = "HP_DMG"   if @result.hp_drain < 0
      rules = "HP_HEAL"  if @result.hp_drain > 0
      value = @result.hp_drain.abs
      text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
      user.create_popup(text, rules)
    end
    if @result.mp_drain != 0
      text = YEA::BATTLE::POPUP_SETTINGS[:drained]
      rules = "DRAIN"
      user.create_popup(text, rules)
      setting = :mp_dmg  if @result.mp_drain < 0
      setting = :mp_heal if @result.mp_drain > 0
      rules = "HP_DMG"   if @result.mp_drain < 0
      rules = "HP_HEAL"  if @result.mp_drain > 0
      value = @result.mp_drain.abs
      text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
      user.create_popup(text, rules)
    end
    #---
    flags = []
    flags.push("critical") if @result.critical
    if @result.hp_damage != 0
      setting = :hp_dmg  if @result.hp_damage > 0
      setting = :hp_heal if @result.hp_damage < 0
      rules = "HP_DMG"   if @result.hp_damage > 0
      rules = "HP_HEAL"  if @result.hp_damage < 0
      value = @result.hp_damage.abs
      text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
      create_popup(text, rules, flags)
    end
    if @result.mp_damage != 0
      setting = :mp_dmg  if @result.mp_damage > 0
      setting = :mp_heal if @result.mp_damage < 0
      rules = "MP_DMG"   if @result.mp_damage > 0
      rules = "MP_HEAL"  if @result.mp_damage < 0
      value = @result.mp_damage.abs
      text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
      create_popup(text, rules, flags)
    end
    if @result.tp_damage != 0
      setting = :tp_dmg  if @result.tp_damage > 0
      setting = :tp_heal if @result.tp_damage < 0
      rules = "TP_DMG"   if @result.tp_damage > 0
      rules = "TP_HEAL"  if @result.tp_damage < 0
      value = @result.tp_damage.abs
      text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
      create_popup(text, rules)
    end
    @result.store_damage
    @result.clear_damage_values
  end
it gets referenced a few more times:

 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,373
Reaction score
1,549
First Language
English
Primarily Uses
RMMV
If you call make_damage_popups(f); does that work?
 

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,725
Reaction score
923
First Language
Dutch
Primarily Uses
N/A
I have to add that to the formula? There's no space.
I don't know how to write it in a script call so there's more space.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,373
Reaction score
1,549
First Language
English
Primarily Uses
RMMV
There's a way to add methods to the system scripts so you can call them in a damage formula so you can have formulae that are longer than the box allows for; I'll tell you how to do this in a bit.
 

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,725
Reaction score
923
First Language
Dutch
Primarily Uses
N/A
Alright thanks :)
 

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,725
Reaction score
923
First Language
Dutch
Primarily Uses
N/A
I tried to give it a shot:

Code:
class Game_Battler < Game_BattlerBase

 
  def leeching_shot(a,b)
c=a.atk*1.6-b.def;d=$game_party.alive_members;d.each{|f|f.change_hp((c*2.7).to_i, false)};c
end

end

But it doesn't work :( no damage at all. And since it also has a c, I don't know how to code it.

Adding make_damage_popups(f) makes it error.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,402
Reaction score
499
First Language
English
Primarily Uses
RMVXA
Your formula there would be
a.leeching_shot(a,b)

then the code should be
Ruby:
class Game_Battler < Game_BattlerBase
  def leeching_shot(a,b)
    c=a.atk*1.6-b.def;d=$game_party.alive_members;d.each{|f|
    f.change_hp((c*2.7).to_i, false)
    make_damage_popups(f) }
    return c
  end
end
 
Last edited:

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,725
Reaction score
923
First Language
Dutch
Primarily Uses
N/A
Still doesn't work. Deals no damage at all.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,402
Reaction score
499
First Language
English
Primarily Uses
RMVXA
I spelled leeching wrong. Did you copy my formula? Screen shot of the skill?
 

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,725
Reaction score
923
First Language
Dutch
Primarily Uses
N/A

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,402
Reaction score
499
First Language
English
Primarily Uses
RMVXA
The part I still get confused on is wether or not I need to put the a. in the formula.
You have leeching_shot(a,b)
could you try a.leeching_shot(a,b)
I think that's needed as you have to specify who is using the skill. the code is game_battler and it doesn't know if it is actor or enemy.
 

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,725
Reaction score
923
First Language
Dutch
Primarily Uses
N/A
Well, it works, but..

the popup says it heals 47, but in reality, heals for 47x3.
And still only a pop-up for the character that uses it, not the party.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I spoke with hudell and many programmer about the Window_BattleLog class and we all just agreed to pretend this class just doesn't exists lol
I haven't been able to solidify a cohesive plot so dropped out of a game jam but, on a fun note, I pre-ordered MZ today! :LZSwink:
So I just spent the weekend...playing my own game. The one I released last year. Yep you heard that right.
Goal for MZ? None... I'm still curious how to finish my VXA project and how it looks like when it actually finished. Which will take at least another two years. Coming late again to the party.

Forum statistics

Threads
100,657
Messages
978,134
Members
132,268
Latest member
janetjoradan
Top