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.
[RESOLVED] 10% sp recovery at the end of battle script

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 87
does anyone have a script that at the end of every battle, a certain percentage of your sp is recovered? Like in Tales of Symphonia, thanks in advance
« Last Edit: May 23, 2007, 04:44:38 AM by Zeriab »

****
Rep:
Level 89
I is my hero!
That sounds very interesting, I would also perhaps like that to happen in my game. I'll try and figure this out.

******
Revolution is not a bed of roses.
Rep:
Level 91
Project of the Month winner for July 2009
Sounds simple, I'll do this tomorrow if no one else beats me to this.

***
Rep:
Level 89
I am yourself!
Code: [Select]
class Auto_Recover

  def main
    for i in 0..3
      max = $game_party.actors[i].maxsp
      now = $game_party.actors[i].sp
      now = now + (max/10)
    end
  end

end

I don't know it works or not ('coz I didn't use RGSS for a long time) but that's the concept. And it's still need an identifier that make sure that this script ONLY works when you won a battle...
Symphony of Alderra : Memoirs of Life

Storyline : 200% (Overimaginatives)
Scripting : 100% (At last...)
Eventing  : 100%
Mapping   : 0.125%

***
Rep:
Level 90
Skilled Scripter, Shitty Mapper, Decent Writer.
Nets, Falcon, sorry! As with all of my scripts, if you have a question on how I did something then just ask and I'll respond. Also, dead actor's will not regain SP at the end of battle.

Code: [Select]
class Scene_Battle
 
  alias shinami_start_phase5 start_phase5
  def start_phase5
    for i in 0...$game_party.actors.size
      unless $game_party.actors[i].dead?
        sp_regain = $game_party.actors[i].maxsp * 0.1
        $game_party.actors[i].sp += sp_regain.to_i
      end#of "unless $game_party.actors[i].dead?"
    end#of "for i in 0...$game_party.actors.size"
    shinami_start_phase5
  end#of aliased "def start_phase5"
end#of class Scene_Battle

***
Rep:
Level 89
I am yourself!
Ok, guess the problem solved.
Thank for helping, Shinami.
Symphony of Alderra : Memoirs of Life

Storyline : 200% (Overimaginatives)
Scripting : 100% (At last...)
Eventing  : 100%
Mapping   : 0.125%

***
Rep:
Level 90
Skilled Scripter, Shitty Mapper, Decent Writer.
Always a pleasure, never a chore.

**
Rep: +0/-0Level 87
thx everybody, the script works great. thx to all.

*
A Random Custom Title
Rep:
Level 96
wah
Add [Resolved] to the topic title to help others and do it by editing the title of your first post. ;D

@Shinami: How are things going in life? Syntax book? (Sorry to sound a bit self-centered T_T)