var/fst = 0
var/scd = 0
var/thd = 0
var/frth= 0
var/fifth=0
var/sixth=0
var/svnth=0
var/eighth=0
var/ninth=0
var/tenth=0
mob/proc/savehighscore()
var/savefile/F = new("highscore.sav") //Access the savefile
if(usr.score>fst)
usr.score = fst
usr<<"You're <b>first</b> on the high score!"
F["1st"] << fst
else if(usr.score>scd)
usr.score = scd
usr<<"You're <b>second</b> on the high score!"
F["2nd"] << scd
else if(usr.score>thd)
usr.score = thd
usr<<"You're <b>third</b> on the high score!"
F["3rd"] << thd
else if(usr.score>frth)
usr.score = frth
usr<<"You're <b>fourth</b> on the high score!"
F["4th"] << frth
else if(usr.score>fifth)
usr.score = frth
usr<<"You're <b>fifth</b> on the high score!"
F["5th"] << fifth
else if(usr.score>sixth)
usr.score = sixth
usr<<"You're <b>sixth</b> on the high score!"
F["6th"] << sixth
else if(usr.score>svnth)
usr.score = svnth
usr<<"You're <b>seventh</b> on the high score!"
F["7th"] << svnth
else if(usr.score>eighth)
usr.score = eighth
usr<<"You're <b>eighth</b> on the high score!"
F["8th"] << eighth
else if(usr.score>ninth)
usr.score = ninth
usr<<"You're <b>ninth</b> on the high score!"
F["9th"] << ninth
else if(usr.score>tenth)
usr.score = tenth
usr<<"You're <b>tenth</b> on the high score!"
F["10th"] << tenth
mob/proc/readhighscore()
var/savefile/F = new("highscore.sav") //Access the savefile
usr<<"\tHigh Scores \n "
F["1st"] >> fst
F["2nd"] >> scd
F["3rd"] >> thd
F["4th"] >> frth
F["5th"] >> fifth
F["6th"] >> sixth
F["7th"] >> svnth
F["8th"] >> eighth
F["9th"] >> ninth
F["10th"] >> tenth
ID:169198
Jul 20 2005, 11:19 am
|
|
Basically, I have no clue what to do with savefiles. I am working with an idea of trying to get scores to print to the screen, so that byond or telnet users can see them. I'm really lost though. I don't know what to do, someone please help and I'll be your best friend...sort of...
|
Jul 20 2005, 2:10 pm
|
|
Look up Raekwon's demo of scoreboards + learn about savefiles in ByondBwicki.
|
In response to DeathAwaitsU
|
|
DeathAwaitsU wrote:
Look up Raekwon's demo of scoreboards Don't. In addition to not even compiling, Raekwon's demo is almost completely uncommented. |
Please look at the following two articles (in order):
A good rule of thumb is that if you find yourself typing the same piece of code out over and over again, you probably don't have to. |
In response to Wizkidd0123
|
|
And it really wouldn't help the telnet users, which is why I want it to print in text.
|
In response to Wizkidd0123
|
|
Well, I changed a little of it...I'm still shooting in the dark after reading those things...
var/fst = 0 |
In response to Wizkidd0123
|
|
Please, explain how to save associative lists! Or what the heck I'm actually supposed to be doing! Please!
|
In response to Draxxis
|
|
Correct me if I'm wrong but shouldn't "src.score=fst" be more like "fst=src.score" if the score and fst are indeed num(s)...?
|
In response to ManDroid13
|
|
I know it's been over 3 years, but has anyone got this to work? This seems like the ideal Highscores that I want for my game. Anyone?
Any help would be greatly appreciated! -Shake |
In response to Xx mAsTa_sHaKe xX
|
|
I posted one for PHP/MySQL:
http://www.byond.com/members/ GhostAnime?command=view_post&post=46866 But a simple one can be programmed in DM... I am just too lazy to do that. |
In response to GhostAnime
|
|
Looks nice, but I don't wanna deal with a PHP mess lol, I think if I could find out the problem with this one I could use it.
|
In response to Xx mAsTa_sHaKe xX
|
|
/* Remember, untested and rather brief (skeleton) points of how it could be done. There are better methods out there though. |
In response to GhostAnime
|
|
At this point I don't care if that works... the fact that you just made it that quickly has me still trying to pick my jaw off of the floor. I will definitely test it out. Thanks (I may come back if I have problems.)
|
In response to Xx mAsTa_sHaKe xX
|
|
It wasn't difficult as you may think.
You have to take things systematically and I will show you what I did: 1) Define the variable to keep track of the high score (this should be a given). 2) Set it up so you can save/load the highscore table. 3) Program in how you want the entry to be. Three simple steps, it may look long and complex but it was rather quite simple and straight-forward. |
In response to GhostAnime
|
|
mob/proc/scoring() Definitely a lot of indentation errors thoughout it all, but I fixed all of those now all I need to know what to do where I put the arrows... it says I'm missing the left hand argument |
In response to Xx mAsTa_sHaKe xX
|
|
Ok, I'm sorry Ghost that was just stupid of me... >.<
I should've looked closer... YOU ROCK! |