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!
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
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.
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
It works!
Thanks, you're a godsend!
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).
Thank you for the fast respond!
It all works fine now 🙂
@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.