Chaos Project

RPG Maker => Tutorials => Tutorial Requests => Topic started by: Azuriyuu on June 21, 2009, 07:07:08 pm

Title: [Resolved 'coz Azi's dumb]Item Database Save/Load
Post by: Azuriyuu on June 21, 2009, 07:07:08 pm
Hey, I'm asking for a tutorial for RPG Maker XP as to how to save/load an item database from a seperate file which is attached to the save file(Or even embedded in the save file).

The reasons for this would primarily to be mixed with the Item Creation System that Blizzard designed.  The uses I imagine are to allow one to do a New Game + retaining the existance of created items, be able to trade created items to another player, or to create bones files if one wanted to create a Roguelike in RPG Maker XP.

EDIT: Pay no attention, folks, move along, nothing to see here, no dead bodies behind the curtain.
Title: Re: Item Database Save/Load
Post by: Ryex on June 21, 2009, 07:10:12 pm
http://forum.chaos-project.com/index.php?topic=1430.0 (http://forum.chaos-project.com/index.php?topic=1430.0) has new game plus
Title: Re: Item Database Save/Load
Post by: Azuriyuu on June 21, 2009, 08:08:00 pm
Well, while New Game +ing is one of the reasons why I want to be able to save and load the item database, that's not the main reason.  :P

The main reason is actually so I can add additional properties to the items, particularly because in the game I'm making I don't want to work with Str, Dex, Agi, and Int(I want to change Dex to Con for defense and add in a Spirit for Magic-Defense), and I want to be able to make equips capable of adding or subtracting from the fifth actor/battler stat.

Additionally, I want to add a few more, 'hidden' properties which would have other effects.  If I could load the item portion of the database from a seperate file, then I could just type in all the items in the game into that seperate file and have it behave as if they were saved into the database.  Then the saving an item database would come from if I did both item crafting and a New Game+, or something like Golden Sun, or again, it'd be handy if I wanted to make a Roguelike style bones file.

EDIT: Also, I thought of another use; if one extended it to actors and classes, and used the RMX-OS, one could also use it as sort of a DLC-type function, allowing a creator to add bonus-characters or weapons in later if he so felt like it.  :P
Title: Re: Item Database Save/Load
Post by: G_G on June 22, 2009, 12:30:51 am
Not needed at all. All you need to do is this


module RPG
  class Item
    def hidden_stat_here
      case id
      when item_id then return stat_amount
      end
      return 0
    end
  end
end
[code]

Example
[code]
module RPG
  class Item
    def magic_defense
      case id
      when 5 then return 80
      when 8 then return 100
      end
      return 0
    end
  end
end
[code]

You can do it with weapons and armors too. Just replace Item with Armor or Weapon
[/code][/code][/code]
Title: Re: Item Database Save/Load
Post by: Azuriyuu on June 22, 2009, 12:46:53 am
That still doesn't quite have all the functionality that I'm looking for, but thank you, game_guy.  It'll be a good place to start.
Title: Re: Item Database Save/Load
Post by: G_G on June 22, 2009, 01:48:51 am
exactly what do you need then? I really dont get it.
Title: Re: Item Database Save/Load
Post by: Starrodkirby86 on June 22, 2009, 02:04:25 am
QuoteHey, I'm asking for a tutorial for RPG Maker XP as to how to save/load an item database from a seperate file which is attached to the save file(Or even embedded in the save file).


Can you elaborate on this more? It might help in the end.
Title: Re: Item Database Save/Load
Post by: Calintz on June 22, 2009, 02:08:19 am
He wants the ability to pull the Items Data(located in the projects Data folder) from a previous save file, and integrate it directly into the current gameplay.
Title: Re: Item Database Save/Load
Post by: Azuriyuu on June 22, 2009, 02:40:00 am
Exactly.  I can see that as being a very useful and multi-faceted function and I think it could be used for quite a bit.
Title: Re: Item Database Save/Load
Post by: Blizzard on June 22, 2009, 10:31:48 am
In case you didn't notice, Creation System DOES save newly created items into the savefile. -_-
Title: Re: Item Database Save/Load
Post by: Azuriyuu on June 22, 2009, 04:48:50 pm
Huh, does it, now?  Well, don't mind me, I'm just gonna put my foot in my mouth and chew on it for a while...
Title: Re: [Resolved 'coz Azi's dumb]Item Database Save/Load
Post by: Blizzard on June 23, 2009, 05:34:23 am
Lol! The script saves created stuff into variables of Game_System which gets saved in the save file. That's how it works.