Designing trouble
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...
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*
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...
s
mp
Mana Potion
Mana,+10
Adds 10 to your current amount of mana.
~
ies
ex
Elixer
Life,+20!Mana,+20
Adds 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*
0
Sign in to follow this
Followers
0
2 Comments
Recommended Comments
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now