Display weapon parameter in item description

sapiboong

Veteran
Veteran
Joined
May 7, 2014
Messages
248
Reaction score
115
First Language
Indonesian
Primarily Uses
Hi,

I wonder if it's possible to call the weapon parameter to be displayed in the item description part by text tags? 

For example:

"A wooden sword. Increase attack by [the text tag for ATK parameter]"

The reason I want something like this is because I am using a weapon upgrade script (custom), so the weapon parameter changes when the item is upgraded (so I can't simply input "Increase attack by 100" in the item description).

I have tried out MA's text codes, but it doesn't provide for the weapon parameter (only the parameter's label).

Any help is appreciated.

Thanks! 
 

Zarby

Veteran
Veteran
Joined
Dec 16, 2012
Messages
42
Reaction score
25
First Language
French
Primarily Uses
class Window_Help < Window_Base def set_item(item) set_text(item ? item.description : "") if (item != nil) sstring = item.description #Max HP sstring = sstring.gsub("[maxhp]", item.params[0].to_s) #Max MP sstring = sstring.gsub("[maxmp]", item.params[1].to_s) #Attack sstring = sstring.gsub("[atk]", item.params[2].to_s) #Defense sstring = sstring.gsub("[def]", item.params[3].to_s) #Magic Attack sstring = sstring.gsub("[matk]", item.params[4].to_s) #Magic Defense sstring = sstring.gsub("[mdef]", item.params[5].to_s) #Agility sstring = sstring.gsub("[agi]", item.params[6].to_s) #Luck sstring = sstring.gsub("[luk]", item.params[7].to_s) set_text(item ? sstring : "") end end endsimple script that replace [atk] [def] [ect...] by the items stats
 

sapiboong

Veteran
Veteran
Joined
May 7, 2014
Messages
248
Reaction score
115
First Language
Indonesian
Primarily Uses
EDIT: I found out that the script causing the trouble is ModernAlgebra's Item Icon List. 

When I removed the script, it works! :)

Is there possibility that the two can be made compatible, though?

Still, thank you very much!

EDIT: removed MA's script.
 
Last edited by a moderator:

Zarby

Veteran
Veteran
Joined
Dec 16, 2012
Messages
42
Reaction score
25
First Language
French
Primarily Uses
module Window_MAIIL_Help #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Set Item #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 #Max HP sstring = sstring.gsub("[maxhp]", item.params[0].to_s) #Max MP sstring = sstring.gsub("[maxmp]", item.params[1].to_s) #Attack sstring = sstring.gsub("[atk]", item.params[2].to_s) #Defense sstring = sstring.gsub("[def]", item.params[3].to_s) #Magic Attack sstring = sstring.gsub("[matk]", item.params[4].to_s) #Magic Defense sstring = sstring.gsub("[mdef]", item.params[5].to_s) #Agility sstring = sstring.gsub("[agi]", item.params[6].to_s) #Luck sstring = sstring.gsub("[luk]", item.params[7].to_s) text += sstring # Add Description 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 endendtry this one it should work with ModernAlgebra script
 

sapiboong

Veteran
Veteran
Joined
May 7, 2014
Messages
248
Reaction score
115
First Language
Indonesian
Primarily Uses
It works!

Thanks, you're a godsend! 
 

sapiboong

Veteran
Veteran
Joined
May 7, 2014
Messages
248
Reaction score
115
First Language
Indonesian
Primarily Uses
Sorry for the bother, but there's error when there is consume-able item (not weapon and armor) in inventory (even though I'm not using any tags in its description).

Line13: NoMethodError occurred. 

I guess it's because I remove categories of inventory, so they are all in 1 category (using Luna Engine). 
 

Zarby

Veteran
Veteran
Joined
Dec 16, 2012
Messages
42
Reaction score
25
First Language
French
Primarily Uses
oops sorry i removed items, they have no stats my bad sorry

 

Code:
module Window_MAIIL_Help  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  # * Set Item  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  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))        #Max HP        sstring = sstring.gsub("[maxhp]", item.params[0].to_s)        #Max MP        sstring = sstring.gsub("[maxmp]", item.params[1].to_s)        #Attack        sstring = sstring.gsub("[atk]", item.params[2].to_s)        #Defense        sstring = sstring.gsub("[def]", item.params[3].to_s)        #Magic Attack        sstring = sstring.gsub("[matk]", item.params[4].to_s)        #Magic Defense        sstring = sstring.gsub("[mdef]", item.params[5].to_s)        #Agility        sstring = sstring.gsub("[agi]", item.params[6].to_s)        #Luck        sstring = sstring.gsub("[luk]", item.params[7].to_s)      end      text += sstring                    # Add Description      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  endend
 

sapiboong

Veteran
Veteran
Joined
May 7, 2014
Messages
248
Reaction score
115
First Language
Indonesian
Primarily Uses
Thank you for the fast respond!

It all works fine now :)
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@spibong

Please edit your posts to reflect the following:

If you post large scripts, please put them in spoilers.  However, most scripters ask that people do not post their scripts all over the internet, but provide a link back to the source for them.  I think that Modern Algebra is one such scripter.

Thank you.
 

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

Latest Threads

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top