-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathGame.bb
176 lines (143 loc) · 6.41 KB
/
Game.bb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
;SCP - Nine Tailed Fox Mod
;
; This is a modification of the game "SCP - Containment Breach"
;
; Version 0.2.0 and onwards are stand-alone versions of the game, which means that all the assets from the original game are
; included within this mod, unless these assets have been removed as they are unused.
;
; This mod is developed by the "Third Subdivision Studios"
; http://www.thirdsubdivision.com
;
; The mod uses the same license as SCP: Containment Breach (as this is a modification of the game).
;
;This is the main file of the NTF mod, you need to compile this file in order to be able to play the game.
Const NameOfTheGame$ = "SCP: Nine-Tailed Fox"
Const VersionNumber$ = "0.2.11"
Const CompatibleNumber$ = "0.2.10"
Const BuildMessage$ = ""
Const AppTitleMain$ = NameOfTheGame+" v"+VersionNumber
Const AppTitleLauncher$ = NameOfTheGame+" Launcher"
Const UserAgent$ = "SCPNTF"
Include "SourceCode/Key.bb"
Include "SourceCode/SteamConstants.bb"
Type GlobalVariables
Field OptionFile$
Field OSBit%
Field RichPresenceTimer#
Field SteamIDUpper%
Field SteamIDLower%
End Type
Type Options
Field GraphicWidth%
Field GraphicHeight%
Field LauncherEnabled%
Field ShowFPS%
Field TotalGFXModes%
Field DisplayMode%
Field EnableRoomLights%
Field TextureDetails%
Field TextureFiltering%
Field ConsoleOpening%
Field SFXVolume#
Field MusicVol#
Field MasterVol#
Field VoiceVol#
Field EnableSFXRelease%
Field EnableSFXRelease_Prev%
Field ConsoleEnabled%
Field RenderCubeMapMode%
Field MouseSmooth#
Field HoldToAim%
Field HoldToCrouch%
Field ShowDisclaimers%
Field GraphicDriver%
End Type
Const GAMEMODE_UNKNOWN% = -1
Const GAMEMODE_DEFAULT% = 0
Const GAMEMODE_CLASSIC% = 1
Const GAMEMODE_MULTIPLAYER% = 2
Type GameOptions
Field SingleplayerGameMode%
Field GameMode%
End Type
;Include the controls file
Include "SourceCode\Controls.bb"
;Include the global type instance accessors
Include "SourceCode\TypeInstances.bb"
InitGlobalVariables()
InitErrorMsgs(11, True)
SetErrorMsg(0, "An error occured in "+NameOfTheGame+" v"+VersionNumber+Chr(10)+"Save compatible version: "+CompatibleNumber+". Engine version: "+SystemProperty("blitzversion"))
SetErrorMsg(1, "OS: "+SystemProperty("os")+" "+gv\OSBit+" bit (Build: "+SystemProperty("osbuild")+")")
SetErrorMsg(3, "CPU: "+Trim(SystemProperty("cpuname"))+" (Arch: "+SystemProperty("cpuarch")+", "+GetEnv("NUMBER_OF_PROCESSORS")+" Threads)")
SetErrorMsg(8, "Error: _CaughtError_")
SetErrorMsg(10, Chr(10)+"Please take a screenshot of this error and send it to us!")
CheckForDlls()
;Create the folder in the AppData if it doesn't exist
If (FileType(GetEnv$("AppData")+"\scpntf\")<>2) Then
CreateDir(GetEnv$("AppData")+"\scpntf")
EndIf
;Create the options.ini file in the AppData folder if it doesn't exist
If (FileType(GetEnv$("AppData")+"\scpntf\options.ini")<>1) Then
WriteFile(GetEnv$("AppData")+"\scpntf\options.ini")
EndIf
InitOptions()
BlitzcordCreateCore("905859463645376522")
;Include the Main.bb file which is the core of the game
Include "SourceCode\Main.bb"
Function CheckForDlls()
Local InitErrorStr$ = ""
If FileSize("Blitzcord.dll")=0 Then InitErrorStr=InitErrorStr+ "Blitzcord.dll"+Chr(13)+Chr(10)
If FileSize("BlitzHash.dll")=0 Then InitErrorStr=InitErrorStr+ "BlitzHash.dll"+Chr(13)+Chr(10)
If FileSize("BlitzMovie.dll")=0 Then InitErrorStr=InitErrorStr+ "BlitzMovie.dll"+Chr(13)+Chr(10)
If FileSize("BlitzSteamworks.dll")=0 Then InitErrorStr=InitErrorStr+ "BlitzSteamworks.dll"+Chr(13)+Chr(10)
;If FileSize("D3DImm.dll")=0 Then InitErrorStr=InitErrorStr+ "D3DImm.dll"+Chr(13)+Chr(10)
;If FileSize("DDraw.dll")=0 Then InitErrorStr=InitErrorStr+ "DDraw.dll"+Chr(13)+Chr(10)
If FileSize("discord_game_sdk.dll")=0 Then InitErrorStr=InitErrorStr+ "discord_game_sdk.dll"+Chr(13)+Chr(10)
If FileSize("fmod.dll")=0 Then InitErrorStr=InitErrorStr+ "fmod.dll"+Chr(13)+Chr(10)
If FileSize("steam_api.dll")=0 Then InitErrorStr=InitErrorStr+ "steam_api.dll"+Chr(13)+Chr(10)
If Len(InitErrorStr)>0 Then
RuntimeError "The following DLLs were not found in the game directory:"+Chr(13)+Chr(10)+Chr(13)+Chr(10)+InitErrorStr
EndIf
Local SteamResultCode% = Steam_Init()
If SteamResultCode <> 0 Then RuntimeError("Steam API failed to initialize! Error Code: " + SteamResultCode)
gv\SteamIDUpper = Steam_GetPlayerIDUpper()
gv\SteamIDLower = Steam_GetPlayerIDLower()
End Function
Function InitGlobalVariables()
gv\OptionFile$ = GetEnv("AppData")+"\scpntf\options.ini"
If GetEnv("ProgramFiles(X86)")>0 Then
gv\OSBit = 64
Else
gv\OSBit = 32
EndIf
End Function
Function InitOptions()
opt\EnableSFXRelease% = GetINIInt(gv\OptionFile, "audio", "sfx release", 1)
opt\EnableSFXRelease_Prev% = opt\EnableSFXRelease%
opt\ConsoleEnabled% = GetINIInt(gv\OptionFile, "console", "enabled", 0)
opt\ConsoleOpening% = GetINIInt(gv\OptionFile, "console", "auto opening", 0)
opt\GraphicWidth% = GetINIInt(gv\OptionFile, "options", "width", DesktopWidth())
opt\GraphicHeight% = GetINIInt(gv\OptionFile, "options", "height", DesktopHeight())
opt\ShowFPS = GetINIInt(gv\OptionFile, "options", "show FPS", 0)
opt\DisplayMode% = GetINIInt(gv\OptionFile, "options", "display mode", 1)
opt\GraphicDriver% = GetINIInt(gv\OptionFile, "options", "graphic driver", 0)
opt\RenderCubeMapMode% = GetINIInt(gv\OptionFile, "options", "cubemaps", 2)
opt\EnableRoomLights% = GetINIInt(gv\OptionFile, "options", "room lights enabled", 1)
opt\TextureDetails% = GetINIInt(gv\OptionFile, "options", "texture details", 2)
opt\TextureFiltering% = GetINIInt(gv\OptionFile, "options", "texture filtering", 2)
opt\LauncherEnabled% = GetINIInt(gv\OptionFile, "options", "launcher enabled", 1)
opt\TotalGFXModes% = CountGfxModes3D()
opt\SFXVolume# = GetINIFloat(gv\OptionFile, "audio", "sound volume", 1.0)
opt\VoiceVol# = GetINIFloat(gv\OptionFile, "audio", "voice volume", 1.0)
opt\MasterVol# = GetINIFloat(gv\OptionFile, "audio", "master volume", 1.0)
opt\MusicVol# = GetINIFloat(gv\OptionFile, "audio", "music volume", 1.0)
opt\MouseSmooth# = GetINIFloat(gv\OptionFile, "options", "mouse smoothing", 1.0)
opt\HoldToAim% = GetINIInt(gv\OptionFile, "options", "hold to aim", 1)
opt\HoldToCrouch% = GetINIInt(gv\OptionFile, "options", "hold to crouch", 1)
opt\ShowDisclaimers% = GetINIInt(gv\OptionFile, "options", "show disclaimers", 1)
LoadResolutions()
gopt\SingleplayerGameMode = GetINIInt(gv\OptionFile, "game options", "game mode", GAMEMODE_DEFAULT)
gopt\GameMode = gopt\SingleplayerGameMode
End Function
;~IDEal Editor Parameters:
;~C#Blitz3D