Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: PhoenixFire on March 27, 2014, 08:22:19 am

Title: Blizz's Heal on level up
Post by: PhoenixFire on March 27, 2014, 08:22:19 am
   Alright, so here I am, using the script blizz made, for heal on level up, in the Tons of Addons collection. Playing through, I noticed that they're not healing on level up, which kind of defeats the purpose of setting it to true =/ so in my tinkering, I somehow came up with the conclusion of, why not just hardcode it right into the class Window_BattleStatus since that's where it goes. I cannot for the life of me, figure out how to get that to work though. I tried it in different, logical, spots, but it produces a syntax error each time, on the last line in the script, which is always an 'end' command. Thoughts, comments, ridicule? Help?

For those that need it, the code is right here:

Spoiler: ShowHide


#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Heal at LvlUp by Blizzard
# Version: 1.0b
# Type: Game Alteration
# Date: 4.12.2006
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Compatibility:
#
#   90% compatible with SDK v1.x. 40% compatible with SDK v2.x. Might not work
#   with exotic CBS-es or exotic Status displays during battle.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#==============================================================================
# Window_BattleStatus
#==============================================================================

class Window_BattleStatus
 
  alias refesh_heal_at_lvlup_later refresh
  def refresh(number = nil)
    if $game_system.HEAL_AT_LVLUP
      $game_party.actors.each_index {|i|
          if @level_up_flags[i]
            $game_party.actors[i].hp = $game_party.actors[i].maxhp
            $game_party.actors[i].sp = $game_party.actors[i].maxsp
          end}
    end
    if number == nil
      refesh_heal_at_lvlup_later
    else
      refesh_heal_at_lvlup_later(number)
    end
  end
end

Title: Re: Blizz's Heal on level up
Post by: G_G on March 27, 2014, 08:27:41 am
In ToA, you actually did turn it on right? You enabled it? If so, do you have any other script under ToA that could be conflicting with Window_BattleStatus, such as a custom battle system?
Title: Re: Blizz's Heal on level up
Post by: PhoenixFire on March 27, 2014, 08:35:42 pm
lolz, yes, I did. It's on. I actually checked that first to make sure haha.. And no, it's the last set of scripts that I have, right above main. Could it be affected by scripts above it? Because if yes, than yes, I have scripts that might mess with it.. I should check to be sure about that though.
Title: Re: Blizz's Heal on level up
Post by: Blizzard on March 28, 2014, 01:41:38 am
Are you using some sort of custom battle result status window? This one could be messing with it. Try putting it above Tons of Add-ons if you haven't already.
Title: Re: Blizz's Heal on level up
Post by: PhoenixFire on March 28, 2014, 09:11:58 am
Quote from: PhoenixFire on March 27, 2014, 08:35:42 pm
...it's the last set of scripts that I have, right above main...


yeah, I thought about that. ToA is right above main, with nothing else under it. I do have the custom battle results active though, so I was wondering, is it possible that it is somehow affecting the heal on level up? I didn't think it would since all other ToA scripts are working the way they're supposed to..
Title: Re: Blizz's Heal on level up
Post by: G_G on March 28, 2014, 10:24:58 am
It's possible that your battle result script isn't setting the level up flags properly. That's how Blizz's heal on level up works.
Title: Re: Blizz's Heal on level up
Post by: KK20 on March 28, 2014, 12:32:02 pm
SHIFT + CTRL + F for Window_BattleStatus in any of your scripts before Tons and look for the method 'refresh' in them. Post those up. If there's nothing out of the ordinary, then it's what G_G says.
Title: Re: Blizz's Heal on level up
Post by: PhoenixFire on March 28, 2014, 09:46:15 pm
Quote from: gameus on March 28, 2014, 10:24:58 am
It's possible that your battle result script isn't setting the level up flags properly. That's how Blizz's heal on level up works.


How would I go about doing this? After looking through with KK20's suggestion, I'm pretty sure that's the issue.
Title: Re: Blizz's Heal on level up
Post by: KK20 on March 28, 2014, 11:27:50 pm
How about finding level_up( and see if your script has that in there.
Title: Re: Blizz's Heal on level up
Post by: PhoenixFire on March 29, 2014, 08:29:38 am
only has draw_actor_level_up(actor, x, y)
Title: Re: Blizz's Heal on level up
Post by: G_G on March 29, 2014, 09:03:53 am
It might help if you posted the custom battle results, then we could look at it.
Title: Re: Blizz's Heal on level up
Post by: PhoenixFire on March 29, 2014, 10:24:06 am
Right here: http://forum.chaos-project.com/index.php/topic,14009.0.html
Title: Re: Blizz's Heal on level up
Post by: KK20 on March 29, 2014, 12:34:03 pm
Well that makes sense. AA doesn't even use the variable @level_up_flags. How about changing @level_up_flags to $draw_level_up?
Title: Re: Blizz's Heal on level up
Post by: PhoenixFire on March 29, 2014, 09:50:59 pm
To be honest, I may have done it wrong, because that didn't make a difference, unless I misunderstood you. You meant to change that in the levelup script, right?
Title: Re: Blizz's Heal on level up
Post by: KK20 on March 29, 2014, 10:10:02 pm

   if $game_system.HEAL_AT_LVLUP
     $game_party.actors.each_index {|i|
         if $draw_level_up[i]    #<================================= That
           $game_party.actors[i].hp = $game_party.actors[i].maxhp
           $game_party.actors[i].sp = $game_party.actors[i].maxsp
         end}
   end

I mainly got the idea from AA's Window_BattleResult#refresh

   for i in 0...$game_party.actors.size
     x = 64
     y = i * 110
     actor = $game_party.actors[i]
       if $draw_level_up[i] == true   #<============= Here
         #print($draw_level_up[i].to_s)
         draw_actor_level_up(actor, x, y)

       end