RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
heal upon lvl up [RESOLVED]

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 85
i dont know whether to put this in troubleshooting or script request but instead of using a script to auto heal your char when he lvls up i heard you can change something in game_actor. im terrible with scripting so can someone tell me what to change in game_actor to auto heal your character when he lvls up?
« Last Edit: August 25, 2009, 09:17:59 AM by ryuzaki95 »

*
A Random Custom Title
Rep:
Level 96
wah
http://rmrk.net/index.php/board,108.0.html

I suppose looking at the description that says "Discussion on Scripts for the RPG Maker XP" doesn't mean anything to you either.

http://rmrk.net/index.php/topic,18051.0.html

This sticky doesn't mean anything, either, I suppose.

Also, I'll see if I can help, but next time, post in the right place.

EDIT: Eh. I'm too lazy to do this. I probably could do this but only with quite a bit of work and searching for syntax because I'm not very good with scripting.
« Last Edit: August 25, 2009, 02:55:18 AM by mastermoo420 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
How modifying Game_Actor is "instead of using a script" I can't figure out, but all you need to change is the exp= method of Game_Actor.

Around line 454 you'll see:

Code: [Select]
  #--------------------------------------------------------------------------
  # * Change EXP
  #     exp : new EXP
  #--------------------------------------------------------------------------
  def exp=(exp)
    @exp = [[exp, 9999999].min, 0].max
    # Level up
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      # Learn skill
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    # Level down
    while @exp < @exp_list[@level]
      @level -= 1
    end
    # Correction if exceeding current max HP and max SP
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end


Where you have:

Code: [Select]
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1

add recover_all, so:

Code: [Select]
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      recover_all

I think that will work.

**
Rep: +0/-0Level 85
it works thank you so much for your help :)