• entries
122
121
• views
68928

Designing trouble

104 views

Well.. I've hit a wall in my coding. I need some easy-to-use way of maintaining player item inventory, equipment, and store lists (rather, maps), but I don't want the user to have to create and maintain three separate files. I'm thinking of having one master file with all the information about an item in it, but then comes two other problems: it'll likely be somewhat unweildy to parse, and I'll have to put the data into each component's map, which might be difficult considering each component is withing its own class, and depending on the needs of the user, it might be there and it might not.

I'm thinking of making it so you HAVE to create an object of type cArena to have everything work, which would allow me to make every other component call a cArena object function, which would switch a bool value to "true", which would cause the cArena file parser to know which components can be loaded...

Well. I guess writing in this journal has helpful side-effects, huh? :P

EDIT: As a last remark, this means I'll need to think up a format the user will use for the "master item file". This is what I'm currently thinking of...

smpMana PotionMana,+10Adds 10 to your current amount of mana.~iesexElixerLife,+20!Mana,+20Adds 20 to your current amount of life.

The first line is a flag that determines which component recieves the info (in this case, the store only). The second is the key used for maps. The third line is the name of the item (duh?), and the fourth shows which player attributes are affected when the item is used (in this case, Mana for 10 points). The fifth line is a description of the item. Between item descriptions is a ~ thing to tell the parser that it's moving on to a new item. The only major differences in the second description are that it has two effects: Life +20 and Mana +20, using the ! to let the parser know it's got another attribute on its hands; and there's three flags set for the item: i (inventory), e (equipped), and s (in the store).

How I'm going to accomplish this is beyond me. I'll sleep on it. *sigh*

Ideally you write parser and serializer objects. Then you provide a client Tool so they don't have to edit files by hand. :) Although this is a start.

The tool will probably come later (if it comes at all, hehe). My primary goal is just to get it working (green on the list). then I'll be doing the polishing, optimising, making things easier on the user, etc. (not that I'm not actively making things easier as it is)

Create an account

Register a new account