123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|608|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Blitz Arrays with Strings

Thu, 20 Aug 2009, 04:08
LostUser
I am wanting to create a "char" type to hold all the characters in a RPG game, including players of the game. But I am not sure if I am doing it right.

I am wanting to use rpg_skills[] to hold all fields as each char would potentially have different skills relevant to each character.

I am stuck on 4 things:

Q1. How do I output the elements of the rpg_skills[] array?

Q2. How do I get the ultimate parent character?

Q3. I need some kind of reference to each player of the game, to handle multi-player (both human/cpu), I need some kind of reference of who (human/cpu) owns what character, etc.

Q4. How do I create an inventory system that is restricted only to the players of the game?

This is a quick dump of my RPG character type, but I still need a reference to the actual players of the game, and how do I grab the skills field such as "business", "cunning", etc?






Thu, 20 Aug 2009, 04:36
Jayenkai
The value of "business" = 0
The value of "shooting" = 0
The value of "health" = 0

Instead, use Constants, not strings.




-=-=-
''Load, Next List!''
Thu, 20 Aug 2009, 11:34
LostUser
Oh, I was hoping that I could use strings, so I could have fields within an array, sorta making it a bit easier to reference things later on.

I will use your idea of constants to reference the array index.

Thanks for your help.
Sun, 06 Sep 2009, 07:50
Teasy
Q2
Repeat checking the parent until it is empty.



I can't answer questions 3 and 4 because I can think of too many options for them without knowing exactly what you want.

Thu, 24 Sep 2009, 02:45
LostUser
Its okay now, I've decided to just keep them as fixed variables.

The original idea was to have a facility where I can add fields and variables and make it more liquid of a design/development process.