Display some uncommon values
#1
Hey it's an issue which is troubling me for quite a time but I never had the motivation to fix it.
Now I'm trying but I think I need some help.

I'm using the following script to have HP and SP stats on Equipment.

Code:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Weapon/Armor HP/SP Plus by Blizzard
# Version: 2.1b
# Type: Weapon/Armor Attribute Alteration
# Date: 18.8.2006
# Date v1.01b: 12.3.2007
# Date v2.0: 15.5.2007
# Date v2.0b: 30.7.2007
# Date v2.1b: 11.6.2009
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Compatibility:
#
#   95% compatible with SDK v1.x. 50% compatible with SDK v2.x. May cause
#   slight incompatibility issues with CBS-es, but can be made compatible
#   easily. Can cause imcompatibility issues with other weapon/armor changing
#   scripts and custom equipments scripts.
#
#
# Features:
#
#   - uses static (i.e. 500 HP more) or dynamic (i.e. 30% HP more) increasements
#   - easy to set up
#   - does NOT change any rxdata files
#   - this script comes UNDER SDK SCRIPTS if you use any
#
# new in v2.0:
#   - completely overworked and changed code for better compatibility
#
# new in v2.0b:
#   - fixed a bug that appeared because of a typing mistake
#
# new in v2.1b:
#   - improve coding
#
#
# Instructions:
#
# - Explanation:
#
#   This script will add the option for Weapons/Armors to have HP/SP pluses
#   while equipped just like the usual STR, DEX, INT etc. pluses.
#
# - Configuration
#
#   Find the phrase saying "START" (CTRL+F) to find the database parts. Use the
#   following template to configure your database:
#
#     when ID then return [EXPR, VAL]
#
#   ID   - Weapon/Armor ID in the normal database
#   EXPR - set to false if you want "static" increasement or true if you want
#          "dynamic" increasement
#   VAL  - if you use static increasement, set this value to any integer you
#          want (i.e. 100, -500, 831 etc.) to increase the HP/SP, otherwise set
#          it to any decimal value of the final HP/SP (i.e. 1.2 = 20% more,
#          2.3 = 130% more, 0.7 = 30% less)
#
#   VAL can be a signed integer (static increasement) OR a decimal number
#   greater than 0 (dynamic increasement). Change MAX_HP and MAX_SP to
#   different values if you use another max HP and/or max SP limit than 9999.
#
#
# Side Note:
#
#   It took more to write the instructions than to write and test script
#   itself.
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

MAX_HP = 999999999 # change if needed, 9999 is standard
MAX_SP = 999999999 # change if needed, 9999 is standard

#==============================================================================
# module BlizzCFG
#==============================================================================

module BlizzCFG
  
  def self.weapon_hp_plus(id)
    case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Weapon HP plus Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    when 1 then return  [false, 100]     # Test

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Weapon SP plus Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    else
      return [false, 16]
    end
  end
  
  def self.armor_hp_plus(id)
    case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Armor HP plus Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    when 1 then return [false, 843]          # Test

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Armor HP plus Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    else
      return [false, 28]
    end
  end
  
  def self.armor_sp_plus(id)
    case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Armor SP plus Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    when 1 then return [false, 843]              # Test  

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Armor SP plus Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    else
      return [false, 16]
    end
  end
  
end

#==============================================================================
# Game_Battler
#==============================================================================

class Game_Battler
  
  alias maxsp_hpsp_add_on_later maxsp
  def maxsp
    val = [MAX_SP, maxsp_hpsp_add_on_later].min
    @sp = val if @sp > val
    return val
  end
  
end

#==============================================================================
# Game_Actor
#==============================================================================

class Game_Actor
  
  alias maxhp_hpsp_add_on_later maxhp
  def maxhp
#    return maxhp_hpsp_add_on_later unless $game_system.HPSPPLUS
    val = [MAX_HP, maxhp_hpsp_add_on_later].min
    @hp = val if @hp > val
    return val
  end
  
  alias base_maxhp_hpsp_add_on_later base_maxhp
  def base_maxhp
#    return base_maxhp_hpsp_add_on_later unless $game_system.HPSPPLUS
    plus, multi = 0, 1.0
    self.equipments.each{|equip|
      if equip.is_a?(RPG::Weapon)
        result = BlizzCFG.weapon_hp_plus(equip.id)
        result[0] ? (multi *= result[1]) : (plus += result[1])
      else
        result = BlizzCFG.armor_hp_plus(equip.id)
        result[0] ? (multi *= result[1]) : (plus += result[1])
      end
    }
    return (multi * (plus + base_maxhp_hpsp_add_on_later)).to_i
  end
  
  alias base_maxsp_hpsp_add_on_later base_maxsp
  def base_maxsp
#    return base_maxsp_hpsp_add_on_later unless $game_system.HPSPPLUS
    plus, multi = 0, 1.0
    self.equipments.each{|equip|
      if equip.is_a?(RPG::Weapon)
        result = BlizzCFG.weapon_sp_plus(equip.id)
        result[0] ? (multi *= result[1]) : (plus += result[1])
      else
        result = BlizzCFG.armor_sp_plus(equip.id)
        result[0] ? (multi *= result[1]) : (plus += result[1])
      end
    }
    return (multi * (plus + base_maxsp_hpsp_add_on_later)).to_i
  end
  
end

And now I want to show these HP/SP + values in another window which displays stats from Equipment.
Is ist even possible at all?
Reply }
#2
Creating a Constant like MAX_HP in Object class?! How daring! Windows and Sprites or Game_Map don't really need it at all.

So far what it only does is to calculate these sort of extended maxhp and maxsp and their base values so it would appear as such on any window that already includes them in their list of actor's stats. What's the actual equipment window script you're using and need these to be implemented there?
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#3
It's this one

Code:
class Window_ItemDetailView < Window_Base
  
  # ---------------------------------------------------------
  # Script v1.1
  # by jackatrades
  #
  # Find me at http://www.dubealex.com/creation_asylum/forum/
  # if you have questions/comments.
  # ---------------------------------------------------------
  
  # Creates the window for usage.
  def initialize
    super(100, 40, 440, 400)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Calibri"
    self.contents.font.size = $fontsize
    self.contents.font.color = normal_color
    # z acts as "layer order."
    self.z += 10
    @itemdetail = []
    # ------------------------------
    # @leadingcharacters is set for the script to delete X amount of
    # characters in each line of the .rxdata
    # In this case, the first 5 characters will be deleted in each line.
    # ------------------------------
    @leadingcharacters = 5
    # Clears and resets the window everytime it is requested by Scene_Item.
    refresh2    
  end
  
  def refresh2
    self.contents.font.name = "Calibri"
    self.contents.font.size = $fontsize
    self.contents.font.color = normal_color
    self.contents.clear
  end
  
  def refresh
    item_id = $currenthighlighteditem.id
    # The three huge if-then statements check the current highlighted
    # item and its property, and executes the appropriate script
    # when it is true.
    # <-----------------------------------ITEM---------------------------->
    if $currenthighlighteditem.is_a?(RPG::Item)
      item = $data_items[item_id]
      item_name = $data_items[item_id].name
      item_icon = $data_items[item_id].icon_name
      item_amount = ($game_party.item_number(item_id)).to_s
      item_price = ($data_items[item_id].price).to_s
      getitem_scope = $data_items[item_id].scope
      # The Item Scope descriptions can be edited if needed.
      if getitem_scope == 0
        getitem_scope = "No Use"
      end
      if getitem_scope == 1
        getitem_scope = "One Enemy"
      end
      if getitem_scope == 2
        getitem_scope = "All Enemies"
      end
      if getitem_scope == 3
        getitem_scope = "One Ally"
      end
      if getitem_scope == 4
        getitem_scope = "Party"
      end
      if getitem_scope == 5
        getitem_scope = "Down Ally (HP = 0)"
      end
      if getitem_scope == 6
        getitem_scope = "Down Allies (HP = 0)"
      end
      if getitem_scope == 7
        getitem_scope = "User"
      end
      # </> #
      self.contents.font.color = system_color
      self.contents.draw_text(310, 44, 100, 24, "Usage:", 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(426, 44, 250, 24, getitem_scope, 0)
    end
    # <-------------------------------------------------------------------->
    
    # <-----------------------------------WEAPON---------------------------->
    if $currenthighlighteditem.is_a?(RPG::Weapon)

      item = $data_weapons[item_id]
      item_name = $data_weapons[item_id].name
      item_icon = $data_weapons[item_id].icon_name
      item_amount = ($game_party.weapon_number(item_id)).to_s
      item_price = ($data_weapons[item_id].price).to_s
      # Initialize p# variables.
      # These are used to display either plus sign or no sign depending on
      # the weapon's attribute bonus.
      # Negative sign originates from the value itself, so no need to check
      # them with if-then statements.
      p1 = ""
      p2 = ""
      p3 = ""
      p4 = ""
      p5 = ""
      p6 = ""
      # ---------------------------------------------------
      # Start inserting appropriate variables from database.
      # ---------------------------------------------------
      item_atk = $data_weapons[item_id].atk.to_s
      item_pdef = $data_weapons[item_id].pdef
      if item_pdef > 0
        p5 = "+"
      end
      item_pdef = item_pdef.to_s
      item_mdef = $data_weapons[item_id].mdef
      if item_mdef > 0
        p6 = "+"
      end
      item_mdef = item_mdef.to_s
      item_str = $data_weapons[item_id].str_plus
      if item_str > 0
        p1 = "+"
      end
      item_str = item_str.to_s
      item_dex = $data_weapons[item_id].dex_plus
      if item_dex > 0
        p2 = "+"
      end
      item_dex = item_dex.to_s
      item_agi = $data_weapons[item_id].agi_plus
      if item_agi > 0
        p3 = "+"
      end
      item_agi = item_agi.to_s
      item_int = $data_weapons[item_id].int_plus
      if item_int > 0
        p4 = "+"
      end
      item_int = item_int.to_s
      # Sets Elemental and Status attributes of weapon string along with
      # suffix slashes when there are two or more attributes.
      item_element = ""
      flag = false
      for i in $data_weapons[item_id].element_set
        if flag
          item_element += "/"
        end
        item_element += $data_system.elements[i]
        flag = true
      end
      # Checks whether item_element is blank. If it is, then sets it
      # to "None".
      if item_element == ""
        item_element = "None"
      end
      item_status = ""
      flag = false
      for i in $data_weapons[item_id].plus_state_set
        if flag
          item_status += "/"
        end
        item_status += $data_states[i].name
        flag = true
      end
      if item_status == ""
        item_status = "None"
      end
      # ------------------------------
      # Start drawing attribute names.
      # ------------------------------
      # x and y can be changed to easily affect other attributes.
      x = 33
      y = 66
      self.contents.font.color = system_color
      self.contents.font.size = $fontsize - 4
      self.contents.font.color = Color.new(255, 255, 0, 255)
      self.contents.draw_text(x, y, 256, 24, $data_system.words.atk)
      self.contents.font.color = system_color
      self.contents.draw_text(x, y + 28, 256, 24, $data_system.words.str)
      self.contents.draw_text(x, y + 42, 256, 24, $data_system.words.dex)
      self.contents.draw_text(x, y + 56, 256, 24, $data_system.words.agi)
      self.contents.draw_text(x, y + 70, 256, 24, $data_system.words.int)
      self.contents.draw_text(x, y + 84, 256, 24, $data_system.words.pdef)
      self.contents.draw_text(x, y + 98, 256, 24, $data_system.words.mdef)
      self.contents.draw_text(x + 170, y, 256, 24, "Elemental Attack:")
      self.contents.draw_text(x + 170, y + 42, 256, 24, "Status Attack:")      
      # ------------------------------
      # Start drawing attribute values.
      # ------------------------------
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 74, y, 64, 24, item_atk, 2)
      self.contents.draw_text(x + 74, y + 28, 64, 24, p1 + item_str, 2)
      self.contents.draw_text(x + 74, y + 42, 64, 24, p2 + item_dex, 2)
      self.contents.draw_text(x + 74, y + 56, 64, 24, p3 + item_agi, 2)
      self.contents.draw_text(x + 74, y + 70, 64, 24, p4 + item_int, 2)
      self.contents.draw_text(x + 74, y + 84, 64, 24, p5 + item_pdef, 2)
      self.contents.draw_text(x + 74, y + 98, 64, 24, p6 + item_mdef, 2)
      self.contents.draw_text(x + 170, y + 14, 420, 24, "   " + item_element, 0)
      self.contents.draw_text(x + 170, y + 56, 420, 24, "   " + item_status, 0)
      # Resets font size.
      self.contents.font.size = $fontsize
    end    
    # <-------------------------------------------------------------------->
    
    # <-----------------------------------ARMOR---------------------------->
    if $currenthighlighteditem.is_a?(RPG::Armor)
      
      item = $data_armors[item_id]
      item_name = $data_armors[item_id].name
      item_icon = $data_armors[item_id].icon_name
      item_amount = ($game_party.armor_number(item_id)).to_s
      item_price = ($data_armors[item_id].price).to_s
      # set variables
      p1 = ""
      p2 = ""
      p3 = ""
      p4 = ""
      p5 = ""
      p6 = ""
      # Checks armor's type and inserts appropriate string.
      type = $data_armors[item_id].kind
      if type == 0
        type = "Handschuhe"
      end
      if type == 1
        type = "Helm"
      end
      if type == 2
        type = "Rüstung"
      end
      if type == 3
        type = "Stiefel"
      end
      if type == 4
        type = "Insigne"
      end
      if type == 5
        type = "Amulett"
      end
      if type == 6
        type = "Ring"
      end
      if type == 7
        type = "Schwingen"
      end
      if type == 8
        type = "Schild"
      end
      if type == 9
        type = "Accessory"
      end
      if type == 10
        type = "Accessory"
      end
      item_pdef = $data_armors[item_id].pdef
      if item_pdef > 0
        p5 = "+"
      end
      item_pdef = item_pdef.to_s
      item_mdef = $data_armors[item_id].mdef
      if item_mdef > 0
        p6 = "+"
      end
      item_mdef = item_mdef.to_s
      item_str = $data_armors[item_id].str_plus
      if item_str > 0
        p1 = "+"
      end
      item_str = item_str.to_s
      item_dex = $data_armors[item_id].dex_plus
      if item_dex > 0
        p2 = "+"
      end
      item_dex = item_dex.to_s
      item_agi = $data_armors[item_id].agi_plus
      if item_agi > 0
        p3 = "+"
      end
      item_agi = item_agi.to_s
      item_int = $data_armors[item_id].int_plus
      if item_int > 0
        p4 = "+"
      end
      item_int = item_int.to_s    
      item_element = ""
      flag = false
      for i in $data_armors[item_id].guard_element_set
        if flag
          item_element += "/"
        end
        item_element += $data_system.elements[i]
        flag = true
      end
      if item_element == ""
        item_element = "None"
      end
      item_status = ""
      flag = false
      for i in $data_armors[item_id].guard_state_set
        if flag
          item_status += "/"
        end
        item_status += $data_states[i].name
        flag = true
      end
      if item_status == ""
        item_status = "None"
      end
      #draw attribute names
      self.contents.font.color = system_color
      self.contents.font.size = $fontsize - 4
      x = 33
      y = 66
      self.contents.font.color = Color.new(255, 255, 0, 255)
      self.contents.draw_text(x, y, 256, 24, "Type")
      self.contents.draw_text(x, y + 14, 256, 24, $data_system.words.pdef)
      self.contents.draw_text(x, y + 28, 256, 24, $data_system.words.mdef)
      self.contents.font.color = system_color
      self.contents.draw_text(x, y + 56, 256, 24, $data_system.words.str)
      self.contents.draw_text(x, y + 70, 256, 24, $data_system.words.dex)
      self.contents.draw_text(x, y + 84, 256, 24, $data_system.words.agi)
      self.contents.draw_text(x, y + 98, 256, 24, $data_system.words.int)      
      self.contents.draw_text(x + 170, y, 256, 24, "Elemental Guard:")
      self.contents.draw_text(x + 170, y + 42, 256, 24, "Status Guard:")                
      #draw attributes
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 74, y, 64, 24, type, 2)
      self.contents.draw_text(x + 74, y + 14, 64, 24, p5 + item_pdef, 2)
      self.contents.draw_text(x + 74, y + 28, 64, 24, p6 + item_mdef, 2)
      self.contents.draw_text(x + 74, y + 56, 64, 24, p1 + item_str, 2)
      self.contents.draw_text(x + 74, y + 70, 64, 24, p2 + item_dex, 2)
      self.contents.draw_text(x + 74, y + 84, 64, 24, p3 + item_agi, 2)
      self.contents.draw_text(x + 74, y + 98, 64, 24, p4 + item_int, 2)
      self.contents.draw_text(x + 170, y + 14, 420, 24, "   " + item_element, 0)
      self.contents.draw_text(x + 170, y + 56, 420, 24, "   " + item_status, 0)
      self.contents.font.size = $fontsize

    end    
    # <-------------------------------------------------------------------->

    # Stores item Price's string width.
    item_price_width = item_price.size * 10
    # Stores item's icon graphic.
    bitmap = RPG::Cache.icon(item_icon + ".png")
    # Draws item's icon.
    self.contents.blt(5, 8, bitmap, Rect.new(0, 0, 24, 24), 255)
    self.contents.font.color = drago_item_colors(item)
    self.contents.draw_text(33, 8, 256, 24, item_name)
    self.contents.font.color = system_color
    self.contents.draw_text(310, 8, 100, 24, "Owned No.:", 2)
    self.contents.draw_text(310, 26, 100, 24, "Value:", 2)
    self.contents.font.color = normal_color
    self.contents.draw_text(426, 8, 160, 24, item_amount, 0)
    self.contents.draw_text(426, 26, 160, 24, item_price, 0)
    # This if-then statement is pretty much unnecessary unless
    # you're using the same idea: if user's party does not
    # know the item's value and had not appraised the item,
    # then don't draw text.
    if item_price != "Unknown"
      self.contents.font.color = system_color
      self.contents.draw_text(432 + item_price_width, 26, 160, 24, $data_system.words.gold, 0)
    end
    self.contents.font.color = normal_color
    # Two lines below calls the two definitions to write the item's
    # detailed description.
    get_item_detail(item_id)
    write_item_detail(5, 223)
  end
  
  def get_item_detail(item_id)
    # descarray stores the line numbers needed to call the right
    # detail description into an array.
    descarray =
    [
    item_id * 7,
    item_id * 7 + 1,
    item_id * 7 + 2,
    item_id * 7 + 3,
    item_id * 7 + 4,
    item_id * 7 + 5,
    item_id * 7 + 6
    ]
    # The if-then statements below checks the highlighted item and use
    # the right .rxdata.
    if $currenthighlighteditem.is_a?(RPG::Item)
      f = File.open("Data/Item_Detail.rxdata")
    end
    if $currenthighlighteditem.is_a?(RPG::Weapon)
      f = File.open("Data/Weapon_Detail.rxdata")
    end
    if $currenthighlighteditem.is_a?(RPG::Armor)
      f = File.open("Data/Armor_Detail.rxdata")
    end
    # Stores _every_ line of the file into @itemdetail as an array.
    @itemdetail = f.readlines
    # Clears first seven lines for Lines 1-7 (0..6), as it will never be used.
    for i in 0..6
      @itemdetail[i] = ""
    end
    # Crops the first 6 characters in each line.
    for i in 0..6
      cropheadcharacters(descarray[i])
    end
    # Stores the cropped lines into description array.
    @description = []
    for i in 0..6
      @description[i] = @itemdetail[descarray[i]]
    end
    return
  end
  
  def cropheadcharacters(descarray)
    # Checks to see if any lines are nil. If so, then sets them
    # as blank lines after cropping.
    if @itemdetail[descarray] == nil
      @itemdetail[descarray] = "123456 "
    end
    # Crops the first (@leadingcharacters) characters in each line.
    # Default: 5.
    @itemdetail[descarray].slice!(0..@leadingcharacters)
    return
  end
  
  def write_item_detail(x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y - 20, 640, 32, "Description:")
    self.contents.font.color = normal_color
    self.contents.font.size = $fontsize - 2
    # Draws the first six lines in normal color.
    for i in 0..5
      self.contents.draw_text(x, y, 640, 32, @description[i])
      y += 18
    end
    # Draws the seventh line in another color.
    self.contents.font.color = Color.new(255, 255, 0, 255)
    self.contents.draw_text(x, y, 640, 32, @description[6])
  end  
end

I want to display the HP and SP values there from that other script there.
I only need to know how to do it, everything else is doable by myself.

Something like this: self.contents.draw_text(x + 74, y + 98, 64, 24, p5 + item_hp, 2)
So I would need to save the HP values of Weapon/Armor ID "x" in item_hp
But I'm not sure how to do it.
Reply }
#4
Err... delete the $fontsize or $fontname or $fontface stuff, XP doesn't need it, it should be equal to nil anyway (non existing) so replace $fontsize with some constant or with any specific integer.

Where it says...

Code:
if getitem_scope == 0
        getitem_scope = "No Use"
      end
      if getitem_scope == 1
        getitem_scope = "One Enemy"
      end
      if getitem_scope == 2
        getitem_scope = "All Enemies"
      end
      if getitem_scope == 3
        getitem_scope = "One Ally"
      end
      if getitem_scope == 4
        getitem_scope = "Party"
      end
      if getitem_scope == 5
        getitem_scope = "Down Ally (HP = 0)"
      end
      if getitem_scope == 6
        getitem_scope = "Down Allies (HP = 0)"
      end
      if getitem_scope == 7
        getitem_scope = "User"
      end

Paste this...

Code:
getitem_scope = case getitem_scope
when 0 then "No Use"
when 1 then "One Enemy"
when 2 then "All Enemies"
when 3 then "One Ally"
when 4 then "Party"
when 5 then "Down Ally (HP = 0)"
when 6 then "Down Allies (HP = 0)"
when 7 then "User"
end

...to make it look less crappy and make it easier to add more lines in case some other scripter added custom skill or item scopes anywhere else.

BlizzCFG.weapon_hp_plus(item_id)
BlizzCFG.weapon_sp_plus(item_id)

Where it says...

Code:
type = $data_armors[item_id].kind
      if type == 0
        type = "Handschuhe"
      end
      if type == 1
        type = "Helm"
      end
      if type == 2
        type = "Rüstung"
      end
      if type == 3
        type = "Stiefel"
      end
      if type == 4
        type = "Insigne"
      end
      if type == 5
        type = "Amulett"
      end
      if type == 6
        type = "Ring"
      end
      if type == 7
        type = "Schwingen"
      end
      if type == 8
        type = "Schild"
      end
      if type == 9
        type = "Accessory"
      end
      if type == 10
        type = "Accessory"
      end

Replace it with...

Code:
type = case $data_armors[item_id].kind
when 0 then "Handschuhe"
when 1 then "Helm"
when 2 then "Rüstung"
when 3 then "Stiefel"
when 4 then "Insigne"
when 5 then "Amulett"
when 6 then "Ring"
when 7 then "Schwingen"
when 8 then "Schild"
when 9 then "Accessory"
when 10 then "Accessory"
end

If you ever ever use mkxp to let people play your game on Linux as well, you'll thank me for making sure the case statement is compatible with Ruby 2.1 as well. Let's admit it, it's easier to read like these and saves many lines of code and multiple checks.

Not much later on you'll find a perfect place to add armor stuff so paste these lines...

hp_plus = 'My Custom Label: ' + BlizzCFG.armor_hp_plus(item_id).to_s
sp_plus = BlizzCFG.armor_sp_plus(item_id).to_s

...then pick a place for new draw_text lines to make it visible, i.e.

self.contents.draw_text(x + 170, y + 70, 420, 24, hp_plus, 0)
self.contents.draw_text(x + 170, y + 90, 420, 24, sp_plus, 0)

In the weapon section you would have to do the same for the pair of lonely lines I left behind that handle weapon stuff, don't forget to customize it under your own risk XP
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#5
Thank you very much for your help.
It nearly works 100%.

Only issue is that it shows the "false" and "true" statements aswell in the window.
Like this:

HP: false100
SP: false50
Reply }
#6
hp_plus = 'My Custom Label: ' + BlizzCFG.armor_hp_plus(item_id)[1].to_s
sp_plus = BlizzCFG.armor_sp_plus(item_id)[1].to_s

That should fix it for sure, but I wonder why he placed those boolean values there, not a very logical place to leave then IMNSHO.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#7
Ok, now everything is fine.
Thank you very much for your help.

Edit: I also managed it to call the detail window from the equipment screen, so I don't have to ask for help again.^^
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Multi Attack & Combo Display Keeroh 9 14,000 05-15-2017, 06:39 PM
Last Post: DerVVulfman
   Display State Ranks in Status Screen Mel 3 7,420 04-02-2017, 12:46 AM
Last Post: marketing small business ideas
Question  Lycan ABS - Weapon display Jetboy 4 7,184 07-14-2015, 06:02 AM
Last Post: DerVVulfman
  Icon Display 1.0 scripts makes events impossible to go to events, which are passable Djigit 0 3,902 01-03-2015, 09:11 PM
Last Post: Djigit



Users browsing this thread: 2 Guest(s)