Help - Search - Members - Calendar
Full Version: Get status' values changings of skills
RPG RPG Revolution Forums > Game Engines > RPG Maker XP Discussion
cometstar
I want a script ,embedded in battler class, can determine the increment or decrement of staus' values of the battler(like ATK ,STR, INT ....)
caused by skill or item and store every chaning value in a variable in the battler's class
to be able to read it and show it in someway ; either in a window or by using PupUp damage....
this would not be difficult ,but I don't have enought expirence in RGSS.
Night_Runner
I was thinking of changing the status screen, so there's a base attack, base pdef, etc, and then there's another column for the final atk, the final pdef etc.

Does that sound okay, or did you want it somewhere else?
cometstar
Yes.
It is.
it shows base or current value and next to it shows new value
or it shows only the names of changed value and changing value (either plus or minus)
anyone will be good.

thank you for your replay my many requests
Night_Runner
I've implemented the second option, using the plus or minus.
I just thought that it's fairly easy to intuit the information that's being displayed

CODE
#==============================================================================
# ** XP: Night_Runner's Evented Page Conditions
#------------------------------------------------------------------------------
# History:
#  Date Created: 28/May/2012
#  Created for: cometstar
#   @> http://www.rpgrevolution.com/forums/index.php?showtopic=56506
#
# Description:
#  This script allows shows the base stat in the status window, and then the
#  changes to it (by skills, weapons, states, etc)
#
# How to Install:
#  Highlight and copy the entire script.
#  In your game's editor, select Tools >> Script Editor.
#  Along the left hand side scroll to the bottom, right click on on
#  'Main' and select 'Insert'.
#  Paste in the blank window on the right.
#==============================================================================



#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  Edited to show changes to stats
#==============================================================================

class Window_Base
  #--------------------------------------------------------------------------
  # * Draw Parameter
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     type  : parameter type (0-6)
  #--------------------------------------------------------------------------
  def draw_actor_parameter(actor, x, y, type)
    types = ['atk', 'pdef', 'mdef', 'str', 'dex', 'agi', 'int']
    type = types[type]
    name = eval("$data_system.words.#{type}")
    base = eval("actor.base_#{type}")
    bonus = eval("actor.#{type}") - base
    bonus_text = (bonus >= 0 ? " +" : " ") + bonus.to_s
    bonus_text_width = self.contents.text_size(bonus_text).width
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 120, 32, name)
    self.contents.font.color = normal_color
    wdth = 156 - bonus_text_width
    self.contents.draw_text(x, y, wdth, 32, base.to_s, 2)
    if bonus > 0
      self.contents.font.color = Color.new(255, 0, 0)
    elsif bonus < 0
      self.contents.font.color = Color.new(0, 255, 0)
    end
    self.contents.draw_text(x, y, 156, 32, bonus_text, 2)
  end
end



#==============================================================================
# ** End of Script.
#==============================================================================


But if you prefer I can easily show the current value, with the new value next to it, maybe formatted like
ATK 20 -> 25
Which also gets the message across?
I'll let you decide happy.gif
cometstar
Thank you for your pacient on my requests.
This job is good ,I'll try it and hopefully it'll work.
since you made the second way ,then it's well and perfect for my purpose
THANK YOU for your appreciated effort.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.