Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Data arrays

Author
Message
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 13th Nov 2003 20:28
Can someone help me with data arrays, how would they be used in an rpg and what are they used for....?
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 13th Nov 2003 22:01
well, lets say you wanted to store a characters stats:

dim charstats$(3,1)
charstats$(1,1)="Sword"
charstats$(2,1)="Dodge"
etc.

then you can save the array and recall them

hope i helped,

Bishop

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 13th Nov 2003 22:05
Sorta, cud someone describe in more detail......plz?
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 13th Nov 2003 22:44
you really want to be looking into using User defined Types, then arraying the type. This is a good hierarchy for rpg games imho.

psuedo code

Type Player
intHitPoints as integer
intSpeed as integer
strWeapon as string
End Type

Dim Players(10) as Player

now you have 11 players all carrying the same underlying structure of hitpoint, speed, weapon. remember this is psuedo code. you make your type hold all the bits you need for a full character - this is just an example

-RUST-
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 13th Nov 2003 23:04
Think I get it.....Soz if im acting slow just new to me. Could someone give me an example of an array?
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 13th Nov 2003 23:13
above is your array Players()

so players(0).intHitPoints=whatever

but is different from

players(1).intHitPoints=whatever

each item in the array (defined by the Index value in the () )
differentiates which item you are referring to.

hope that helps. Maybe someone will give the long answer - sorry I am being a little brief - I am in the middle of a coding nightmare here (for work) and can only check in briefly here and there. If no one else helps I will come back at some point and give the full version - sorry

guys?

-RUST-
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 13th Nov 2003 23:25
thanks
can somene give me any links to explain this?
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 14th Nov 2003 20:39
help!
X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 15th Nov 2003 01:30
try this

You cant do it if you try

Login to post a reply

Server time is: 2024-09-21 09:32:05
Your offset time is: 2024-09-21 09:32:05