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,297
Reaction score
11,711
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 Posts

Latest Profile Posts

Just finished composing a boss battle theme!
Scripted a multi-variable weather system that randomizes wind speed, cloudiness, rain, fogginess, etc, while attempting to realistically account for interactions between them (e.g. wind speed affects fogginess, cloudiness affects rain, etc), the current weather pattern, and the player's biome e.g. swamp, beach, etc. Now I "just" have to tie visuals and sounds to the variables so stuff actually happens...
I'm having a headache balancing the combat using flat defense so I'm gonna use percentual armor, in this pic, Simon has 16 on Defense which means all the incoming damage will be reduced by 16% this will ease my burden a bit.
!Have a nice day everybody¡
SO glad they patched outer worlds for switch! I can finally play it! Weird that other peeps are still having issues. I know it was really chugging on my lite when it first came out.

Forum statistics

Threads
105,556
Messages
1,014,638
Members
137,236
Latest member
Crowned_gaming_youtube
Top