diff --git a/Data/materials.ini b/Data/materials.ini index 4450a81..8616c32 100644 --- a/Data/materials.ini +++ b/Data/materials.ini @@ -16,11 +16,11 @@ bump = GFX\map\textures\bump\ventbump.jpg stepsound = 1 [dirtymetal.jpg] -bump = GFX\map\textures\bump\dirtymetalbump.jpg +bump = GFX\map\textures\bump\dirtymetalbump.jpg stepsound = 1 [misc.jpg] -bump = GFX\map\textures\bump\miscbump.jpg +bump = GFX\map\textures\bump\miscbump.jpg [rockmoss.jpg] bump = GFX\map\textures\bump\rockmossbump.jpg diff --git a/Game.bb b/Game.bb index c7bac84..694286b 100644 --- a/Game.bb +++ b/Game.bb @@ -102,6 +102,7 @@ Include "SourceCode\Main.bb" Function CheckForDlls() Local InitErrorStr$ = "" + If FileSize("IniController.dll")=0 Then InitErrorStr=InitErrorStr+ "IniController.dll"+Chr(13)+Chr(10) 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) @@ -137,33 +138,33 @@ End Function Function InitOptions() - opt\EnableSFXRelease% = GetINIInt(gv\OptionFile, "audio", "sfx release", 1) + opt\EnableSFXRelease% = IniGetInt(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\ConsoleEnabled% = IniGetInt(gv\OptionFile, "console", "enabled", 0) + opt\ConsoleOpening% = IniGetInt(gv\OptionFile, "console", "auto opening", 0) + opt\GraphicWidth% = IniGetInt(gv\OptionFile, "options", "width", DesktopWidth()) + opt\GraphicHeight% = IniGetInt(gv\OptionFile, "options", "height", DesktopHeight()) + opt\ShowFPS = IniGetInt(gv\OptionFile, "options", "show FPS", 0) + opt\DisplayMode% = IniGetInt(gv\OptionFile, "options", "display mode", 1) + opt\GraphicDriver% = IniGetInt(gv\OptionFile, "options", "graphic driver", 0) + opt\RenderCubeMapMode% = IniGetInt(gv\OptionFile, "options", "cubemaps", 2) + opt\EnableRoomLights% = IniGetInt(gv\OptionFile, "options", "room lights enabled", 1) + opt\TextureDetails% = IniGetInt(gv\OptionFile, "options", "texture details", 2) + opt\TextureFiltering% = IniGetInt(gv\OptionFile, "options", "texture filtering", 2) + opt\LauncherEnabled% = IniGetInt(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) + opt\SFXVolume# = IniGetFloat(gv\OptionFile, "audio", "sound volume", 1.0) + opt\VoiceVol# = IniGetFloat(gv\OptionFile, "audio", "voice volume", 1.0) + opt\MasterVol# = IniGetFloat(gv\OptionFile, "audio", "master volume", 1.0) + opt\MusicVol# = IniGetFloat(gv\OptionFile, "audio", "music volume", 1.0) + opt\MouseSmooth# = IniGetFloat(gv\OptionFile, "options", "mouse smoothing", 1.0) + opt\HoldToAim% = IniGetInt(gv\OptionFile, "options", "hold to aim", 1) + opt\HoldToCrouch% = IniGetInt(gv\OptionFile, "options", "hold to crouch", 1) + opt\ShowDisclaimers% = IniGetInt(gv\OptionFile, "options", "show disclaimers", 1) LoadResolutions() - gopt\SingleplayerGameMode = GetINIInt(gv\OptionFile, "game options", "game mode", GAMEMODE_DEFAULT) + gopt\SingleplayerGameMode = IniGetInt(gv\OptionFile, "game options", "game mode", GAMEMODE_DEFAULT) gopt\GameMode = gopt\SingleplayerGameMode End Function diff --git a/Game.exe b/Game.exe new file mode 100644 index 0000000..af63385 Binary files /dev/null and b/Game.exe differ diff --git a/IniControler.dll b/IniControler.dll deleted file mode 100644 index 124a30b..0000000 Binary files a/IniControler.dll and /dev/null differ diff --git a/IniController.dll b/IniController.dll new file mode 100644 index 0000000..8f604a7 Binary files /dev/null and b/IniController.dll differ diff --git a/SCP Nine-Tailed Fox.exe b/SCP Nine-Tailed Fox.exe index d674483..a368c20 100644 Binary files a/SCP Nine-Tailed Fox.exe and b/SCP Nine-Tailed Fox.exe differ diff --git a/SourceCode/Achievements.bb b/SourceCode/Achievements.bb index da3cf02..d5e5d24 100644 --- a/SourceCode/Achievements.bb +++ b/SourceCode/Achievements.bb @@ -22,14 +22,14 @@ ;Global UsedConsole ; ;Global AchievementsMenu% -;Global AchvMSGenabled% = GetINIInt(gv\OptionFile, "options", "achievement popup enabled", 1) +;Global AchvMSGenabled% = IniGetInt(gv\OptionFile, "options", "achievement popup enabled", 1) ;For i = 0 To MAXACHIEVEMENTS-1 ; Local loc2% = GetINISectionLocation(AchvIni, "s"+Str(i)) ; Local NEW_ACH.Achievement = New Achievement -; NEW_ACH\Name = GetINIString2(AchvIni, loc2, "string1") -; NEW_ACH\Desc = GetINIString2(AchvIni, loc2, "AchvDesc") +; NEW_ACH\Name = IniGetString2(AchvIni, loc2, "string1") +; NEW_ACH\Desc = IniGetString2(AchvIni, loc2, "AchvDesc") ; -; Local image$ = GetINIString2(AchvIni, loc2, "image") +; Local image$ = IniGetString2(AchvIni, loc2, "image") ; ; NEW_ACH\IMG = LoadImage_Strict("GFX\menu\achievements\"+image+".jpg") ; NEW_ACH\IMG = ResizeImage2(NEW_ACH\IMG,ImageWidth(NEW_ACH\IMG)*opt\GraphicHeight/768.0,ImageHeight(NEW_ACH\IMG)*opt\GraphicHeight/768.0) @@ -49,7 +49,7 @@ Function GiveAchievement(ID%, showMessage%=True) ; Achievements[achvname]\Unlocked=True ; If AchvMSGenabled And showMessage Then ; Local loc2% = GetINISectionLocation(AchvIni, "s"+achvname) -; Local AchievementName$ = GetINIString2(AchvIni, loc2, "string1") +; Local AchievementName$ = IniGetString2(AchvIni, loc2, "string1") ; CreateAchievementMsg(achvname,AchievementName) ; EndIf ; EndIf diff --git a/SourceCode/Console.bb b/SourceCode/Console.bb index 34b257d..3db714e 100644 --- a/SourceCode/Console.bb +++ b/SourceCode/Console.bb @@ -1109,7 +1109,7 @@ Function UpdateConsole(commandSet%) Default Cheat\Mini173 = Not Cheat\Mini173 End Select - Local scale# = (GetINIFloat("DATA\NPCs.ini", "SCP-173", "scale") / MeshDepth(Curr173\obj)) + Local scale# = (IniGetFloat("Data\NPCs.ini", "SCP-173", "scale") / MeshDepth(Curr173\obj)) If Cheat\Mini173 Then CreateConsoleMsg("MINI SCP-173 ON") scale# = scale# / 3.0 @@ -1150,7 +1150,7 @@ Function UpdateConsole(commandSet%) If n\obj = 0 Then n\obj = LoadAnimMesh_Strict(n\Model) - Local temp2# = (GetINIFloat("DATA\NPCs.ini", "SCP-049-2", "scale") / 2.5) + Local temp2# = (IniGetFloat("Data\NPCs.ini", "SCP-049-2", "scale") / 2.5) ScaleEntity n\obj, temp2#, temp2#, temp2# MeshCullBox (n\obj, -MeshWidth(n\obj), -MeshHeight(n\obj), -MeshDepth(n\obj), MeshWidth(n\obj)*2, MeshHeight(n\obj)*2, MeshDepth(n\obj)*2) @@ -1263,7 +1263,7 @@ Function UpdateConsole(commandSet%) StrTemp$ = "" EndIf If StrTemp <> "" - PutINIValue(gv\OptionFile,"options","progress",StrTemp) + IniWriteString(gv\OptionFile,"options","progress",StrTemp) Null3DMenu() Load3DMenu(StrTemp) CreateConsoleMsg("Loaded 3D menu background: "+StrTemp) @@ -1322,7 +1322,7 @@ Function UpdateConsole(commandSet%) psp\Checkpoint106Passed = True EndIf - PutINIValue(gv\OptionFile, "options", "intro enabled", IntroEnabled%) + IniWriteString(gv\OptionFile, "options", "intro enabled", IntroEnabled%) Else CreateConsoleMsg("Cannot recognize zone number "+Int(StrTemp2),255,150,0) EndIf diff --git a/SourceCode/Controls.bb b/SourceCode/Controls.bb index bdc8b0b..8511d3b 100644 --- a/SourceCode/Controls.bb +++ b/SourceCode/Controls.bb @@ -31,13 +31,13 @@ Function InitController() Return EndIf - co\Enabled = GetINIInt(gv\OptionFile, "binds", "controller enabled") - co\Sensitivity = GetINIFloat(gv\OptionFile, "binds", "controller sensitivity") - co\InvertAxis[Controller_XAxis] = GetINIInt(gv\OptionFile, "binds", "controller invert x") - co\InvertAxis[Controller_YAxis] = GetINIInt(gv\OptionFile, "binds", "controller invert y") + co\Enabled = IniGetInt(gv\OptionFile, "binds", "controller enabled") + co\Sensitivity = IniGetFloat(gv\OptionFile, "binds", "controller sensitivity") + co\InvertAxis[Controller_XAxis] = IniGetInt(gv\OptionFile, "binds", "controller invert x") + co\InvertAxis[Controller_YAxis] = IniGetInt(gv\OptionFile, "binds", "controller invert y") co\FullControl = False ;Currently only partial controller support is available, so the main menu, pause menu and console cannot be navigated by a controller - co\Scheme = GetINIInt(gv\OptionFile, "binds", "controller scheme") - co\SwapDPad_And_LeftStick = GetINIInt(gv\OptionFile, "binds", "controller swap dpad leftstick") + co\Scheme = IniGetInt(gv\OptionFile, "binds", "controller scheme") + co\SwapDPad_And_LeftStick = IniGetInt(gv\OptionFile, "binds", "controller swap dpad leftstick") co\SelectSFX = LoadSound_Strict("SFX\Interact\SelectButton.ogg") @@ -46,12 +46,12 @@ End Function Function SaveController() If JoyType()=0 Then Return ;Just skip this if no controller has been plugged in or detected - PutINIValue(gv\OptionFile, "binds", "controller enabled", co\Enabled) - PutINIValue(gv\OptionFile, "binds", "controller sensitivity", co\Sensitivity) - PutINIValue(gv\OptionFile, "binds", "controller invert x", co\InvertAxis[Controller_XAxis]) - PutINIValue(gv\OptionFile, "binds", "controller invert y", co\InvertAxis[Controller_YAxis]) - PutINIValue(gv\OptionFile, "binds", "controller scheme", co\Scheme) - PutINIValue(gv\OptionFile, "binds", "controller swap dpad leftstick", co\SwapDPad_And_LeftStick) + IniWriteString(gv\OptionFile, "binds", "controller enabled", co\Enabled) + IniWriteString(gv\OptionFile, "binds", "controller sensitivity", co\Sensitivity) + IniWriteString(gv\OptionFile, "binds", "controller invert x", co\InvertAxis[Controller_XAxis]) + IniWriteString(gv\OptionFile, "binds", "controller invert y", co\InvertAxis[Controller_YAxis]) + IniWriteString(gv\OptionFile, "binds", "controller scheme", co\Scheme) + IniWriteString(gv\OptionFile, "binds", "controller swap dpad leftstick", co\SwapDPad_And_LeftStick) End Function diff --git a/SourceCode/GUI.bb b/SourceCode/GUI.bb index 4fd528f..1e50acd 100644 --- a/SourceCode/GUI.bb +++ b/SourceCode/GUI.bb @@ -1220,39 +1220,39 @@ Function UpdateGUI() x2 = (SelectedItem\state+1.0) Local iniStr$ = Data294 - - Local loc% = GetINISectionLocation(iniStr, SelectedItem\name) + + Local drink$ = FindSCP294Drink(SelectedItem\name) ;Stop - strtemp = GetINIString2(iniStr, loc, "message") + strtemp = IniGetString(iniStr, drink, "message") If strtemp <> "" Then Msg = strtemp : MsgTimer = 70*6 - If GetINIInt2(iniStr, loc, "lethal") Lor GetINIInt2(iniStr, loc, "deathtimer") Then - DeathMSG = GetINIString2(iniStr, loc, "deathmessage") - If GetINIInt2(iniStr, loc, "lethal") Then Kill() + If IniGetInt(iniStr, drink, "lethal") Lor IniGetInt(iniStr, drink, "deathtimer") Then + DeathMSG = IniGetString(iniStr, drink, "deathmessage") + If IniGetInt(iniStr, drink, "lethal") Then Kill() EndIf - BlurTimer = GetINIInt2(iniStr, loc, "blur")*70;*temp - If VomitTimer = 0 Then VomitTimer = GetINIInt2(iniStr, loc, "vomit") - CameraShakeTimer = GetINIString2(iniStr, loc, "camerashake") - ;Injuries = Max(Injuries + GetINIInt2(iniStr, loc, "damage"),0);*temp - ;Bloodloss = Max(Bloodloss + GetINIInt2(iniStr, loc, "blood loss"),0);*temp - DamageSPPlayer(GetINIInt2(iniStr, loc, "damage") * 25.0, True) - strtemp = GetINIString2(iniStr, loc, "sound") + BlurTimer = IniGetInt(iniStr, drink, "blur")*70;*temp + If VomitTimer = 0 Then VomitTimer = IniGetInt(iniStr, drink, "vomit") + CameraShakeTimer = IniGetString(iniStr, drink, "camerashake") + ;Injuries = Max(Injuries + IniGetInt2(iniStr, loc, "damage"),0);*temp + ;Bloodloss = Max(Bloodloss + IniGetInt2(iniStr, loc, "blood loss"),0);*temp + DamageSPPlayer(IniGetInt(iniStr, drink, "damage") * 25.0, True) + strtemp = IniGetString(iniStr, drink, "sound") If strtemp<>"" Then PlaySound_Strict LoadTempSound(strtemp) EndIf - If GetINIInt2(iniStr, loc, "stomachache") Then SCP1025state[3]=1 + If IniGetInt(iniStr, drink, "stomachache") Then SCP1025state[3]=1 - DeathTimer=GetINIInt2(iniStr, loc, "deathtimer")*70 + DeathTimer=IniGetInt(iniStr, drink, "deathtimer")*70 - BlinkEffect = Float(GetINIString2(iniStr, loc, "blink effect", 1.0))*x2 - BlinkEffectTimer = Float(GetINIString2(iniStr, loc, "blink effect timer", 1.0))*x2 + BlinkEffect = Float(IniGetString(iniStr, drink, "blink effect", 1.0))*x2 + BlinkEffectTimer = Float(IniGetString(iniStr, drink, "blink effect timer", 1.0))*x2 - StaminaEffect = Float(GetINIString2(iniStr, loc, "stamina effect", 1.0))*x2 - StaminaEffectTimer = Float(GetINIString2(iniStr, loc, "stamina effect timer", 1.0))*x2 + StaminaEffect = Float(IniGetString(iniStr, drink, "stamina effect", 1.0))*x2 + StaminaEffectTimer = Float(IniGetString(iniStr, drink, "stamina effect timer", 1.0))*x2 - strtemp = GetINIString2(iniStr, loc, "refusemessage") + strtemp = IniGetString(iniStr, drink, "refusemessage") If strtemp <> "" Then Msg = strtemp MsgTimer = 70*6 @@ -4145,13 +4145,13 @@ Function UpdateMenu() ; ; If AchievementsMenu>0 Then ; If AchievementsMenu <= Floor(Float(MAXACHIEVEMENTS-1)/12.0) Then -; If DrawButton(x+341*MenuScale, y + 344*MenuScale, 50*MenuScale, 60*MenuScale, "â?¶", 2) Then +; If DrawButton(x+341*MenuScale, y + 344*MenuScale, 50*MenuScale, 60*MenuScale, "�?�", 2) Then ; AchievementsMenu = AchievementsMenu+1 ; ShouldDeleteGadgets=True ; EndIf ; EndIf ; If AchievementsMenu > 1 Then -; If DrawButton(x+41*MenuScale, y + 344*MenuScale, 50*MenuScale, 60*MenuScale, "â??", 2) Then +; If DrawButton(x+41*MenuScale, y + 344*MenuScale, 50*MenuScale, 60*MenuScale, "�??", 2) Then ; AchievementsMenu = AchievementsMenu-1 ; ShouldDeleteGadgets=True ; EndIf diff --git a/SourceCode/Guns.bb b/SourceCode/Guns.bb index 6231d8e..26f6301 100644 --- a/SourceCode/Guns.bb +++ b/SourceCode/Guns.bb @@ -47,8 +47,8 @@ Global P90BulletMeter Global Crowbar_HitPivot Global MuzzleFlash -Global KEY_RELOAD = GetINIInt(gv\OptionFile, "binds", "Reload key", 19) -Global KEY_HOLSTERGUN = GetINIInt(gv\OptionFile, "binds", "Holstergun key", 16) +Global KEY_RELOAD = IniGetInt(gv\OptionFile, "binds", "Reload key", 19) +Global KEY_HOLSTERGUN = IniGetInt(gv\OptionFile, "binds", "Holstergun key", 16) Global BulletHole1,BulletHole2,DustParticle @@ -196,12 +196,12 @@ Function CreateGun.Guns(name$, id, model$, img$, canhavesilencer = False, CanUse g\IMG = LoadImage("GFX\weapons\"+img$) MaskImage(g\IMG, 255, 0, 255) - g\CurrAmmo = GetINIInt("Data\weapons.ini",name$,"ammo",1) + g\CurrAmmo = IniGetInt("Data\weapons.ini",name$,"ammo",1) g\MaxCurrAmmo = g\CurrAmmo g\CurrReloadAmmo = 0 - g\MaxReloadAmmo = GetINIInt("Data\weapons.ini",name$,"reload_ammo") - g\DamageOnEntity = GetINIInt("Data\weapons.ini",name$,"damage",1) - g\Accuracy = GetINIFloat("Data\weapons.ini",name$,"accuracy",1.0) + g\MaxReloadAmmo = IniGetInt("Data\weapons.ini",name$,"reload_ammo") + g\DamageOnEntity = IniGetInt("Data\weapons.ini",name$,"damage",1) + g\Accuracy = IniGetFloat("Data\weapons.ini",name$,"accuracy",1.0) g\CanHaveSilencer = canhavesilencer g\obj = LoadAnimMesh_Strict("GFX\weapons\"+model$,g_I\GunPivot) ScaleEntity g\obj,0.005,0.005,0.005 @@ -212,7 +212,7 @@ Function CreateGun.Guns(name$, id, model$, img$, canhavesilencer = False, CanUse g\ViewModelPath = model$ g\IMGPath = img$ - Local StrTemp$ = GetINIString("Data\weapons.ini", g\name, "type", "semi") + Local StrTemp$ = IniGetString("Data\weapons.ini", g\name, "type", "semi") Select StrTemp Case "semi" g\GunType = GUNTYPE_SEMI @@ -226,75 +226,75 @@ Function CreateGun.Guns(name$, id, model$, img$, canhavesilencer = False, CanUse g\GunType = GUNTYPE_UNKNOWN End Select - g\Knockback = GetINIFloat("Data\weapons.ini",name,"knockback") - g\Rate_Of_Fire = GetINIFloat("Data\weapons.ini",name,"rate_of_fire",1.0) - g\Reload_Time = GetINIFloat("Data\weapons.ini",name,"reload_time",1.0) - g\Reload_Start_Time = GetINIFloat("Data\weapons.ini",name,"reload_start_time",1.0) - g\Deploy_Time = GetINIFloat("Data\weapons.ini",name,"deploy_time",1.0) - g\MaxShootSounds = GetINIInt("Data\weapons.ini",name,"sounds_shoot",1) - g\MaxReloadSounds = GetINIInt("Data\weapons.ini",name,"sounds_reload",1) - g\MaxWallhitSounds = GetINIInt("Data\weapons.ini",name,"sounds_wallhit",1) - g\Amount_Of_Bullets = GetINIInt("Data\weapons.ini",name,"amount_of_bullets",1) + g\Knockback = IniGetFloat("Data\weapons.ini",name,"knockback") + g\Rate_Of_Fire = IniGetFloat("Data\weapons.ini",name,"rate_of_fire",1.0) + g\Reload_Time = IniGetFloat("Data\weapons.ini",name,"reload_time",1.0) + g\Reload_Start_Time = IniGetFloat("Data\weapons.ini",name,"reload_start_time",1.0) + g\Deploy_Time = IniGetFloat("Data\weapons.ini",name,"deploy_time",1.0) + g\MaxShootSounds = IniGetInt("Data\weapons.ini",name,"sounds_shoot",1) + g\MaxReloadSounds = IniGetInt("Data\weapons.ini",name,"sounds_reload",1) + g\MaxWallhitSounds = IniGetInt("Data\weapons.ini",name,"sounds_wallhit",1) + g\Amount_Of_Bullets = IniGetInt("Data\weapons.ini",name,"amount_of_bullets",1) Local AnimString$ ;Deploy - AnimString = GetINIString("Data\weapons.ini",name,"anim_deploy","") + AnimString = IniGetString("Data\weapons.ini",name,"anim_deploy","") g\Anim_Deploy = CreateVector3D(Piece(AnimString,1,"|"),Piece(AnimString,2,"|"),Piece(AnimString,3,"|")) ;Shoot - AnimString = GetINIString("Data\weapons.ini",name,"anim_shoot","") + AnimString = IniGetString("Data\weapons.ini",name,"anim_shoot","") g\Anim_Shoot = CreateVector3D(Piece(AnimString,1,"|"),Piece(AnimString,2,"|"),Piece(AnimString,3,"|")) ;Reload - AnimString = GetINIString("Data\weapons.ini",name,"anim_reload","") + AnimString = IniGetString("Data\weapons.ini",name,"anim_reload","") g\Anim_Reload = CreateVector3D(Piece(AnimString,1,"|"),Piece(AnimString,2,"|"),Piece(AnimString,3,"|")) ;Sprint Transition - AnimString = GetINIString("Data\weapons.ini",name,"anim_sprint_transition","") + AnimString = IniGetString("Data\weapons.ini",name,"anim_sprint_transition","") g\Anim_Sprint_Transition = CreateVector3D(Piece(AnimString,1,"|"),Piece(AnimString,2,"|"),Piece(AnimString,3,"|")) ;Sprint Cycle - AnimString = GetINIString("Data\weapons.ini",name,"anim_sprint_cycle","") + AnimString = IniGetString("Data\weapons.ini",name,"anim_sprint_cycle","") g\Anim_Sprint_Cycle = CreateVector3D(Piece(AnimString,1,"|"),Piece(AnimString,2,"|"),Piece(AnimString,3,"|")) ;Deploy No Ammo - AnimString = GetINIString("Data\weapons.ini",name,"anim_noammo_deploy","") + AnimString = IniGetString("Data\weapons.ini",name,"anim_noammo_deploy","") If AnimString<>"" Then g\Anim_NoAmmo_Deploy = CreateVector3D(Piece(AnimString,1,"|"),Piece(AnimString,2,"|"),Piece(AnimString,3,"|")) EndIf ;Shoot No Ammo - AnimString = GetINIString("Data\weapons.ini",name,"anim_noammo_shoot","") + AnimString = IniGetString("Data\weapons.ini",name,"anim_noammo_shoot","") If AnimString<>"" Then g\Anim_NoAmmo_Shoot = CreateVector3D(Piece(AnimString,1,"|"),Piece(AnimString,2,"|"),Piece(AnimString,3,"|")) EndIf ;Sprint Transition No Ammo - AnimString = GetINIString("Data\weapons.ini",name,"anim_noammo_sprint_transition","") + AnimString = IniGetString("Data\weapons.ini",name,"anim_noammo_sprint_transition","") If AnimString<>"" Then g\Anim_NoAmmo_Sprint_Transition = CreateVector3D(Piece(AnimString,1,"|"),Piece(AnimString,2,"|"),Piece(AnimString,3,"|")) EndIf ;Sprint Cycle No Ammo - AnimString = GetINIString("Data\weapons.ini",name,"anim_noammo_sprint_cycle","") + AnimString = IniGetString("Data\weapons.ini",name,"anim_noammo_sprint_cycle","") If AnimString<>"" Then g\Anim_NoAmmo_Sprint_Cycle = CreateVector3D(Piece(AnimString,1,"|"),Piece(AnimString,2,"|"),Piece(AnimString,3,"|")) EndIf ;Reload Start - AnimString = GetINIString("Data\weapons.ini",name,"anim_reload_start","") + AnimString = IniGetString("Data\weapons.ini",name,"anim_reload_start","") If AnimString<>"" Then g\Anim_Reload_Start = CreateVector3D(Piece(AnimString,1,"|"),Piece(AnimString,2,"|"),Piece(AnimString,3,"|")) EndIf ;Reload Stop - AnimString = GetINIString("Data\weapons.ini",name,"anim_reload_stop","") + AnimString = IniGetString("Data\weapons.ini",name,"anim_reload_stop","") If AnimString<>"" Then g\Anim_Reload_Stop = CreateVector3D(Piece(AnimString,1,"|"),Piece(AnimString,2,"|"),Piece(AnimString,3,"|")) EndIf - g\Frame_Idle = GetINIFloat("Data\weapons.ini",name,"frame_idle") - g\Frame_NoAmmo_Idle = GetINIFloat("Data\weapons.ini",name,"frame_noammo_idle") + g\Frame_Idle = IniGetFloat("Data\weapons.ini",name,"frame_idle") + g\Frame_NoAmmo_Idle = IniGetFloat("Data\weapons.ini",name,"frame_noammo_idle") Local VectorString$ - VectorString = GetINIString("Data\weapons.ini",name,"offset","") + VectorString = IniGetString("Data\weapons.ini",name,"offset","") MoveEntity g\obj,Piece(VectorString,1,"|"),Piece(VectorString,2,"|"),Piece(VectorString,3,"|") - VectorString = GetINIString("Data\weapons.ini",name,"aimoffset","") + VectorString = IniGetString("Data\weapons.ini",name,"aimoffset","") If VectorString<>"" Then g\IronSightCoords = CreateVector3D(Piece(VectorString,1,"|"),Piece(VectorString,2,"|"),Piece(VectorString,3,"|")) EndIf - g\DisplayName = GetINIString("Data\weapons.ini",name,"display_name",name) - StrTemp$ = GetINIString("Data\weapons.ini",name,"slot","secondary") + g\DisplayName = IniGetString("Data\weapons.ini",name,"display_name",name) + StrTemp$ = IniGetString("Data\weapons.ini",name,"slot","secondary") Select StrTemp Case "primary" g\Slot = SLOT_PRIMARY @@ -304,8 +304,8 @@ Function CreateGun.Guns(name$, id, model$, img$, canhavesilencer = False, CanUse g\Slot = SLOT_MELEE End Select - g\ShootDelay = GetINIFloat("Data\weapons.ini",name,"attack_delay") - g\Range = GetINIFloat("Data\weapons.ini",name,"range") + g\ShootDelay = IniGetFloat("Data\weapons.ini",name,"attack_delay") + g\Range = IniGetFloat("Data\weapons.ini",name,"range") ;Preload gun sounds If g\MaxShootSounds > 1 Then @@ -316,7 +316,7 @@ Function CreateGun.Guns(name$, id, model$, img$, canhavesilencer = False, CanUse g\ShootSounds[0] = LoadSound_Strict("SFX\Guns\"+g\name+"\shoot.ogg") EndIf - VectorString = GetINIString("Data\weapons.ini",name,"muzzleoffset","") + VectorString = IniGetString("Data\weapons.ini",name,"muzzleoffset","") g\MuzzleFlash = CreateSprite() EntityFX g\MuzzleFlash,1 SpriteViewMode g\MuzzleFlash,2 @@ -328,7 +328,7 @@ Function CreateGun.Guns(name$, id, model$, img$, canhavesilencer = False, CanUse g\PlayerModel = LoadAnimMesh_Strict("GFX\weapons\"+g\name+"_worldmodel.b3d") HideEntity g\PlayerModel - Local SimpleString$ = GetINIString("Data\weapons.ini",name,"player_model_anim","") + Local SimpleString$ = IniGetString("Data\weapons.ini",name,"player_model_anim","") Select Lower(SimpleString) Case "smg" g\PlayerModelAnim = GUNANIM_SMG @@ -344,9 +344,9 @@ Function CreateGun.Guns(name$, id, model$, img$, canhavesilencer = False, CanUse RuntimeError "ERROR: Weapon type " + SimpleString + " doesn't exist!" End Select - g\ShouldCreateItem = GetINIInt("Data\weapons.ini",name,"generate_item",1) + g\ShouldCreateItem = IniGetInt("Data\weapons.ini",name,"generate_item",1) - SimpleString = GetINIString("Data\weapons.ini",name,"decal_type","bullet") + SimpleString = IniGetString("Data\weapons.ini",name,"decal_type","bullet") Select Lower(SimpleString) Case "bullet" g\DecalType = GUNDECAL_DEFAULT @@ -407,7 +407,7 @@ Function InitGuns() gunID = gunID + 1 g.Guns = CreateGun(l,gunID,l+"_viewmodel.b3d","INV"+l+".jpg",False,True) If g\ShouldCreateItem Then - it = CreateItemTemplate(g\DisplayName,g\name,"GFX\weapons\"+g\name+"_worldmodel.b3d","GFX\weapons\INV"+g\name+".jpg","",GetINIFloat("Data\weapons.ini",g\name,"world scale",0.02)) + it = CreateItemTemplate(g\DisplayName,g\name,"GFX\weapons\"+g\name+"_worldmodel.b3d","GFX\weapons\INV"+g\name+".jpg","",IniGetFloat("Data\weapons.ini",g\name,"world scale",0.02)) it\isGun% = True it\sound = 66 EndIf diff --git a/SourceCode/IniControler.bb b/SourceCode/IniControler.bb deleted file mode 100644 index 108e2f3..0000000 --- a/SourceCode/IniControler.bb +++ /dev/null @@ -1,17 +0,0 @@ -Function IniWriteBuffer%(File$, ClearPrevious% = True) - IniWriteBuffer_(File, ClearPrevious) -End Function - -Function IniGetBufferString$(File$, Section$, Parameter$, DefaultValue$ = "") - Return(IniGetBufferString_(File, Section, Parameter, DefaultValue)) -End Function - -Function IniWriteString%(File$, Section$, Parameter$, Value$, UpdateBuffer% = True) - IniWriteString_(File, Section, Parameter, Value, UpdateBuffer) -End Function - -Function IniGetString$(File$, Section$, Parameter$, DefaultValue$ = "", AllowBuffer% = True) - Return(IniGetString_(File, Section, Parameter, DefaultValue, AllowBuffer)) -End Function -;~IDEal Editor Parameters: -;~C#Blitz3D \ No newline at end of file diff --git a/SourceCode/IniController.bb b/SourceCode/IniController.bb new file mode 100644 index 0000000..8c10ac6 --- /dev/null +++ b/SourceCode/IniController.bb @@ -0,0 +1,113 @@ +; IniController - A part of BlitzToolbox +; Reading & writing INI files for Blitz3D. Customize strict file path edition for SCP: Nine-Tailed Fox. +; v1.081 2024.9.20 +; https://github.com/ZiYueCommentary/BlitzToolbox + +Function IniWriteBuffer(path$, clearPrevious% = 1) + IniWriteBuffer_(path$, clearPrevious%) +End Function + +Function IniWriteString(path$, section$, key$, value$, updateBuffer% = 1) + IniWriteString_(path$, section$, key$, value$, updateBuffer%) +End Function + +Function IniWriteInt(path$, section$, key$, value%, updateBuffer% = 1) + IniWriteInt_(path$, section$, key$, value%, updateBuffer%) +End Function + +Function IniWriteFloat(path$, section$, key$, value#, updateBuffer% = 1) + IniWriteFloat_(path$, section$, key$, value#, updateBuffer%) +End Function + +Function IniGetString$(path$, section$, key$, defaultValue$ = "", allowBuffer% = 1) + Return IniGetString_(path$, section$, key$, defaultValue$, allowBuffer%) +End Function + +Function IniGetInt%(path$, section$, key$, defaultValue% = 0, allowBuffer% = 1) + Local Result$ = IniGetString(path, section, key, defaultValue, allowBuffer) + + Select Result + Case "True", "true", "1" + ;[Block] + Return(True) + ;[End Block] + Case "False", "false", "0" + ;[Block] + Return(False) + ;[End Block] + Default + ;[Block] + Return(Int(Result)) + ;[End Block] + End Select +End Function + +Function IniGetFloat#(path$, section$, key$, defaultValue# = 0.0, allowBuffer% = 1) + Return IniGetFloat_(path$, section$, key$, defaultValue#, allowBuffer%) +End Function + +Function IniGetBufferString$(path$, section$, key$, defaultValue$ = "") + Return IniGetBufferString_(path$, section$, key$, defaultValue$) +End Function + +Function IniGetBufferInt%(path$, section$, key$, defaultValue% = 0) + Return IniGetBufferInt_(path$, section$, key$, defaultValue%) +End Function + +Function IniGetBufferFloat#(path$, section$, key$, defaultValue# = 0.0) + Return IniGetBufferFloat_(path$, section$, key$, defaultValue#) +End Function + +Function IniSectionExist%(path$, section$, allowBuffer% = 1) + Return IniSectionExist_(path$, section$, allowBuffer%) +End Function + +Function IniKeyExist%(path$, section$, key$, allowBuffer% = 1) + Return IniKeyExist_%(path$, section$, key$, allowBuffer%) +End Function + +Function IniExportJson(path$, json$, isMin% = 0, stringOnly% = 0, allowBuffer% = 1) + IniExportJson_(path$, json$, isMin%, stringOnly%, allowBuffer%) +End Function + +Function IniBufferExportJson(path$, json$, isMin% = 0, stringOnly% = 0) + IniBufferExportJson_(path$, json$, isMin%, stringOnly%) +End Function + +Function IniExportHtml(path$, html$, isMin% = 0, isList% = 0, allowBuffer% = 1) + IniExportHtml_(path$, html$, isMin%, isList%, allowBuffer%) +End Function + +Function IniBufferExportHtml(path$, html$, isMin% = 0, isList% = 0) + IniBufferExportHtml_(path$, html$, isMin%, isList%) +End Function + +Function IniExportXml(path$, xml$, isMin% = 0, allowBuffer% = 1) + IniExportXml_(path$, xml$, isMin%, allowBuffer%) +End Function + +Function IniBufferExportXml(path$, xml$, isMin% = 0) + IniBufferExportXml_(path$, xml$, isMin%) +End Function + +Function IniRemoveKey(path$, section$, key$, updateBuffer% = 1) + IniRemoveKey_(path$, section$, key$, updateBuffer%) +End Function + +Function IniRemoveSection(path$, section$, updateBuffer% = 1) + IniRemoveSection_(path$, section$, updateBuffer%) +End Function + +Function IniExportIni(path$, ini$, isMin% = 0, allowBuffer% = 1) + IniExportIni_(path$, ini$, isMin%, allowBuffer%) +End Function + +Function IniBufferExportIni(path$, ini$, isMin% = 0) + IniBufferExportIni_(path$, ini$, isMin%) +End Function + +Function FindSCP294Drink$(Drink$) + Local StrTemp$ = FindSCP294Drink_("Data\SCP-294.ini", Drink) + If StrTemp = "Null" Then Return(StrTemp) + Return Left(StrTemp, Instr(StrTemp, ",") - 1) +End Function diff --git a/SourceCode/KeyBinds.bb b/SourceCode/KeyBinds.bb index b76e450..88de887 100644 --- a/SourceCode/KeyBinds.bb +++ b/SourceCode/KeyBinds.bb @@ -8,19 +8,19 @@ End Type Function LoadKeyBinds() - kb\NVToggleKey = GetINIInt(gv\OptionFile, "binds", "Nightvision key", 33) - kb\CommandWheelKey = GetINIInt(gv\OptionFile, "binds", "Command wheel key", 46) - kb\SocialWheelKey = GetINIInt(gv\OptionFile, "binds", "Social wheel key", 47) - kb\ChatKey = GetINIInt(gv\OptionFile, "binds", "Chat key", 28) + kb\NVToggleKey = IniGetInt(gv\OptionFile, "binds", "Nightvision key", 33) + kb\CommandWheelKey = IniGetInt(gv\OptionFile, "binds", "Command wheel key", 46) + kb\SocialWheelKey = IniGetInt(gv\OptionFile, "binds", "Social wheel key", 47) + kb\ChatKey = IniGetInt(gv\OptionFile, "binds", "Chat key", 28) End Function Function SaveKeyBinds() - PutINIValue(gv\OptionFile, "binds", "Nightvision key", kb\NVToggleKey) - PutINIValue(gv\OptionFile, "binds", "Command wheel key", kb\CommandWheelKey) - PutINIValue(gv\OptionFile, "binds", "Social wheel key", kb\SocialWheelKey) - PutINIValue(gv\OptionFile, "binds", "Chat key", kb\ChatKey) + IniWriteString(gv\OptionFile, "binds", "Nightvision key", kb\NVToggleKey) + IniWriteString(gv\OptionFile, "binds", "Command wheel key", kb\CommandWheelKey) + IniWriteString(gv\OptionFile, "binds", "Social wheel key", kb\SocialWheelKey) + IniWriteString(gv\OptionFile, "binds", "Chat key", kb\ChatKey) End Function diff --git a/SourceCode/LoadingScreens.bb b/SourceCode/LoadingScreens.bb index 33de1e9..5788715 100644 --- a/SourceCode/LoadingScreens.bb +++ b/SourceCode/LoadingScreens.bb @@ -38,16 +38,16 @@ Function InitLoadingScreens(filename$) ls\title = TemporaryString For i = 0 To (LOADINGSCREEN_MAX_IMG-1) - ls\imgpath[i] = GetINIString(file, TemporaryString, "image"+(i+1)) + ls\imgpath[i] = IniGetString(file, TemporaryString, "image"+(i+1)) If ls\imgpath[i]<> "" Then ls\imgamount=ls\imgamount+1 Next For i = 0 To (LOADINGSCREEN_MAX_TXT-1) - ls\txt[i] = GetINIString(file, TemporaryString, "text"+(i+1)) + ls\txt[i] = IniGetString(file, TemporaryString, "text"+(i+1)) If ls\txt[i]<> "" Then ls\txtamount=ls\txtamount+1 Next - ls\noAuto = GetINIInt(file, TemporaryString, "disable auto selection") + ls\noAuto = IniGetInt(file, TemporaryString, "disable auto selection") EndIf Wend diff --git a/SourceCode/MTF.bb b/SourceCode/MTF.bb index 822c7ff..d750c59 100644 --- a/SourceCode/MTF.bb +++ b/SourceCode/MTF.bb @@ -2,7 +2,7 @@ Global keyhituse,keydownuse Global SwitchFollow$ = "Split Up" Global ChatSFXCHN -;Global KEY_CHAT = GetINIInt(gv\OptionFile, "binds", "Chat key", 46) +;Global KEY_CHAT = IniGetInt(gv\OptionFile, "binds", "Chat key", 46) Global ChatSFXOpened% = False Global ChatSFXOpenedTimer# = 0.0 Global ChatSFXOpenedColor% = 255 @@ -12,18 +12,18 @@ Global ChatSFX_CurrSound Global BloodSpitSprite1,BloodSpitSprite2 -;Global NTF_DisableConsoleOpening% = GetINIInt(gv\OptionFile, "console", "disable opening") +;Global NTF_DisableConsoleOpening% = IniGetInt(gv\OptionFile, "console", "disable opening") Global ClassDObj2,N966Obj -Global KEY_USE = GetINIInt(gv\OptionFile, "binds", "Use key", 18) +Global KEY_USE = IniGetInt(gv\OptionFile, "binds", "Use key", 18) Global NTF_PainSFX[8] Global NTF_PainWeakSFX[2] Global NTF_MaxAmbientSFX% = 39 -Global NTF_AimCross% = GetINIInt(gv\OptionFile, "options", "aim cross", 1) +Global NTF_AimCross% = IniGetInt(gv\OptionFile, "options", "aim cross", 1) ;AI For the NTF @@ -38,7 +38,7 @@ Global flame01,Ash Global NTF_457Flame Global NTF_RadioCHN -Global KEY_RADIOTOGGLE = GetINIInt(gv\OptionFile, "binds", "Radiotoggle key", 20) +Global KEY_RADIOTOGGLE = IniGetInt(gv\OptionFile, "binds", "Radiotoggle key", 20) Global NTF_BrokenDoorSFX @@ -247,8 +247,8 @@ NTF_SewerAmbienceStrings[8] = "Tunnels2" Global NTF_GasMaskBlood -Global GunPitchShift% = GetINIInt(gv\OptionFile, "options", "gun sfx pitch", 1) -;Global NTF_LQModels% = GetINIInt(gv\OptionFile, "ingame", "lq models") +Global GunPitchShift% = IniGetInt(gv\OptionFile, "options", "gun sfx pitch", 1) +;Global NTF_LQModels% = IniGetInt(gv\OptionFile, "ingame", "lq models") Global NTF_AchvMenuScroll# = 0.0 ;Global NTF_LangMenuScroll# = 0.0 @@ -275,7 +275,7 @@ Global MeleeSFX Global IsPlayerSprinting% = False -;Global SFXRelease% = GetINIInt(gv\OptionFile, "options", "sfx release", 1) +;Global SFXRelease% = IniGetInt(gv\OptionFile, "options", "sfx release", 1) Global CurrD9341.NPCs @@ -303,7 +303,7 @@ Global WaterParticleTexture%[2] Global SplashTextSFX% = LoadSound_Strict("SFX\Interact\Typing.ogg") -Global SaveTexturesInVRam = GetINIInt(gv\OptionFile,"options","enable vram",1) +Global SaveTexturesInVRam = IniGetInt(gv\OptionFile,"options","enable vram",1) Global EquipmentSFX[2 * 8] ; TODO unusued For i = 0 To 7 @@ -335,7 +335,7 @@ Global CKM_Back = 3 ;Circle Global CKM_Next = 6 ;R1 Global CKM_Prev = 5 ;L1 -Global FOV% = GetINIInt(gv\OptionFile, "options", "fov", 60) +Global FOV% = IniGetInt(gv\OptionFile, "options", "fov", 60) Type CubeMap Field Name$ @@ -765,7 +765,7 @@ Function UpdateRadio() Select NTF_RadioCHN Case 0 ;randomkanava - Case 1 ;hÃ?¤lytyskanava + Case 1 ;h�?¤lytyskanava DebugLog RadioState[1] ResumeChannel(RadioCHN[1]) @@ -1746,20 +1746,20 @@ Function ApplyHitBoxes.HitBox(npctype,npcname$) ;If NTF_GameModeFlag=3 And mp_I\PlayState=GAME_CLIENT Then Return - For i = 0 To GetINIInt(file$,npcname$,"hitbox_amount")-1 - htype% = GetINIInt(file$,npcname$,"hitbox"+(i+1)+"_type") - bonename$ = GetINIString(file$,npcname$,"hitbox"+(i+1)+"_parent") + For i = 0 To IniGetInt(file$,npcname$,"hitbox_amount")-1 + htype% = IniGetInt(file$,npcname$,"hitbox"+(i+1)+"_type") + bonename$ = IniGetString(file$,npcname$,"hitbox"+(i+1)+"_parent") hb\BoneName[i] = bonename ;bone% = FindChild(n\obj,bonename$) ;If bone% = 0 Then RuntimeError "Error applying hitbox: Bone "+bonename$+" not found for npc "+npcname$ If htype = 0 hb\HitBox1[i] = CreateCube() - scaleX# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleX",1.0) - scaleY# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleY",1.0) - scaleZ# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleZ",1.0) - posX# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_posX",0.0) - posY# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_posY",0.0) - posZ# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_posZ",0.0) + scaleX# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleX",1.0) + scaleY# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleY",1.0) + scaleZ# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleZ",1.0) + posX# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_posX",0.0) + posY# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_posY",0.0) + posZ# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_posZ",0.0) ScaleEntity hb\HitBox1[i],scaleX,scaleY,scaleZ PositionEntity hb\HitBox1[i],posX,posY,posZ EntityPickMode hb\HitBox1[i],2 @@ -1767,12 +1767,12 @@ Function ApplyHitBoxes.HitBox(npctype,npcname$) HideEntity hb\HitBox1[i] ElseIf htype = 1 hb\HitBox2[i] = CreateCube() - scaleX# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleX",1.0) - scaleY# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleY",1.0) - scaleZ# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleZ",1.0) - posX# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_posX",0.0) - posY# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_posY",0.0) - posZ# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_posZ",0.0) + scaleX# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleX",1.0) + scaleY# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleY",1.0) + scaleZ# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleZ",1.0) + posX# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_posX",0.0) + posY# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_posY",0.0) + posZ# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_posZ",0.0) ScaleEntity hb\HitBox2[i],scaleX,scaleY,scaleZ PositionEntity hb\HitBox2[i],posX,posY,posZ EntityPickMode hb\HitBox2[i],2 @@ -1780,12 +1780,12 @@ Function ApplyHitBoxes.HitBox(npctype,npcname$) HideEntity hb\HitBox2[i] Else hb\HitBox3[i] = CreateCube() - scaleX# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleX",1.0) - scaleY# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleY",1.0) - scaleZ# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleZ",1.0) - posX# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_posX",0.0) - posY# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_posY",0.0) - posZ# = GetINIFloat(file$,npcname$,"hitbox"+(i+1)+"_posZ",0.0) + scaleX# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleX",1.0) + scaleY# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleY",1.0) + scaleZ# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_scaleZ",1.0) + posX# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_posX",0.0) + posY# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_posY",0.0) + posZ# = IniGetFloat(file$,npcname$,"hitbox"+(i+1)+"_posZ",0.0) ScaleEntity hb\HitBox3[i],scaleX,scaleY,scaleZ PositionEntity hb\HitBox3[i],posX,posY,posZ EntityPickMode hb\HitBox3[i],2 @@ -1913,9 +1913,9 @@ Function GetAnimationSequences(n.NPCs,npcname$) Local animstart%,animstop% Local file$ = "Data\NPCBones.ini" - For i = 1 To GetINIInt(file$,npcname$,"anim_amount") - animstart = GetINIInt(file$,npcname$,"anim"+i+"_start") - animstop = GetINIInt(file$,npcname$,"anim"+i+"_stop") + For i = 1 To IniGetInt(file$,npcname$,"anim_amount") + animstart = IniGetInt(file$,npcname$,"anim"+i+"_start") + animstop = IniGetInt(file$,npcname$,"anim"+i+"_stop") ExtractAnimSeq(n\obj,animstart,animstop,0) Next @@ -1924,7 +1924,7 @@ End Function Function GetAnimationSpeed(n.NPCs,npcname$,currsequence%) Local file$ = "Data\NPCBones.ini" - Return GetINIFloat(file$,npcname$,"anim"+currsequence%+"_speed",0.5) + Return IniGetFloat(file$,npcname$,"anim"+currsequence%+"_speed",0.5) End Function Function ApplyAnimation(n.NPCs,sequence%,speed#,animmode%=1) ;Only works for animations with consistent speed - ENDSHN diff --git a/SourceCode/Main.bb b/SourceCode/Main.bb index 7c63be5..97579ad 100644 --- a/SourceCode/Main.bb +++ b/SourceCode/Main.bb @@ -1,6 +1,6 @@ Include "SourceCode\Math.bb" -Include "SourceCode\IniControler.bb" +Include "SourceCode\IniController.bb" Type FixedTimesteps Field tickDuration# @@ -75,9 +75,20 @@ Function UpdateLang(Lang$) I_Loc\Lang = Lang I_Loc\LangPath = "Localization\" + Lang + "\" I_Loc\Localized = True - IniWriteBuffer(I_Loc\LangPath + "Data\local.ini", 1) + IniWriteBuffer(I_Loc\LangPath + "Data\local.ini") + IniWriteBuffer(I_Loc\LangPath + "Data\SCP-294.ini") EndIf - IniWriteBuffer("Data\local.ini", 1) + IniWriteBuffer("Data\local.ini") + IniWriteBuffer("Data\1499chunks.ini") + ;IniWriteBuffer("Data\events.ini") + IniWriteBuffer("Data\materials.ini") + IniWriteBuffer("Data\NPCAnims.ini") + IniWriteBuffer("Data\NPCBones.ini") + IniWriteBuffer("Data\NPCs.ini") + IniWriteBuffer("Data\PlayerBones.ini") + IniWriteBuffer("Data\rooms.ini") + IniWriteBuffer("Data\SCP-294.ini") + IniWriteBuffer("Data\weapons.ini") InitFonts() End Function @@ -130,40 +141,40 @@ Global MenuWhite%, MenuBlack% Global ButtonSFX% = LoadSound_Strict("SFX\Interact\Button.ogg") Global ButtonSFX2 = LoadSound_Strict("SFX\Interact\Button2.ogg") -;Global EnableSFXRelease% = GetINIInt(gv\OptionFile, "audio", "sfx release", 1) +;Global EnableSFXRelease% = IniGetInt(gv\OptionFile, "audio", "sfx release", 1) ;Global EnableSFXRelease_Prev% = EnableSFXRelease% -;Global ConsoleEnabled% = Instr(gv\Cmd$,"-console");GetINIInt(gv\OptionFile, "console", "enabled") +;Global ConsoleEnabled% = Instr(gv\Cmd$,"-console");IniGetInt(gv\OptionFile, "console", "enabled") ;[Block] -;Global LauncherWidth%= Min(GetINIInt(gv\OptionFile, "launcher", "launcher width", 640), 1024) -;Global LauncherHeight% = Min(GetINIInt(gv\OptionFile, "launcher", "launcher height", 480), 768) -;Global LauncherEnabled% = GetINIInt(gv\OptionFile, "launcher", "launcher enabled", 1) +;Global LauncherWidth%= Min(IniGetInt(gv\OptionFile, "launcher", "launcher width", 640), 1024) +;Global LauncherHeight% = Min(IniGetInt(gv\OptionFile, "launcher", "launcher height", 480), 768) +;Global LauncherEnabled% = IniGetInt(gv\OptionFile, "launcher", "launcher enabled", 1) Global LauncherIMG% -;Global GraphicWidth% = GetINIInt(gv\OptionFile, "options", "width", DesktopWidth()) -;Global GraphicHeight% = GetINIInt(gv\OptionFile, "options", "height", DesktopHeight()) +;Global GraphicWidth% = IniGetInt(gv\OptionFile, "options", "width", DesktopWidth()) +;Global GraphicHeight% = IniGetInt(gv\OptionFile, "options", "height", DesktopHeight()) ;Global Depth% = 0 ;Global SelectedGFXMode% -;Global SelectedGFXDriver% = Max(GetINIInt(gv\OptionFile, "options", "gfx driver", 1), 1) +;Global SelectedGFXDriver% = Max(IniGetInt(gv\OptionFile, "options", "gfx driver", 1), 1) Global fresize_image%, fresize_texture%, fresize_texture2% Global fresize_cam% -;Global ShowFPS = GetINIInt(gv\OptionFile, "options", "show FPS") +;Global ShowFPS = IniGetInt(gv\OptionFile, "options", "show FPS") Global WireframeState Global HalloweenTex -;Global DisplayMode% = GetINIInt(gv\OptionFile, "options", "display mode", 1) +;Global DisplayMode% = IniGetInt(gv\OptionFile, "options", "display mode", 1) Global RealGraphicWidth%,RealGraphicHeight% Global AspectRatioRatio# -;Global EnableRoomLights% = GetINIInt(gv\OptionFile, "options", "room lights enabled", 1) +;Global EnableRoomLights% = IniGetInt(gv\OptionFile, "options", "room lights enabled", 1) -;Global TextureDetails% = GetINIInt(gv\OptionFile, "options", "texture details", 3) +;Global TextureDetails% = IniGetInt(gv\OptionFile, "options", "texture details", 3) Global TextureFloat# Select opt\TextureDetails% Case 0 @@ -173,8 +184,8 @@ Select opt\TextureDetails% Case 2 TextureFloat# = -0.8 End Select -;Global ConsoleOpening% = GetINIInt(gv\OptionFile, "console", "auto opening") -;Global SFXVolume# = GetINIFloat(gv\OptionFile, "audio", "sound volume", 1.0) +;Global ConsoleOpening% = IniGetInt(gv\OptionFile, "console", "auto opening") +;Global SFXVolume# = IniGetFloat(gv\OptionFile, "audio", "sound volume", 1.0) ;Include "SourceCode\Achievements.bb" ;Include "SourceCode\Difficulty.bb" @@ -204,6 +215,7 @@ EndIf If FileType(I_Loc\LangPath + Data294) = 1 Then Data294 = I_Loc\LangPath + Data294 + IniWriteBuffer(Data294) EndIf If FileType(I_Loc\LangPath + AchvIni) = 1 Then @@ -218,15 +230,15 @@ SetBuffer(BackBuffer()) Global CurTime%, PrevTime%, LoopDelay%, FPSfactor#, FPSfactor2# -Global Framelimit% = GetINIInt(gv\OptionFile, "options", "framelimit", 120) -Global Vsync% = GetINIInt(gv\OptionFile, "options", "vsync") +Global Framelimit% = IniGetInt(gv\OptionFile, "options", "framelimit", 120) +Global Vsync% = IniGetInt(gv\OptionFile, "options", "vsync") Global CurrFrameLimit# = (Framelimit%-29)/100.0 TextureAnisotropic 2^(opt\TextureFiltering+1) TextureLodBias TextureFloat# -Global ScreenGamma# = GetINIFloat(gv\OptionFile, "options", "screengamma", 1.0) +Global ScreenGamma# = IniGetFloat(gv\OptionFile, "options", "screengamma", 1.0) SeedRnd MilliSecs() @@ -271,17 +283,17 @@ Global mouse_left_limit% = 250 * MenuScale, mouse_right_limit% = opt\GraphicWidt Global mouse_top_limit% = 150 * MenuScale, mouse_bottom_limit% = opt\GraphicHeight - mouse_top_limit ; As above. Global mouse_x_speed_1#, mouse_y_speed_1# -Global KEY_RIGHT = GetINIInt(gv\OptionFile, "binds", "Right key", 32) -Global KEY_LEFT = GetINIInt(gv\OptionFile, "binds", "Left key", 30) -Global KEY_UP = GetINIInt(gv\OptionFile, "binds", "Up key", 17) -Global KEY_DOWN = GetINIInt(gv\OptionFile, "binds", "Down key", 31) +Global KEY_RIGHT = IniGetInt(gv\OptionFile, "binds", "Right key", 32) +Global KEY_LEFT = IniGetInt(gv\OptionFile, "binds", "Left key", 30) +Global KEY_UP = IniGetInt(gv\OptionFile, "binds", "Up key", 17) +Global KEY_DOWN = IniGetInt(gv\OptionFile, "binds", "Down key", 31) -Global KEY_BLINK = GetINIInt(gv\OptionFile, "binds", "Blink key", 57) -Global KEY_SPRINT = GetINIInt(gv\OptionFile, "binds", "Sprint key", 42) -Global KEY_INV = GetINIInt(gv\OptionFile, "binds", "Inventory key", 15) -Global KEY_CROUCH = GetINIInt(gv\OptionFile, "binds", "Crouch key", 29) -Global KEY_SAVE = GetINIInt(gv\OptionFile, "binds", "Save key", 63) -Global KEY_CONSOLE = GetINIInt(gv\OptionFile, "binds", "Console key", 61) +Global KEY_BLINK = IniGetInt(gv\OptionFile, "binds", "Blink key", 57) +Global KEY_SPRINT = IniGetInt(gv\OptionFile, "binds", "Sprint key", 42) +Global KEY_INV = IniGetInt(gv\OptionFile, "binds", "Inventory key", 15) +Global KEY_CROUCH = IniGetInt(gv\OptionFile, "binds", "Crouch key", 29) +Global KEY_SAVE = IniGetInt(gv\OptionFile, "binds", "Save key", 63) +Global KEY_CONSOLE = IniGetInt(gv\OptionFile, "binds", "Console key", 61) Global Mesh_MinX#, Mesh_MinY#, Mesh_MinZ# Global Mesh_MaxX#, Mesh_MaxY#, Mesh_MaxZ# @@ -324,7 +336,7 @@ Global PlayerZone%, PlayerRoom.Rooms Global GrabbedEntity% -Global InvertMouse% = GetINIInt(gv\OptionFile, "options", "invert mouse y") +Global InvertMouse% = IniGetInt(gv\OptionFile, "options", "invert mouse y") Global MouseHit1%, MouseDown1%, MouseHit2%, MouseDown2%, DoubleClick%, LastMouseHit1%, MouseUp1% Global GodMode%, NoClip%, NoClipSpeed# = 2.0 @@ -408,18 +420,18 @@ Global BlurVolume#, BlurTimer# Global LightBlink#, LightFlash# -Global BumpEnabled% = GetINIInt(gv\OptionFile, "options", "bump mapping enabled", 1) -Global HUDenabled% = GetINIInt(gv\OptionFile, "options", "HUD enabled", 1) +Global BumpEnabled% = IniGetInt(gv\OptionFile, "options", "bump mapping enabled", 1) +Global HUDenabled% = IniGetInt(gv\OptionFile, "options", "HUD enabled", 1) Global Camera%, CameraShake#, CurrCameraZoom# -Global Brightness% = GetINIFloat(gv\OptionFile, "options", "brightness", 20) -Global CameraFogNear# = GetINIFloat(gv\OptionFile, "options", "camera fog near", 0.5) -Global CameraFogFar# = GetINIFloat(gv\OptionFile, "options", "camera fog far", 6.0) +Global Brightness% = IniGetFloat(gv\OptionFile, "options", "brightness", 20) +Global CameraFogNear# = IniGetFloat(gv\OptionFile, "options", "camera fog near", 0.5) +Global CameraFogFar# = IniGetFloat(gv\OptionFile, "options", "camera fog far", 6.0) Global StoredCameraFogFar# = CameraFogFar -Global MouseSens# = GetINIFloat(gv\OptionFile, "options", "mouse sensitivity") +Global MouseSens# = IniGetFloat(gv\OptionFile, "options", "mouse sensitivity") Include "SourceCode\dreamfilter.bb" @@ -476,7 +488,7 @@ Music[37] = "Multiplayer\It_Watches" Music[38] = "Suspense" Music[39] = "SaveMeFrom" -;Global MusicVolume# = GetINIFloat(gv\OptionFile, "audio", "music volume", 0.5) +;Global MusicVolume# = IniGetFloat(gv\OptionFile, "audio", "music volume", 0.5) ;Global MusicCHN% = PlaySound_Strict(Music[2]) Global MusicCHN @@ -632,8 +644,8 @@ MaskImage NVGImages,255,0,255 Global Wearing1499% = False Global AmbientLightRoomTex%, AmbientLightRoomVal% -Global EnableUserTracks% = GetINIInt(gv\OptionFile, "audio", "enable user tracks") -Global UserTrackMode% = GetINIInt(gv\OptionFile, "audio", "user track setting") +Global EnableUserTracks% = IniGetInt(gv\OptionFile, "audio", "enable user tracks") +Global UserTrackMode% = IniGetInt(gv\OptionFile, "audio", "user track setting") Global UserTrackCheck% = 0, UserTrackCheck2% = 0 Global UserTrackMusicAmount% = 0, CurrUserTrack%, UserTrackFlag% = False Global UserTrackName$[64] @@ -663,7 +675,7 @@ Global room2gw_brokendoor% = False Global room2gw_x# = 0.0 Global room2gw_z# = 0.0 -Global ParticleAmount% = GetINIInt(gv\OptionFile,"options","particle amount", 2) +Global ParticleAmount% = IniGetInt(gv\OptionFile,"options","particle amount", 2) Global NavImages%[5] For i = 0 To 3 @@ -3223,9 +3235,9 @@ Function LoadEntities() Panel294 = LoadImage_Strict("GFX\294panel.jpg") MaskImage(Panel294, 255,0,255) - Brightness% = GetINIFloat(gv\OptionFile, "options", "brightness", 20) - CameraFogNear# = GetINIFloat(gv\OptionFile, "options", "camera fog near", 0.5) - CameraFogFar# = GetINIFloat(gv\OptionFile, "options", "camera fog far", 6.0) + Brightness% = IniGetFloat(gv\OptionFile, "options", "brightness", 20) + CameraFogNear# = IniGetFloat(gv\OptionFile, "options", "camera fog near", 0.5) + CameraFogFar# = IniGetFloat(gv\OptionFile, "options", "camera fog far", 6.0) StoredCameraFogFar# = CameraFogFar ;TextureLodBias @@ -3247,7 +3259,7 @@ Function LoadEntities() CameraRange(Camera, 0.01, CameraFogFar) CameraFogMode (Camera, 1) CameraFogRange (Camera, CameraFogNear, CameraFogFar) - CameraFogColor (Camera, GetINIInt(gv\OptionFile, "options", "fog r"), GetINIInt(gv\OptionFile, "options", "fog g"), GetINIInt(gv\OptionFile, "options", "fog b")) + CameraFogColor (Camera, IniGetInt(gv\OptionFile, "options", "fog r"), IniGetInt(gv\OptionFile, "options", "fog g"), IniGetInt(gv\OptionFile, "options", "fog b")) AmbientLight Brightness, Brightness, Brightness m_I\Cam = CreateCamera(Camera) @@ -4146,7 +4158,7 @@ Function NullGame(nomenuload%=False,playbuttonsfx%=True) entry = PlayerRoomName EndIf EndIf - PutINIValue(gv\OptionFile,"options","progress",entry) + IniWriteString(gv\OptionFile,"options","progress",entry) InitConsole(2) Delete Each Menu3DInstance Load3DMenu(entry) @@ -4835,24 +4847,24 @@ Function Use294() Input294 = Right(Input294, Len(Input294)-9) EndIf - If Input294<>"" - Local loc% = GetINISectionLocation(Data294, Input294) + If Input294 <> "" + Local drink$ = FindSCP294Drink(Input294) EndIf - If loc > 0 Then - strtemp$ = GetINIString2(Data294, loc, "dispensesound") + If drink <> "Null" Then + strtemp$ = IniGetString(Data294, drink, "dispensesound") If strtemp="" Then PlayerRoom\SoundCHN = PlaySound_Strict (LoadTempSound("SFX\SCP\294\dispense1.ogg")) Else PlayerRoom\SoundCHN = PlaySound_Strict (LoadTempSound(strtemp)) EndIf - If GetINIInt2(Data294, loc, "explosion")=True Then + If IniGetInt(Data294, drink, "explosion")=True Then ExplosionTimer = 135 - DeathMSG = GetINIString2(Data294, loc, "deathmessage") + DeathMSG = IniGetString(Data294, drink, "deathmessage") EndIf - strtemp$ = GetINIString2(Data294, loc, "color") + strtemp$ = IniGetString(Data294, drink, "color") sep1 = Instr(strtemp, ",", 1) sep2 = Instr(strtemp, ",", sep1+1) @@ -4860,8 +4872,8 @@ Function Use294() g% = Trim(Mid(strtemp, sep1+1, sep2-sep1-1)) b% = Trim(Right(strtemp, Len(strtemp)-sep2)) - alpha# = Float(GetINIString2(Data294, loc, "alpha",1.0)) - glow = GetINIInt2(Data294, loc, "glow") + alpha# = Float(IniGetString(Data294, drink, "alpha",1.0)) + glow = IniGetInt(Data294, drink, "glow") ;If alpha = 0 Then alpha = 1.0 If glow Then alpha = -alpha @@ -5277,371 +5289,62 @@ Include "SourceCode/Decals.bb" ;--------------------------------------- INI-functions ------------------------------------------------------- -Type INIFile - Field name$ - Field bank% - Field bankOffset% = 0 - Field size% -End Type - -Function ReadINILine$(file.INIFile) - Local rdbyte% - Local firstbyte% = True - Local offset% = file\bankOffset - Local bank% = file\bank - Local retStr$ = "" - rdbyte = PeekByte(bank,offset) - While ((firstbyte) Lor ((rdbyte<>13) And (rdbyte<>10))) And (offset13) And (rdbyte<>10)) Then - firstbyte = False - retStr=retStr+Chr(rdbyte) - EndIf - offset=offset+1 - Wend - file\bankOffset = offset - Return retStr -End Function - -Function UpdateINIFile$(filename$) - Local file.INIFile = Null - For k.INIFile = Each INIFile - If k\name = Lower(filename) Then - file = k - Exit - EndIf - Next - - If file=Null Then Return - - If file\bank<>0 Then FreeBank file\bank - Local f% = ReadFile(file\name) - Local fleSize% = 1 - While fleSize 0 Then - Local file.INIFile = Null - For k.INIFile = Each INIFile - If k\name = Lower(filename) Then - file = k - Exit - EndIf - Next - If file <> Null Then - FreeBank file\bank - DebugLog "FREED BANK FOR "+filename - Delete file - Return - EndIf - EndIf - DebugLog "COULD NOT FREE BANK FOR "+filename+": INI FILE IS NOT LOADED" -End Function - -Function GetINIString$(file$, section$, parameter$, defaultvalue$="") - Local TemporaryString$ = "" - - Local lfile.INIFile = Null - For k.INIFile = Each INIFile - If k\name = Lower(file) Then - lfile = k - Exit - EndIf - Next - - If lfile = Null Then - DebugLog "CREATE BANK FOR "+file - lfile = New INIFile - lfile\name = Lower(file) - lfile\bank = 0 - UpdateINIFile(lfile\name) - EndIf - - lfile\bankOffset = 0 - - section = Lower(section) - - ;While Not Eof(f) - While lfile\bankOffset=lfile\size) - - ;CloseFile f - Return defaultvalue - EndIf - EndIf - Wend - - Return defaultvalue -End Function - -Function GetINIInt%(file$, section$, parameter$, defaultvalue% = 0) - Local txt$ = GetINIString(file$, section$, parameter$, defaultvalue) - If Lower(txt) = "true" Then - Return 1 - ElseIf Lower(txt) = "false" - Return 0 - Else - Return Int(txt) - EndIf -End Function - -Function GetINIFloat#(file$, section$, parameter$, defaultvalue# = 0.0) - Return Float(GetINIString(file$, section$, parameter$, defaultvalue)) -End Function - - -Function GetINIString2$(file$, start%, parameter$, defaultvalue$="") - Local TemporaryString$ = "" - Local f% = ReadFile(file) - - Local n%=0 - While Not Eof(f) - Local strtemp$ = ReadLine(f) - n=n+1 - If n=start Then - Repeat - TemporaryString = ReadLine(f) - If Lower(Trim(Left(TemporaryString, Max(Instr(TemporaryString, "=") - 1, 0)))) = Lower(parameter) Then - CloseFile f - Return Trim( Right(TemporaryString,Len(TemporaryString)-Instr(TemporaryString,"=")) ) - EndIf - Until Left(TemporaryString, 1) = "[" Lor Eof(f) - CloseFile f - Return defaultvalue - EndIf - Wend - - CloseFile f - - Return defaultvalue -End Function - -Function GetINIInt2%(file$, start%, parameter$, defaultvalue$="") - Local txt$ = GetINIString2(file$, start%, parameter$, defaultvalue$) - If Lower(txt) = "true" Then - Return 1 - ElseIf Lower(txt) = "false" - Return 0 - Else - Return Int(txt) - EndIf -End Function - - -Function GetINISectionLocation%(file$, section$) - Local Temp% - Local f% = ReadFile(file) - - section = Lower(section) - - Local n%=0 - While Not Eof(f) - Local strtemp$ = ReadLine(f) - n=n+1 - If Left(strtemp,1) = "[" Then - strtemp$ = Lower(strtemp) - Temp = Instr(strtemp, section) - If Temp>0 Then - If (Mid(strtemp, Temp-1, 1)="[" Lor Mid(strtemp, Temp-1, 1)="|") And (Mid(strtemp, Temp+Len(section), 1)="]" Lor Mid(strtemp, Temp+Len(section), 1)="|") Then - CloseFile f - Return n - EndIf - EndIf - EndIf - Wend - - CloseFile f -End Function - - - -Function PutINIValue%(file$, INI_sSection$, INI_sKey$, INI_sValue$) - - ; Returns: True (Success) Lor False (Failed) - - INI_sSection = "[" + Trim$(INI_sSection) + "]" - Local INI_sUpperSection$ = Upper$(INI_sSection) - INI_sKey = Trim$(INI_sKey) - INI_sValue = Trim$(INI_sValue) - Local INI_sFilename$ = file$ - - ; Retrieve the INI Data (If it exists) - - Local INI_sContents$ = INI_FileToString(INI_sFilename) - - ; (Re)Create the INI file updating/adding the SECTION, KEY And VALUE - - Local INI_bWrittenKey% = False - Local INI_bSectionFound% = False - Local INI_sCurrentSection$ = "" - - Local INI_lFileHandle% = WriteFile(INI_sFilename) - If INI_lFileHandle = 0 Then Return False ; Create file failed! - - Local INI_lOldPos% = 1 - Local INI_lPos% = Instr(INI_sContents, Chr$(0)) - - While (INI_lPos <> 0) - - Local INI_sTemp$ = Mid$(INI_sContents, INI_lOldPos, (INI_lPos - INI_lOldPos)) - - If (INI_sTemp <> "") Then - - If Left$(INI_sTemp, 1) = "[" And Right$(INI_sTemp, 1) = "]" Then - - ; Process SECTION - - If (INI_sCurrentSection = INI_sUpperSection) And (INI_bWrittenKey = False) Then - INI_bWrittenKey = INI_CreateKey(INI_lFileHandle, INI_sKey, INI_sValue) - End If - INI_sCurrentSection = Upper$(INI_CreateSection(INI_lFileHandle, INI_sTemp)) - If (INI_sCurrentSection = INI_sUpperSection) Then INI_bSectionFound = True - - Else - If Left(INI_sTemp, 1) = ":" Then - WriteLine INI_lFileHandle, INI_sTemp - Else - ; KEY=VALUE - Local lEqualsPos% = Instr(INI_sTemp, "=") - If (lEqualsPos <> 0) Then - If (INI_sCurrentSection = INI_sUpperSection) And (Upper$(Trim$(Left$(INI_sTemp, (lEqualsPos - 1)))) = Upper$(INI_sKey)) Then - If (INI_sValue <> "") Then INI_CreateKey INI_lFileHandle, INI_sKey, INI_sValue - INI_bWrittenKey = True - Else - WriteLine INI_lFileHandle, INI_sTemp - End If - End If - EndIf - - End If - - End If - - ; Move through the INI file... - - INI_lOldPos = INI_lPos + 1 - INI_lPos% = Instr(INI_sContents, Chr$(0), INI_lOldPos) - - Wend - - ; KEY wasn;t found in the INI file - Append a New SECTION If required And create our KEY=VALUE Line - - If (INI_bWrittenKey = False) Then - If (INI_bSectionFound = False) Then INI_CreateSection INI_lFileHandle, INI_sSection - INI_CreateKey INI_lFileHandle, INI_sKey, INI_sValue - End If - - CloseFile INI_lFileHandle - - Return True ; Success - -End Function - -Function INI_FileToString$(INI_sFilename$) - - Local INI_sString$ = "" - Local INI_lFileHandle%= ReadFile(INI_sFilename) - If INI_lFileHandle <> 0 Then - While Not(Eof(INI_lFileHandle)) - INI_sString = INI_sString + ReadLine$(INI_lFileHandle) + Chr$(0) - Wend - CloseFile INI_lFileHandle - End If - Return INI_sString - -End Function - -Function INI_CreateSection$(INI_lFileHandle%, INI_sNewSection$) - - If FilePos(INI_lFileHandle) <> 0 Then WriteLine INI_lFileHandle, "" ; Blank Line between sections - WriteLine INI_lFileHandle, INI_sNewSection - Return INI_sNewSection - -End Function - -Function INI_CreateKey%(INI_lFileHandle%, INI_sKey$, INI_sValue$) - - WriteLine INI_lFileHandle, INI_sKey + " = " + INI_sValue - Return True - -End Function - ;Save options to .ini. Function SaveOptionsINI() - PutINIValue(gv\OptionFile, "options", "mouse sensitivity", MouseSens) - PutINIValue(gv\OptionFile, "options", "mouse smoothing", opt\MouseSmooth) - PutINIValue(gv\OptionFile, "options", "invert mouse y", InvertMouse) - PutINIValue(gv\OptionFile, "options", "hold to aim", opt\HoldToAim) - PutINIValue(gv\OptionFile, "options", "hold to crouch", opt\HoldToCrouch) - PutINIValue(gv\OptionFile, "options", "bump mapping enabled", BumpEnabled) - PutINIValue(gv\OptionFile, "options", "HUD enabled", HUDenabled) - PutINIValue(gv\OptionFile, "options", "screengamma", ScreenGamma) - PutINIValue(gv\OptionFile, "options", "vsync", Vsync) - PutINIValue(gv\OptionFile, "options", "show FPS", opt\ShowFPS) - PutINIValue(gv\OptionFile, "options", "framelimit", Framelimit%) - PutINIValue(gv\OptionFile, "options", "achievement popup enabled", AchvMSGenabled%) - PutINIValue(gv\OptionFile, "options", "room lights enabled", opt\EnableRoomLights%) - PutINIValue(gv\OptionFile, "options", "texture details", opt\TextureDetails%) - PutINIValue(gv\OptionFile, "options", "texture filtering", opt\TextureFiltering%) - PutINIValue(gv\OptionFile, "console", "enabled", opt\ConsoleEnabled%) - PutINIValue(gv\OptionFile, "console", "auto opening", opt\ConsoleOpening%) - PutINIValue(gv\OptionFile, "options", "particle amount", ParticleAmount) - PutINIValue(gv\OptionFile, "options", "enable vram", SaveTexturesInVRam) - PutINIValue(gv\OptionFile, "options", "cubemaps", opt\RenderCubeMapMode) - - PutINIValue(gv\OptionFile, "audio", "master volume", opt\MasterVol) - PutINIValue(gv\OptionFile, "audio", "music volume", opt\MusicVol) - PutINIValue(gv\OptionFile, "audio", "sound volume", opt\SFXVolume) - PutINIValue(gv\OptionFile, "audio", "voice volume", opt\VoiceVol) - PutINIValue(gv\OptionFile, "audio", "sfx release", opt\EnableSFXRelease) - PutINIValue(gv\OptionFile, "audio", "enable user tracks", EnableUserTracks%) - PutINIValue(gv\OptionFile, "audio", "user track setting", UserTrackMode%) - - PutINIValue(gv\OptionFile, "binds", "Right key", KEY_RIGHT) - PutINIValue(gv\OptionFile, "binds", "Left key", KEY_LEFT) - PutINIValue(gv\OptionFile, "binds", "Up key", KEY_UP) - PutINIValue(gv\OptionFile, "binds", "Down key", KEY_DOWN) - PutINIValue(gv\OptionFile, "binds", "Blink key", KEY_BLINK) - PutINIValue(gv\OptionFile, "binds", "Sprint key", KEY_SPRINT) - PutINIValue(gv\OptionFile, "binds", "Inventory key", KEY_INV) - PutINIValue(gv\OptionFile, "binds", "Crouch key", KEY_CROUCH) - PutINIValue(gv\OptionFile, "binds", "Save key", KEY_SAVE) - PutINIValue(gv\OptionFile, "binds", "Console key", KEY_CONSOLE) + IniWriteString(gv\OptionFile, "options", "mouse sensitivity", MouseSens) + IniWriteString(gv\OptionFile, "options", "mouse smoothing", opt\MouseSmooth) + IniWriteString(gv\OptionFile, "options", "invert mouse y", InvertMouse) + IniWriteString(gv\OptionFile, "options", "hold to aim", opt\HoldToAim) + IniWriteString(gv\OptionFile, "options", "hold to crouch", opt\HoldToCrouch) + IniWriteString(gv\OptionFile, "options", "bump mapping enabled", BumpEnabled) + IniWriteString(gv\OptionFile, "options", "HUD enabled", HUDenabled) + IniWriteString(gv\OptionFile, "options", "screengamma", ScreenGamma) + IniWriteString(gv\OptionFile, "options", "vsync", Vsync) + IniWriteString(gv\OptionFile, "options", "show FPS", opt\ShowFPS) + IniWriteString(gv\OptionFile, "options", "framelimit", Framelimit%) + IniWriteString(gv\OptionFile, "options", "achievement popup enabled", AchvMSGenabled%) + IniWriteString(gv\OptionFile, "options", "room lights enabled", opt\EnableRoomLights%) + IniWriteString(gv\OptionFile, "options", "texture details", opt\TextureDetails%) + IniWriteString(gv\OptionFile, "options", "texture filtering", opt\TextureFiltering%) + IniWriteString(gv\OptionFile, "console", "enabled", opt\ConsoleEnabled%) + IniWriteString(gv\OptionFile, "console", "auto opening", opt\ConsoleOpening%) + IniWriteString(gv\OptionFile, "options", "particle amount", ParticleAmount) + IniWriteString(gv\OptionFile, "options", "enable vram", SaveTexturesInVRam) + IniWriteString(gv\OptionFile, "options", "cubemaps", opt\RenderCubeMapMode) + + IniWriteString(gv\OptionFile, "audio", "master volume", opt\MasterVol) + IniWriteString(gv\OptionFile, "audio", "music volume", opt\MusicVol) + IniWriteString(gv\OptionFile, "audio", "sound volume", opt\SFXVolume) + IniWriteString(gv\OptionFile, "audio", "voice volume", opt\VoiceVol) + IniWriteString(gv\OptionFile, "audio", "sfx release", opt\EnableSFXRelease) + IniWriteString(gv\OptionFile, "audio", "enable user tracks", EnableUserTracks%) + IniWriteString(gv\OptionFile, "audio", "user track setting", UserTrackMode%) + + IniWriteString(gv\OptionFile, "binds", "Right key", KEY_RIGHT) + IniWriteString(gv\OptionFile, "binds", "Left key", KEY_LEFT) + IniWriteString(gv\OptionFile, "binds", "Up key", KEY_UP) + IniWriteString(gv\OptionFile, "binds", "Down key", KEY_DOWN) + IniWriteString(gv\OptionFile, "binds", "Blink key", KEY_BLINK) + IniWriteString(gv\OptionFile, "binds", "Sprint key", KEY_SPRINT) + IniWriteString(gv\OptionFile, "binds", "Inventory key", KEY_INV) + IniWriteString(gv\OptionFile, "binds", "Crouch key", KEY_CROUCH) + IniWriteString(gv\OptionFile, "binds", "Save key", KEY_SAVE) + IniWriteString(gv\OptionFile, "binds", "Console key", KEY_CONSOLE) ;NTF mod options - PutINIValue(gv\OptionFile, "binds", "Reload key", KEY_RELOAD) - ;PutINIValue(gv\OptionFile, "binds", "Chat key", KEY_CHAT) - PutINIValue(gv\OptionFile, "binds", "Holstergun key", KEY_HOLSTERGUN) - PutINIValue(gv\OptionFile, "binds", "Radiotoggle key", KEY_RADIOTOGGLE) - PutINIValue(gv\OptionFile, "binds", "Use key", KEY_USE) - PutINIValue(gv\OptionFile, "options", "fov", FOV) - ;PutINIValue(gv\OptionFile, "options", "pack", "English") TODO - PutINIValue(gv\OptionFile, "options", "show disclaimers", opt\ShowDisclaimers) + IniWriteString(gv\OptionFile, "binds", "Reload key", KEY_RELOAD) + ;IniWriteString(gv\OptionFile, "binds", "Chat key", KEY_CHAT) + IniWriteString(gv\OptionFile, "binds", "Holstergun key", KEY_HOLSTERGUN) + IniWriteString(gv\OptionFile, "binds", "Radiotoggle key", KEY_RADIOTOGGLE) + IniWriteString(gv\OptionFile, "binds", "Use key", KEY_USE) + IniWriteString(gv\OptionFile, "options", "fov", FOV) + ;IniWriteString(gv\OptionFile, "options", "pack", "English") TODO + IniWriteString(gv\OptionFile, "options", "show disclaimers", opt\ShowDisclaimers) SaveController() SaveKeyBinds() - PutINIValue(gv\OptionFile, "game options", "game mode", gopt\SingleplayerGameMode) + IniWriteString(gv\OptionFile, "game options", "game mode", gopt\SingleplayerGameMode) End Function @@ -6105,18 +5808,18 @@ End Function Function InitFonts() Local txt$ - fo\Font[Font_Default] = LoadFont("GFX\font\Courier New.ttf", Int(16 * (opt\GraphicHeight / 1024.0))) - fo\Font[Font_Default_Medium] = LoadFont("GFX\font\Courier New.ttf", Int(28 * (opt\GraphicHeight / 1024.0))) - fo\Font[Font_Default_Large] = LoadFont("GFX\font\Courier New.ttf", Int(46 * (opt\GraphicHeight / 1024.0))) ;TODO make this use a bold font - fo\Font[Font_Menu_Small] = LoadFont("GFX\font\Capture It.ttf",Int(23 * (opt\GraphicHeight / 1024.0))) - fo\Font[Font_Menu_Medium] = LoadFont("GFX\font\Capture It.ttf",Int(42 * (opt\GraphicHeight / 1024.0))) - fo\Font[Font_Menu] = LoadFont("GFX\font\Capture It.ttf", Int(56 * (opt\GraphicHeight / 1024.0))) - fo\Font[Font_Digital_Small] = LoadFont("GFX\font\DS-Digital.ttf", Int(20 * (opt\GraphicHeight / 1024.0))) - fo\Font[Font_Digital_Medium] = LoadFont("GFX\font\DS-Digital.ttf", Int(28 * (opt\GraphicHeight / 1024.0))) - fo\Font[Font_Digital_Large] = LoadFont("GFX\font\DS-Digital.ttf", Int(58 * (opt\GraphicHeight / 1024.0))) - fo\Font[Font_Journal] = LoadFont("GFX\font\Journal.ttf", Int(56 * (opt\GraphicHeight / 1024.0))) + fo\Font[Font_Default] = LoadFont_Strict("GFX\font\Courier New.ttf", Int(16 * (opt\GraphicHeight / 1024.0))) + fo\Font[Font_Default_Medium] = LoadFont_Strict("GFX\font\Courier New.ttf", Int(28 * (opt\GraphicHeight / 1024.0))) + fo\Font[Font_Default_Large] = LoadFont_Strict("GFX\font\Courier New.ttf", Int(46 * (opt\GraphicHeight / 1024.0))) ;TODO make this use a bold font + fo\Font[Font_Menu_Small] = LoadFont_Strict("GFX\font\Capture It.ttf",Int(23 * (opt\GraphicHeight / 1024.0))) + fo\Font[Font_Menu_Medium] = LoadFont_Strict("GFX\font\Capture It.ttf",Int(42 * (opt\GraphicHeight / 1024.0))) + fo\Font[Font_Menu] = LoadFont_Strict("GFX\font\Capture It.ttf", Int(56 * (opt\GraphicHeight / 1024.0))) + fo\Font[Font_Digital_Small] = LoadFont_Strict("GFX\font\DS-Digital.ttf", Int(20 * (opt\GraphicHeight / 1024.0))) + fo\Font[Font_Digital_Medium] = LoadFont_Strict("GFX\font\DS-Digital.ttf", Int(28 * (opt\GraphicHeight / 1024.0))) + fo\Font[Font_Digital_Large] = LoadFont_Strict("GFX\font\DS-Digital.ttf", Int(58 * (opt\GraphicHeight / 1024.0))) + fo\Font[Font_Journal] = LoadFont_Strict("GFX\font\Journal.ttf", Int(56 * (opt\GraphicHeight / 1024.0))) - fo\ConsoleFont% = LoadFont("GFX\font\Minimal5x7.ttf", Int(28 * (opt\GraphicHeight / 1024.0))) + fo\ConsoleFont% = LoadFont_Strict("GFX\font\Minimal5x7.ttf", Int(28 * (opt\GraphicHeight / 1024.0))) SetFont fo\Font[Font_Menu] @@ -6160,7 +5863,7 @@ End Function Function PlayStartupVideos() CatchErrors("PlayStartupVideos()") - If GetINIInt(gv\OptionFile,"options","play startup video",1)=0 Then Return + If IniGetInt(gv\OptionFile,"options","play startup video",1)=0 Then Return HidePointer() @@ -6188,7 +5891,7 @@ Function PlayStartupVideos() SplashScreenVideo = BlitzMovie_OpenD3D(moviefile$+".wmv", SystemProperty("Direct3DDevice7"), SystemProperty("DirectDraw7")) If SplashScreenVideo = 0 Then - PutINIValue(gv\OptionFile, "options", "play startup video", "false") + IniWriteString(gv\OptionFile, "options", "play startup video", "false") Return EndIf diff --git a/SourceCode/MapSystem.bb b/SourceCode/MapSystem.bb index 02522bf..e367c09 100644 --- a/SourceCode/MapSystem.bb +++ b/SourceCode/MapSystem.bb @@ -1605,12 +1605,12 @@ Function LoadRoomTemplates(file$) If Left(TemporaryString,1) = "[" Then TemporaryString = Mid(TemporaryString, 2, Len(TemporaryString) - 2) If TemporaryString<>"room ambience" Then - StrTemp = Lower(TemporaryString)+"\"+GetINIString(file, TemporaryString, "mesh") + StrTemp = Lower(TemporaryString)+"\"+IniGetString(file, TemporaryString, "mesh") rt = CreateRoomTemplate(StrTemp) rt\Name = Lower(TemporaryString) - StrTemp = Lower(GetINIString(file, TemporaryString, "shape")) + StrTemp = Lower(IniGetString(file, TemporaryString, "shape")) Select StrTemp Case "room1", "1" rt\Shape = ROOM1 @@ -1625,7 +1625,7 @@ Function LoadRoomTemplates(file$) End Select For i = 0 To 1 - StrTemp = Lower(GetINIString(file, TemporaryString, "zone"+(i+1))) + StrTemp = Lower(IniGetString(file, TemporaryString, "zone"+(i+1))) Select StrTemp Case "lcz" @@ -1637,11 +1637,11 @@ Function LoadRoomTemplates(file$) End Select Next - rt\Commonness = Max(Min(GetINIInt(file, TemporaryString, "commonness"), 100), 0) - rt\DisableDecals = GetINIInt(file, TemporaryString, "disabledecals") - rt\UseLightCones = GetINIInt(file, TemporaryString, "usevolumelighting") - rt\DisableOverlapCheck = GetINIInt(file, TemporaryString, "disableoverlapcheck") - rt\AutoSpawn = GetINIInt(file, TemporaryString, "autospawn", 0) + rt\Commonness = Max(Min(IniGetInt(file, TemporaryString, "commonness"), 100), 0) + rt\DisableDecals = IniGetInt(file, TemporaryString, "disabledecals") + rt\UseLightCones = IniGetInt(file, TemporaryString, "usevolumelighting") + rt\DisableOverlapCheck = IniGetInt(file, TemporaryString, "disableoverlapcheck") + rt\AutoSpawn = IniGetInt(file, TemporaryString, "autospawn", 0) EndIf EndIf Wend @@ -1654,7 +1654,7 @@ Function LoadRoomTemplates(file$) Else drawtimer = drawtimer + 1 EndIf - StrTemp = GetINIString(file, "room ambience", "ambience"+i) + StrTemp = IniGetString(file, "room ambience", "ambience"+i) If StrTemp = "" Then Exit RoomAmbience[i]=LoadSound_Strict(StrTemp) @@ -4601,7 +4601,7 @@ Function SetChunkDataValues() For i = 0 To 63 For j = 0 To 63 - CHUNKDATA[i * 64 + j]=Rand(0,GetINIInt("Data\1499chunks.INI","general","count")) + CHUNKDATA[i * 64 + j]=Rand(0,IniGetInt("Data\1499chunks.ini","general","count")) Next Next @@ -4617,8 +4617,8 @@ Type ChunkPart End Type Function CreateChunkParts(r.Rooms) - Local File$ = "Data\1499chunks.INI" - Local ChunkAmount% = GetINIInt(File$,"general","count") + Local File$ = "Data\1499chunks.ini" + Local ChunkAmount% = IniGetInt(File$,"general","count") Local i%,StrTemp$,j% Local chp.ChunkPart,chp2.ChunkPart Local obj% @@ -4626,38 +4626,35 @@ Function CreateChunkParts(r.Rooms) SeedRnd GenerateSeedNumber(RandomSeed) For i = 0 To ChunkAmount% - Local loc% = GetINISectionLocation(File$,"chunk"+i) - If loc > 0 Then - StrTemp$ = GetINIString2(File,loc%,"count") - chp = New ChunkPart - chp\Amount% = Int(StrTemp$) - DebugLog "------------------" - For j = 0 To Int(StrTemp$) - Local objID% = GetINIString2(File$,loc%,"obj"+j) - Local x$ = GetINIString2(File$,loc%,"obj"+j+"-x") - Local z$ = GetINIString2(File$,loc%,"obj"+j+"-z") - Local yaw$ = GetINIString2(File$,loc%,"obj"+j+"-yaw") - DebugLog "1499 chunk X/Z/Yaw: "+x$+"|"+z$+"|"+yaw$ - chp\obj%[j] = CopyEntity(r\Objects[objID%]) - If Lower(yaw$) = "random" - chp\RandomYaw#[j] = Rnd(360) - RotateEntity chp\obj[j],0,chp\RandomYaw[j],0 - Else - RotateEntity chp\obj[j],0,Float(yaw),0 - EndIf - PositionEntity chp\obj[j],Float(x),0,Float(z) - ScaleEntity chp\obj[j],RoomScale,RoomScale,RoomScale - EntityType chp\obj[j],HIT_MAP - EntityPickMode chp\obj[j],2 - ;EntityParent chp\obj[j],r\obj - Next - chp2 = Before(chp) - If chp2 <> Null - chp\ID = chp2\ID+1 + StrTemp$ = IniGetString(File,"chunk"+i,"count") + chp = New ChunkPart + chp\Amount% = Int(StrTemp$) + DebugLog "------------------" + For j = 0 To Int(StrTemp$) + Local objID% = IniGetString(File$,"chunk"+i,"obj"+j) + Local x$ = IniGetString(File$,"chunk"+i,"obj"+j+"-x") + Local z$ = IniGetString(File$,"chunk"+i,"obj"+j+"-z") + Local yaw$ = IniGetString(File$,"chunk"+i,"obj"+j+"-yaw") + DebugLog "1499 chunk X/Z/Yaw: "+x$+"|"+z$+"|"+yaw$ + chp\obj%[j] = CopyEntity(r\Objects[objID%]) + If Lower(yaw$) = "random" + chp\RandomYaw#[j] = Rnd(360) + RotateEntity chp\obj[j],0,chp\RandomYaw[j],0 + Else + RotateEntity chp\obj[j],0,Float(yaw),0 EndIf - DebugLog "<<<<<<<<<<<<<<<<" - DebugLog "Generated 1499 chunk "+chp\ID+" sucessfully" + PositionEntity chp\obj[j],Float(x),0,Float(z) + ScaleEntity chp\obj[j],RoomScale,RoomScale,RoomScale + EntityType chp\obj[j],HIT_MAP + EntityPickMode chp\obj[j],2 + ;EntityParent chp\obj[j],r\obj + Next + chp2 = Before(chp) + If chp2 <> Null + chp\ID = chp2\ID+1 EndIf + DebugLog "<<<<<<<<<<<<<<<<" + DebugLog "Generated 1499 chunk "+chp\ID+" sucessfully" Next SeedRnd MilliSecs() @@ -4698,7 +4695,7 @@ Function CreateChunk.Chunk(obj%,x#,y#,z#,isSpawnChunk%=False) EntityAlpha ch\ChunkDebugObj,0.2 If obj% > -1 - ch\Amount% = GetINIInt("Data\1499chunks.INI","chunk"+obj,"count") + ch\Amount% = IniGetInt("Data\1499chunks.ini","chunk"+obj,"count") For chp = Each ChunkPart If chp\ID = obj% For i = 0 To ch\Amount @@ -4728,7 +4725,7 @@ Function UpdateChunks(r.Rooms,ChunkPartAmount%,spawnNPCs%=True) x# = -ChunkMaxDistance#+(ChunkX*40) z# = -ChunkMaxDistance#+(ChunkZ*40) - Local CurrChunkData% = 0, MaxChunks% = GetINIInt("Data\1499chunks.INI","general","count") + Local CurrChunkData% = 0, MaxChunks% = IniGetInt("Data\1499chunks.ini","general","count") Repeat Local chunkfound% = False @@ -4742,7 +4739,7 @@ Function UpdateChunks(r.Rooms,ChunkPartAmount%,spawnNPCs%=True) Next If (Not chunkfound) CurrChunkData = CHUNKDATA[Abs(((x+32)/40) Mod 64) * 64 + Abs(((z+32)/40) Mod 64)] - ;ch2 = CreateChunk(Rand(0,GetINIInt("Data\1499chunks.INI","general","count")),x#,y#,z#) + ;ch2 = CreateChunk(Rand(0,IniGetInt("Data\1499chunks.ini","general","count")),x#,y#,z#) ch2 = CreateChunk(CurrChunkData%,x#,y#,z#) ch2\IsSpawnChunk = False EndIf diff --git a/SourceCode/Materials.bb b/SourceCode/Materials.bb index c953782..f016b5c 100644 --- a/SourceCode/Materials.bb +++ b/SourceCode/Materials.bb @@ -32,31 +32,31 @@ Function LoadMaterials(file$) mat\name = Lower(TemporaryString) If BumpEnabled Then - StrTemp = GetINIString(file, TemporaryString, "bump") + StrTemp = IniGetString(file, TemporaryString, "bump") If StrTemp <> "" Then mat\Bump = LoadTexture_Strict(StrTemp,256) ApplyBumpMap(mat\Bump) EndIf - StrTemp = GetINIString(file, TemporaryString, "reflection") + StrTemp = IniGetString(file, TemporaryString, "reflection") If StrTemp <> "" Then mat\Reflection = LoadTexture_Strict(StrTemp,1+64+256) TextureBlend mat\Reflection,1 ScaleTexture mat\Reflection,0.01,0.01 EndIf - StrTemp = GetINIString(file, TemporaryString, "detailtex") + StrTemp = IniGetString(file, TemporaryString, "detailtex") If StrTemp <> "" Then mat\DetailTex= LoadTexture_Strict(StrTemp,1+256) ScaleTexture mat\DetailTex,0.1,0.1 EndIf EndIf - mat\StepSound = (GetINIInt(file, TemporaryString, "stepsound")+1) - mat\isDiffuseAlpha = GetINIInt(file, TemporaryString, "transparent") - mat\useMask = GetINIInt(file, TemporaryString, "masked") - mat\specular = GetINIFloat(file, TemporaryString, "specular") - mat\sphereReflection = GetINIInt(file, TemporaryString, "sphere_reflection") - mat\UScale = GetINIFloat(file, TemporaryString, "u_scale",1.0) - mat\VScale = GetINIFloat(file, TemporaryString, "v_scale",1.0) + mat\StepSound = (IniGetInt(file, TemporaryString, "stepsound")+1) + mat\isDiffuseAlpha = IniGetInt(file, TemporaryString, "transparent") + mat\useMask = IniGetInt(file, TemporaryString, "masked") + mat\specular = IniGetFloat(file, TemporaryString, "specular") + mat\sphereReflection = IniGetInt(file, TemporaryString, "sphere_reflection") + mat\UScale = IniGetFloat(file, TemporaryString, "u_scale",1.0) + mat\VScale = IniGetFloat(file, TemporaryString, "v_scale",1.0) EndIf Wend diff --git a/SourceCode/Menu.bb b/SourceCode/Menu.bb index ca8f640..7c5794c 100644 --- a/SourceCode/Menu.bb +++ b/SourceCode/Menu.bb @@ -22,7 +22,7 @@ Global MainMenuTab% Global PrevMainMenuTab% Global ShouldDeleteGadgets% -Global IntroEnabled% = GetINIInt(gv\OptionFile, "options", "intro enabled", 1) +Global IntroEnabled% = IniGetInt(gv\OptionFile, "options", "intro enabled", 1) Global SelectedInputBox% @@ -3396,9 +3396,9 @@ Function UpdateLauncher() DrawImage(LauncherIMG, 0, 0) If DrawButton(640 - 32, 0, 32, 32, "X", False, False, False) Then - PutINIValue(gv\OptionFile, "options", "width", currentWidth) - PutINIValue(gv\OptionFile, "options", "height", currentHeight) - PutINIValue(gv\OptionFile, "options", "graphic driver", opt\GraphicDriver) + IniWriteString(gv\OptionFile, "options", "width", currentWidth) + IniWriteString(gv\OptionFile, "options", "height", currentHeight) + IniWriteString(gv\OptionFile, "options", "graphic driver", opt\GraphicDriver) Steam_Shutdown() End EndIf @@ -3576,9 +3576,9 @@ Function UpdateLauncher() Flip Forever - PutINIValue(gv\OptionFile, "options", "width", opt\GraphicWidth) - PutINIValue(gv\OptionFile, "options", "height", opt\GraphicHeight) - PutINIValue(gv\OptionFile, "options", "graphic driver", opt\GraphicDriver) + IniWriteString(gv\OptionFile, "options", "width", opt\GraphicWidth) + IniWriteString(gv\OptionFile, "options", "height", opt\GraphicHeight) + IniWriteString(gv\OptionFile, "options", "graphic driver", opt\GraphicDriver) DeleteMenuImages() diff --git a/SourceCode/Menu3D.bb b/SourceCode/Menu3D.bb index 004e61e..caa9664 100644 --- a/SourceCode/Menu3D.bb +++ b/SourceCode/Menu3D.bb @@ -249,7 +249,7 @@ Function Load3DMenu(customprogress$="") ;First, we need to determine the room If customprogress="" Then - m3d\Progress = GetINIString(gv\OptionFile,"options","progress","intro") + m3d\Progress = IniGetString(gv\OptionFile,"options","progress","intro") Else m3d\Progress = customprogress EndIf @@ -322,9 +322,9 @@ Function Load3DMenu(customprogress$="") ;After that, we need to load all important assets that are required for every room m3d\Scene = CreatePivot() - Brightness% = GetINIFloat(gv\OptionFile, "options", "brightness", 20) - CameraFogNear# = GetINIFloat(gv\OptionFile, "options", "camera fog near", 0.5) - CameraFogFar# = GetINIFloat(gv\OptionFile, "options", "camera fog far", 6.0) + Brightness% = IniGetFloat(gv\OptionFile, "options", "brightness", 20) + CameraFogNear# = IniGetFloat(gv\OptionFile, "options", "camera fog near", 0.5) + CameraFogFar# = IniGetFloat(gv\OptionFile, "options", "camera fog far", 6.0) StoredCameraFogFar# = CameraFogFar m3d\Pivot = CreatePivot() m_I\Cam = CreateCamera(m3d\Pivot) @@ -549,7 +549,7 @@ Function Load3DMenu(customprogress$="") m3d\Objects[0] = LoadAnimMesh_Strict("GFX\npcs\scp-966.b3d",m3d\Scene) PositionEntity m3d\Objects[0],0,0,512.0*RoomScale EntityFX m3d\Objects[0],1 - temp# = GetINIFloat("DATA\NPCs.ini", "SCP-966", "scale")/40.0 + temp# = IniGetFloat("Data\NPCs.ini", "SCP-966", "scale")/40.0 ScaleEntity m3d\Objects[0], temp, temp, temp HideEntity m3d\Objects[0] ;[End Block] @@ -709,7 +709,7 @@ Function Load3DMenu(customprogress$="") m3d\Rendering = 1 m3d\Objects[0] = LoadMesh_Strict("GFX\npcs\173\173body.b3d",m3d\Scene) m3d\Objects[8] = LoadMesh_Strict("GFX\npcs\173\173head.b3d",m3d\Scene) - temp# = (GetINIFloat("DATA\NPCs.ini", "SCP-173", "scale") / MeshDepth(m3d\Objects[0])) + temp# = (IniGetFloat("Data\NPCs.ini", "SCP-173", "scale") / MeshDepth(m3d\Objects[0])) ScaleEntity m3d\Objects[0],temp,temp,temp ScaleEntity m3d\Objects[8],temp,temp,temp PositionEntity m3d\Objects[0], 0.0, 0.0, -940.0* RoomScale @@ -1733,7 +1733,7 @@ Function ReloadAll() MaskImage(Panel294, 255,0,255) ; For i = 0 To MAXACHIEVEMENTS-1 ; Local loc2% = GetINISectionLocation(AchvIni, "s"+Str(i)) -; Local image$ = GetINIString2(AchvIni, loc2, "image") +; Local image$ = IniGetString2(AchvIni, loc2, "image") ; Achievements[i]\IMG = LoadImage_Strict("GFX\menu\achievements\"+image+".jpg") ; Achievements[i]\IMG = ResizeImage2(Achievements[i]\IMG,ImageWidth(Achievements[i]\IMG)*opt\GraphicHeight/768.0,ImageHeight(Achievements[i]\IMG)*opt\GraphicHeight/768.0) ; Next diff --git a/SourceCode/Multiplayer/Multiplayer_Base.bb b/SourceCode/Multiplayer/Multiplayer_Base.bb index 34f28b3..505dfa9 100644 --- a/SourceCode/Multiplayer/Multiplayer_Base.bb +++ b/SourceCode/Multiplayer/Multiplayer_Base.bb @@ -293,11 +293,11 @@ Function InitMultiplayer() mp_O.MultiplayerOptions = New MultiplayerOptions mp_O\PlayerName = Steam_GetPlayerName() - mp_O\MaxPlayers = GetINIInt(gv\OptionFile,"server","max players",4) - mp_O\TimeOut = GetINIInt(gv\OptionFile,"server","timeout",5) - mp_O\LocalServer = GetINIInt(gv\OptionFile,"server","local",0) - mp_O\ServerName = GetINIString(gv\OptionFile,"server","name") - mp_O\Password = GetINIString(gv\OptionFile,"server","password") + mp_O\MaxPlayers = IniGetInt(gv\OptionFile,"server","max players",4) + mp_O\TimeOut = IniGetInt(gv\OptionFile,"server","timeout",5) + mp_O\LocalServer = IniGetInt(gv\OptionFile,"server","local",0) + mp_O\ServerName = IniGetString(gv\OptionFile,"server","name") + mp_O\Password = IniGetString(gv\OptionFile,"server","password") mp_O\BanFile = GetEnv("AppData")+"\scpntf\server_bans.txt" ReadBanList() @@ -736,20 +736,20 @@ End Function Function SaveMPOptions() Local mgm.MultiplayerGameMode - PutINIValue(gv\OptionFile,"server","max players",mp_O\MaxPlayers) - PutINIValue(gv\OptionFile,"server","timeout",mp_O\TimeOut) - PutINIValue(gv\OptionFile,"server","local",mp_O\LocalServer) - PutINIValue(gv\OptionFile,"server","name",mp_O\ServerName) - PutINIValue(gv\OptionFile,"server","password",mp_O\Password) - PutINIValue(gv\OptionFile,"server","map",mp_O\MapInList\Name) - PutINIValue(gv\OptionFile,"server","gamemode",mp_O\Gamemode\name) + IniWriteString(gv\OptionFile,"server","max players",mp_O\MaxPlayers) + IniWriteString(gv\OptionFile,"server","timeout",mp_O\TimeOut) + IniWriteString(gv\OptionFile,"server","local",mp_O\LocalServer) + IniWriteString(gv\OptionFile,"server","name",mp_O\ServerName) + IniWriteString(gv\OptionFile,"server","password",mp_O\Password) + IniWriteString(gv\OptionFile,"server","map",mp_O\MapInList\Name) + IniWriteString(gv\OptionFile,"server","gamemode",mp_O\Gamemode\name) For mgm = Each MultiplayerGameMode Select mgm\ID Case Gamemode_Waves ;[Block] - PutINIValue(gv\OptionFile,"server","waves_difficulty",mgm\Difficulty) - PutINIValue(gv\OptionFile,"server","waves_max",mgm\MaxPhase) + IniWriteString(gv\OptionFile,"server","waves_difficulty",mgm\Difficulty) + IniWriteString(gv\OptionFile,"server","waves_max",mgm\MaxPhase) ;[End Block] End Select Next diff --git a/SourceCode/Multiplayer/Multiplayer_GamemodesAndMaps.bb b/SourceCode/Multiplayer/Multiplayer_GamemodesAndMaps.bb index 385dfc9..51ffce3 100644 --- a/SourceCode/Multiplayer/Multiplayer_GamemodesAndMaps.bb +++ b/SourceCode/Multiplayer/Multiplayer_GamemodesAndMaps.bb @@ -111,26 +111,26 @@ Function LoadMPMaps() If file <> "." And file <> ".." Then If (FileType(dirPath+"\"+file+"\config.ini") > 0) Then mfl = New MapForList - mfl\MeshPath = dirPath+"\"+file+"\"+GetINIString(dirPath+"\"+file+"\config.ini","global","mesh") - mfl\Name = GetINIString(dirPath+"\"+file+"\config.ini","global","name") - mfl\Gamemodes = GetINIString(dirPath+"\"+file+"\config.ini","global","gamemodes") - mfl\ChunkStart = GetINIInt(dirPath+"\"+file+"\config.ini","chunkdata","start") - mfl\ChunkEnd = GetINIInt(dirPath+"\"+file+"\config.ini","chunkdata","end") - mfl\NTFSpawn = GetINIInt(dirPath+"\"+file+"\config.ini","chunkdata","ntf_spawn") - mfl\CISpawn = GetINIInt(dirPath+"\"+file+"\config.ini","chunkdata","ci_spawn") - mfl\TriggerAmount = GetINIInt(dirPath+"\"+file+"\config.ini","chunkdata","trigger_amount") - mfl\TriggerMeshPath = dirPath+"\"+file+"\"+GetINIString(dirPath+"\"+file+"\config.ini","chunkdata","trigger_mesh") + mfl\MeshPath = dirPath+"\"+file+"\"+IniGetString(dirPath+"\"+file+"\config.ini","global","mesh") + mfl\Name = IniGetString(dirPath+"\"+file+"\config.ini","global","name") + mfl\Gamemodes = IniGetString(dirPath+"\"+file+"\config.ini","global","gamemodes") + mfl\ChunkStart = IniGetInt(dirPath+"\"+file+"\config.ini","chunkdata","start") + mfl\ChunkEnd = IniGetInt(dirPath+"\"+file+"\config.ini","chunkdata","end") + mfl\NTFSpawn = IniGetInt(dirPath+"\"+file+"\config.ini","chunkdata","ntf_spawn") + mfl\CISpawn = IniGetInt(dirPath+"\"+file+"\config.ini","chunkdata","ci_spawn") + mfl\TriggerAmount = IniGetInt(dirPath+"\"+file+"\config.ini","chunkdata","trigger_amount") + mfl\TriggerMeshPath = dirPath+"\"+file+"\"+IniGetString(dirPath+"\"+file+"\config.ini","chunkdata","trigger_mesh") For i = 0 To mfl\TriggerAmount-1 - mfl\TriggerYaw[i] = GetINIInt(dirPath+"\"+file+"\config.ini","chunkdata","trigger"+(i+1)+"_yaw") - Local x# = GetINIFloat(dirPath+"\"+file+"\config.ini","chunkdata","trigger"+(i+1)+"_x") - Local y# = GetINIFloat(dirPath+"\"+file+"\config.ini","chunkdata","trigger"+(i+1)+"_y") - Local z# = GetINIFloat(dirPath+"\"+file+"\config.ini","chunkdata","trigger"+(i+1)+"_z") - Local area1 = GetINIInt(dirPath+"\"+file+"\config.ini","chunkdata","trigger"+(i+1)+"_area1") - Local area2 = GetINIInt(dirPath+"\"+file+"\config.ini","chunkdata","trigger"+(i+1)+"_area2") + mfl\TriggerYaw[i] = IniGetInt(dirPath+"\"+file+"\config.ini","chunkdata","trigger"+(i+1)+"_yaw") + Local x# = IniGetFloat(dirPath+"\"+file+"\config.ini","chunkdata","trigger"+(i+1)+"_x") + Local y# = IniGetFloat(dirPath+"\"+file+"\config.ini","chunkdata","trigger"+(i+1)+"_y") + Local z# = IniGetFloat(dirPath+"\"+file+"\config.ini","chunkdata","trigger"+(i+1)+"_z") + Local area1 = IniGetInt(dirPath+"\"+file+"\config.ini","chunkdata","trigger"+(i+1)+"_area1") + Local area2 = IniGetInt(dirPath+"\"+file+"\config.ini","chunkdata","trigger"+(i+1)+"_area2") mfl\TriggerCoords[i] = CreateVector3D(x,y,z,True) mfl\TriggerAreas[i] = CreateVector2D(area1,area2,True) Next - mfl\BossNPC = GetINIString(dirPath+"\"+file+"\config.ini","global","boss") + mfl\BossNPC = IniGetString(dirPath+"\"+file+"\config.ini","global","boss") If (FileType(dirPath+"\"+file+"\preview.png") > 0) Then mfl\Image = LoadImage_Strict(dirPath+"\"+file+"\preview.png") Else @@ -143,7 +143,7 @@ Function LoadMPMaps() EndIf Forever - Local SelMap$ = GetINIString(gv\OptionFile,"server","map") + Local SelMap$ = IniGetString(gv\OptionFile,"server","map") If SelMap<>"" Then ;Get the selected map, depending on what the player has selected For mfl = Each MapForList @@ -174,8 +174,8 @@ Function CreateMPGameModes() mgm\img[0] = LoadImage_Strict("GFX\skull_logo.png") MidHandle mgm\img[0] ResizeImage(mgm\img[0], ImageWidth(mgm\img[0]) * MenuScale, ImageHeight(mgm\img[0]) * MenuScale) - mgm\MaxPhase = GetINIInt(gv\OptionFile,"server","waves_max",Waves_Short) - mgm\Difficulty = GetINIInt(gv\OptionFile,"server","waves_difficulty",MP_DIFFICULTY_SAFE) + mgm\MaxPhase = IniGetInt(gv\OptionFile,"server","waves_max",Waves_Short) + mgm\Difficulty = IniGetInt(gv\OptionFile,"server","waves_difficulty",MP_DIFFICULTY_SAFE) mgm\Image = LoadImage_Strict("GFX\menu\gamemode_preview_waves.png") mgm\Image = ResizeImage2(mgm\Image, 384 * MenuScale, 192 * MenuScale) mgm\MaxPlayersAllowed = 6 @@ -203,7 +203,7 @@ Function LoadMPGameModes() Local mgm.MultiplayerGameMode CreateMPGameModes() - Local SelGamemode$ = GetINIString(gv\OptionFile,"server","gamemode","") + Local SelGamemode$ = IniGetString(gv\OptionFile,"server","gamemode","") If SelGamemode$<>"" Then For mgm = Each MultiplayerGameMode If mgm\name = SelGamemode Then diff --git a/SourceCode/Multiplayer/Multiplayer_Loading.bb b/SourceCode/Multiplayer/Multiplayer_Loading.bb index 478d46f..3ecb04a 100644 --- a/SourceCode/Multiplayer/Multiplayer_Loading.bb +++ b/SourceCode/Multiplayer/Multiplayer_Loading.bb @@ -281,9 +281,9 @@ Function CreateMPGame() LoadMissingTexture() - Brightness% = GetINIFloat(gv\OptionFile, "options", "brightness", 20) - CameraFogNear# = GetINIFloat(gv\OptionFile, "options", "camera fog near", 0.5) - CameraFogFar# = GetINIFloat(gv\OptionFile, "options", "camera fog far", 6.0) + Brightness% = IniGetFloat(gv\OptionFile, "options", "brightness", 20) + CameraFogNear# = IniGetFloat(gv\OptionFile, "options", "camera fog near", 0.5) + CameraFogFar# = IniGetFloat(gv\OptionFile, "options", "camera fog far", 6.0) StoredCameraFogFar# = CameraFogFar LoadMaterials("Data\materials.ini") @@ -309,7 +309,7 @@ Function CreateMPGame() EndIf CameraRange(Camera,0.01,GetCameraFogRangeFar(Camera)*2.0) CameraFogMode (Camera, 1) - CameraFogColor (Camera, GetINIInt(gv\OptionFile, "options", "fog r"), GetINIInt(gv\OptionFile, "options", "fog g"), GetINIInt(gv\OptionFile, "options", "fog b")) + CameraFogColor (Camera, IniGetInt(gv\OptionFile, "options", "fog r"), IniGetInt(gv\OptionFile, "options", "fog g"), IniGetInt(gv\OptionFile, "options", "fog b")) AmbientLight Brightness, Brightness, Brightness m_I\Cam = CreateCamera(Camera) @@ -525,7 +525,7 @@ Function CreateMPGame() i = 1 Repeat - StrTemp = GetINIString("Data\rooms.ini", "room ambience", "ambience"+i) + StrTemp = IniGetString("Data\rooms.ini", "room ambience", "ambience"+i) If StrTemp = "" Then Exit RoomAmbience[i]=LoadSound_Strict(StrTemp) @@ -712,8 +712,6 @@ Function NullMPGame(nomenuload%=False,playbuttonsfx%=True) Disconnect() EndIf - DeleteINIFile("Data\weapons.ini") - If (Not nomenuload) Lor mp_I\PlayState = GAME_CLIENT Then Local SelGamemode$ = mp_O\Gamemode\name Local mgm.MultiplayerGameMode diff --git a/SourceCode/Multiplayer/Multiplayer_PlayerBase.bb b/SourceCode/Multiplayer/Multiplayer_PlayerBase.bb index 9848f76..9bd83e6 100644 --- a/SourceCode/Multiplayer/Multiplayer_PlayerBase.bb +++ b/SourceCode/Multiplayer/Multiplayer_PlayerBase.bb @@ -188,7 +188,7 @@ Function SwitchPlayerGun(playerID%) ;SetAnimTime Players[playerID]\obj_lower,0 ;SetAnimTime Players[playerID]\obj_upper,0 - Local bone = FindChild(Players[playerID]\obj_upper,GetINIString("Data\PlayerBones.ini", "Player", "weapon_hand_bonename")) + Local bone = FindChild(Players[playerID]\obj_upper,IniGetString("Data\PlayerBones.ini", "Player", "weapon_hand_bonename")) Local gunname$ = "" For g = Each Guns @@ -200,14 +200,14 @@ Function SwitchPlayerGun(playerID%) Next If gunname <> "" Then - Local scale# = GetINIFloat("Data\weapons.ini",gunname,"world scale",0.02) / (0.29 / 2.5) + Local scale# = IniGetFloat("Data\weapons.ini",gunname,"world scale",0.02) / (0.29 / 2.5) ScaleEntity Players[playerID]\GunModel,scale,scale,scale - VectorString = GetINIString("Data\weapons.ini",gunname,"player_model_offset","") + VectorString = IniGetString("Data\weapons.ini",gunname,"player_model_offset","") If VectorString<>"" Then PositionEntity Players[playerID]\GunModel,Piece(VectorString,1,"|"),Piece(VectorString,2,"|"),Piece(VectorString,3,"|") EndIf - VectorString = GetINIString("Data\weapons.ini",gunname,"player_model_rotation","") + VectorString = IniGetString("Data\weapons.ini",gunname,"player_model_rotation","") If VectorString<>"" Then RotateEntity Players[playerID]\GunModel,Piece(VectorString,1,"|"),Piece(VectorString,2,"|"),Piece(VectorString,3,"|") EndIf @@ -1237,18 +1237,18 @@ Function ApplyPlayerHitBoxes.HitBox() ;If NTF_GameModeFlag=3 And mp_I\PlayState=GAME_CLIENT Then Return - For i = 0 To GetINIInt(file$,"Player","hitbox_amount")-1 - htype% = GetINIInt(file$,"Player","hitbox"+(i+1)+"_type") - bonename$ = GetINIString(file$,"Player","hitbox"+(i+1)+"_parent") + For i = 0 To IniGetInt(file$,"Player","hitbox_amount")-1 + htype% = IniGetInt(file$,"Player","hitbox"+(i+1)+"_type") + bonename$ = IniGetString(file$,"Player","hitbox"+(i+1)+"_parent") hb\BoneName[i] = bonename If htype = 0 hb\HitBox1[i] = CreateCube() - scaleX# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_scaleX",1.0) - scaleY# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_scaleY",1.0) - scaleZ# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_scaleZ",1.0) - posX# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_posX",0.0) - posY# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_posY",0.0) - posZ# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_posZ",0.0) + scaleX# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_scaleX",1.0) + scaleY# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_scaleY",1.0) + scaleZ# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_scaleZ",1.0) + posX# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_posX",0.0) + posY# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_posY",0.0) + posZ# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_posZ",0.0) ScaleEntity hb\HitBox1[i],scaleX,scaleY,scaleZ PositionEntity hb\HitBox1[i],posX,posY,posZ EntityPickMode hb\HitBox1[i],2 @@ -1256,12 +1256,12 @@ Function ApplyPlayerHitBoxes.HitBox() HideEntity hb\HitBox1[i] ElseIf htype = 1 hb\HitBox2[i] = CreateCube() - scaleX# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_scaleX",1.0) - scaleY# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_scaleY",1.0) - scaleZ# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_scaleZ",1.0) - posX# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_posX",0.0) - posY# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_posY",0.0) - posZ# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_posZ",0.0) + scaleX# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_scaleX",1.0) + scaleY# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_scaleY",1.0) + scaleZ# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_scaleZ",1.0) + posX# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_posX",0.0) + posY# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_posY",0.0) + posZ# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_posZ",0.0) ScaleEntity hb\HitBox2[i],scaleX,scaleY,scaleZ PositionEntity hb\HitBox2[i],posX,posY,posZ EntityPickMode hb\HitBox2[i],2 @@ -1269,12 +1269,12 @@ Function ApplyPlayerHitBoxes.HitBox() HideEntity hb\HitBox2[i] Else hb\HitBox3[i] = CreateCube() - scaleX# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_scaleX",1.0) - scaleY# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_scaleY",1.0) - scaleZ# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_scaleZ",1.0) - posX# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_posX",0.0) - posY# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_posY",0.0) - posZ# = GetINIFloat(file$,"Player","hitbox"+(i+1)+"_posZ",0.0) + scaleX# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_scaleX",1.0) + scaleY# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_scaleY",1.0) + scaleZ# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_scaleZ",1.0) + posX# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_posX",0.0) + posY# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_posY",0.0) + posZ# = IniGetFloat(file$,"Player","hitbox"+(i+1)+"_posZ",0.0) ScaleEntity hb\HitBox3[i],scaleX,scaleY,scaleZ PositionEntity hb\HitBox3[i],posX,posY,posZ EntityPickMode hb\HitBox3[i],2 diff --git a/SourceCode/NPCs.bb b/SourceCode/NPCs.bb index d4ce783..1775d4c 100644 --- a/SourceCode/NPCs.bb +++ b/SourceCode/NPCs.bb @@ -311,9 +311,9 @@ Function CreateNPC.NPCs(NPCtype%, x#, y#, z#, model%=-1) EntityBlend(n\obj2, BLEND_ADD) SpriteViewMode(n\obj2, 2) - n\Speed = (GetINIFloat("DATA\NPCs.ini", "forestmonster", "speed") / 100.0) + n\Speed = (IniGetFloat("Data\NPCs.ini", "forestmonster", "speed") / 100.0) - temp# = (GetINIFloat("DATA\NPCs.ini", "forestmonster", "scale") / 20.0) + temp# = (IniGetFloat("Data\NPCs.ini", "forestmonster", "scale") / 20.0) ScaleEntity n\obj, temp, temp, temp MeshCullBox (n\obj, -MeshWidth(n\obj)*2, -MeshHeight(n\obj)*2, -MeshDepth(n\obj)*2, MeshWidth(n\obj)*2, MeshHeight(n\obj)*4, MeshDepth(n\obj)*4) @@ -334,7 +334,7 @@ Function CreateNPC.NPCs(NPCtype%, x#, y#, z#, model%=-1) EntityType n\Collider, HIT_PLAYER n\obj = LoadAnimMesh_Strict("GFX\NPCs\scp-066.b3d") - temp# = GetINIFloat("DATA\NPCs.ini", "SCP-066", "scale")/2.5 + temp# = IniGetFloat("Data\NPCs.ini", "SCP-066", "scale")/2.5 ScaleEntity n\obj, temp, temp, temp ;If BumpEnabled Then @@ -347,7 +347,7 @@ Function CreateNPC.NPCs(NPCtype%, x#, y#, z#, model%=-1) ; DeleteSingleTextureEntryFromCache bump1 ;EndIf - n\Speed = (GetINIFloat("DATA\NPCs.ini", "SCP-066", "speed") / 100.0) + n\Speed = (IniGetFloat("Data\NPCs.ini", "SCP-066", "speed") / 100.0) ;[End Block] Case NPCtype966 CreateNPCtype966(n) @@ -376,8 +376,8 @@ Function CreateNPC.NPCs(NPCtype%, x#, y#, z#, model%=-1) n\obj = LoadAnimMesh_Strict("GFX\npcs\1499-1.b3d") EndIf - n\Speed = (GetINIFloat("DATA\NPCs.ini", "SCP-1499-1", "speed") / 100.0) * Rnd(0.9,1.1) - temp# = (GetINIFloat("DATA\NPCs.ini", "SCP-1499-1", "scale") / 4.0) * Rnd(0.8,1.0) + n\Speed = (IniGetFloat("Data\NPCs.ini", "SCP-1499-1", "speed") / 100.0) * Rnd(0.9,1.1) + temp# = (IniGetFloat("Data\NPCs.ini", "SCP-1499-1", "scale") / 4.0) * Rnd(0.8,1.0) ScaleEntity n\obj, temp, temp, temp @@ -464,8 +464,8 @@ Function CreateNPC.NPCs(NPCtype%, x#, y#, z#, model%=-1) EntityType n\Collider, HIT_PLAYER n\obj = CopyEntity(GuardObj) ;LoadAnimMesh_Strict("GFX\npcs\mtf.b3d") - n\Speed = (GetINIFloat("DATA\NPCs.ini", "Guard", "speed") / 100.0) - temp# = (GetINIFloat("DATA\NPCs.ini", "Guard", "scale") / 2.5) + n\Speed = (IniGetFloat("Data\NPCs.ini", "Guard", "speed") / 100.0) + temp# = (IniGetFloat("Data\NPCs.ini", "Guard", "scale") / 2.5) ScaleEntity n\obj, temp, temp, temp @@ -485,8 +485,8 @@ Function CreateNPC.NPCs(NPCtype%, x#, y#, z#, model%=-1) EntityType n\Collider, HIT_PLAYER n\obj = CopyEntity(GuardObj) ;LoadAnimMesh_Strict("GFX\npcs\mtf.b3d") - n\Speed = (GetINIFloat("DATA\NPCs.ini", "Guard", "speed") / 100.0) - temp# = (GetINIFloat("DATA\NPCs.ini", "Guard", "scale") / 2.5) + n\Speed = (IniGetFloat("Data\NPCs.ini", "Guard", "speed") / 100.0) + temp# = (IniGetFloat("Data\NPCs.ini", "Guard", "scale") / 2.5) ScaleEntity n\obj, temp, temp, temp @@ -3913,7 +3913,7 @@ Function GetNPCManipulationValue$(NPC$,bone$,section$,valuetype%=0) ;2 - Float ;3 - Boolean - Local value$ = GetINIString("Data\NPCBones.ini",NPC$,bone$+"_"+section$) + Local value$ = IniGetString("Data\NPCBones.ini",NPC$,bone$+"_"+section$) Select valuetype% Case 0 Return value$ @@ -4372,7 +4372,7 @@ Function SwitchNPCGun%(n.NPCs, WeaponID%) RotateEntity n\obj,0,0,0 PositionEntity n\obj,0,0,0 - bone = FindChild(n\obj,GetINIString("Data\NPCBones.ini", n\NPCName, "weapon_hand_bonename")) + bone = FindChild(n\obj,IniGetString("Data\NPCBones.ini", n\NPCName, "weapon_hand_bonename")) gunname$ = "" For g = Each Guns @@ -4394,14 +4394,14 @@ Function SwitchNPCGun%(n.NPCs, WeaponID%) Next If gunname <> "" Then - Scale# = GetINIFloat("Data\weapons.ini", gunname, "world scale", 0.02) / EntityScaleX(n\obj) + Scale# = IniGetFloat("Data\weapons.ini", gunname, "world scale", 0.02) / EntityScaleX(n\obj) ScaleEntity n\Gun\obj,Scale,Scale,Scale - VectorString = GetINIString("Data\weapons.ini", gunname, "player_model_offset", "") + VectorString = IniGetString("Data\weapons.ini", gunname, "player_model_offset", "") If VectorString <> "" Then PositionEntity n\Gun\obj, Piece(VectorString,1,"|"), Piece(VectorString,2,"|"), Piece(VectorString,3,"|") EndIf - VectorString = GetINIString("Data\weapons.ini", gunname, "player_model_rotation", "") + VectorString = IniGetString("Data\weapons.ini", gunname, "player_model_rotation", "") If VectorString <> "" Then RotateEntity n\Gun\obj, Piece(VectorString,1,"|"), Piece(VectorString,2,"|"), Piece(VectorString,3,"|") EndIf @@ -4501,7 +4501,7 @@ Function PreloadNPCAnimation(NPCtype%, NPCName$, AnimName$) Local file$ = "Data\NPCAnims.ini" Local na.NPCAnim - Local AnimString$ = GetINIString(file, NPCName, AnimName) + Local AnimString$ = IniGetString(file, NPCName, AnimName) If AnimString<>"" Then na = New NPCAnim na\NPCtype = NPCtype diff --git a/SourceCode/NPCs/NPCtype049.bb b/SourceCode/NPCs/NPCtype049.bb index e8df9c1..5c19f79 100644 --- a/SourceCode/NPCs/NPCtype049.bb +++ b/SourceCode/NPCs/NPCtype049.bb @@ -19,9 +19,9 @@ Function CreateNPCtype049(n.NPCs) ;n\obj = LoadAnimMesh_Strict("GFX\npcs\scp-049.b3d") n\obj = CopyEntity(NPC049OBJ) - n\Speed = (GetINIFloat("DATA\NPCs.ini", "SCP-049", "speed") / 100.0) + n\Speed = (IniGetFloat("Data\NPCs.ini", "SCP-049", "speed") / 100.0) - temp = GetINIFloat("DATA\NPCs.ini", "SCP-049", "scale") + temp = IniGetFloat("Data\NPCs.ini", "SCP-049", "scale") ScaleEntity n\obj, temp, temp, temp n\CanUseElevator = True diff --git a/SourceCode/NPCs/NPCtype096.bb b/SourceCode/NPCs/NPCtype096.bb index ace82a9..17f7920 100644 --- a/SourceCode/NPCs/NPCtype096.bb +++ b/SourceCode/NPCs/NPCtype096.bb @@ -17,9 +17,9 @@ Function CreateNPCtype096(n.NPCs) EntityType n\Collider, HIT_PLAYER n\obj = LoadAnimMesh_Strict("GFX\npcs\scp096.b3d") - n\Speed = (GetINIFloat("DATA\NPCs.ini", "SCP-096", "speed") / 100.0) + n\Speed = (IniGetFloat("Data\NPCs.ini", "SCP-096", "speed") / 100.0) - temp = (GetINIFloat("DATA\NPCs.ini", "SCP-096", "scale") / 3.0) + temp = (IniGetFloat("Data\NPCs.ini", "SCP-096", "scale") / 3.0) ScaleEntity n\obj, temp, temp, temp MeshCullBox (n\obj, -MeshWidth(n\obj)*2, -MeshHeight(n\obj)*2, -MeshDepth(n\obj)*2, MeshWidth(n\obj)*2, MeshHeight(n\obj)*4, MeshDepth(n\obj)*4) diff --git a/SourceCode/NPCs/NPCtype106.bb b/SourceCode/NPCs/NPCtype106.bb index bd0d5de..0970efc 100644 --- a/SourceCode/NPCs/NPCtype106.bb +++ b/SourceCode/NPCs/NPCtype106.bb @@ -16,12 +16,12 @@ Function CreateNPCtype106(n.NPCs) EntityType n\Collider, HIT_PLAYER n\obj = LoadAnimMesh_Strict("GFX\npcs\106_2.b3d") - temp# = (GetINIFloat("DATA\NPCs.ini", "SCP-106", "scale") / 2.2) + temp# = (IniGetFloat("Data\NPCs.ini", "SCP-106", "scale") / 2.2) ScaleEntity n\obj, temp, temp, temp Local OldManEyes% = LoadTexture_Strict("GFX\npcs\oldmaneyes.jpg",1,2) - n\Speed = (GetINIFloat("DATA\NPCs.ini", "SCP-106", "speed") / 100.0) + n\Speed = (IniGetFloat("Data\NPCs.ini", "SCP-106", "speed") / 100.0) n\obj2 = CreateSprite() ScaleSprite(n\obj2, 0.03, 0.03) diff --git a/SourceCode/NPCs/NPCtype173.bb b/SourceCode/NPCs/NPCtype173.bb index befeb06..5ec14a3 100644 --- a/SourceCode/NPCs/NPCtype173.bb +++ b/SourceCode/NPCs/NPCtype173.bb @@ -21,7 +21,7 @@ Function CreateNPCtype173(n.NPCs) n\obj = LoadMesh_Strict("GFX\npcs\173\173body.b3d") n\obj2 = LoadMesh_Strict("GFX\npcs\173\173head.b3d") - temp# = (GetINIFloat("DATA\NPCs.ini", "SCP-173", "scale") / MeshDepth(n\obj)) + temp# = (IniGetFloat("Data\NPCs.ini", "SCP-173", "scale") / MeshDepth(n\obj)) ScaleEntity n\obj, temp,temp,temp ScaleEntity n\obj2, temp,temp,temp @@ -48,7 +48,7 @@ Function CreateNPCtype173(n.NPCs) ScaleEntity n\obj2, scaleX,scaleY,scaleZ EndIf - n\Speed = (GetINIFloat("DATA\NPCs.ini", "SCP-173", "speed") / 200.0) + n\Speed = (IniGetFloat("Data\NPCs.ini", "SCP-173", "speed") / 200.0) n\obj3 = LoadMesh_Strict("GFX\npcs\173\173box.b3d") ScaleEntity n\obj3, RoomScale, RoomScale, RoomScale diff --git a/SourceCode/NPCs/NPCtype457.bb b/SourceCode/NPCs/NPCtype457.bb index 0b9e6c1..13c7bce 100644 --- a/SourceCode/NPCs/NPCtype457.bb +++ b/SourceCode/NPCs/NPCtype457.bb @@ -21,10 +21,10 @@ Function CreateNPCtype457(n.NPCs) EntityType n\Collider, HIT_PLAYER n\obj = LoadAnimMesh_Strict("GFX\npcs\106_2.b3d") - temp# = (GetINIFloat("DATA\NPCs.ini", "SCP-106", "scale") / 2.2) + temp# = (IniGetFloat("Data\NPCs.ini", "SCP-106", "scale") / 2.2) ScaleEntity n\obj, temp, temp, temp - n\Speed = (GetINIFloat("DATA\NPCs.ini", "SCP-106", "speed") / 100.0) + n\Speed = (IniGetFloat("Data\NPCs.ini", "SCP-106", "speed") / 100.0) EntityColor(n\obj, 0, 0, 0) EntityAlpha(n\obj, 0.1) @@ -137,7 +137,7 @@ Function CreateNPCtype457MP(n.NPCs) EntityType n\Collider, HIT_NPC_MP n\obj = CopyEntity(mp_I\BossModel) - temp# = (GetINIFloat("DATA\NPCs.ini", "SCP-106", "scale") / 2.2) + temp# = (IniGetFloat("Data\NPCs.ini", "SCP-106", "scale") / 2.2) ScaleEntity n\obj, temp, temp, temp n\Speed = (1.6 / 100.0) diff --git a/SourceCode/NPCs/NPCtype682.bb b/SourceCode/NPCs/NPCtype682.bb index 8a33884..087385c 100644 --- a/SourceCode/NPCs/NPCtype682.bb +++ b/SourceCode/NPCs/NPCtype682.bb @@ -20,7 +20,7 @@ Function CreateNPCtype682(n.NPCs) MeshCullBox (n\obj, -MeshWidth(n\obj), -MeshHeight(n\obj), -MeshDepth(n\obj), MeshWidth(n\obj)*2, MeshHeight(n\obj)*2, MeshDepth(n\obj)*2) - n\Speed = (GetINIFloat("DATA\NPCs.ini", "SCP-939", "speed") / 100.0) + n\Speed = (IniGetFloat("Data\NPCs.ini", "SCP-939", "speed") / 100.0) End Function diff --git a/SourceCode/NPCs/NPCtype939.bb b/SourceCode/NPCs/NPCtype939.bb index ee0dc27..9c107f5 100644 --- a/SourceCode/NPCs/NPCtype939.bb +++ b/SourceCode/NPCs/NPCtype939.bb @@ -39,11 +39,11 @@ Function CreateNPCtype939(n.NPCs) If n\obj = 0 Then n\obj = LoadAnimMesh_Strict("GFX\NPCs\scp-939.b3d") - temp# = GetINIFloat("DATA\NPCs.ini", "SCP-939", "scale")/2.5 + temp# = IniGetFloat("Data\NPCs.ini", "SCP-939", "scale")/2.5 ScaleEntity n\obj, temp, temp, temp EndIf - n\Speed = (GetINIFloat("DATA\NPCs.ini", "SCP-939", "speed") / 100.0) + n\Speed = (IniGetFloat("Data\NPCs.ini", "SCP-939", "speed") / 100.0) n\CollRadius = 0.3 @@ -60,10 +60,10 @@ Function CreateNPCtype939MP(n.NPCs) n\obj = CopyEntity(mp_I\SCP939Model) - Local temp# = GetINIFloat("DATA\NPCs.ini", "SCP-939", "scale")/2.5 + Local temp# = IniGetFloat("Data\NPCs.ini", "SCP-939", "scale")/2.5 ScaleEntity n\obj, temp, temp, temp - n\Speed = (GetINIFloat("DATA\NPCs.ini", "SCP-939", "speed") / 150.0) + n\Speed = (IniGetFloat("Data\NPCs.ini", "SCP-939", "speed") / 150.0) n\HP = 250 n\PathTimer = 70*5 n\NVName = "SCP-939" diff --git a/SourceCode/NPCs/NPCtype966.bb b/SourceCode/NPCs/NPCtype966.bb index fd13774..96c5e7c 100644 --- a/SourceCode/NPCs/NPCtype966.bb +++ b/SourceCode/NPCs/NPCtype966.bb @@ -29,7 +29,7 @@ Function CreateNPCtype966(n.NPCs) EntityFX n\obj,1 - temp# = GetINIFloat("DATA\NPCs.ini", "SCP-966", "scale")/40.0 + temp# = IniGetFloat("Data\NPCs.ini", "SCP-966", "scale")/40.0 ScaleEntity n\obj, temp, temp, temp SetAnimTime n\obj,15.0 diff --git a/SourceCode/NPCs/NPCtypeD2.bb b/SourceCode/NPCs/NPCtypeD2.bb index 4dd5c07..f56b52b 100644 --- a/SourceCode/NPCs/NPCtypeD2.bb +++ b/SourceCode/NPCs/NPCtypeD2.bb @@ -298,7 +298,7 @@ Function UpdateNPCtypeD2(n.NPCs) n\LastSeen = 0.0 n\Reload = 0.0 If n\Gun <> Null And n\Frame >= v3d\y-0.5 Then - bone% = FindChild(n\obj, GetINIString("Data\NPCBones.ini", n\NPCName, "weapon_hand_bonename")) + bone% = FindChild(n\obj, IniGetString("Data\NPCBones.ini", n\NPCName, "weapon_hand_bonename")) For g = Each Guns If g\ID = n\Gun\ID Then it = CreateItem(g\DisplayName, g\name, EntityX(bone%, True), EntityY(bone%, True) + 0.025, EntityZ(bone%, True)) diff --git a/SourceCode/NPCs/NPCtypeGuard.bb b/SourceCode/NPCs/NPCtypeGuard.bb index 63d0bbd..5b555c2 100644 --- a/SourceCode/NPCs/NPCtypeGuard.bb +++ b/SourceCode/NPCs/NPCtypeGuard.bb @@ -9,8 +9,8 @@ Function CreateNPCtypeGuard(n.NPCs) EntityType n\Collider, HIT_PLAYER n\obj = CopyEntity(GuardObj) - n\Speed = (GetINIFloat("DATA\NPCs.ini", "Guard", "speed") / 100.0) - temp# = (GetINIFloat("DATA\NPCs.ini", "Guard", "scale") / 2.5) + n\Speed = (IniGetFloat("Data\NPCs.ini", "Guard", "speed") / 100.0) + temp# = (IniGetFloat("Data\NPCs.ini", "Guard", "scale") / 2.5) ScaleEntity n\obj, temp, temp, temp diff --git a/SourceCode/NPCs/NPCtypeMTF.bb b/SourceCode/NPCs/NPCtypeMTF.bb index 78e3f2b..f1f5b3c 100644 --- a/SourceCode/NPCs/NPCtypeMTF.bb +++ b/SourceCode/NPCs/NPCtypeMTF.bb @@ -29,8 +29,8 @@ Function CreateNPCtypeMTF(n.NPCs) EntityType n\Collider, HIT_PLAYER n\obj = CopyEntity(MTFObj) - n\Speed = (GetINIFloat("DATA\NPCs.ini", "MTF", "speed") / 100.0) - temp# = (GetINIFloat("DATA\NPCs.ini", "MTF", "scale") / 2.5) + n\Speed = (IniGetFloat("Data\NPCs.ini", "MTF", "speed") / 100.0) + temp# = (IniGetFloat("Data\NPCs.ini", "MTF", "scale") / 2.5) ScaleEntity n\obj, temp, temp, temp MeshCullBox (n\obj, -MeshWidth(MTFObj), -MeshHeight(MTFObj), -MeshDepth(MTFObj), MeshWidth(MTFObj)*2, MeshHeight(MTFObj)*2, MeshDepth(MTFObj)*2) diff --git a/SourceCode/NPCs/NPCtypeZombie.bb b/SourceCode/NPCs/NPCtypeZombie.bb index 502fe61..4156b85 100644 --- a/SourceCode/NPCs/NPCtypeZombie.bb +++ b/SourceCode/NPCs/NPCtypeZombie.bb @@ -18,13 +18,13 @@ Function CreateNPCtypeZombie(n.NPCs) If n\obj = 0 Then n\obj = CopyEntity(NPC0492OBJ) - temp# = (GetINIFloat("DATA\NPCs.ini", "SCP-049-2", "scale") / 2.5) + temp# = (IniGetFloat("Data\NPCs.ini", "SCP-049-2", "scale") / 2.5) ScaleEntity n\obj, temp, temp, temp MeshCullBox (n\obj, -MeshWidth(n\obj), -MeshHeight(n\obj), -MeshDepth(n\obj), MeshWidth(n\obj)*2, MeshHeight(n\obj)*2, MeshDepth(n\obj)*2) EndIf - n\Speed = (GetINIFloat("DATA\NPCs.ini", "SCP-049-2", "speed") / 100.0) + n\Speed = (IniGetFloat("Data\NPCs.ini", "SCP-049-2", "speed") / 100.0) SetAnimTime(n\obj, 107) diff --git a/SourceCode/NPCs/NPCtypeZombieMP.bb b/SourceCode/NPCs/NPCtypeZombieMP.bb index 403f795..5d19220 100644 --- a/SourceCode/NPCs/NPCtypeZombieMP.bb +++ b/SourceCode/NPCs/NPCtypeZombieMP.bb @@ -424,13 +424,13 @@ Function CreateNPCtypeZombieMP_Guard(n.NPCs,model%=-1) EndIf n\obj = CopyEntity(mp_I\GuardZombieModel[n\State3]) - temp# = (GetINIFloat("DATA\NPCs.ini", "SCP-049-2", "scale") / 2.5) + temp# = (IniGetFloat("Data\NPCs.ini", "SCP-049-2", "scale") / 2.5) ScaleEntity n\obj, temp, temp, temp MeshCullBox (n\obj, -MeshWidth(n\obj), -MeshHeight(n\obj), -MeshDepth(n\obj), MeshWidth(n\obj)*2, MeshHeight(n\obj)*2, MeshDepth(n\obj)*2) EndIf - n\Speed = (GetINIFloat("DATA\NPCs.ini", "SCP-049-2", "speed") / 50.0) + n\Speed = (IniGetFloat("Data\NPCs.ini", "SCP-049-2", "speed") / 50.0) If n\State3 = 1 Then If n\Sound = 0 Then diff --git a/SourceCode/Save.bb b/SourceCode/Save.bb index 7347e47..5542612 100644 --- a/SourceCode/Save.bb +++ b/SourceCode/Save.bb @@ -18,7 +18,7 @@ Function SaveGame(file$, newzone%=-1) EndIf Local savename$ = Replace(Replace(file, SavePath, ""), "\", "") - PutINIValue(gv\OptionFile, "options", "last save", savename) + IniWriteString(gv\OptionFile, "options", "last save", savename) m_I\CurrentSave = savename ;Save global data in here @@ -2510,7 +2510,7 @@ Function LoadSaveGames() SaveGameAmount = 0 If m_I <> Null And m_I\CurrentSave = "" Then - m_I\CurrentSave = GetINIString(gv\OptionFile, "options", "last save") + m_I\CurrentSave = IniGetString(gv\OptionFile, "options", "last save") EndIf If FileType(SavePath)=1 Then RuntimeError "Can't create dir "+Chr(34)+SavePath+Chr(34) diff --git a/SourceCode/StrictLoads.bb b/SourceCode/StrictLoads.bb index a2b5486..46a49e6 100644 --- a/SourceCode/StrictLoads.bb +++ b/SourceCode/StrictLoads.bb @@ -572,10 +572,8 @@ Function FreeImage_Strict%(image%) End Function ;don't use in LoadRMesh, as Reg does this manually there. If you wanna fuck around with the logic in that function, be my guest -Function LoadTexture_Strict(File$,flags=1,texdeletetype%=0) - If FileType(File$) <> 1 Then RuntimeError "Texture " + File$ + " not found." - - Local tmp +Function LoadTexture_Strict%(File$,flags=1,texdeletetype%=0) + Local tmp% If FileType(File$) <> 1 Then RuntimeError "Texture " + File$ + " not found." tmp = LoadTextureCheckingIfInCache(File$,texdeletetype,flags) diff --git a/SourceCode/userlibs/IniControler.decls b/SourceCode/userlibs/IniController.decls similarity index 63% rename from SourceCode/userlibs/IniControler.decls rename to SourceCode/userlibs/IniController.decls index 45d8995..9522217 100644 --- a/SourceCode/userlibs/IniControler.decls +++ b/SourceCode/userlibs/IniController.decls @@ -1,9 +1,9 @@ -; IniControler - A part of BlitzToolBox -; Write & Read ini file. -; v1.05 2022.10.28 +; IniController - A part of BlitzToolbox +; Reading & writing INI files for Blitz3D. Customize strict file path edition for SCP: Nine-Tailed Fox. +; v1.081 2024.9.20 ; https://github.com/ZiYueCommentary/BlitzToolbox -.lib "IniControler.dll" +.lib "IniController.dll" IniClearBuffer(path$):"_IniClearBuffer@4" IniClearAllBuffer():"_IniClearAllBuffer@0" @@ -19,7 +19,10 @@ IniRemoveBufferKey(path$, section$, key$):"_IniRemoveBufferKey@12" IniRemoveBufferSection(path$, section$):"_IniRemoveBufferSection@8" IniSetExportBufferValue(buffer%, section$, key$, value$):"_IniSetExportBufferValue@16" -; they have default parameters so you need include "IniControler.bb" +; Custom for SCP: Nine-Tailed Fox. +FindSCP294Drink_$(file$, drink$):"_FindSCP294Drink@8" + +; they have default parameters so you need include "IniController.bb" IniWriteBuffer_(path$, clearPrevious%):"_IniWriteBuffer@8" IniGetString_$(path$, section$, key$, defaultValue$, allowBuffer%):"_IniGetString@20" IniGetInt_%(path$, section$, key$, defaultValue%, allowBuffer%):"_IniGetInt@20" @@ -41,30 +44,4 @@ IniBufferExportXml_(path$, xml$, isMin%):"_IniBufferExportXml@12" IniRemoveKey_(path$, section$, key$, updateBuffer%):"_IniRemoveKey@16" IniRemoveSection_(path$, section$, updateBuffer%):"_IniRemoveSection@12" IniExportIni_(path$, ini$, isMin%, allowBuffer%):"_IniExportIni@16" -IniBufferExportIni_(path$, ini$, isMin%):"_IniBufferExportIni@12" - -; Header File :DDD -.lib " " - -IniWriteBuffer(path$, clearPrevious%) -IniGetString$(path$, section$, key$, defaultValue$, allowBuffer%) -IniGetInt%(path$, section$, key$, defaultValue%, allowBuffer%) -IniGetFloat#(path$, section$, key$, defaultValue#, allowBuffer%) -IniGetBufferString$(path$, section$, key$, defaultValue$) -IniGetBufferInt%(path$, section$, key$, defaultValue%) -IniGetBufferFloat#(path$, section$, key$, defaultValue#) -IniWriteString(path$, section$, key$, value$, updateBuffer%) -IniWriteInt(path$, section$, key$, value%, updateBuffer%) -IniWriteFloat(path$, section$, key$, value#, updateBuffer%) -IniSectionExist%(path$, section$, allowBuffer%) -IniKeyExist%(path$, section$, key$, allowBuffer%) -IniExportJson(path$, json$, isMin%, stringOnly%, allowBuffer%) -IniBufferExportJson(path$, json$, isMin%, stringOnly%) -IniExportHtml(path$, html$, isMin%, isList%, allowBuffer%) -IniBufferExportHtml(path$, html$, isMin%, isList%) -IniExportXml(path$, xml$, isMin%, allowBuffer%) -IniBufferExportXml(path$, xml$, isMin%) -IniRemoveKey(path$, section$, key$, updateBuffer%) -IniRemoveSection(path$, section$, updateBuffer%) -IniExportIni(path$, ini$, isMin%, allowBuffer%) -IniBufferExportIni(path$, ini$, isMin%) \ No newline at end of file +IniBufferExportIni_(path$, ini$, isMin%):"_IniBufferExportIni@12" \ No newline at end of file