(SOLVED) Hello! How about item stats in description?

userlame

Veteran
Veteran
Joined
Nov 25, 2014
Messages
47
Reaction score
9
First Language
English
Primarily Uses
SOLVED:
Trough some further research I found this thread: 





Since the latest forum update the code's been messed up so I repaired Zarby's lovely script for anyone interested:

Code:
#by Zarby

class Window_Help < Window_Base
  def set_item(item)
    set_text(item ? item.description : "")
    if (item != nil)
      sstring = item.description
      sstring = sstring.gsub("[maxhp]", item.params[0].to_s) #Max HP
      sstring = sstring.gsub("[maxmp]", item.params[1].to_s) #Max MP
      sstring = sstring.gsub("[atk]", item.params[2].to_s) #Attack
      sstring = sstring.gsub("[def]", item.params[3].to_s) #Defense
      sstring = sstring.gsub("[matk]", item.params[4].to_s) #WOW MAGIC
      sstring = sstring.gsub("[mdef]", item.params[5].to_s) #Magic Defense
      sstring = sstring.gsub("[agi]", item.params[6].to_s) #Agility
      sstring = sstring.gsub("[luk]", item.params[7].to_s) #You'll need it
      set_text(item ? sstring : "")
    end
  end
end



For Modern Algebra's Item Icon List:

module Window_MAIIL_Help
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Set Item edited by Zarby
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def set_item(item, *args)
if item # if Item passed
text = MA_IconItemList::NAME_FORMAT.dup # Get Name Format
text.gsub!(/\\ICON/i, "\\i[#{item.icon_index}]") # Replace Icon
text.gsub!(/\\NAME/i, item.name) # Replace Name
sstring = item.description
if (!item.is_a?(RPG::Item))
sstring = sstring.gsub("[maxhp]", item.params[0].to_s) #Max HP
sstring = sstring.gsub("[maxmp]", item.params[1].to_s) #Max MP
sstring = sstring.gsub("[atk]", item.params[2].to_s) #Attack
sstring = sstring.gsub("[def]", item.params[3].to_s) #Defense
sstring = sstring.gsub("[matk]", item.params[4].to_s) #WOW MAGIC
sstring = sstring.gsub("[mdef]", item.params[5].to_s) #Magic Defense
sstring = sstring.gsub("[agi]", item.params[6].to_s) #Agility
sstring = sstring.gsub("[luk]", item.params[7].to_s) #You'll need it
end
text += sstring
if $imported[:"MA Customizable Item Menu 1.0.x"] && self.is_a?(Window_MACIM_Help) # if using Custom Item Menu
image = item.is_a?(MACIM_RPG_ItemWeaponArmor) ? item.macim_desc_image : ""
set_text(text, image) # Set Text (CIM)
else
set_text(text) # Set Text (NO CIM)
end
else # if nil Passed
set_text("") # Set Text when no item
end
end
end




////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

I'm using an instance item script for my procedurally generated dungeon crawler. If you don't know what an instance item script is; it basically makes different versions of the same item in the database so you can have varied stats for an item.

I noticed something that would be a great little addon to have whether you have instance items or items that dynamically change stats, where simply writing the stats in the description won't work. If you are playing the game and have many, let's say, scythes of the darkened elders, you might want to know which scythe of the darkened elders has the most attack before selling them so you can keep the best one. Or even if you only have one of an item, it's nice to know just how much DEF that armor gives you without having to do the math in the equip scene.

Concept: I'm imagining a simple script that lists the stats you choose  in the item description. I figured the game already has a way of knowing the item's stats since it uses them to describe the actor's stat changes in the shop and equip scene. So this idea is not far fetched, right? Regardless if it is, I don't doubt limitless scripters!




It surprised me I couldn't find any script that does this. But maybe any of you geniuses could put this together? I'd be very thankful and I think others will find use in this too. Or maybe there is a similar script that does this that I didn't find in my research?
 
Last edited by a moderator:

userlame

Veteran
Veteran
Joined
Nov 25, 2014
Messages
47
Reaction score
9
First Language
English
Primarily Uses
Sorry! Must have been a misclick when setting up my account. I primarily use Ace, not VX! This script would be for Ace!
 

Cadh20000

Veteran
Veteran
Joined
Sep 15, 2013
Messages
1,828
Reaction score
445
First Language
English
Primarily Uses
Lol, it happens. :p
At least it is straightened up now, right?
 

userlame

Veteran
Veteran
Joined
Nov 25, 2014
Messages
47
Reaction score
9
First Language
English
Primarily Uses
Haha yes! Good catch!
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
Mainly because the status window in both equip and shop scene is there to help determine which weapon gives what kind of bonuses in stats.

And that works more effectively than having to write a long description in the default help window that has its limit in space and lines.

So unless you have a script that removes that, it should already be working on your shop/equip scene in VXA.
 

userlame

Veteran
Veteran
Joined
Nov 25, 2014
Messages
47
Reaction score
9
First Language
English
Primarily Uses
Not really. I mean, it's not what I am asking for here, that doesn't solve anything. I understand why they didn't bother to implement it into the default game settings. 

Having multiple items with the same name yet different stats, the inventory becomes a confusing mess. The shop scene only gives you stat bonus info on items to buy. It isn't effective at all for these kind of things. There is no way of telling items apart just by the items themselves, and I would like that! 
 

userlame

Veteran
Veteran
Joined
Nov 25, 2014
Messages
47
Reaction score
9
First Language
English
Primarily Uses
Look! I'm maybe about to solve this but I need a little help! I could use a Modern Algebra script to insert variables in the item descriptions. However...

Granting I know the code for item stats. Which I don't, but someone does! Control Variables' Game Data section doesn't feature this but there is a script option where you'd be able to set a variable to an items stats, am I right?


What should I write?

EDIT: Figured it would only correspond to the original item, also would have to have a variable for each instance otherwise. I was so close!
 
Last edited by a moderator:

userlame

Veteran
Veteran
Joined
Nov 25, 2014
Messages
47
Reaction score
9
First Language
English
Primarily Uses
Thank you for the tip but Yanfly's Item Menu and Shop Options adds so much more than I want and is conflicting with the way I've already shaped my scenes. Also the Shop Options show two different stats, one of the original item stats and one of the current item boost, which is confusing for everyone. I'm convinced a much simpler script would solve this much smoother.
 
Last edited by a moderator:

userlame

Veteran
Veteran
Joined
Nov 25, 2014
Messages
47
Reaction score
9
First Language
English
Primarily Uses
Sooooo this is where the shop draws the parameter change when selling or buying I think!
 

Code:
  #--------------------------------------------------------------------------
  # * Draw Actor Equipment Information
  #--------------------------------------------------------------------------
  def draw_actor_equip_info(x, y, actor)
    enabled = actor.equippable?(@item)
    change_color(normal_color, enabled)
    draw_text(x, y, 112, line_height, actor.name)
    item1 = current_equipped_item(actor, @item.etype_id)
    draw_actor_param_change(x, y, actor, item1) if enabled
    draw_item_name(item1, x, y + line_height, enabled)
  end
  #--------------------------------------------------------------------------
  # * Draw Actor Parameter Change
  #--------------------------------------------------------------------------
  def draw_actor_param_change(x, y, actor, item1)
    rect = Rect.new(x, y, contents.width - 4 - x, line_height)
    change = @item.params[param_id] - (item1 ? item1.params[param_id] : 0)
    change_color(param_change_color(change))
    draw_text(rect, sprintf("%+d", change), 2)
  end
  #--------------------------------------------------------------------------
  # * Get Parameter ID Corresponding to Selected Item
  #    By default, ATK if weapon and DEF if armor.
  #--------------------------------------------------------------------------
  def param_id
    @item.is_a?(RPG::Weapon) ? 2 : 3
  end
  #--------------------------------------------------------------------------
  # * Get Current Equipment
  #    Returns the weaker equipment if there is more than one of the same type,
  #    such as with dual wield.
  #--------------------------------------------------------------------------
  def current_equipped_item(actor, etype_id)
    list = []
    actor.equip_slots.each_with_index do |slot_etype_id, i|
      list.push(actor.equips[i]) if slot_etype_id == etype_id
    end
    list.min_by {|item| item ? item.params[param_id] : 0 }
  end

Now how do we put it into an item's description? :---o
 
Last edited by a moderator:

userlame

Veteran
Veteran
Joined
Nov 25, 2014
Messages
47
Reaction score
9
First Language
English
Primarily Uses
SWEET SOLUTION, SEE OP
(how dost thou mark as solved after this forum update?)
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,074
Members
137,578
Latest member
JamesLightning
Top