diff --git a/Achievements.bb b/Achievements.bb index 7894d924b..9a4d3ff2f 100644 --- a/Achievements.bb +++ b/Achievements.bb @@ -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 @@ -177,5 +175,5 @@ End Function ;~IDEal Editor Parameters: -;~F#31#48 +;~F#2D#44 ;~C#Blitz3D \ No newline at end of file diff --git a/Data/achievementstrings.ini b/Data/achievementstrings.ini index 56034af37..590fe9f49 100644 --- a/Data/achievementstrings.ini +++ b/Data/achievementstrings.ini @@ -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. \ No newline at end of file diff --git a/Main.bb b/Main.bb index b5a66d703..79b06262e 100644 --- a/Main.bb +++ b/Main.bb @@ -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 OldestSupportedVersion$ = "1.3.10" Global MenuWhite%, MenuBlack% Global ButtonSFX% = LoadSound_Strict("SFX\Interact\Button.ogg") @@ -10619,6 +10619,19 @@ Function UpdateInfect() EndIf End Function +Function CompareVersions%(v1$, v2$) + ;Return -1 if v1 < v2 + ;Return 0 if v1 = v2 + ;Return 1 if v1 > v2 + If v1 = v2 Then Return 0 + While Int(v1) = Int(v2) + If Instr(v1, ".") Then v1 = Right(v1, Len(v1) - Instr(v1, ".")) Else v1 = "" + If Instr(v2, ".") Then v2 = Right(v2, Len(v2) - Instr(v2, ".")) Else v2 = "" + If v1 = "" And v2 = "" Then Return 0 + Wend + If Int(v1) > Int(v2) Then Return 1 Else Return -1 +End Function + ;--------------------------------------- math ------------------------------------------------------- Function GenerateSeedNumber(seed$) @@ -11738,7 +11751,6 @@ Function CatchErrors(location$) errF = WriteFile(ErrorFile) WriteLine errF,"An error occured in SCP - Containment Breach!" WriteLine errF,"Version: "+VersionNumber - WriteLine errF,"Save compatible version: "+CompatibleNumber WriteLine errF,"Date and time: "+CurrentDate()+" at "+CurrentTime() WriteLine errF,"Total video memory (MB): "+TotalVidMem()/1024/1024 WriteLine errF,"Available video memory (MB): "+AvailVidMem()/1024/1024 diff --git a/Menu.bb b/Menu.bb index a4f971f96..7cd311e64 100644 --- a/Menu.bb +++ b/Menu.bb @@ -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 CompareVersions(SaveGameVersion(i - 1), OldestSupportedVersion) < 0 Then Color 255,0,0 Else Color 255,255,255 @@ -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 CompareVersions(SaveGameVersion(i - 1), OldestSupportedVersion) < 0 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) @@ -512,7 +512,7 @@ Function UpdateMainMenu() EndIf Else DrawFrame(x + 280 * MenuScale, y + 20 * MenuScale, 100 * MenuScale, 30 * MenuScale) - If SaveGameVersion(i - 1) <> CompatibleNumber And SaveGameVersion(i - 1) <> "1.3.10" Then + If CompareVersions(SaveGameVersion(i - 1), OldestSupportedVersion) < 0 Then Color(255, 0, 0) Else Color(100, 100, 100) diff --git a/NPCs.bb b/NPCs.bb index d9ba6868e..bce1ccabf 100644 --- a/NPCs.bb +++ b/NPCs.bb @@ -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 diff --git a/Save.bb b/Save.bb index de5c818cf..ad5e8d2db 100644 --- a/Save.bb +++ b/Save.bb @@ -34,8 +34,7 @@ Function SaveGame(file$) WriteFloat f, EntityPitch(Collider) WriteFloat f, EntityYaw(Collider) - ;WriteString f, VersionNumber - WriteString f, CompatibleNumber + WriteString f, VersionNumber WriteFloat f, BlinkTimer WriteFloat f, BlinkEffect @@ -120,6 +119,7 @@ Function SaveGame(file$) WriteByte f, SoundTransmission WriteByte f, Contained106 + WriteByte f, MAXACHIEVEMENTS For i = 0 To MAXACHIEVEMENTS-1 WriteByte f, Achievements(i) Next @@ -505,8 +505,8 @@ Function LoadGame(file$) y = ReadFloat(f) RotateEntity(Collider, x, y, 0, 0) - strtemp = ReadString(f) - version = strtemp + version = ReadString(f) + If CompareVersions(version, OldestSupportedVersion) < 0 Then RuntimeError "Save file version not supported" BlinkTimer = ReadFloat(f) BlinkEffect = ReadFloat(f) @@ -582,9 +582,30 @@ Function LoadGame(file$) SoundTransmission = ReadByte(f) Contained106 = ReadByte(f) - For i = 0 To MAXACHIEVEMENTS-1 + If CompareVersions(version, "1.3.12") >= 0 Then + temp = ReadByte(f) + Else + temp = 37 + EndIf + For i = 0 To temp-1 Achievements(i)=ReadByte(f) Next + If CompareVersions(version, "1.3.12") < 0 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) @@ -708,7 +729,7 @@ Function LoadGame(file$) room2gw_x = ReadFloat(f) room2gw_z = ReadFloat(f) - If version = CompatibleNumber Then + If CompareVersions(version, "1.3.11") >= 0 Then I_Zone\Transition[0] = ReadByte(f) I_Zone\Transition[1] = ReadByte(f) I_Zone\HasCustomForest = ReadByte(f) @@ -1340,8 +1361,8 @@ Function LoadGameQuick(file$) y = ReadFloat(f) RotateEntity(Collider, x, y, 0, 0) - strtemp = ReadString(f) - version = strtemp + version = ReadString(f) + If CompareVersions(version, OldestSupportedVersion) < 0 Then RuntimeError "Save file version not supported" BlinkTimer = ReadFloat(f) BlinkEffect = ReadFloat(f) @@ -1417,9 +1438,30 @@ Function LoadGameQuick(file$) SoundTransmission = ReadByte(f) Contained106 = ReadByte(f) - For i = 0 To MAXACHIEVEMENTS-1 + If CompareVersions(version, "1.3.12") >= 0 Then + temp = ReadByte(f) + Else + temp = 37 + EndIf + For i = 0 To temp-1 Achievements(i)=ReadByte(f) Next + If CompareVersions(version, "1.3.12") < 0 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) @@ -1547,7 +1589,7 @@ Function LoadGameQuick(file$) room2gw_x = ReadFloat(f) room2gw_z = ReadFloat(f) - If version = CompatibleNumber Then + If CompareVersions(version, "1.3.11") >= 0 Then I_Zone\Transition[0] = ReadByte(f) I_Zone\Transition[1] = ReadByte(f) I_Zone\HasCustomForest = ReadByte(f) @@ -2043,7 +2085,7 @@ Function LoadSaveGames() Local f% = ReadFile(SavePath + SaveGames(i - 1) + "\save.txt") SaveGameTime(i - 1) = ReadString(f) SaveGameDate(i - 1) = ReadString(f) - ;Skip all data until the CompatibleVersion number + ;Skip all data until the version number ReadInt(f) For j = 0 To 5 ReadFloat(f)