The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: blazinhandle on February 02, 2007, 06:06:58 PM

Title: Setting characters' max SP
Post by: blazinhandle on February 02, 2007, 06:06:58 PM
Anybody know how to set the maximum sp a character can reach (I want to set it to 100)?

I think it would be something like this but im not sure
if actor.max_sp >= 100
  set actor.max_sp = 100

i'm looking at where to set this limit (script wise) so that characters cannot curve past 100 sp.

i hope thats not too confusing,
thanks!
Title: Re: Setting characters' max SP
Post by: Snailer on February 02, 2007, 06:13:33 PM
Yes i think that is the right way putting it..
Title: Re: Setting characters' max SP
Post by: blazinhandle on February 02, 2007, 06:15:20 PM
lol, yes but do u know what script to throw it in?
Title: Re: Setting characters' max SP
Post by: Snailer on February 02, 2007, 06:21:44 PM
I'm guessing in game_character 1 or 2 or 3..
Title: Re: Setting characters' max SP
Post by: modern algebra on February 02, 2007, 07:35:55 PM
Why not just set it in the database?
Title: Re: Setting characters' max SP
Post by: Blizzard on February 03, 2007, 03:19:52 PM
Oh, you wanted the limitation IN GENERAL! Lol, I thought you wanted it for the CSGS specifically. Then just use this code:

class Game_Actor

  def maxsp
    n = super
    return (n > 100 ? 100 : n)
  end
 
  def maxsp=(val)
    super(val > 100 ? 100 : val)
  end
 
end


Sorry for the misunderstanding, blazin'. (>.<)
Title: Re: Setting characters' max SP
Post by: blazinhandle on February 03, 2007, 10:16:16 PM
aaaaand blizzard comes in clutch yet again. RESOLVED!

thanks, blizz.

btw who is that baaaaaaanging chick in ur avator?
Title: Re: Setting characters' max SP
Post by: Blizzard on February 04, 2007, 03:14:58 PM
It's a friend of a girl I chat with on ICQ.