The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: djkdjl on October 02, 2007, 11:40:06 PM

Title: [RESOLVED] EQUIP screen feat. 2 Handed Weapon Script AND Attributes
Post by: djkdjl on October 02, 2007, 11:40:06 PM
Apparently XP doesn't have an easy way to make weapons 2handed (2000 did)

I came accross a nice 2 handed weapon script a while ago.  It works fine [it uses weapon elements to idenfity a weapon as 2 handed,,which was a brilliant idea I thought].  Obviously when a 2 handed weapon is equipped,,the shield should be unequipped automatically.  This script worked very well,,and I can post it if needed.

The problem however is,,that the Equip screen for that script looks default,,where as I would like the Equip screen to display all the attributes: Strength,,Dexterity,,Agility,,etc

Is there someone dedicated enough to make two scripts that coincide with each other (one to give weapons a 2handed property,,and the other to make the Equip Screen contain all the attributes)

I would be forever greatful,,thx.
Title: Re: [REQUEST] EQUIP screen feat. 2 Handed Weapon Script AND Attributes
Post by: tSwitch on October 02, 2007, 11:58:24 PM
oh, I wrote this up once, hld on I'll copy paste it for ya


#===============================================================================
# NAMKCOR's Requested 2-Member-CMS v2.00 [equip screen only]
#-------------------------------------------------------------------------------
# Features:
# > Upgraded Equip Menu
#   -- Shows all stats and single column equip item
#-------------------------------------------------------------------------------
# Compatability:
#   Most likely incompatable with other CMSes
#   Most likely SDK compatable
#   -No Known Incompatability Issues-
#-------------------------------------------------------------------------------
# Versions History:
#   1.00 - Finished all features, most likely bug free
#-------------------------------------------------------------------------------
# Bugs and Incompatability:
#  If you find bugs or incompatability issues with this script, contact me and
#  I will do what I can to make it compatable/fix whatever bugs you find
#-------------------------------------------------------------------------------
# Contact Info:
#   RMRK - NAMKCOR
#   ChaosProject - NAMKCOR
#   E-Mail - Rockman922@aol.com -or- rockmanamkcor@yahoo.com
#-------------------------------------------------------------------------------
# This menu is only to be posted on RPG Maker Resource Kit and Chaos Project
#(rmrk.net, chaosproject.co.nr)
# if this script is posted on any site other than the ones mentioned above
# it is stolen and I would like to be contacted immediately
#===============================================================================

#===============================================================
#DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING!
#===============================================================
#-------------------------------------------------------------------------------
# Scene_Equip: Has : Equip Left/Item, Scene_Equip
#-------------------------------------------------------------------------------
class Window_EquipLeft < Window_Base
  def initialize(actor)
    super(0, 64, 272, 328)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    @actor = actor
    refresh
  end
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, 0)
    draw_actor_level(@actor, 160, 0)
    draw_actor_hp(@actor, 4, 49)
    draw_actor_sp(@actor, 4, 74)
    draw_actor_graphic(@actor, 185, 110)
    draw_actor_parameter(@actor, 4, 128, 0)
    draw_actor_parameter(@actor, 4, 148, 1)
    draw_actor_parameter(@actor, 4, 168, 2)
    draw_actor_parameter(@actor, 4, 188, 3)
    draw_actor_parameter(@actor, 4, 208, 4)
    draw_actor_parameter(@actor, 4, 228, 5)
    draw_actor_parameter(@actor, 4, 248, 6)
    if @new_atk != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 128, 40, 32, " ---", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 128, 36, 32, @new_atk.to_s, 2)
    end
    if @new_pdef != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 148, 40, 32, " ---", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 148, 36, 32, @new_pdef.to_s, 2)
    end
    if @new_mdef != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 168, 40, 32, " ---", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 168, 36, 32, @new_mdef.to_s, 2)
    end
    if @new_str != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 188, 40, 32, " ---", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 188, 36, 32, @new_str.to_s, 2)
    end
    if @new_dex != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 208, 40, 32, " ---", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 208, 36, 32, @new_dex.to_s, 2)
    end
    if @new_agi != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 228, 40, 32, " ---", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 228, 36, 32, @new_agi.to_s, 2)
    end
    if @new_int != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 248, 40, 32, " ---", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 248, 36, 32, @new_int.to_s, 2)
    end
  end
  def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex,
    new_agi, new_int)
    if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or
      @new_str != new_str or @new_dex != new_dex or @new_agi != new_agi or
      @new_int != new_int
      @new_atk = new_atk
      @new_pdef = new_pdef
      @new_mdef = new_mdef
      @new_str = new_str
      @new_dex = new_dex
      @new_agi = new_agi
      @new_int = new_int
      refresh
    end
  end
end

class Window_EquipItem < Window_Selectable
  def initialize(actor, equip_type)
    super(272, 256, 368, 224)
    @actor = actor
    @equip_type = equip_type
    @column_max = 1
    refresh
    self.active = false
    self.index = -1
  end
  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))
    self.contents.font.color = normal_color
    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, 24, 32, number.to_s, 2)
  end
end

class Scene_Equip
  def refresh
    @item_window1.visible = (@right_window.index == 0)
    @item_window2.visible = (@right_window.index == 1)
    @item_window3.visible = (@right_window.index == 2)
    @item_window4.visible = (@right_window.index == 3)
    @item_window5.visible = (@right_window.index == 4)
    item1 = @right_window.item
    case @right_window.index
    when 0
      @item_window = @item_window1
    when 1
      @item_window = @item_window2
    when 2
      @item_window = @item_window3
    when 3
      @item_window = @item_window4
    when 4
      @item_window = @item_window5
    end
    if @right_window.active
      @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil)
    end
    if @item_window.active
      item2 = @item_window.item
      last_hp = @actor.hp
      last_sp = @actor.sp
      @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
      new_atk = @actor.atk
      new_pdef = @actor.pdef
      new_mdef = @actor.mdef
      new_str = @actor.str
      new_dex = @actor.dex
      new_agi = @actor.agi
      new_int = @actor.int
      @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
      @actor.hp = last_hp
      @actor.sp = last_sp
      @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str,
                                      new_dex, new_agi, new_int)
    end
  end
end


I didn't bother with aliases or the like, all it does is modify how the stats are shown
it should be compatible
if it's not, lemme know and I'll refine it
(all I really did was copy-paste and modify from there)
Title: Re: [REQUEST] EQUIP screen feat. 2 Handed Weapon Script AND Attributes
Post by: djkdjl on October 03, 2007, 03:06:04 AM
woohooo,,thx NAMKCOR!

It is ALMOST working.  The only problem is:

[spoiler](https://rmrk.net/proxy.php?request=http%3A%2F%2Fi243.photobucket.com%2Falbums%2Fff118%2Fdjkdjl%2FRPGMakerXP-NewStatsvsOldStats.jpg&hash=8112faf753654f9fe1e5b9e39fe6180596149c25)[/spoiler]

as you can see new_stats are not updated
Title: Re: [REQUEST] EQUIP screen feat. 2 Handed Weapon Script AND Attributes
Post by: tSwitch on October 03, 2007, 03:43:44 AM
I don't have that problem, can you send me your scripts.rxdata so I can take a look?
Title: Re: [REQUEST] EQUIP screen feat. 2 Handed Weapon Script AND Attributes
Post by: djkdjl on October 03, 2007, 03:57:01 AM
Here is the link to Script.rxdata:

http://www.mediafire.com/?6p1zz1xd0cn

Sorry for mediafire,,but I couldn't attach it here,,file type not allowed.  It looks quite a mess in notepad....
Title: Re: [REQUEST] EQUIP screen feat. 2 Handed Weapon Script AND Attributes
Post by: tSwitch on October 03, 2007, 04:55:27 AM
I know exactly what's wrong
you replaced Scene_EquipLeft with my script right?

here's the thing, you have another custom menu system, so aspects of mine are being overwritten with theirs, here's a .zip with a fixed version
Title: Re: [RESOLVED] EQUIP screen feat. 2 Handed Weapon Script AND Attributes
Post by: djkdjl on October 03, 2007, 05:59:16 AM
OMIGOD!!! It's working!!!!  You are awesome NAMKCOR.  I shall make sure to keep bothering you from now on if I have a scripting problem.

LoL jk.

Thx a million.

This topic has been RESOLVED
Title: Re: [RESOLVED] EQUIP screen feat. 2 Handed Weapon Script AND Attributes
Post by: tSwitch on October 03, 2007, 06:10:56 AM
no problems
just make sure you send me a shout so I can see whatever game my work is in k?
Title: Re: [RESOLVED] EQUIP screen feat. 2 Handed Weapon Script AND Attributes
Post by: djkdjl on October 03, 2007, 05:38:15 PM
absolutely,,u'll be in the credits if I ever complete a demo for my game