[XP] Item Quality

Started by G_G, January 16, 2011, 03:14:01 pm

Previous topic - Next topic

Griver03

May 30, 2011, 02:51:20 pm #20 Last Edit: May 30, 2011, 03:31:06 pm by Griver03
omfg thats  :evil:
great thx and go on like this  :)

edit:
ok i tested it and works good in multi-equip but only in the equip window not in the window at bottom where you select a weapon/armor...
and in fft shop the items are standard white just like before ...
my item quality script is above fft shop is this correct ?!

edit2: sry i dont read correct ^^
you "will" make the patch for fft and its not out yet thats why it doesnt work hahaha
My most wanted games...



Dweller

Quote from: game_guy on May 30, 2011, 02:33:38 pm
Updated to 1.3. Added default shop support. Added multi slot patch. Working on FFT Shop system now.


Working fine, ty for the fix
Dwellercoc
Spoiler: ShowHide

Dweller

*double post

g_g can you fix the script to solve the equip window problem?

Will be difficult to make it run with ccoa UMS?

ty,
Dwellercoc
Spoiler: ShowHide

G_G

I'll fix it, I'll be busy for a couple of days so I can't do it right away. It shouldn't be a problem hopefully. I'm gonna rewrite the script to make it smaller and hopefully more efficient.

Dweller

Quote from: Captain Falcon on June 08, 2011, 05:35:19 am
I'll fix it, I'll be busy for a couple of days so I can't do it right away. It shouldn't be a problem hopefully. I'm gonna rewrite the script to make it smaller and hopefully more efficient.


nice ty ;)
Dwellercoc
Spoiler: ShowHide

G_G

Updated to 1.4. Fixed equip window, rewrote main part of the script, its much much more efficient now.

Dweller

I tried the new version and got a problem:

Spoiler: ShowHide
Dwellercoc
Spoiler: ShowHide

G_G

Any special scripts you're using? Not that it should matter. It seems to be working just fine for me.

Dweller

Quote from: Captain Falcon on June 08, 2011, 08:08:20 pm
Any special scripts you're using? Not that it should matter. It seems to be working just fine for me.


Is working on a new project so is probably messing up with some of the scripts I´m using.
Dwellercoc
Spoiler: ShowHide

G_G

what other scripts are you using?

Dweller

Scripts I´m using right now (in order)

- Universal Message System v1.8.0 by Ccoa
- Item Quality 1.4 by g_g
- Credit script (still looking for autor)
Spoiler: ShowHide
CREDITS_FONT = "Times New Roman"
CREDITS_SIZE = 24
CREDITS_OUTLINE = Color.new(0,0,127, 255)
CREDITS_SHADOW = Color.new(0,0,0, 100)
CREDITS_FILL = Color.new(255,255,255, 255)

#==============================================================================
# ¦ Scene_Credits
#------------------------------------------------------------------------------
#  Scrolls the credits you make below. Original Author unknown. Edited by
#  MiDas Mike so it doesn't play over the Title, but runs by calling the following:
#  $scene = Scene_Credits.new
#==============================================================================

class Scene_Credits

# This next piece of code is the credits.

CREDIT=<<_END_
#Start Editing
Título: 7 Islands

by Dweller

SCRIPTS
---------------
Game Guy (ItemQuality)
Blizzard (Blizz ABS, Visual Equip, Z-Hud)
Winkio (Blizz ABS)
RPGManiac3030 (Weapon Equip Z-HUD)
Ccoa (UMS)

SPRITES
---------------
Dweller
Leirgoth (Custom Art)

MUSIC and SOUND
---------------


MAPPING
---------------
Dweller
Dark_Split

STORYLINE
---------------
Dweller

BETATESTERS
---------------
Dark_Split
Ochiru

Special Thanks
---------------


---------------



#Stop Editing
_END_
def main
#-------------------------------
# Animated Background Setup
#-------------------------------
@sprite = Sprite.new
#@sprite.bitmap = RPG::Cache.title($data_system.title_name)
@backgroundList = ["credits"] #Edit this to the title screen(s) you wish to show in the background. They do repeat.
@backgroundGameFrameCount = 0
# Number of game frames per background frame.
@backgroundG_BFrameCount = 3.4
@sprite.bitmap = RPG::Cache.title(@backgroundList[0])
#------------------
# Credits Setup
#------------------
credit_lines = CREDIT.split(/\n/)
credit_bitmap = Bitmap.new(640,32 * credit_lines.size)
credit_lines.each_index do |i|
line = credit_lines[i]
credit_bitmap.font.name = CREDITS_FONT
credit_bitmap.font.size = CREDITS_SIZE
x = 0
credit_bitmap.font.color = CREDITS_OUTLINE
credit_bitmap.draw_text(0 + 1,i * 32 + 1,640,32,line,1)
credit_bitmap.draw_text(0 - 1,i * 32 + 1,640,32,line,1)
credit_bitmap.draw_text(0 + 1,i * 32 - 1,640,32,line,1)
credit_bitmap.draw_text(0 - 1,i * 32 - 1,640,32,line,1)
credit_bitmap.font.color = CREDITS_SHADOW
credit_bitmap.draw_text(0,i * 32 + 8,640,32,line,1)
credit_bitmap.font.color = CREDITS_FILL
credit_bitmap.draw_text(0,i * 32,640,32,line,1)
end
@credit_sprite = Sprite.new(Viewport.new(0,50,640,380))
@credit_sprite.bitmap = credit_bitmap
@credit_sprite.z = 9998
@credit_sprite.oy = -430
@frame_index = 0
@last_flag = false
#--------
# Setup
#--------
# ME?BGS ??????
Audio.me_stop
Audio.bgs_stop
Audio.se_stop
# ?????????
Graphics.transition
# ??????
loop do
# ????????
Graphics.update
# ???????
Input.update
# ??????
update
# ????????????????
if $scene != self
break
end
end
# ?????????
Graphics.freeze
@sprite.dispose
@credit_sprite.dispose
end
#Checks if credits bitmap has reached it's ending point
def last?
return (@frame_index >= @credit_sprite.bitmap.height + 480)
end
def last
if not @last_flag
@last_flag = true
@last_count = 0
else
@last_count += 1
end
if @last_count >= 300
$scene = Scene_Map.new
end
end
#Check if the credits should be cancelled
def cancel?
if Input.trigger?(Input::C)
$scene = Scene_Map.new
return true
end
return false
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
@backgroundGameFrameCount = @backgroundGameFrameCount + 1
if @backgroundGameFrameCount >= @backgroundG_BFrameCount
@backgroundGameFrameCount = 0
# Add current background frame to the end
@backgroundList = @backgroundList << @backgroundList[0]
# and drop it from the first position
@backgroundList.delete_at(0)
@sprite.bitmap = RPG::Cache.title(@backgroundList[0])
end
return if cancel?
last if last?
@credit_sprite.oy += 1
end
end

- Blizz-ABS 2.84 by Blizzard/Winkio
- Visual Equipment for Blizz-ABS by Blizzard
- Z-HUD for Blizz-ABS by Blizzard
- Weapon Equip HUD for Z-HUD by RPGManiac3030

Dwellercoc
Spoiler: ShowHide

G_G

Try placing my script below everyone elses.

Dweller

I placed Item Quality script below the rest of the scripts and is running fine. I made a few more test and the problem is with Blizz-ABS (just over Blizz-ABS scripts fails and just below them is ok).

Ty for you help ;)
Dwellercoc
Spoiler: ShowHide

syldocaine

First at all i want to say that this script is awsome

but i have one problem.

im using the Drago Inventory System
http://forum.chaos-project.com/index.php/topic,11582.0.html

and the only place where the colors not appear is the stat window
im not deep enough into ruby to fix that issue so maybe you could help me with that problem


Moshan

 I can't make it fully compatible with Zer0_CMS. How can I keep the colors in equipment window?
Example (big image):
Spoiler: ShowHide

exile360

Having the same problem with my CMS, but I just left it for now as it's not a huge issue. :P If a solution is found, I'm interested in it as well, though!

KK20

FZer0 created his own Item Window class rather than extending RMXP's default class. As such, he wrote his own draw_item method. Basically all I did was just copy-paste G_G's draw_item rewrite and replaced FZer0's with it.

Around line 2149 in FZer0's CMS script, you should see def draw_item(index). Replace that method with this:
Spoiler: ShowHide

  def draw_item(index)
    use = false
    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)
      use = true
    end
    if item.quality == "gg_def"
      self.contents.font.color = GG_QualityColors::Default_Color
    else
      self.contents.font.color = GG_QualityColors::Quality[item.quality]
    end
    x = 4 + index % 2 * (192 + 32)
    y = index / 2 * 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 = use == true ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 172, 32, item.name, 0)
    self.contents.font.color = Font.default_color
    self.contents.draw_text(x + 144, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 160, y, 24, 32, number.to_s, 2)
  end

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Moshan


caspa94

January 31, 2018, 12:21:38 pm #38 Last Edit: January 31, 2018, 03:05:07 pm by KK20
Can you tell me how to fix this script? with this script i can create items where i can put for example gems to enhance the item
But if i create a enhanced item the colour of the item turns into white again
Is it possible to fix that?
heres the script
http://save-point.org/thread-2299.html

KK20

Add this below both of the scripts
Spoiler: ShowHide

module RPG
  class Item
    def full_name
      @name
    end
  end
  class Armor
    def full_name
      @name
    end
  end
  class Weapon
    def full_name
      @name
    end
  end
end

class Enhanced_Weapon < RPG::Weapon
  alias get_weapons_full_name initialize
  def initialize(ref_id)
    get_weapons_full_name(ref_id)
    @name = $data_weapons[@ref_id].full_name
  end
end

class Enhanced_Armor < RPG::Armor
  alias get_armors_full_name initialize
  def initialize(ref_id)
    get_armors_full_name(ref_id)
    @name = $data_armors[@ref_id].full_name
  end
end

class Window_Weapons < Window_Selectable 
  def draw_item(index)
    item = @data[index][0]
    x = 4
    y = index * 32

    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    if item.quality == 'gg_def'
      self.contents.font.color = GG_QualityColors::Default_Color
    else
      self.contents.font.color = GG_QualityColors::Quality[item.quality]
    end
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.font.color = Font.default_color
  end
end

class Window_Enhancements < Window_Selectable
  def draw_item(index)
    item = @data[index]
    x = 4
    y = index * 32
    case item
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    if item.quality == 'gg_def'
      self.contents.font.color = GG_QualityColors::Default_Color
    else
      self.contents.font.color = GG_QualityColors::Quality[item.quality]
    end
    self.contents.draw_text(x + 28, y, 84, 32, item.name, 0)
    self.contents.font.color = Font.default_color
    self.contents.draw_text(x + 28 + 80, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 28 + 80 + 16, y, 24, 32, number.to_s, 2)
  end
end

class Window_WeaponInfo < Window_Base
  def refresh
    self.contents.clear
    if @item!=nil
      self.contents.font.size=20
      self.contents.font.bold=true
      aw=self.width - 40
      bitmap = RPG::Cache.icon(item.icon_name)
      self.contents.blt(4, 0, bitmap, Rect.new(0, 0, 24, 24))
      # get actor
      actor_str=(@actor!=nil)?("  ["+@actor.name+"]"):("")
      if @item.quality == 'gg_def'
        self.contents.font.color = GG_QualityColors::Default_Color
      else
        self.contents.font.color = GG_QualityColors::Quality[item.quality]
      end
      self.contents.draw_text(4+32, 0, aw-32, 24, @item.name+actor_str)
      self.contents.font.color = Font.default_color
      self.contents.font.size=18
      self.contents.font.bold=false
      self.contents.draw_text(4, 24, self.width-36, 24, @item.description)
      if @item.is_a?(Enhanced_Weapon)
        self.contents.draw_text(4, 48, aw/4-4, 24, "ATK: "+@item.atk.to_s)
      else
        self.contents.draw_text(4, 48, aw/4-4, 24, "EVA: "+@item.eva.to_s)
      end
      self.contents.draw_text(4+aw/4, 48, aw/4-4, 24, "PDEF: "+@item.pdef.to_s)
      self.contents.draw_text(4+2*aw/4, 48, aw/4-4, 24, "MDEF: "+@item.mdef.to_s)
      self.contents.draw_text(4, 72, aw/4-4, 24, "STR: "+@item.str_plus.to_s)
      self.contents.draw_text(4+aw/4, 72, aw/4-4, 24, "DEX: "+@item.dex_plus.to_s)
      self.contents.draw_text(4+2*aw/4, 72, aw/4-4, 24, "AGI: "+@item.agi_plus.to_s)
      self.contents.draw_text(4+3*aw/4, 72, aw/4-4, 24, "INT: "+@item.int_plus.to_s)
    end
  end
end

class Window_EnhancementInfo < Window_Base
  def refresh
    self.contents.clear
    if @item!=nil
      self.contents.font.size=20
      self.contents.font.bold=true
      aw=self.width - 40
      bitmap = RPG::Cache.icon(item.icon_name)
      self.contents.blt(4, 0, bitmap, Rect.new(0, 0, 24, 24))
      if @item.quality == 'gg_def'
        self.contents.font.color = GG_QualityColors::Default_Color
      else
        self.contents.font.color = GG_QualityColors::Quality[item.quality]
      end
      self.contents.draw_text(4+32, 0, aw-32, 24, @item.name)
      self.contents.font.color = Font.default_color
      self.contents.font.size=18
      self.contents.font.bold=false
      self.contents.draw_text(4, 24, self.width-36, 24, @item.description)
      if @item.is_a?(RPG::Weapon)
        self.contents.draw_text(4, 48, aw/4-4, 24, "ATK " + sprintf("%+d", @item.atk)) unless @item.atk == 0
      else
        self.contents.draw_text(4, 48, aw/4-4, 24, "EVA " + sprintf("%+d", @item.eva)) unless @item.eva == 0
      end
      self.contents.draw_text(4+aw/4, 48, aw/4-4, 24, "PDEF " + sprintf("%+d", @item.pdef)) unless @item.pdef == 0
      self.contents.draw_text(4+2*aw/4, 48, aw/4-4, 24, "MDEF " + sprintf("%+d", @item.mdef)) unless @item.mdef == 0
      self.contents.draw_text(4, 72, aw/4-4, 24, "STR " + sprintf("%+d", @item.str_plus)) unless @item.str_plus == 0
      self.contents.draw_text(4+aw/4, 72, aw/4-4, 24, "DEX " + sprintf("%+d", @item.dex_plus)) unless @item.dex_plus == 0
      self.contents.draw_text(4+2*aw/4, 72, aw/4-4, 24, "AGI " + sprintf("%+d", @item.agi_plus)) unless @item.agi_plus == 0
      self.contents.draw_text(4+3*aw/4, 72, aw/4-4, 24, "INT " + sprintf("%+d", @item.int_plus)) unless @item.int_plus == 0
    end
  end

end

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!