Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: Blizzard on January 09, 2008, 04:18:49 pm

Title: [XP] Stat Distribution System
Post by: Blizzard on January 09, 2008, 04:18:49 pm
Stat Distribution System
Authors: Blizzard
Version: 2.3
Type: Actor Attribute Modifier
Key Term: Actor Add-on

Introduction

This script will allow you to distribute points to character stats instead of increasing the stats the usual way.

This work is licensed under BSD License 2.0:
QuoteCopyright (c) Boris "Blizzard" Mikić
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1.  Redistributions of source code must retain the above copyright notice,
    this list of conditions and the following disclaimer.

2.  Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation
    and/or other materials provided with the distribution.

3.  Neither the name of the copyright holder nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

You may use this script for both non-commercial and commercial products without limitations as long as you fulfill the conditions presented by the above license. The "complete" way to give credit is to include the license somewhere in your product (e.g. in the credits screen), but a "simple" way is also acceptable. The "simple" way to give credit is as follows:
QuoteStat Distribution System licensed under BSD License 2.0, Copyright (c) Boris "Blizzard" Mikić

Alternatively, if your font doesn't support diacritic characters, you may use this variant:
QuoteStat Distribution System licensed under BSD License 2.0, Copyright (c) Boris "Blizzard" Mikic

In general other similar variants are allowed as long as it is clear who the creator is (e.g. "Stat Distribution System created by Blizzard" is acceptable). But if possible, prefer to use one of the two variants listed above.

If you fail to give credit and/or claim that this work was created by you, this may result in legal action and/or payment of damages even though this work is free of charge to use normally.


Features

v1.1b
v1.2b
v1.3b
v1.33b
v2.0
v2.01
v2.1
v2.2
v2.2b
v2.3


Screenshots

(http://img188.imageshack.us/img188/783/snap998.th.png) (http://img188.imageshack.us/img188/783/snap998.png) (http://img14.imageshack.us/img14/4396/snap003f.th.png) (http://img14.imageshack.us/img14/4396/snap003f.png)


Demo

Stat Distribution System (https://downloads.chaos-project.com/scripts/Stat Distribution System.zip)

Script

Just make a new script above main and paste this code into it.
Script Download (https://downloads.chaos-project.com/scripts/Stat Distribution System.txt)

Instructions

Inside the script in the first comment.

Compatibility

99% compatible with SDK v1.x. 80% compatible with SDK 2.x. WILL corrupt your old savegames. Might cause problems with custom leveling up systems. 99% compatibility with everything else.

Credits and Thanks


Author's Notes

If you find any bugs, please report them here:
http://forum.chaos-project.com

That's it! N-Joy! =D
Title: Re: Stat Distribution System
Post by: Galatea on January 10, 2008, 10:16:15 am
OMG! Your a genius! Thx!
Title: Re: Stat Distribution System
Post by: Blizzard on January 10, 2008, 11:52:44 am
Lol, the script's been existing for like 10 months. xD
Title: Re: Stat Distribution System
Post by: Spoofus on January 14, 2008, 02:58:23 pm
lol has it really?  ??? i been using the heck out of it in my game it fits what i need just perfect
Title: Re: Stat Distribution System
Post by: Blizzard on January 14, 2008, 03:31:19 pm
You should try my other scripts, too. There are many useful scripts amongst them.
Title: Re: Stat Distribution System
Post by: Calintz on January 14, 2008, 09:46:03 pm
Does this script automatically up the character's SP and HP, and you just add stats to everything else??
Title: Re: Stat Distribution System
Post by: Nortos on January 14, 2008, 09:56:04 pm
yeah you don't do hp/sp
Title: Re: Stat Distribution System
Post by: Calintz on January 14, 2008, 10:01:14 pm
Then I think I might use this...
It actually gives the user the ability to optimize their own characters as they see fit.
Title: Re: Stat Distribution System
Post by: Blizzard on January 15, 2008, 04:48:59 am
Yeah, it allows a system similar to Diablo 2 or MMOs like RO.
Title: Re: Stat Distribution System
Post by: Nortos on January 15, 2008, 05:47:43 am
goes well with the job system and ABS makes Diablo 2 style :P
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on October 19, 2008, 09:14:38 am
Nobody likes my SDS. ._.
Title: Re: [XP] Stat Distribution System
Post by: legacyblade on October 20, 2008, 12:00:30 am
No, I think just less people are finding bugs with it than previous scripts. I personally use this, and it's the best one in my opinion.
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on October 20, 2008, 05:43:55 am
LOL! Yeah, one of the reasons why I made this was because so many people complained about other buggy scripts. Did you know that the basic system for v1.0 took me a bit more than half an hour and the rest of the script around 2.5 hours? I practically made v1.0 of this script in 3 hours. o.o
Title: Re: [XP] Stat Distribution System
Post by: legacyblade on October 20, 2008, 10:09:59 am
That's a short amount of time, right? XD Yeah, I've used other ones, and in my opinion they suck :P
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on October 20, 2008, 11:25:20 am
It's scarily short. Do you think you could pull off a system like this in 3 hours? :xD:
Title: Re: [XP] Stat Distribution System
Post by: legacyblade on October 20, 2008, 11:31:02 am
I figured it was short. But I thought maybe its a long time for the scripting god, XD
Title: Re: [XP] Stat Distribution System
Post by: Calintz on January 13, 2009, 04:22:22 pm
Again...This is a beautiful script...
*adds to his game*

But like...
What would be the best way to call the scene from the map??
What would be your choice or method??
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on January 14, 2009, 09:33:01 am
I'd make a parallel process common event that checks for button input (i.e. A which is SHIFT) to call it via the script call I described in the instructions. And I think I would definitely turn on the option to call it automatically after a battle when necessary.
Title: Re: [XP] Stat Distribution System
Post by: Calintz on January 14, 2009, 06:37:17 pm
Haha...
I'm a genius!! I'm glad I thought of it =)

Lol, but that's what I was thinking.
I figure I'll make it a common event so I can turn it on at the beginning of the game, and presto!!
Title: Re: [XP] Stat Distribution System
Post by: Zinx10 on January 15, 2009, 06:36:31 pm
Nice script!
Title: Re: [XP] Stat Distribution System
Post by: SowS on February 09, 2009, 09:31:13 pm
Is there a way if I would like to add a new stat then it would be added to the SDS?
Title: Re: [XP] Stat Distribution System
Post by: Calintz on February 09, 2009, 09:32:31 pm
Have you already tried it??
Title: Re: [XP] Stat Distribution System
Post by: Reno-s--Joker on February 10, 2009, 12:15:39 am
Quote from: Blizzard on October 19, 2008, 09:14:38 am
Nobody likes my SDS. ._.

:O.o:

I think I want to try this out. ;) It sounds good, and I always trust your scripts.
Title: Re: [XP] Stat Distribution System
Post by: Calintz on February 10, 2009, 12:16:34 am
I do believe I will be using this for WITW...
Title: Re: [XP] Stat Distribution System
Post by: SowS on February 10, 2009, 03:17:50 am
I'll try to put a Luck system in it.. hope I'll succeed!  :^_^':
Title: Re: [XP] Stat Distribution System
Post by: Calintz on February 10, 2009, 06:41:32 pm
Well, let us know how it turns out...
Title: Re: [XP] Stat Distribution System
Post by: themrmystery on February 12, 2009, 09:47:24 am
Is there anyway to change the graphic it pulls for the character in the distribution window, I use the Animated Battlers, so that image really fills up the screen?
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on February 12, 2009, 10:43:13 am
Remove the line that begins with "draw_actor_battler(...". Use CTRL+F for search.
Title: Re: [XP] Stat Distribution System
Post by: Broxar on February 12, 2009, 02:14:05 pm
Great script! Gonna use this is my game, and also gonna check your RO job/skill system thing and see if i can make a good combo... If i manage to get the other on to work... It looks complicated. :P

Thanks for this. Had planned something like this from the very beginning and didn't even need to look for it. Combine this with your RO system and your ABS and it will be awesome. Only my second day ever with RMXP but already got 4 of your scripts blizzard! If i continue like this i think Blizzard will take up more than half of my credits.. o.o You do not happen to have some kind of message system to? So you can display what people say above their heads kinda?

Brox.
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on February 12, 2009, 03:43:12 pm
No, but ccoa's has a great message system (called UMS) which is compatible with Blizz-ABS.

I'm glad that you like my scripts. :D Combining this with Blizz-ABS and you can almost make a Diablo clone. xD
Title: Re: [XP] Stat Distribution System
Post by: C.C. rOyAl on August 09, 2009, 03:19:50 pm
i cant decide if i should use this or ur other stat system..  :P
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on August 09, 2009, 03:26:37 pm
This one is more like Diablo 2 while the other one is a lot like Final Fantasy 2. It's up to you. This one is definitely more popular while the other one is more for experienced RPG players.
Title: Re: [XP] Stat Distribution System
Post by: C.C. rOyAl on August 10, 2009, 07:38:06 pm
i think to make it more life like im gonna  use ur other one  ;)
Title: Re: [XP] Stat Distribution System
Post by: RoseSkye on August 11, 2009, 12:27:00 pm
Damnit Blizzard how many Gems can you shoot out?
Title: Re: [XP] Stat Distribution System
Post by: Jragyn on August 22, 2009, 01:16:08 pm
Oi, Blizzard...I was hoping to perhaps solve this myself, :shy:
but is there a way to make it so that if yu add points to, say...INT, it raises SP by X points?

ie:

SP += (INT * 4)
HP += (STR * 6)
eva +=(AGI * .2)
crit += (DEX * .1)

All I want to know is how to do SP/HP... the just others are ideas for the other stats...

--JeR
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on August 22, 2009, 01:23:51 pm
You need a script that modifies your stats. It's unrelated to this script.
Title: Re: [XP] Stat Distribution System
Post by: Jragyn on August 22, 2009, 03:08:55 pm
phew, through little bits of modification of another script, I managed to succeed in my methods!

However, is there a way to refresh the screen everytime yu raise or lower a point?
Just so that you can see the boost in hp/sp you -could- get if you dropped the points into the appropriate stat.

Is that even a plausible idea?
:O.o:
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on August 23, 2009, 04:19:51 am
Lol! It can be done simplier. :)

class Game_Battler
 alias base_hp_ex base_hp
 def base_hp
   return base_hp_ex + self.str * 6
 end
 alias base_sp_ex base_sp
 def base_sp
   return base_sp_ex + self.int * 4
 end
 alias base_eva_ex base_eva
 def base_eva
   return base_eva_ex + self.agi / 5
 end
end


Only the critical rate needs to be coded into Game_Battler#attack_effect and Game_Battler#skill_effect methods manually. You would need to change this part:

if rand(100) < 4 * attacker.dex / self.agi


to something like this:

if rand(100) < 44 * attacker.dex / 10 / self.agi


or this (which might be better as it is more precise):

if rand(100) < 4.4 * attacker.dex / self.agi


This here doesn't require any refreshing as the stats are now directly dependent on the other stats.
Title: Re: [XP] Stat Distribution System
Post by: Jragyn on August 24, 2009, 07:04:09 pm
I did just this! Except...I didn't know how exactly to arrange it stand alone, and I needed a cap for stats, so I utilized Game_guy's max modifier script and just =begin-=end everything I didn't need and altered the script accordingly.

Spoiler: ShowHide
# This is a collection of game add ons that alter the max amount of everything
# almost. Here you can easily change the max amount of items owned, or gold
# amount, actor hp, actor sp etc.
=begin

Version History
Version 1.0 1-24-09:
Script Made
Configure HP, SP, Gold, Steps, and Items

Version 1.2 1-25-09:
Strength, Agility, and Dexterity Added
Configure HP, SP, Gold, Steps, Items, Strength, Dexterity, and Agility

THIS SCRIPT HAS MODDED VERSIONS OF WINDOW_ITEM, WINDOW_MENUSTATUS, PARTS OF
WINDOW_BASE, WINDOW_TARGET. DO NOT USE ANY OTHER MODDED VERSIONS OF THESE WINDOS
IF YOU WOULD LIKE THIS TO WORK!

IT ALSO HAS SOME PARTS MODDED FROM THE GAME_PARTY, GAME_ACTOR, AND GAME_BATTLER.
DO NOT USE ANYTHING THAT REPLACES THESE PARTS IN THE SCRIPT!

class Game_Party
  def gain_item(item_id, n)
    if item_id > 0
      @items[item_id] = [[item_number(item_id) + n, 0].max, Config::Max_Items].min
    end
  end
  def gain_gold(n)
    @gold = [[@gold + n, 0].max, Config::Max_Gold].min
  end
  def increase_steps
    @steps = [@steps + 1, Config::Max_Steps].min
  end
end
class Game_Actor
  def maxhp
    n = [[base_maxhp + @maxhp_plus, 1].max, Config::Max_HP].min
    for i in @states
      n *= $data_states[i].maxhp_rate / 100.0
    end
    n = [[Integer(n), 1].max, Config::Max_HP].min
    return n
  end
end
class Game_Battler
  def maxsp
    n = [[base_maxsp + @maxsp_plus, 0].max, Config::Max_SP].min
    for i in @states
      n *= $data_states[i].maxsp_rate / 100.0
    end
    n = [[Integer(n), 0].max, Config::Max_SP].min
    return n
  end
end


YOU CAN HAVE THINGS THAT ALTER GAME_PARTY GAME_ACTOR AND GAME_BATTLER1 JUST NOT
THOSE PARTS IN THE SCRIPT> THIS ONLY APPLIES TO THE ABOVE PARTS LISTED. DO NOT
REPLACE THE MODDED WINDOWS WITH ANYTHING UNLESS YOU WANT THINGS TO LOOK WIERD.

IT ALSO HAS A SMALL MODIFICATION OF SCENE_ITEM IN IT. DO NOT OVERWRITE THIS

@target_window.x = 160

ITS LOCATED IN SCENE_ITEM DEF UPDATE_ITEM BELOW TOWARDS THE END


To add more than 99 items at a time, go to Script and type this in
$game_party.gain_item(x, y)
x = item id
y = amount

To do that with gold do
$game_party.gain_gold(x)
x = amount of gold

Credits
game_guy for modding the default scripts
enterbrain for making the default scripts
fantasist for helping me understand window_item alot better
=end
#CONFIGURATION
module Config
  Max_Items = 100
  Max_Gold = 99999999
  Max_Steps = 999999
  Max_HP = 1000
  Max_SP = 1000
  Max_Strength = 100
  Max_Agility = 100
  Max_Dexterity = 100
  Max_Intelligence = 100
end


# DO NOT MESS WITH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU"RE DOING!

=begin
# THIS IS THE MODDED WINDOW_ITEM
class Window_Item < Window_Selectable
  def initialize
    super(0, 64, 640, 416)
    @column_max = 1
    refresh
    self.index = 0
    if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
  def item
    return @data[self.index]
  end
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items[i])
      end
    end
    unless $game_temp.in_battle
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0
          @data.push($data_weapons[i])
        end
      end
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0
          @data.push($data_armors[i])
        end
      end
    end
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    if item.is_a?(RPG::Item) and
       $game_party.item_can_use?(item.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % @column_max * (288 + 32)
    y = index / @column_max * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 256, y, 100, 32, number.to_s, 2)
  end
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end

# HERE IS THE MODDED TARGET_WINDOW
class Window_Target < Window_Selectable
  def initialize
    super(0, 0, 480, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.z += 10
    @item_max = $game_party.actors.size
    refresh
  end
  def refresh
    self.contents.clear
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 116
      actor = $game_party.actors[i]
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 144, y)
      draw_actor_level(actor, x + 8, y + 32)
      draw_actor_state(actor, x + 8, y + 64)
      draw_actor_hp(actor, x + 152, y + 32)
      draw_actor_sp(actor, x + 152, y + 64)
    end
  end
  def update_cursor_rect
    if @index <= -2
      self.cursor_rect.set(0, (@index + 10) * 116, self.width - 32, 96)
    elsif @index == -1
      self.cursor_rect.set(0, 0, self.width - 32, @item_max * 116 - 20)
    else
      self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
    end
  end
end

# HERE IS THE MODDED WINDOW_MENUSTATUS
class Window_MenuStatus < Window_Selectable
  def initialize
    super(0, 0, 480, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.active = false
    self.index = -1
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 116
      actor = $game_party.actors[i]
      draw_actor_graphic(actor, x - 40, y + 80)
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 144, y)
      draw_actor_level(actor, x, y + 32)
      draw_actor_state(actor, x + 90, y + 32)
      draw_actor_exp(actor, x, y + 64)
      draw_actor_hp(actor, x + 220, y + 32)
      draw_actor_sp(actor, x + 220, y + 64)
    end
  end
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
    end
  end
end
# BELOW THIS IS THE MODDED PARTS OF WINDOW BASE
class Window_Base < Window
  def draw_actor_hp(actor, x, y, width = 144)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
    if width - 32 >= 108
      hp_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      hp_x = x + width - 48
      flag = false
    end
    self.contents.font.color = actor.hp == 0 ? knockout_color :
      actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
    self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(hp_x + 48, y, 15, 32, "/", 1)
      self.contents.draw_text(hp_x + 60, y, 50, 32, actor.maxhp.to_s)
    end
  end
  def draw_actor_sp(actor, x, y, width = 144)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
    if width - 32 >= 108
      sp_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      sp_x = x + width - 48
      flag = false
    end
    self.contents.font.color = actor.sp == 0 ? knockout_color :
      actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
    self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(sp_x + 48, y, 15, 32, "/", 1)
      self.contents.draw_text(sp_x + 60, y, 50, 32, actor.maxsp.to_s)
    end
  end
  def draw_actor_parameter(actor, x, y, type)
    case type
    when 0
      parameter_name = $data_system.words.atk
      parameter_value = actor.atk
    when 1
      parameter_name = $data_system.words.pdef
      parameter_value = actor.pdef
    when 2
      parameter_name = $data_system.words.mdef
      parameter_value = actor.mdef
    when 3
      parameter_name = $data_system.words.str
      parameter_value = actor.str
    when 4
      parameter_name = $data_system.words.dex
      parameter_value = actor.dex
    when 5
      parameter_name = $data_system.words.agi
      parameter_value = actor.agi
    when 6
      parameter_name = $data_system.words.int
      parameter_value = actor.int
    end
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 120, 32, parameter_name)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 120, y, 50, 32, parameter_value.to_s, 2)
  end
end

# BELOW IS THE MODDED VERSION OF WINDOW_ITEM
class Window_Item < Window_Selectable
  def initialize
    super(0, 64, 640, 416)
    @column_max = 1
    refresh
    self.index = 0
    if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
  def item
    return @data[self.index]
  end
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items[i])
      end
    end
    unless $game_temp.in_battle
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0
          @data.push($data_weapons[i])
        end
      end
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0
          @data.push($data_armors[i])
        end
      end
    end
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    if item.is_a?(RPG::Item) and
       $game_party.item_can_use?(item.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % @column_max * (288 + 32)
    y = index / @column_max * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 250, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 255, y, 100, 32, number.to_s, 2)
  end
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end
=end
# BELOW ARE THE MODDED PARTS OF GAME_ACTOR GAME_PARTY AND GAME_BATTLER1
class Game_Party
  def gain_item(item_id, n)
    if item_id > 0
      @items[item_id] = [[item_number(item_id) + n, 0].max, Config::Max_Items].min
    end
  end
  def gain_gold(n)
    @gold = [[@gold + n, 0].max, Config::Max_Gold].min
  end
  def increase_steps
    @steps = [@steps + 1, Config::Max_Steps].min
  end
end
class Game_Actor
  def maxhp
    n = [[base_maxhp + @maxhp_plus + base_str*6 + @str_plus*6, 1].max, Config::Max_HP].min
    for i in @states
      n *= $data_states[i].maxhp_rate / 100.0
    end
    n = [[Integer(n), 1].max, Config::Max_HP].min
    return n
  end
  def base_str
    n = $data_actors[@actor_id].parameters[2, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.str_plus : 0
    n += armor1 != nil ? armor1.str_plus : 0
    n += armor2 != nil ? armor2.str_plus : 0
    n += armor3 != nil ? armor3.str_plus : 0
    n += armor4 != nil ? armor4.str_plus : 0
    return [[n, 1].max, Config::Max_Strength].min
  end
  def base_dex
    n = $data_actors[@actor_id].parameters[3, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.dex_plus : 0
    n += armor1 != nil ? armor1.dex_plus : 0
    n += armor2 != nil ? armor2.dex_plus : 0
    n += armor3 != nil ? armor3.dex_plus : 0
    n += armor4 != nil ? armor4.dex_plus : 0
    return [[n, 1].max, Config::Max_Dexterity].min
  end
  def base_agi
    n = $data_actors[@actor_id].parameters[4, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.agi_plus : 0
    n += armor1 != nil ? armor1.agi_plus : 0
    n += armor2 != nil ? armor2.agi_plus : 0
    n += armor3 != nil ? armor3.agi_plus : 0
    n += armor4 != nil ? armor4.agi_plus : 0
    return [[n, 1].max, Config::Max_Agility].min
  end
  def base_int
    n = $data_actors[@actor_id].parameters[5, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.int_plus : 0
    n += armor1 != nil ? armor1.int_plus : 0
    n += armor2 != nil ? armor2.int_plus : 0
    n += armor3 != nil ? armor3.int_plus : 0
    n += armor4 != nil ? armor4.int_plus : 0
    return [[n, 1].max, Config::Max_Intelligence].min
  end
end
class Game_Battler
  def maxsp
    n = [[base_maxsp + @maxsp_plus + base_int*6 + @int_plus*6, 0].max, Config::Max_SP].min
    for i in @states
      n *= $data_states[i].maxsp_rate / 100.0
    end
    n = [[Integer(n), 0].max, Config::Max_SP].min
    return n
  end
  def str
    n = [[base_str + @str_plus, 1].max, Config::Max_Strength].min
    for i in @states
      n *= $data_states[i].str_rate / 100.0
    end
    n = [[Integer(n), 1].max, Config::Max_Strength].min
    return n
  end
  def dex
    n = [[base_dex + @dex_plus, 1].max, Config::Max_Dexterity].min
    for i in @states
      n *= $data_states[i].dex_rate / 100.0
    end
    n = [[Integer(n), 1].max, Config::Max_Dexterity].min
    return n
  end
  def agi
    n = [[base_agi + @agi_plus, 1].max, Config::Max_Agility].min
    for i in @states
      n *= $data_states[i].agi_rate / 100.0
    end
    n = [[Integer(n), 1].max, Config::Max_Agility].min
    return n
  end
  def int
    n = [[base_int + @int_plus, 1].max, Config::Max_Intelligence].min
    for i in @states
      n *= $data_states[i].int_rate / 100.0
    end
    n = [[Integer(n), 1].max, Config::Max_Intelligence].min
    return n
  end
end

class Scene_Item
  def update_item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(0)
      return
    end
    if Input.trigger?(Input::C)
      @item = @item_window.item
      unless @item.is_a?(RPG::Item)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      unless $game_party.item_can_use?(@item.id)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      if @item.scope >= 3
        @item_window.active = false
        @target_window.x = 160
        @target_window.visible = true
        @target_window.active = true
        if @item.scope == 4 || @item.scope == 6
          @target_window.index = -1
        else
          @target_window.index = 0
        end
      else
        if @item.common_event_id > 0
          $game_temp.common_event_id = @item.common_event_id
          $game_system.se_play(@item.menu_se)
          if @item.consumable
            $game_party.lose_item(@item.id, 1)
            @item_window.draw_item(@item_window.index)
          end
          $scene = Scene_Map.new
          return
        end
      end
      return
    end
  end
end


However, in reference to refreshing, I was specifically talking about while in your status distribution screen...
You know, when you select a stat, and are adding/subtracting points?

I was wondering if there is a way so when you are tinkering with points, to make it so that the HP will reflect while yu alter, so yu can see exactly what you could be getting...err, it already does it after you accept the stats, but is there a way to make it display...like...even a +12hp if yu put 2 points in...so the player wuld know what their getting before hand?

Kind of a nit-picky thing, I'm sure, but...when yu only get 2 or 3 points a level, and 100 is the max STR, every point counts! And its nice to visually know whats gonna happen when yu drop in those points.
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on August 25, 2009, 05:22:57 am
You'd need to edit the windows to display it. :P The stats you see in the windows are not the actual stats but the modified values that will be applied in the end.
Title: Re: [XP] Stat Distribution System
Post by: Jragyn on August 25, 2009, 01:07:57 pm
Oh...
Well, thats helpful to know.
I'll see if I can't do that when I get an extra minute, as its not horrendously vital.

Thanks again, Blizzard, for your constantly extra and useful advice. ^.^
Title: Re: [XP] Stat Distribution System
Post by: 9VoltWiseMan on September 29, 2009, 06:51:34 pm
I would use this, but it doesn't have hp and mp... I have one in my game that has it and I would be more than happy if you modified yours if you have any spare time. :D
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on September 30, 2009, 05:01:30 am
Well, I can definitely add that. Question is when I will have time to do it. :P
Title: Re: [XP] Stat Distribution System
Post by: blademan on October 17, 2009, 05:15:03 pm
Quote from: Blizzard on September 30, 2009, 05:01:30 am
Well, I can definitely add that. Question is when I will have time to do it. :P


Please do. I'm sure lots of people would thank you for it (myself included).  :)
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on October 17, 2009, 05:19:10 pm
I might do it tomorrow (since somebody else requested it as well).

EDIT: There you go.
Title: Re: [XP] Stat Distribution System
Post by: G_G on October 18, 2009, 12:07:31 pm
very nice blizzard, I like the new design and layout, I think it looks better than the old one.
Title: Re: [XP] Stat Distribution System
Post by: Calintz on October 18, 2009, 12:46:14 pm
Fantastic ...
Look great Blizz.
Title: Re: [XP] Stat Distribution System
Post by: 9VoltWiseMan on October 18, 2009, 01:06:18 pm
HUZZAH! Thanks Blizzard! Much better than the old one I used.
Title: Re: [XP] Stat Distribution System
Post by: Calintz on October 18, 2009, 01:19:05 pm
Applying a custom windowskin will really improve the aesthetics of this script.
Title: Re: [XP] Stat Distribution System
Post by: Hellfire Dragon on October 18, 2009, 02:24:38 pm
Really liking the new look Blizzy, nice work :)
Title: Re: [XP] Stat Distribution System
Post by: blademan on October 18, 2009, 04:07:37 pm
Thanks, awesome job as always, and I like the new look.  :D
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on October 18, 2009, 04:31:49 pm
I had to redesign the interface because of the additional HP and SP display so when I was actually done with the script, I decided to change one part of the interface back (at one moment there were 5 commands, the new one being "Apply" to apply changes) and change the look completely to be able to add the DP cost and current values of the stats.
Title: Re: [XP] Stat Distribution System
Post by: JPlatt on June 30, 2010, 10:00:02 pm
I am wondering if there is a way to modify the script so that once a stat reaches a certain point, the cost of the stat increases. An example of what I am saying is from lets say 20 to 30 strength, one more point in that stat costs 3 distribution points. Once it reaches 30, to add one more point in strength would cost 5 distribution points and once it reaches 40 or something it'll cost 9 distribution points, etc.

It would be great to hear how to do it. I'm using BlizzABS as my battle system and each monster awards distribution points instead of experience when killed, so there aren't any true levels. I just want an incentive to kill harder monsters to improve your stats instead of having earlier monsters give the same distribution points and cause an inflation of stats.
Title: Re: [XP] Stat Distribution System
Post by: SBR* on July 01, 2010, 07:05:54 am
Quote from: JPlatt on June 30, 2010, 10:00:02 pm
I am wondering if there is a way to modify the script so that once a stat reaches a certain point, the cost of the stat increases. An example of what I am saying is from lets say 20 to 30 strength, one more point in that stat costs 3 distribution points. Once it reaches 30, to add one more point in strength would cost 5 distribution points and once it reaches 40 or something it'll cost 9 distribution points, etc.

It would be great to hear how to do it. I'm using BlizzABS as my battle system and each monster awards distribution points instead of experience when killed, so there aren't any true levels. I just want an incentive to kill harder monsters to improve your stats instead of having earlier monsters give the same distribution points and cause an inflation of stats.


You kind of necroposted... Well, since you had a question, I don't think it's that bad, but I'm not the one who has to judge this...

It would be easy to do that, we just need to know what you want the formula of DP cost to be? onelvlcost = skilllvl / 10?

Oh, and I just HAVE to say this: I don't know if anyone has noticed, but I love the new name of Arshes :D.
Title: Re: [XP] Stat Distribution System
Post by: G_G on July 01, 2010, 10:40:04 am
Quote from: Rule 33. Contrary to popular belief, gravedigging, or posting in an old topic, is for the most part ok. This means as long as your post is relevant and important enough to post in a topic that has been considered dead, it is ok. Unless of course, the topic you're posting in is several months old, then you would be better off just starting your own topic. This also means posting just to say "Cool" or "I agree" or anything else pointless in nature will result in the deletion of the post and/or locking of the topic.


Its okay to necropost as long as its relavent. A lot of people are getting the wrong idea that its never okay to necropost.
Title: Re: [XP] Stat Distribution System
Post by: SBR* on July 01, 2010, 11:52:53 am
Quote from: SBR* on July 01, 2010, 07:05:54 am
Well, since you had a question, I don't think it's that bad, but I'm not the one who has to judge this...


Maybe I had to say 'I don't think it's bad', but w/e.
Title: Re: [XP] Stat Distribution System
Post by: JPlatt on July 03, 2010, 12:41:36 pm
The formula you posted would actually work quite nicely. It would have to start from a base of 3 though, so onelvlcost = skilllvl / 10 + 3 I guess  :)
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on July 28, 2010, 04:13:16 pm
Update to v2.01.
Title: Re: [XP] Stat Distribution System
Post by: Mimi Chan on July 28, 2010, 04:34:23 pm
Oh nice! An update to one of my fav script *.*

I think the download for demo is corrupted T-T

Does this one has a feature of DP scaling?
I mean the higher your stat, the more DP it will consume (like RO)
ex.
Str 1-10 = only needs 1 DP per point
Str 11-20 = Needs 2 DP per point

So it prevents early maxing out of stats o.oa
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on July 28, 2010, 04:39:36 pm
It has scaling, though, it's not based on ranges but fixed values for each stat.

Looks like the upload broke up. I reuploaded the demo.
Title: Re: [XP] Stat Distribution System
Post by: blademan on July 28, 2010, 04:46:32 pm
Quote from: Blizzard on July 28, 2010, 04:39:36 pm
It has scaling, though, it's not based on ranges but fixed values for each stat.

Looks like the upload broke up. I reuploaded the demo.


Thanks for the fix, Blizzard.

It looks like the v2.01 script is only in the demo though, and not on the Script Download; that's still at v2.0.
Title: Re: [XP] Stat Distribution System
Post by: Mimi Chan on July 28, 2010, 04:52:29 pm
Any plans on adding scaling though o.oa

You get certain amount of DP depending on your level range.
And stat requiring certain DP depending on it's value range o.o

ex.
Level 1-4 = 3 DP
        5-9 = 4 DP

Stat 1-11 = 2 DP
       12-21 = 3 DP

^^;
     
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on July 28, 2010, 05:01:56 pm
Nope.

Quote from: blademan on July 28, 2010, 04:46:32 pm
It looks like the v2.01 script is only in the demo though, and not on the Script Download; that's still at v2.0.


You need to empty the cache in your browser. It is still displaying you the old cached version.
Title: Re: [XP] Stat Distribution System
Post by: blademan on July 28, 2010, 05:30:53 pm
Quote from: Blizzard on July 28, 2010, 05:01:56 pm
Nope.

Quote from: blademan on July 28, 2010, 04:46:32 pm
It looks like the v2.01 script is only in the demo though, and not on the Script Download; that's still at v2.0.


You need to empty the cache in your browser. It is still displaying you the old cached version.


Ah. Well, don't I look stupid.  :^_^':

Thanks again for the update.
Title: Re: [XP] Stat Distribution System
Post by: monkeydash on January 09, 2011, 04:02:17 pm
Im having a slight problem with this. When I had an event try to change the characters DP I got this message and then the game crashed.

NameErroroccurred while running script.

Uninitialized constant Interpreter ::ID
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on January 09, 2011, 04:19:11 pm
And it didn't occur to you that you should replace ID with the numeric ID of the actor as it is described in the instructions?
Title: Re: [XP] Stat Distribution System
Post by: monkeydash on January 09, 2011, 05:09:01 pm
Oh yeah. That was a dumb mistake.
Should stop watching tv while trying to do things.
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on January 09, 2011, 05:11:55 pm
Yeah, definitely. Same goes for doing stuff at 2 AM in the morning. xD
Title: Re: [XP] Stat Distribution System
Post by: Futendra on January 19, 2011, 03:16:15 pm
I'm using this for my online game using RMX-OS and BABS, I want it to be for 1 actor, so no next character/previous character, how do I make it so?
Also how do I make it save the changes? So if you log off, and back in, you still have the DP used,.

EDIT: Srry for necropost
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on January 19, 2011, 06:00:47 pm
It's fine because this was a relevant question.
Title: Re: [XP] Stat Distribution System
Post by: ShadowSaber on February 02, 2011, 07:57:07 am
Excuse me, I want to ask how to configure this so the AUTO CALL only affect one actor (just actor with ID 1) :???:
(the SDS won't appear if any of party member leveled up)


edit: problem solved, please pretend that I never ask that question
Title: Re: [XP] Stat Distribution System
Post by: elmangakac on March 02, 2011, 02:45:46 am
Awesome Script!!!

But a question...what name needs the own icon????
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on March 02, 2011, 02:57:48 am
Read the instructions. It's one of the configuration options and it's explained there.
Title: Re: [XP] Stat Distribution System
Post by: OracleGames on March 26, 2011, 08:27:13 pm
Hey Blizz, i have been trying to add your script as a menu option replacing the default status window by changing this line in "Scene_Menu":

Spoiler: ShowHide
(http://img862.imageshack.us/img862/7785/script2.png) (http://img862.imageshack.us/i/script2.png/)


And worked... However when i select a character (when status window is active) it always returns "0" as a value, so the first character will always appear even when i choose something else and i found the line i wanted here:

Spoiler: ShowHide
(http://img220.imageshack.us/img220/6800/script1q.png) (http://img220.imageshack.us/i/script1q.png/)


What variable between the [] can make this work? I get tons of syntax errors and such when i try to experiment with variables i see in the default system like "$game_party.actors" "@actor_index" and stuff like that

Title: Re: [XP] Stat Distribution System
Post by: Blizzard on March 27, 2011, 05:10:02 am
Change it to "Scene_Points.new($scene.class, @status_window.index)".
Then change Scene_Points#initialize to this:

  def initialize(classe = $scene.class, index = 0)
    @scene = classe
    @actor_index = index
  end


And finally where you put the ??????, just put @actor_index.
Title: Re: [XP] Stat Distribution System
Post by: OracleGames on March 27, 2011, 04:08:30 pm
The Scene menu now looks like:

Spoiler: ShowHide
(http://img6.imageshack.us/img6/2102/script1z.png) (http://img6.imageshack.us/i/script1z.png/)


And the Scene_Points looks like:

Spoiler: ShowHide
(http://img716.imageshack.us/img716/7785/script2.png) (http://img716.imageshack.us/i/script2.png/)


But it still takes me to the number 0 position, and when i try to exit back to menu i get this error:

Spoiler: ShowHide
(http://img22.imageshack.us/img22/6645/script3.png) (http://img22.imageshack.us/i/script3.png/)


Is there a way to return the @actor_index value from another script? ie: Menu, or where is it processed? im so lost =O






Title: Re: [XP] Stat Distribution System
Post by: Blizzard on March 28, 2011, 02:30:16 am
I didn't say "Scene_Points.new([$scene.class, @status_window.index])", I said "Scene_Points.new($scene.class, @status_window.index)".
Title: Re: [XP] Stat Distribution System
Post by: PhoenixFire on April 07, 2011, 01:47:07 pm
I shall be using this script, and I'll put credit to you in it... It sounds pretty awesome so far
Title: Re: [XP] Stat Distribution System
Post by: cheos on April 07, 2011, 05:00:41 pm
is there any way 2 turn off the default stat growth and use this to increase the stats instead of a stat boost
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on April 07, 2011, 05:07:54 pm
Spoiler: ShowHide
(http://img7.imageshack.us/img7/3756/snap673.png)
Title: Re: [XP] Stat Distribution System
Post by: Genow on April 09, 2011, 07:05:36 pm
I have a question.



I tried to edit the script so that PDEF would be calculated by DEX (Which would be renamed to VIT on the system thing), and MDEF by INT.

However, it seems this defense is calculated using the base values you get with the stat growth.

So, when I raise "Vit" after a level up, the PDEF raise doesn't count the stats added to VIT, since they're not the base stats.

Is there any way I can fix this?
Title: Re: [XP] Stat Distribution System
Post by: Genow on April 11, 2011, 06:22:42 pm
...Anyone?
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on April 12, 2011, 02:23:15 am
I don't think your script that calculates VIT does not take PDEF properly into account.
Title: Re: [XP] Stat Distribution System
Post by: Twb6543 on June 27, 2011, 11:07:44 am
@JanraeMendoza Try this for the second part:

Spoiler: ShowHide

def update_command
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Switch to map screen
     $scene = Scene_Map.new
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # If command other than save or end game, and party members = 0
     if $game_party.actors.size == 0 and @command_window.index < 4
       # Play buzzer SE
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Branch by command window cursor position
     case @command_window.index
     when 0  # item
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to item screen
       $scene = Scene_Item.new
     when 1  # skill
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 2  # equipment
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 3  # status
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 4  # save
       # If saving is forbidden
       if $game_system.save_disabled
         # Play buzzer SE
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to save screen
       $scene = Scene_Save.new
     when 5  # quest book
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to end game screen
       $scene = Scene_Quest.new
     when 6 #Stat Dist
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to end game screen
       $scene = Scene_Points.new
     end
      return
   end
 end

Title: Re: [XP] Stat Distribution System
Post by: Blizzard on June 27, 2011, 12:57:24 pm
I propose the same fix as TWB.
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on June 27, 2011, 01:25:10 pm
There's a mistake. It should be "when 6 #Stat Dist", not "when 7 #Stat Dist".
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on June 27, 2011, 01:50:37 pm
Judging from your code, you should be able to scroll further down. Basically the command window should display the last command when you have selected the last command and press down once more.
Title: Re: [XP] Stat Distribution System
Post by: Twb6543 on June 27, 2011, 02:21:24 pm
Sorry I missed a return from the snippet see if that makes any difference (shouldn't). // Fixed the snippet posted by me above.
Title: Re: [XP] Stat Distribution System
Post by: Vexus on December 11, 2011, 10:54:54 am
Sorry for the necropost but I need some help on this script.

I'm using this script and it work like a charm but is there a way to remove the cap of stats? I mean I tried testing it too see how builds could be done at level 99 but I can't up the stats higher than 560 it doesn't let me what can I do?

And another question how can I make this script to work only on certain characters not on every actor? (Have some pets like characters in the game that will increase their stats the normal way)

Thanks for the help and sorry again for the necropost.
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on December 16, 2011, 01:50:27 pm
HELL MUST'VE FROZEN OVER BECAUSE I JUST UPDATED THIS SCRIPT!

Seriously, though, Vexus was right about the weird stat cap. It was a bug that used the spent DP to determine how many more points can be added instead of the actual stat value. I have updated the script to v2.1 and I have fixed that problem.
Title: Re: [XP] Stat Distribution System
Post by: Vexus on December 16, 2011, 04:19:18 pm
Sweet thanks :)
Title: Re: [XP] Stat Distribution System
Post by: sirSLR on March 15, 2012, 03:34:58 pm
can i edit something so that 1 dp rises 10 hp or sp instead of 1=1  ?
Title: Re: [XP] Stat Distribution System
Post by: Morganthedragon on July 08, 2012, 03:38:43 pm
That script is great and all, but I want to do a Stat Distribution System only on the main Character only.
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on July 08, 2012, 05:32:58 pm
Then edit the script.
Title: Re: [XP] Stat Distribution System
Post by: Launian on September 27, 2012, 06:24:17 pm
Quote from: sirSLR on March 15, 2012, 03:34:58 pm
can i edit something so that 1 dp rises 10 hp or sp instead of 1=1  ?


Find this part:

def apply_new_attributes
    @actor.maxhp += @spent[0] / BlizzCFG::HP_DP_COST
    @actor.maxsp += @spent[1]  / BlizzCFG::SP_DP_COST
    @actor.str += @spent[2] / BlizzCFG::STR_DP_COST
    @actor.dex += @spent[3] / BlizzCFG::DEX_DP_COST
    @actor.agi += @spent[4] / BlizzCFG::AGI_DP_COST
    @actor.int += @spent[5] / BlizzCFG::INT_DP_COST
    @actor.dp -= @spent.sum
    self.actor = @actor
  end


and then change it for this:

def apply_new_attributes
    @actor.maxhp += (@spent[0] * 10) / BlizzCFG::HP_DP_COST
    @actor.maxsp += (@spent[1] * 10) / BlizzCFG::SP_DP_COST
    @actor.str += @spent[2] / BlizzCFG::STR_DP_COST
    @actor.dex += @spent[3] / BlizzCFG::DEX_DP_COST
    @actor.agi += @spent[4] / BlizzCFG::AGI_DP_COST
    @actor.int += @spent[5] / BlizzCFG::INT_DP_COST
    @actor.dp -= @spent.sum
    self.actor = @actor
  end


Sadly, this doesn't change the behaivor of the stat distribution window, wich means that, if you allocate 1 DP to your HP, it'll show 501 instead of 510 until you click on Accept Changes. I can't find out how to make it so the window reflects the fact that it adds 10 HP instead of 1, but leaving alone the Stats (STR, DEX, etc.).
Title: Re: [XP] Stat Distribution System
Post by: KK20 on September 27, 2012, 07:58:56 pm
Quote from: Launian on September 27, 2012, 06:24:17 pm
Sadly, this doesn't change the behaivor of the stat distribution window, wich means that, if you allocate 1 DP to your HP, it'll show 501 instead of 510 until you click on Accept Changes. I can't find out how to make it so the window reflects the fact that it adds 10 HP instead of 1, but leaving alone the Stats (STR, DEX, etc.).

That would be this line:
self.contents.draw_text(116, y, 64, 32,
        (@current[i] + @spent[i] / BlizzCFG::ExchangeRates[i]).to_s, 2)
Simple use of case i can make it possible.
Title: Re: [XP] Stat Distribution System
Post by: Launian on September 28, 2012, 02:00:03 am
Quote from: KK20 on September 27, 2012, 07:58:56 pm
Quote from: Launian on September 27, 2012, 06:24:17 pm
Sadly, this doesn't change the behaivor of the stat distribution window, wich means that, if you allocate 1 DP to your HP, it'll show 501 instead of 510 until you click on Accept Changes. I can't find out how to make it so the window reflects the fact that it adds 10 HP instead of 1, but leaving alone the Stats (STR, DEX, etc.).

That would be this line:
self.contents.draw_text(116, y, 64, 32,
       (@current[i] + @spent[i] / BlizzCFG::ExchangeRates[i]).to_s, 2)
Simple use of case i can make it possible.


Yeah, I found out that was the line that draws the numbers, but I couldn't figure out how to set up the case i function  :( I tried to make it draw the lines separately (using 6 self.content commands), but it wouldn't work. It'd update all the lines whenever I allocated one point to any skill.

Any advice on how to do it? Just a pointer, mind you. It'd be nice to learn how to do it at last.

Edit:

I tried this, but it didn't work; all the text is drawn on the MaxSP place:

    case
    when @actor.maxhp then
    self.contents.draw_text(116, 32, 64, 32,
    (@actor.maxhp + (@spent[i] * 10) / BlizzCFG::ExchangeRates[i]).to_s, 2)
    when @actor.maxsp then
    self.contents.draw_text(116, 96, 64, 32,
    (@actor.maxsp + (@spent[i] * 10) / BlizzCFG::ExchangeRates[i]).to_s, 2)
    when @actor.str then
    self.contents.draw_text(116, 96, 64, 32,
    (@actor.str + @spent[i] / BlizzCFG::ExchangeRates[i]).to_s, 2)
    when @actor.dex then
    self.contents.draw_text(116, 128, 64, 32,
    (@actor.dex + @spent[i] / BlizzCFG::ExchangeRates[i]).to_s, 2)
    when @actor.agi then
    self.contents.draw_text(116, 160, 64, 32,
    (@actor.agi + @spent[i] / BlizzCFG::ExchangeRates[i]).to_s, 2)
    when @actor.int then
    self.contents.draw_text(116, 192, 64, 32,
    (@actor.int + @spent[i] / BlizzCFG::ExchangeRates[i]).to_s, 2)
    end
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on September 28, 2012, 03:33:27 am
I guess it's better if I edit the script. Then you should be able to simply specify HP_DP_COST as 0.1 and it will raise 10 HP with 1 DP. That would be the cleanest solution, but it won't work well right now as the end result has to be an integer and this kind of calculation (without the edit that I will add) turns it into a decimal number.
Title: Re: [XP] Stat Distribution System
Post by: Launian on September 28, 2012, 03:52:35 am
Yeah, I tried setting up the costs as 0.1, but it did turn the results on decimals, and I'd end up with 999.899999995 of HP, and stuff like that.

Anyways, thank you for the responses, and I'm sorry for being such a nuisance.
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on September 28, 2012, 04:53:54 am
I should be the one apologizing for being a lazy ass. Regardless of the fact that I retired 2 and a half years ago.
Title: Re: [XP] Stat Distribution System
Post by: Launian on September 28, 2012, 01:19:24 pm
Ok then, apology accepted  :haha: No, seriously, thank you. Can't imagine how many questions and requests like this you get per script, and considering just how many you make...
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on September 28, 2012, 02:40:26 pm
People still ask me for advice and scripts. xD

EDIT: I have updated the script and added the feature. You simply assign negative values for X_DP_COST and it will use an inverted exchange rate (e.g. -100 means that 1 DP increases the stat by 100). Why I have gone with this convention instead of using decimal numbers?

Quote from: Script notesThis convention has been added as calculation with decimals (floating point numbers) can cause problems during rounding due to physically limited precision.
Title: Re: [XP] Stat Distribution System
Post by: Launian on September 29, 2012, 12:46:28 pm
Because you don't like decimals? Lol I have no idea. I guess it was easier than scripting it so it wouldn't draw the numbers as 999.899999997 or something, right? Easier to write something like "if string is negative, @spent = @spent * string)" than making a function for rounding up the result, I guess.

And yes, my example is bad, and I should feel bad. Please refrain from pointing out :P

EDIT: It seems to work great! I just found a little bug: say you have a MaxHP of 500, then add 200 HP to it. Then, you hold the R key and click the left arrow (R+key adds/substracts 1000), and you'd end up with -300 MaxHP and 80 DP more than whatever you started with. Same with the L key. And it is possible to lower your MaxHP with this.

Anyways, thank you for the script! =D
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on September 29, 2012, 12:59:54 pm
There is a function for rounding, but if you type 2.000000000000000000000001 and 1.999999999999999999999999 in a programming language, you'll most likely end up with 2.0 in both cases. That also means that 1.499999999999999999999999 could end up as 1.5 which would be incorrectly rounded up to 2 instead of being rounded down to 1. Oh, the joys of floating point numbers. :X

I'll check the negative bug later. I think I know what causes it and how I can quickly fix it.
Title: Re: [XP] Stat Distribution System
Post by: Launian on September 29, 2012, 01:07:37 pm
Soooo... it was easier to do that than to ensure it'd round up properly? xD

And, for now, I deleted this part; not sure if it helps:

 def update
    super
    return unless self.active
    if Input.press?(Input::R)
      if Input.repeat?(Input::RIGHT)
        if add_points(100)
          $game_system.se_play($data_system.cursor_se)
          draw_item(self.index)
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      elsif Input.repeat?(Input::LEFT)
        if remove_points(100)
          $game_system.se_play($data_system.cursor_se)
          draw_item(self.index)
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      end
    elsif Input.press?(Input::L)
      if Input.repeat?(Input::RIGHT)
        if add_points(10)
          $game_system.se_play($data_system.cursor_se)
          draw_item(self.index)
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      elsif Input.repeat?(Input::LEFT)
        if remove_points(10)
          $game_system.se_play($data_system.cursor_se)
          draw_item(self.index)
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      end
    elsif Input.repeat?(Input::RIGHT)
      if add_points(1)
        $game_system.se_play($data_system.cursor_se)
        draw_item(self.index)
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    elsif Input.repeat?(Input::LEFT)
      if remove_points(1)
        $game_system.se_play($data_system.cursor_se)
        draw_item(self.index)
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    end
  end


And left just the add_points(1) parts.
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on September 29, 2012, 01:16:14 pm
This will disable the feature to add 10 or 100 points at once. I'll fix this tomorrow properly.

Technically it's simply not possible to make it round up properly. Trust me, working with floating point numbers is not a can of worms that you want to open if you're not a programmer. xD

EDIT: There you go.
Title: Re: [XP] Stat Distribution System
Post by: Launian on October 03, 2012, 12:55:13 am
Hadn't had time to check it out. It works great (no surprises there :p) Still, will report any bugs I find.

Again, thanks a lot. For this, and all the other amazing scripts you've made for XP
Title: Re: [XP] Stat Distribution System
Post by: Kiwa on April 09, 2013, 08:40:07 am
Ive been trying for the past 2 hours to create a Hotkey to this. Can someone help me to add this feature? or perma add it to the script plz :D

I just cant do it.
I tried using dragos addition to blizzes smart target as a foundation for my "mod"
this is sorta what i was going off of.

Quote
module LiTTleDRAgo

  TARGET_ANIMATION_ID = 104 # 141
  TARGET_CHANGE_KEY   = Input::Key['T']
  AUTO_CHANGE_TARGET  = false


end


#==============================================================================
# BlizzABS::Controls
#==============================================================================

class BlizzABS::Controls
 
  alias update_attack_autotarget_later update_attack
  def update_attack

    if $BlizzABS.autotarget == nil
        targets = $game_map.battlers.find_all {|b| b.valid? && b.in_screen?}
        $BlizzABS.autotarget = targets[0] if targets.size > 0
    elsif Input.repeat?(LiTTleDRAgo::TARGET_CHANGE_KEY) 
      targets = $game_map.battlers.find_all {|b| b.valid? && b.in_screen?}
      index = targets.index($BlizzABS.autotarget)
      $BlizzABS.autotarget = targets[(index + 1) % targets.size] if index != nil
    end
    if $BlizzABS.autotarget != nil && (!$BlizzABS.autotarget.in_screen? ||
        !$BlizzABS.autotarget.valid?)
      $BlizzABS.autotarget = nil
    end
    return update_attack_autotarget_later
  end


I created a module just the same as dragos.


module getkey

  CHANGE_KEY   = Input::Key['N']

end


This is ok.. but the second i try to make it call $scene = Scene_Points.new
it tells me theres an error with the "module getkey"

If anyone can add the option or link some code to add i would greatly appreciate it :D
Title: Re: [XP] Stat Distribution System
Post by: KK20 on April 10, 2013, 11:23:20 pm
You can use a common event. Parallel process with a conditional branch in there. Check if Input.trigger?(Input::Key['T']). Then use a script call $scene = Scene_Points.new
Title: Re: [XP] Stat Distribution System
Post by: Kiwa on April 13, 2013, 11:24:32 am
I'm trying to keep down parallel processes.
the more events i have the more it will lag me down right?

i have 1 main parallel process that slowly restores mana.. i wonder if i can add this in to no effect? but it may delay 60 frames between pressing the button and the menu going up lol.


its a wait 60 frames
then entire party +mp

so i don't think i can add it in cuz of the wait option.

anyway ill check back on it later.. thanks kk20 :D
Title: Re: [XP] Stat Distribution System
Post by: ThallionDarkshine on April 13, 2013, 03:33:43 pm
Try this:


module PointsHotkey
 KEY = Input::Key['T']
 CALLABLE_SCENES = [Scene_Map, Scene_Menu, Scene_Item, Scene_Status, Scene_Equip]
end

module Input
 class << self
   alias_method :tdks_points_hotkey_updt, :update
 end

 def self.update
   self.tdks_points_hotkey_updt
   if Input.trigger?(PointsHotkey::KEY) and PointsHotkey::CALLABLE_SCENES.include?($scene.class)
     $scene = Scene_Points.new
   end
 end
end
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on April 13, 2013, 03:35:28 pm
That's not a good fix. It will trigger anywhere, even on the title screen, during battle, etc.
Title: Re: [XP] Stat Distribution System
Post by: ThallionDarkshine on April 13, 2013, 03:46:42 pm
Right you are. And fixed.
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on April 13, 2013, 04:02:10 pm
It should be:

PointsHotkey::CALLABLE_SCENES.include?($scene.class)


xD
Title: Re: [XP] Stat Distribution System
Post by: ThallionDarkshine on April 13, 2013, 06:17:13 pm
Fixed again. I can be so dumb at times.
Title: Re: [XP] Stat Distribution System
Post by: PhoenixFire on April 13, 2013, 11:11:26 pm
=P So, I'll be using this script in the latest version of TEP as well.. I think it'll work fine for me the way it is though..
Title: Re: [XP] Stat Distribution System
Post by: Kiwa on April 14, 2013, 12:09:49 am
Thank worked great Darkshine!! :D

thanks for the mod!!!!!
Title: Re: [XP] Stat Distribution System
Post by: TrueCynder on May 07, 2013, 01:19:24 pm
hey sorry if that got asked before but
is there a way for me to give every actor an unique max value for each stat ?

and is there a way how i can use the currency as DP ´?
Title: Re: [XP] Stat Distribution System
Post by: sirSLR on November 21, 2013, 11:27:46 am
Quote from: Launian on September 27, 2012, 06:24:17 pm
Quote from: sirSLR on March 15, 2012, 03:34:58 pm
can i edit something so that 1 dp rises 10 hp or sp instead of 1=1  ?


Find this part:

def apply_new_attributes
    @actor.maxhp += @spent[0] / BlizzCFG::HP_DP_COST
    @actor.maxsp += @spent[1]  / BlizzCFG::SP_DP_COST
    @actor.str += @spent[2] / BlizzCFG::STR_DP_COST
    @actor.dex += @spent[3] / BlizzCFG::DEX_DP_COST
    @actor.agi += @spent[4] / BlizzCFG::AGI_DP_COST
    @actor.int += @spent[5] / BlizzCFG::INT_DP_COST
    @actor.dp -= @spent.sum
    self.actor = @actor
  end


and then change it for this:

def apply_new_attributes
    @actor.maxhp += (@spent[0] * 10) / BlizzCFG::HP_DP_COST
    @actor.maxsp += (@spent[1] * 10) / BlizzCFG::SP_DP_COST
    @actor.str += @spent[2] / BlizzCFG::STR_DP_COST
    @actor.dex += @spent[3] / BlizzCFG::DEX_DP_COST
    @actor.agi += @spent[4] / BlizzCFG::AGI_DP_COST
    @actor.int += @spent[5] / BlizzCFG::INT_DP_COST
    @actor.dp -= @spent.sum
    self.actor = @actor
  end


Sadly, this doesn't change the behaivor of the stat distribution window, wich means that, if you allocate 1 DP to your HP, it'll show 501 instead of 510 until you click on Accept Changes. I can't find out how to make it so the window reflects the fact that it adds 10 HP instead of 1, but leaving alone the Stats (STR, DEX, etc.).




oh well funny thing :D i did what u said than it didnt work i was stuck with hp i haid before so i tried this

def apply_new_attributes
    @actor.maxhp += (BlizzCFG::HP_DP_COST > 0 ?
        @spent[0] / BlizzCFG::HP_DP_COST : @spent[0] * 10 )


worked like a charm :D tough in windiow mode it still shows as if i add 100 hp


EDIT :

after few min of playing i did this

from:
  HP_DP_COST = -100


to:
  HP_DP_COST = -10


all is well that ends well :D
Title: Re: [XP] Stat Distribution System
Post by: PhoenixFire on December 29, 2013, 11:26:54 pm
Alright, so, here's a question for anyone out there who might know.. I'm using Blizzs' Mouse Controller, and, the Mouse Controller Enhancement Script. They work great together, and this script works as expected too, minus one issue; when leveling up, you can click the distribute points button, but it doesn't allow you to actually distribute the points. Any thoughts on how to get it to work? I don't care if it still requires the left and right arrow keys to increase/decrease the values, but to be honest, I have no clue where I would even start when trying to edit the script(s).

If needed, I can link to a demo of the game so you can see what I mean..
Title: Re: [XP] Stat Distribution System
Post by: TrueCynder on January 24, 2014, 12:47:04 pm
*bumps question from ages ago*

Quote from: TrueCynder on May 07, 2013, 01:19:24 pm
hey sorry if that got asked before but
is there a way for me to give every actor an unique max value for each stat ?

and is there a way how i can use the currency as DP ´?
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on January 24, 2014, 04:07:36 pm
Not without some additional scripting.
Title: Re: [XP] Stat Distribution System
Post by: TrueCynder on January 24, 2014, 05:18:53 pm
hmmm how much "additional scripting." ?
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on January 24, 2014, 05:38:21 pm
First you would have to define the maximum for each actor and swap out the current code with the new definitions. This one is fairly easy.

Using DP as currency would require a lot more work. First you would have to decide where you can use DP and for what. And then you would have to script all those scenes and windows. Just saying "DP is gold" is not really possible since every actor has their own DP whiele gold is common party value.
Title: Re: [XP] Stat Distribution System
Post by: TrueCynder on January 24, 2014, 06:17:08 pm
tz i think you miss understood
i want to use curency instead of DP
so no DP at all  :uhm:

so all in all how exactly would i do all of that
or could you do it if you have some free time?
these changes are more or less important :/
Title: Re: [XP] Stat Distribution System
Post by: Blizzard on January 24, 2014, 06:33:52 pm
I have retired from RMXP almost 4 years ago so I'm not doing any scripting anymore.

Wouldn't it be simpler to make an event shop where you can buy DP and then just use script calls and event commands to make that work? It shouldn't be too difficult.
Title: Re: [XP] Stat Distribution System
Post by: Tedrainbow on May 21, 2020, 07:45:40 pm
Hello, I just wanted to say..
Add a variable for the number of combat points using this in code.
Game.Actor

value = (@level - old_level) * BlizzCFG::DP_PER_LEVEL

Replace to value = (@level - old_level) * BlizzCFG::DP_PER_LEVEL+ $game_variables[ID]

But it is add point to for each fight.

To not be too strong.

Add point variable id, only add buy items, to comment event for 120 Sc time to item not effet anymore.

The try is very nice work..

The new formula possible..