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 / Storing rpg player stats....

Author
Message
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 14th Nov 2003 21:17
How would I write an array thats keeps my players data like....
player 1:
hp=5
mp=5
speed=5

so then...
player battles gains exp levels up
so then I can add more data onto each variable so 5 becomes 2.
and its stored...get me?
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 14th Nov 2003 21:59
write an array:

dim charstats(1,4)

let (1,1) be hp, (1,2) be mp, (1,3) be speed, and (1,4) be xp

so then write:
charstats(1,1)=5
charstats(1,2)=5
charstats(1,3)=5
charstats(1,4)=500

then when you want to change one, just write it different:

charstats(1,4)=600
etc.

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 14th Nov 2003 22:59
read "data arrays" thread in this forum, it discusses using Types to do what you are trying to do. Types are way more readable IMHO

-RUST-
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 15th Nov 2003 06:07
If you have DBP, Types should be your friend


Dont forget to Join the Forums!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 15th Nov 2003 07:03
you can actually use types in DBC 1.13 using DarkEdit
(blast from the past)

-RUST-
Artos
21
Years of Service
User Offline
Joined: 10th Nov 2003
Location:
Posted: 15th Nov 2003 12:05
Where do you guys come up with this stuff? I don't know any of this and I want to make an RPG
Guyon
21
Years of Service
User Offline
Joined: 6th Jun 2003
Location: United States
Posted: 15th Nov 2003 13:50
Types are definitly the way to go.

TYPE AccountEntryType
Name AS STRING
Number AS INTEGER
Amount AS FLOAT
ENDTYPE

But what is the best way to save it to disk so you can continue play later?
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 15th Nov 2003 17:34
if your using types the best way is to save it all into a text file, using the 'open to write' and 'write string' functions.


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!

Login to post a reply

Server time is: 2024-11-25 17:24:00
Your offset time is: 2024-11-25 17:24:00