- Home /
where do i save premade objects?
in my rpg i need to use my armor class to construct a premade piece of armor. like how in the elder scrolls series they have premade armor sets(iron, steel, ebony, etc) my question is: where do i save the info required to construct those armors? is there separate files that hold info on constructing items. or would all that info be stored the armor class's constructor, ready to be constructed via some parameter like:
var steelBoots = Armor("Steel Boots");
Answer by PhilRousse · Nov 25, 2013 at 07:06 PM
It's really depend on how do you plan to organize your game. Without more information, here how I would achieve that.
Let's start by a character (Class character). He got base stats (HP, MP, ATK, DEF...). Eventually, these base stat get modified at level up. The character also got equipment that add up to these stats.
The equipment are store in an array or dictionary inside your character. Your equipment should all have the sa,e base class or implementing an interface to allow polymorphism. When these item are created, they go seek the data into an XML file containing all the stats, description, image path, model name, etc.
XML are a standardize way to store data. Here some link on the subject:
If you need more specific information, please comment.
i think i got all that, but i'm not sure what an X$$anonymous$$L file is. I can just Google that though, thanks for taking the time :)
Updated the anwser with more info on X$$anonymous$$L and Polymorphism.
Your answer
Follow this Question
Related Questions
How to access the data in a list that save any class inside 1 Answer
Adding data to a set of transforms 1 Answer
Is it possible to use a custom object in java (my WeaponObject) as a data type (like Vector3) 1 Answer
Constructing an object from prefabs 0 Answers
how to store data (Varibles) without losing them each scene? 1 Answer