(Request)(XP) Change Equipment/Item Name

Started by The Dude, September 10, 2013, 10:51:22 pm

Previous topic - Next topic

The Dude

I was wondering if there is a way to input a name for equipment (Example: After forging a sword you can name the sword).

If anyone can help, I would be increasingly grateful :D


Spoiler: ShowHide
class Game_System
  def rename_weapon(weapon_id, name)
    $data_weapons[weapon_id].name = name
    File.open('Data/Weapons.rxdata', 'wb') {|f| Marshal.dump($data_weapons, f)}
  def rename_armor(armor_id, name)
    $data_armors[armor_id].name = name
    File.open('Data/Armors.rxdata', 'wb') {|f| Marshal.dump($data_armors, f)}
  def rename_item(item_id, name)
    $data_items[item_id].name = name
    File.open('Data/Items.rxdata', 'wb') {|f| Marshal.dump($data_items, f)}

Use the following script calls:
$game_system.rename_weapon(WEAPON_ID, NAME)
$game_system.rename_armor(ARMOR_ID, NAME)
$game_system.rename_item(ITEM_ID, NAME)

The changes will not show in the editor right away if the project is open in it, the project will need reloaded afterwards for it to take effect, but this only matters when testing the game.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

The Dude

Thanks, man. This should work out nicely with my Custom Blacksmith System :3


However, this isn't going to work well with an encrypted game, am I right? Wouldn't it be better to store it into Game_System where it's saved on a Save file basis rather than a global basis?