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 / I need a little help on my experience, and class system.

Author
Message
wind27382
18
Years of Service
User Offline
Joined: 10th Feb 2006
Location:
Posted: 6th Jul 2008 20:24
sorry guys but I still have another question. I have made array to keep track of my players experiences. I have made another program just to test it that will open the array and inc the experiences points then save it. the problem that I am having is i want every time he gets so many experience point to move to a new level and I need to know a way to do this. so far this is what I have come up with and it's not working.


level# = playerone(0)
level2# = 500
level3# = 1000
level4# = 2000

` rem this is the part where the computer will check your experience and deside what level you r
if level# > 500 and < 1000 then level2 = level#
if level# > then 1000 and < 2000 then level3 = level#
print level#

wind
wind27382
18
Years of Service
User Offline
Joined: 10th Feb 2006
Location:
Posted: 6th Jul 2008 20:28 Edited at: 6th Jul 2008 20:31
this is the new code that I have been working on but ti is still not working

oh and if you can't tell playerone(0) is an array that saves his experience right now it about 750

rem this is the command for the class system
level# = playerone(0)


class# = 0
classA# = 1
classb# = 2
classC# = 3
classS# = 4

` rem this is the part where the computer will check your experience and deside what level you r
if level# > 500 and < 1000 then class# = classA#
if level# > then 1000 and < 2000 then class# = classb#
print class#

darkbasic usually gets stuck at the part where I added the and. it worked before where I only had it checking to see if it was greater than 500. but when I tried to add code to make sure it was less than 100 it started to have problems. I appreciate all help that u guys can give me.

wind
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 6th Jul 2008 21:46 Edited at: 6th Jul 2008 21:47
Isn't it easier to make something like this?




Now, when the variable exp# is equal or more than max_exp, max_exp is increased with itself.

So it will be something like this

100
200
400
800
1600
3200
6400
12800
etc etc

Or is this not the answer you are looking for?

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
wind27382
18
Years of Service
User Offline
Joined: 10th Feb 2006
Location:
Posted: 7th Jul 2008 00:16 Edited at: 7th Jul 2008 00:21
thanks I'll give this one a try.

wow this worked a whole lot better than whats I was thinking thanks again. for the help.

wind
nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 7th Jul 2008 00:37
No problems, Glad I can help.

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
Moe
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Sunny California
Posted: 7th Jul 2008 11:06 Edited at: 7th Jul 2008 11:24
That works great but, if you want to use specific amount of experience points, then an array works great. What you were using wasn't actually an array. An array looks like this
`dim creates an array, how mant points of data is declared by the number in the parentheses.



Or if you want a generated level experience counter...

The beauty of the second one is that there can be as many levels as you want.... eventually it gets pretty big though, level ten is 10,000 experience points. level 11 would be 12,100, 12 would be 14,400, up to 20 which would be 40,000 experience points.

parrot
sinisterstuf
17
Years of Service
User Offline
Joined: 28th Mar 2007
Location: Namibia, Southern Africa
Posted: 7th Jul 2008 22:17
If you like you can check out in the 'noobs wanted' thread we discussed this a bit and how to make arrays for levelups similar to moe's.

No, contrary to popular belief my name is not actually 'Sinister Stuff' but 'sinisterstuf', a misspelling resulting from the former having too many characters with no spaces in between

oh well
wind27382
18
Years of Service
User Offline
Joined: 10th Feb 2006
Location:
Posted: 8th Jul 2008 00:34 Edited at: 8th Jul 2008 00:34
hey thanks sinister stuff I will be checking your thread. i actually meant to check up on it sooner but forgot. I will be posting an example of what i'm working on so everyone can get a good idea. since i KEEP ASKING FOR HELP

oh an the array is actually in the code i just didn't post it.

wind

Login to post a reply

Server time is: 2024-11-25 21:32:21
Your offset time is: 2024-11-25 21:32:21