Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reintroduce achievement changes (using vanilla save compatibility system) #258

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions Achievements.bb
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
;achievement menu & messages by InnocentSam

Const MAXACHIEVEMENTS=37
Const MAXACHIEVEMENTS=38
Dim Achievements%(MAXACHIEVEMENTS)

Const Achv008%=0, Achv012%=1, Achv035%=2, Achv049%=3, Achv055=4, Achv079%=5, Achv096%=6, Achv106%=7, Achv148%=8, Achv205=9
Const Achv294%=10, Achv372%=11, Achv420%=12, Achv427=13, Achv500%=14, Achv513%=15, Achv714%=16, Achv789%=17, Achv860%=18, Achv895%=19
Const Achv914%=20, Achv939%=21, Achv966%=22, Achv970=23, Achv1025%=24, Achv1048=25, Achv1123=26
Const Achv008%=0, Achv012%=1, Achv035%=2, Achv049%=3, Achv055%=4, Achv066%=5, Achv079%=6, Achv096%=7, Achv106%=8, Achv148%=9
Const Achv205%=10, Achv294%=11, Achv372%=12, Achv420%=13, Achv427%=14, Achv500%=15, Achv513%=16, Achv714%=17, Achv789%=18, Achv860%=19
Const Achv895%=20, Achv914%=21, Achv939%=22, Achv966%=23, Achv970%=24, Achv1025%=25, Achv1048%=26, Achv1123%=27, Achv1162%=28, Achv1499%=29

Const AchvMaynard%=27, AchvHarp%=28, AchvSNAV%=29, AchvOmni%=30, AchvConsole%=31, AchvTesla%=32, AchvPD%=33
Const AchvMaynard%=30, AchvHarp%=31, AchvSNAV%=32, AchvOmni%=33, AchvTesla%=34, AchvPD%=35

Const Achv1162% = 34, Achv1499% = 35

Const AchvKeter% = 36
Const AchvConsole%=36, AchvKeter%=37

Global UsedConsole

Expand Down Expand Up @@ -177,5 +175,5 @@ End Function


;~IDEal Editor Parameters:
;~F#31#48
;~F#2D#44
;~C#Blitz3D
99 changes: 52 additions & 47 deletions Data/achievementstrings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,169 +16,174 @@ AchvDesc=Encountered the Possessive Mask.
[s3]
string1=Doctor, Doctor
image=Achv049
AchvDesc=Found the cure
AchvDesc=Found the cure.

[s4]
string1=Anti-Meme
image=Achv055
AchvDesc=Recontained SCP-055
AchvDesc=Recontained SCP-055.

[s5]
string1="Eric?"
image=Achv066
AchvDesc=Encountered Eric's Toy.

[s6]
string1=Deductive Reasoning
image=Achv079
AchvDesc=Encountered the Old AI.

[s6]
string1=Don't Look At Me
[s7]
string1=Don't Look at Me
image=Achv096
AchvDesc=Encountered the Shy Guy.

[s7]
[s8]
string1=A Decayed March
image=Achv106
AchvDesc=Encountered the Old Man.

[s8]
[s9]
string1=Dirty Metal
image=Achv148
AchvDesc=Acquired the "Telekill Alloy".

[s9]
[s10]
string1=Femme Fatale
image=Achv205
AchvDesc=Encountered the Shadow Lamps.

[s10]
[s11]
string1=OUT OF RANGE
image=Achv294
AchvDesc=Obtained a liquid from the Coffee Machine.

[s11]
[s12]
string1=The Corner of Your Eye...
image=Achv372
AchvDesc=Encountered the Peripheral Jumper.

[s12]
[s13]
string1="Reggae, man."
image=Achv420
AchvDesc=Smoked some good ass shit.

[s13]
[s14]
string1=Light of Life
image=Achv427
AchvDesc=Found and equipped the "Lovecraftian Locket".

[s14]
[s15]
string1=A Taste of Immortality
image=Achv500
AchvDesc=Swallowed a sample of Panacea.

[s15]
[s16]
string1=If You Ring It, He Will Come
image=Achv513
AchvDesc=Encountered an Old Cowbell.

[s16]
[s17]
string1=Mental Exhaustion
image=Achv714
AchvDesc=Found a Jaded Ring.

[s17]
[s18]
string1="by researcher james, age 11"
image=Achv789
AchvDesc=Encountered the Butt Ghost.

[s18]
[s19]
string1=Blue Hue
image=Achv860
AchvDesc=Found a Blue Key.

[s19]
[s20]
string1=Interference
image=Achv895
AchvDesc=Encountered an Old Coffin.

[s20]
[s21]
string1=Refinery
image=Achv914
AchvDesc=Encountered the Clockworks Machine.

[s21]
[s22]
string1=Show Yourself
image=Achv939
AchvDesc=Encountered the Creatures with Many Voices.

[s22]
[s23]
string1=Rapid Eye Movement
image=Achv966
AchvDesc=Encountered the Sleep Killers.

[s23]
[s24]
string1=Recursive Spacial Phenomenon
image=Achv970
AchvDesc=Encountered a Recursive Room.

[s24]
[s25]
string1="Potential Bioweapon"
image=Achv1025
AchvDesc=Read the Encyclopedia of Common Diseases.

[s25]
[s26]
string1=The Architect
image=Achv1048
AchvDesc=Encountered the Builder Bear.

[s26]
[s27]
string1=The Final Solution
image=Achv1123
AchvDesc=Encountered the Atrocity Skull.

[s27]
[s28]
string1=Pieces of the Past
image=Achv1162
AchvDesc=Encountered the Hole In The Wall.

[s29]
string1=Screams Of The Present
image=Achv1499
AchvDesc=Wore a GP-5 Gas Mask.

[s30]
string1=The Containment Breach
image=AchvMaynard
AchvDesc=Entered Doctor Maynard's office.

[s28]
[s31]
string1=World-Ending Scenario
image=AchvHarp
AchvDesc=Entered Doctor Harp's office.

[s29]
[s32]
string1=Technical Accomplishments
image=AchvSNAV
AchvDesc=Acquired the S-NAV Navigator Ultimate.

[s30]
[s33]
string1=Unlimited Access
image=AchvOmni
AchvDesc=Acquired an Omni-level Keycard.

[s31]
string1=Fair Play
image=AchvConsole
AchvDesc=Didn't use console commands.

[s32]
[s34]
string1=Shell Shocked
image=AchvTesla
AchvDesc=Lured the Old Man through a Tesla gate.

[s33]
[s35]
string1=No Man's Land
image=AchvPD
AchvDesc=Escaped the Old Man's Pocket Dimension.

[s34]
string1=Pieces of the Past
image=Achv1162
AchvDesc=Encountered the Hole In The Wall.

[s35]
string1=Screams Of The Present
image=Achv1499
AchvDesc=Wore a GP-5 Gas Mask.

[s36]
string1=Survival In a Nightmare
string1=Fair Play
image=AchvConsole
AchvDesc=Didn't use console commands.

[s37]
string1=Survival in a Nightmare
image=AchvKeter
AchvDesc=Beat the game on Keter difficulty.
AchvDesc=Beat the game on Keter difficulty.
4 changes: 2 additions & 2 deletions Main.bb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Global UpdaterFont%
Global Font1%, Font2%, Font3%, Font4%, Font5%
Global ConsoleFont%

Global VersionNumber$ = "1.3.11"
Global CompatibleNumber$ = "1.3.11" ;Only change this if the version given isn't working with the current build version - ENDSHN
Global VersionNumber$ = "1.3.12"
Global CompatibleNumber$ = "1.3.12" ;Only change this if the version given isn't working with the current build version - ENDSHN

Global MenuWhite%, MenuBlack%
Global ButtonSFX% = LoadSound_Strict("SFX\Interact\Button.ogg")
Expand Down
4 changes: 2 additions & 2 deletions Menu.bb
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ Function UpdateMainMenu()
If i <= SaveGameAmount Then
DrawFrame(x,y,540* MenuScale, 70* MenuScale)

If SaveGameVersion(i - 1) <> CompatibleNumber And SaveGameVersion(i - 1) <> "1.3.10" Then
If SaveGameVersion(i - 1) <> CompatibleNumber And SaveGameVersion(i - 1) <> "1.3.11" And SaveGameVersion(i - 1) <> "1.3.10" Then
Color 255,0,0
Else
Color 255,255,255
Expand All @@ -490,7 +490,7 @@ Function UpdateMainMenu()
AAText(x + 20 * MenuScale, y + (10+36) * MenuScale, SaveGameVersion(i - 1))

If SaveMSG = "" Then
If SaveGameVersion(i - 1) <> CompatibleNumber And SaveGameVersion(i - 1) <> "1.3.10" Then
If SaveGameVersion(i - 1) <> CompatibleNumber And SaveGameVersion(i - 1) <> "1.3.11" And SaveGameVersion(i - 1) <> "1.3.10" Then
DrawFrame(x + 280 * MenuScale, y + 20 * MenuScale, 100 * MenuScale, 30 * MenuScale)
Color(255, 0, 0)
AAText(x + 330 * MenuScale, y + 34 * MenuScale, "Load", True, True)
Expand Down
1 change: 1 addition & 0 deletions NPCs.bb
Original file line number Diff line number Diff line change
Expand Up @@ -3920,6 +3920,7 @@ Function UpdateNPCs()
If Rand(700)=1 Then PlaySound2(LoadTempSound("SFX\SCP\066\Eric"+Rand(1,3)+".ogg"),Camera, n\Collider, 8.0)

If dist < 1.0+n\LastDist Then
GiveAchievement(Achv066)
n\State = Rand(2,3)
EndIf
Case 2 ;roll towards the player and make a sound, and then escape
Expand Down
51 changes: 47 additions & 4 deletions Save.bb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Function SaveGame(file$)
WriteByte f, SoundTransmission
WriteByte f, Contained106

WriteByte f, MAXACHIEVEMENTS
For i = 0 To MAXACHIEVEMENTS-1
WriteByte f, Achievements(i)
Next
Expand Down Expand Up @@ -582,9 +583,30 @@ Function LoadGame(file$)
SoundTransmission = ReadByte(f)
Contained106 = ReadByte(f)

For i = 0 To MAXACHIEVEMENTS-1
If version = CompatibleNumber Then
temp = ReadByte(f)
Else
temp = 37
EndIf
For i = 0 To temp-1
Achievements(i)=ReadByte(f)
Next
If version <> CompatibleNumber Then
Achievements(37)=Achievements(36)
Achievements(36)=Achievements(31)
Achievements(31)=Achievements(28)
Achievements(28)=Achievements(34)
Achievements(34)=Achievements(32)
Achievements(32)=Achievements(29)
Achievements(29)=Achievements(35)
Achievements(35)=Achievements(33)
Achievements(33)=Achievements(30)
Achievements(30)=Achievements(27)
For i = 27 To 6 Step -1
Achievements(i)=Achievements(i-1)
Next
Achievements(5)=False
EndIf
RefinedItems = ReadInt(f)

MapWidth = ReadInt(f)
Expand Down Expand Up @@ -708,7 +730,7 @@ Function LoadGame(file$)
room2gw_x = ReadFloat(f)
room2gw_z = ReadFloat(f)

If version = CompatibleNumber Then
If version = CompatibleNumber Or version = "1.3.11" Then
I_Zone\Transition[0] = ReadByte(f)
I_Zone\Transition[1] = ReadByte(f)
I_Zone\HasCustomForest = ReadByte(f)
Expand Down Expand Up @@ -1417,9 +1439,30 @@ Function LoadGameQuick(file$)
SoundTransmission = ReadByte(f)
Contained106 = ReadByte(f)

For i = 0 To MAXACHIEVEMENTS-1
If version = CompatibleNumber Then
temp = ReadByte(f)
Else
temp = 37
EndIf
For i = 0 To temp-1
Achievements(i)=ReadByte(f)
Next
If version <> CompatibleNumber Then
Achievements(37)=Achievements(36)
Achievements(36)=Achievements(31)
Achievements(31)=Achievements(28)
Achievements(28)=Achievements(34)
Achievements(34)=Achievements(32)
Achievements(32)=Achievements(29)
Achievements(29)=Achievements(35)
Achievements(35)=Achievements(33)
Achievements(33)=Achievements(30)
Achievements(30)=Achievements(27)
For i = 27 To 6 Step -1
Achievements(i)=Achievements(i-1)
Next
Achievements(5)=False
EndIf
RefinedItems = ReadInt(f)

MapWidth = ReadInt(f)
Expand Down Expand Up @@ -1547,7 +1590,7 @@ Function LoadGameQuick(file$)
room2gw_x = ReadFloat(f)
room2gw_z = ReadFloat(f)

If version = CompatibleNumber Then
If version = CompatibleNumber Or version = "1.3.11" Then
I_Zone\Transition[0] = ReadByte(f)
I_Zone\Transition[1] = ReadByte(f)
I_Zone\HasCustomForest = ReadByte(f)
Expand Down