'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
' X X X X X X X X X X X X X X X X X X X X X X X
'/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/
'\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
' X X X X X X X X X X X X X X X X X X X X X X X
'/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/
' High Scores
'\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
' X X X X X X X X X X X X X X X X X X X X X X X
'/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/
'\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
' X X X X X X X X X X X X X X X X X X X X X X X
' load em up
Dim hschecker:hschecker = 0
Sub Loadhs
Dim x
x = LoadValue(cGameName, "HighScore1")
If(x <> "") Then HighScore(0) = CDbl(x) Else HighScore(0) = 80000 End If
x = LoadValue(cGameName, "HighScore1Name")
If(x <> "") Then HighScoreName(0) = x Else HighScoreName(0) = "EVI" End If
x = LoadValue(cGameName, "HighScore2")
If(x <> "") then HighScore(1) = CDbl(x) Else HighScore(1) = 60000 End If
x = LoadValue(cGameName, "HighScore2Name")
If(x <> "") then HighScoreName(1) = x Else HighScoreName(1) = "EVI" End If
x = LoadValue(cGameName, "HighScore3")
If(x <> "") then HighScore(2) = CDbl(x) Else HighScore(2) = 40000 End If
x = LoadValue(cGameName, "HighScore3Name")
If(x <> "") then HighScoreName(2) = x Else HighScoreName(2) = "EVI" End If
x = LoadValue(cGameName, "HighScore4")
If(x <> "") then HighScore(3) = CDbl(x) Else HighScore(3) = 20000 End If
x = LoadValue(cGameName, "HighScore4Name")
If(x <> "") then HighScoreName(3) = x Else HighScoreName(3) = "EVI" End If
x = LoadValue(cGameName, "TotalGamesPlayed")
If(x <> "") then TotalGamesPlayed = CInt(x) Else TotalGamesPlayed = 0 End If
End Sub
Sub Savehs
SaveValue cGameName, "HighScore1", HighScore(0)
SaveValue cGameName, "HighScore1Name", HighScoreName(0)
SaveValue cGameName, "HighScore2", HighScore(1)
SaveValue cGameName, "HighScore2Name", HighScoreName(1)
SaveValue cGameName, "HighScore3", HighScore(2)
SaveValue cGameName, "HighScore3Name", HighScoreName(2)
SaveValue cGameName, "HighScore4", HighScore(3)
SaveValue cGameName, "HighScore4Name", HighScoreName(3)
SaveValue cGameName, "TotalGamesPlayed", TotalGamesPlayed
End Sub
Sub ResetHS()
SaveValue cGameName, "HighScore1", 0
SaveValue cGameName, "HighScore1Name", "EVI"
SaveValue cGameName, "HighScore2", 0
SaveValue cGameName, "HighScore2Name", "EVI"
SaveValue cGameName, "HighScore3", 0
SaveValue cGameName, "HighScore3Name", "EVI"
SaveValue cGameName, "HighScore4", 0
SaveValue cGameName, "HighScore4Name", "EVI"
Loadhs
dmdflush
DMD2 "","HIGH SCORES", "ERASED", 5000, UltraDmd_eNone , ""
playsound "SFX_Commit",1,nFxVolume
TimerDmdIntro.enabled = False
TimerDmdIntro.enabled = True
dmdintroloop
End Sub
Sub Savegp
SaveValue cGameName, "TotalGamesPlayed", TotalGamesPlayed
vpmtimer.addtimer 1000, "Loadhs'"
End Sub
' Initials
Dim hsbModeActive:hsbModeActive = False
Dim hsEnteredName
Dim hsEnteredDigits(3)
Dim hsCurrentDigit
Dim hsValidLetters
Dim hsCurrentLetter
Dim hsLetterFlash
Sub CheckHighscore()
Dim tmp,a
tmp = Score(1):a=1
If Score(2)> tmp Then tmp = Score(2):a=2
If Score(3)> tmp Then tmp = Score(3):a=3
If Score(4)> tmp Then tmp = Score(4):a=4
DMD2 "","PLAYER "+cstr(a), "GOT HIGHSCORE", 5000, UltraDmd_eNone , ""
If tmp> HighScore(1) Then 'add 1 credit for beating the highscore
AwardSpecial
End If
If tmp> HighScore(3) Then
PlaySound "PFFX_Word_YouGotAHighScore",1,nFxVolume
'vpmtimer.addtimer 2000, "PlaySound ""SFX_Speech_Initials"" '"
HighScore(3) = tmp
'enter player's name
vpmtimer.addtimer 4000, "HighScoreEntryInit() '"
Else
vpmtimer.addtimer 2000, "EndOfBallComplete '"
End If
End Sub
Sub HighScoreEntryInit()
hsbModeActive = True
hsLetterFlash = 0
hsEnteredDigits(0) = "A"
hsEnteredDigits(1) = " "
hsEnteredDigits(2) = " "
hsCurrentDigit = 0
hsValidLetters = " ABCDEFGHIJKLMNOPQRSTUVWXYZ<+-0123456789" ' < is used to delete the last letter
hsCurrentLetter = 1
DMDFlush
DMDId "hsc", "sepf-black-background.jpg", "ENTER YOUR NAME:", " ", 999999
HighScoreDisplayName()
End Sub
Sub EnterHighScoreKey(keycode)
If keycode = LeftFlipperKey Then
DOF 182, DOFPulse 'left to right
Playsound "SFX_Electra1",1,nFxVolume
hsCurrentLetter = hsCurrentLetter - 1
if(hsCurrentLetter = 0) then
hsCurrentLetter = len(hsValidLetters)
end if
HighScoreDisplayName()
End If
If keycode = RightFlipperKey Then
DOF 181, DOFPulse 'right to Left
Playsound "SFX_Faulty",1,nFxVolume
hsCurrentLetter = hsCurrentLetter + 1
if(hsCurrentLetter> len(hsValidLetters) ) then
hsCurrentLetter = 1
end if
HighScoreDisplayName()
End If
If keycode = StartGameKey OR keycode = PlungerKey Then
if(mid(hsValidLetters, hsCurrentLetter, 1) <> "<") then
playsound "SFX_Commit",1,nFxVolume
hsEnteredDigits(hsCurrentDigit) = mid(hsValidLetters, hsCurrentLetter, 1)
hsCurrentDigit = hsCurrentDigit + 1
if(hsCurrentDigit = 3) then
HighScoreCommitName()
else
HighScoreDisplayName()
end if
else
playsound "SFX_Commit"
hsEnteredDigits(hsCurrentDigit) = " "
if(hsCurrentDigit> 0) then
hsCurrentDigit = hsCurrentDigit - 1
end if
HighScoreDisplayName()
end if
end if
End Sub
Sub HighScoreDisplayName()
Dim i, TempStr
TempStr = " >"
if(hsCurrentDigit> 0) then TempStr = TempStr & hsEnteredDigits(0)
if(hsCurrentDigit> 1) then TempStr = TempStr & hsEnteredDigits(1)
if(hsCurrentDigit> 2) then TempStr = TempStr & hsEnteredDigits(2)
if(hsCurrentDigit <> 3) then
if(hsLetterFlash <> 0) then
TempStr = TempStr & "_"
else
TempStr = TempStr & mid(hsValidLetters, hsCurrentLetter, 1)
end if
end if
if(hsCurrentDigit <1) then TempStr = TempStr & hsEnteredDigits(1)
if(hsCurrentDigit <2) then TempStr = TempStr & hsEnteredDigits(2)
TempStr = TempStr & "< "
DMDMod "hsc", "ENTER YOUR NAME:", Mid(TempStr, 2, 5), 999999
End Sub
Sub HighScoreCommitName()
hsbModeActive = False
PlaySound "SFX_Commit",1,nFxVolume
hsEnteredName = hsEnteredDigits(0) & hsEnteredDigits(1) & hsEnteredDigits(2)
if(hsEnteredName = " ") then
hsEnteredName = "YOU"
end if
HighScoreName(3) = hsEnteredName
SortHighscore
savehs
DMDFlush
vpmtimer.addtimer 2000, "EndOfBallComplete '"
End Sub
Sub SortHighscore
Dim tmp, tmp2, i, j
For i = 0 to 3
For j = 0 to 2
If HighScore(j) <HighScore(j + 1) Then
tmp = HighScore(j + 1)
tmp2 = HighScoreName(j + 1)
HighScore(j + 1) = HighScore(j)
HighScoreName(j + 1) = HighScoreName(j)
HighScore(j) = tmp
HighScoreName(j) = tmp2
End If
Next
Next
End Sub
So, on this table when you get a high score, that score becomes the high score for 2nd, 3rd,4th and 5th. If you get 3rd high score and enter your initials, your initials are registered, but not the score. All 5 scores are the same (the highest one). It registers the initials for 2nd-4th correctly, just not the score. Any help here would be appreciated, I have 3 friends coming over this weekend and I told them I have Pink Floyd The Wall!!! I'd like for them to be able to post up some high scores!
Edited by spisi69, 16 February 2023 - 11:13 PM.