forked from Regalis11/scpcb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.bb
9295 lines (7784 loc) · 287 KB
/
Main.bb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;This is the Source Code from SCP:CB Version 1.3.0 and onwards. This version was created by the "Third Subdivision Team".
;Original credit goes to Regalis and all the other contributers to SCP:CB.
;Modified by juanjp600 to remove FastExt and FastText due to stability and compatibility concerns.
;Removing this code also makes a potential engine conversion marginally easier to do (try parsing the code and converting it to C?),
;since the strange parts of the extensions are gone.
;In addition, you won't need FastExt.bb in the first place, making redistribution easier.
Include "StrictLoads.bb"
Include "fullscreen_window_fix.bb"
Include "KeyName.bb"
Global OptionFile$ = "options.ini"
Global ErrorFile$ = "error_log_"
Local ErrorFileInd% = 0
While FileType(ErrorFile+Str(ErrorFileInd)+".txt")<>0
ErrorFileInd = ErrorFileInd+1
Wend
ErrorFile = ErrorFile+Str(ErrorFileInd)+".txt"
Global Font1%, Font2%, Font3%, Font4%, Font5%
Global VersionNumber$ = "1.3.2"
Global CompatibleNumber$ = "1.3.2"
AppTitle "SCP - Containment Breach Launcher"
Global MenuWhite%, MenuBlack%
Global ButtonSFX%
Global EnableSFXRelease% = GetINIInt(OptionFile, "options", "sfx release")
Global EnableSFXRelease_Prev% = EnableSFXRelease%
;If you're gonna revert this then let Regalis do it.
Global CanOpenConsole% = GetINIInt(OptionFile, "console", "enabled")
Dim ArrowIMG(4)
;[Block]
Global LauncherWidth%= Min(GetINIInt(OptionFile, "launcher", "launcher width"), 1024)
Global LauncherHeight% = Min(GetINIInt(OptionFile, "launcher", "launcher height"), 768)
Global LauncherEnabled% = GetINIInt(OptionFile, "launcher", "launcher enabled")
Global LauncherIMG%
Global GraphicWidth% = GetINIInt(OptionFile, "options", "width")
Global GraphicHeight% = GetINIInt(OptionFile, "options", "height")
Global Depth% = 0, Fullscreen% = GetINIInt(OptionFile, "options", "fullscreen")
Global SelectedGFXMode%
Global SelectedGFXDriver% = Max(GetINIInt(OptionFile, "options", "gfx driver"), 1)
Global fresize_image%, fresize_texture%, fresize_texture2%
Global fresize_cam%
Global ShowFPS = GetINIInt(OptionFile, "options", "show FPS")
Global WireframeState
Global HalloweenTex
Global TotalGFXModes% = CountGfxModes3D(), GFXModes%
Dim GfxModeWidths%(TotalGFXModes), GfxModeHeights%(TotalGFXModes)
Global BorderlessWindowed% = GetINIInt(OptionFile, "options", "borderless windowed")
Global RealGraphicWidth%,RealGraphicHeight%
Global AspectRatioRatio#
Global EnableRoomLights% = GetINIInt(OptionFile, "options", "room lights enabled")
Global TextureDetails% = GetINIInt(OptionFile, "options", "texture details")
Global TextureFloat#
Select TextureDetails%
Case 0
TextureFloat# = 1.5
Case 1
TextureFloat# = 0.75
Case 2
TextureFloat# = 0.0
Case 3
TextureFloat# = -0.75
End Select
Global ConsoleOpening% = GetINIInt(OptionFile, "console", "auto opening")
Global SFXVolume# = GetINIFloat(OptionFile, "options", "sound volume")
Global Bit16Mode = GetINIInt(OptionFile, "options", "16bit")
Include "AAText.bb"
If LauncherEnabled Then
AspectRatioRatio = 1.0
UpdateLauncher()
;New "fake fullscreen" - ENDSHN Psst, it's called borderless windowed mode --Love Mark,
If BorderlessWindowed
DebugLog "Using Borderless Windowed Mode"
Graphics3DExt G_viewport_width, G_viewport_height, 0, 2
; -- Change the window style to 'WS_POPUP' and then set the window position to force the style to update.
api_SetWindowLong( G_app_handle, C_GWL_STYLE, C_WS_POPUP )
api_SetWindowPos( G_app_handle, C_HWND_TOP, G_viewport_x, G_viewport_y, G_viewport_width, G_viewport_height, C_SWP_SHOWWINDOW )
RealGraphicWidth = G_viewport_width
RealGraphicHeight = G_viewport_height
AspectRatioRatio = (Float(GraphicWidth)/Float(GraphicHeight))/(Float(RealGraphicWidth)/Float(RealGraphicHeight))
Fullscreen = False
Else
AspectRatioRatio = 1.0
If Fullscreen Then
Graphics3DExt(GraphicWidth, GraphicHeight, (16*Bit16Mode), 1)
Else
Graphics3DExt(GraphicWidth, GraphicHeight, 0, 2)
End If
EndIf
Else
For i% = 1 To TotalGFXModes
Local samefound% = False
For n% = 0 To TotalGFXModes - 1
If GfxModeWidths(n) = GfxModeWidth(i) And GfxModeHeights(n) = GfxModeHeight(i) Then samefound = True : Exit
Next
If samefound = False Then
If GraphicWidth = GfxModeWidth(i) And GraphicHeight = GfxModeHeight(i) Then SelectedGFXMode = GFXModes
GfxModeWidths(GFXModes) = GfxModeWidth(i)
GfxModeHeights(GFXModes) = GfxModeHeight(i)
GFXModes=GFXModes+1
End If
Next
GraphicWidth = GfxModeWidths(SelectedGFXMode)
GraphicHeight = GfxModeHeights(SelectedGFXMode)
;New "fake fullscreen" - ENDSHN Psst, it's called borderless windowed mode --Love Mark,
If BorderlessWindowed
DebugLog "Using Faked Fullscreen"
Graphics3DExt G_viewport_width, G_viewport_height, 0, 2
; -- Change the window style to 'WS_POPUP' and then set the window position to force the style to update.
api_SetWindowLong( G_app_handle, C_GWL_STYLE, C_WS_POPUP )
api_SetWindowPos( G_app_handle, C_HWND_TOP, G_viewport_x, G_viewport_y, G_viewport_width, G_viewport_height, C_SWP_SHOWWINDOW )
RealGraphicWidth = G_viewport_width
RealGraphicHeight = G_viewport_height
AspectRatioRatio = (Float(GraphicWidth)/Float(GraphicHeight))/(Float(RealGraphicWidth)/Float(RealGraphicHeight))
Fullscreen = False
Else
AspectRatioRatio = 1.0
If Fullscreen Then
Graphics3DExt(GraphicWidth, GraphicHeight, (16*Bit16Mode), 1)
Else
Graphics3DExt(GraphicWidth, GraphicHeight, 0, 2)
End If
EndIf
EndIf
Global MenuScale# = (GraphicHeight / 1024.0)
SetBuffer(BackBuffer())
Global CurTime%, PrevTime%, LoopDelay%, FPSfactor#, FPSfactor2#
Local CheckFPS%, ElapsedLoops%, FPS%, ElapsedTime#
Global Framelimit% = GetINIInt(OptionFile, "options", "framelimit")
Global Vsync% = GetINIInt(OptionFile, "options", "vsync")
Global Opt_AntiAlias = GetINIInt(OptionFile, "options", "antialias")
Global CurrFrameLimit# = Framelimit%
Global ScreenGamma# = GetINIFloat(OptionFile, "options", "screengamma")
;If Fullscreen Then UpdateScreenGamma()
Const HIT_MAP% = 1, HIT_PLAYER% = 2, HIT_ITEM% = 3, HIT_APACHE% = 4, HIT_178% = 5, HIT_DEAD% = 6
SeedRnd MilliSecs()
;[End block]
Global GameSaved%
Global CanSave% = True
AppTitle "SCP - Containment Breach v"+VersionNumber
;---------------------------------------------------------------------------------------------------------------------
;[Block]
Global CursorIMG% = LoadImage_Strict("GFX\cursor.png")
Global SelectedLoadingScreen.LoadingScreens, LoadingScreenAmount%, LoadingScreenText%
Global LoadingBack% = LoadImage_Strict("Loadingscreens\loadingback.jpg")
InitLoadingScreens("Loadingscreens\loadingscreens.ini")
InitAAFont()
;For some reason, Blitz3D doesn't load fonts that have filenames that
;don't match their "internal name" (i.e. their display name in applications
;like Word and such). As a workaround, I moved the files and renamed them so they
;can load without FastText.
Font1% = AALoadFont("GFX\font\cour\Courier New.ttf", Int(18 * (GraphicHeight / 1024.0)), 0,0,0)
Font2% = AALoadFont("GFX\font\courbd\Courier New.ttf", Int(58 * (GraphicHeight / 1024.0)), 0,0,0)
Font3% = AALoadFont("GFX\font\DS-DIGI\DS-Digital.ttf", Int(22 * (GraphicHeight / 1024.0)), 0,0,0)
Font4% = AALoadFont("GFX\font\DS-DIGI\DS-Digital.ttf", Int(60 * (GraphicHeight / 1024.0)), 0,0,0)
Font5% = AALoadFont("GFX\font\Journal\Journal.ttf", Int(58 * (GraphicHeight / 1024.0)), 0,0,0)
AASetFont Font2
Global BlinkMeterIMG% = LoadImage_Strict("GFX\blinkmeter.jpg")
DrawLoading(0, True)
; - -Viewport.
Global viewport_center_x% = GraphicWidth / 2, viewport_center_y% = GraphicHeight / 2
; -- Mouselook.
Global mouselook_x_inc# = 0.3 ; This sets both the sensitivity and direction (+/-) of the mouse on the X axis.
Global mouselook_y_inc# = 0.3 ; This sets both the sensitivity and direction (+/-) of the mouse on the Y axis.
; Used to limit the mouse movement to within a certain number of pixels (250 is used here) from the center of the screen. This produces smoother mouse movement than continuously moving the mouse back to the center each loop.
Global mouse_left_limit% = 250, mouse_right_limit% = GraphicsWidth () - 250
Global mouse_top_limit% = 150, mouse_bottom_limit% = GraphicsHeight () - 150 ; As above.
Global mouse_x_speed_1#, mouse_y_speed_1#
Global KEY_RIGHT = GetINIInt(OptionFile, "binds", "Right key")
Global KEY_LEFT = GetINIInt(OptionFile, "binds", "Left key")
Global KEY_UP = GetINIInt(OptionFile, "binds", "Up key")
Global KEY_DOWN = GetINIInt(OptionFile, "binds", "Down key")
Global KEY_BLINK = GetINIInt(OptionFile, "binds", "Blink key")
Global KEY_SPRINT = GetINIInt(OptionFile, "binds", "Sprint key")
Global KEY_INV = GetINIInt(OptionFile, "binds", "Inventory key")
Global KEY_CROUCH = GetINIInt(OptionFile, "binds", "Crouch key")
Global KEY_SAVE = GetINIInt(OptionFile, "binds", "Save key")
Global KEY_CONSOLE = GetINIInt(OptionFile, "binds", "Console key")
Const INFINITY# = (999.0) ^ (99999.0), NAN# = (-1.0) ^ (0.5)
Global Mesh_MinX#, Mesh_MinY#, Mesh_MinZ#
Global Mesh_MaxX#, Mesh_MaxY#, Mesh_MaxZ#
Global Mesh_MagX#, Mesh_MagY#, Mesh_MagZ#
;player stats -------------------------------------------------------------------------------------------------------
Global KillTimer#, KillAnim%, FallTimer#, DeathTimer#
Global Sanity#, ForceMove#, ForceAngle#
Global Playable% = True
Global BLINKFREQ#
Global BlinkTimer#, EyeIrritation#, EyeStuck#, BlinkEffect# = 1.0, BlinkEffectTimer#
Global Stamina#, StaminaEffect#=1.0, StaminaEffectTimer#
Global SCP1025state#[6]
Global HeartBeatRate#, HeartBeatTimer#, HeartBeatVolume#
Global WearingGasMask%, WearingHazmat%, WearingVest%, Wearing714%, WearingNightVision%, Wearing178%
Global NVTimer#
Global SuperMan%, SuperManTimer#
Global Injuries#, Bloodloss#, Infect#
Global RefinedItems%
Include "Achievements.bb"
;player coordinates, angle, speed, movement etc ---------------------------------------------------------------------
Global DropSpeed#, HeadDropSpeed#, CurrSpeed#
Global user_camera_pitch#, side#
Global Crouch%, CrouchState#
Global PlayerZone%, PlayerRoom.Rooms
Global isIn8601%
Global GrabbedEntity%
Global InvertMouse% = GetINIInt(OptionFile, "options", "invert mouse y")
Global MouseHit1%, MouseDown1%, MouseHit2%, DoubleClick%, LastMouseHit1%, MouseUp1%
Global GodMode%, NoClip%, NoClipSpeed# = 2.0
Global CoffinDistance#
Global PlayerSoundVolume#
;camera/lighting effects (blur, camera shake, etc)-------------------------------------------------------------------
Global Shake#
Global ExplosionTimer#, ExplosionSFX%
Global LightsOn% = True
Global SoundTransmission%
;menus, GUI ---------------------------------------------------------------------------------------------------------
Global MainMenuOpen%, MenuOpen%, StopHidingTimer#, InvOpen%
Global OtherOpen.Items = Null
Global SelectedEnding$, EndingScreen%, EndingTimer#
Global MsgTimer#, Msg$, DeathMSG$
Global AccessCode%, KeypadInput$, KeypadTimer#, KeypadMSG$
Global DrawHandIcon%
Dim DrawArrowIcon%(4)
;misc ---------------------------------------------------------------------------------------------------------------
Include "Difficulty.bb"
Global MTFtimer#, MTFrooms.Rooms[10], MTFroomState%[10]
Dim RadioState#(10)
Dim RadioState3%(3)
Dim RadioState4%(9)
Dim RadioCHN%(8)
Dim OldAiPics%(5)
Global PlayTime%
Global ConsoleFlush%
Global ConsoleFlushSnd% = 0, ConsoleMusFlush% = 0
Global InfiniteStamina% = False
Global NVBlink%
Global IsNVGBlinking% = False
;[End block]
;---------------------------------------------- Console -----------------------------------------------------
Global ConsoleOpen%, ConsoleInput$
Type ConsoleMsg
Field txt$
End Type
Function CreateConsoleMsg(txt$)
Local c.ConsoleMsg = New ConsoleMsg
Insert c Before First ConsoleMsg
c\txt = txt
End Function
Function UpdateConsole()
If CanOpenConsole = False Then ConsoleOpen = False
If ConsoleOpen Then
Local x% = 20, y% = 20, width% = 400, height% = 500
Local StrTemp$, temp%, i%
Local ev.Events, r.Rooms, it.Items
DrawFrame x,y,width,height
Color 255, 255, 255
SelectedInputBox = 2
ConsoleInput = InputBox(x, y + height - 30, width, 30, ConsoleInput, 2)
ConsoleInput = Left(ConsoleInput, 50)
If KeyHit(28) And ConsoleInput <> "" Then
If Instr(ConsoleInput, " ") > 0 Then
StrTemp$ = Lower(Left(ConsoleInput, Instr(ConsoleInput, " ") - 1))
Else
StrTemp$ = Lower(ConsoleInput)
End If
Select Lower(StrTemp)
Case "help"
If Instr(ConsoleInput, " ")<>0 Then
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Else
StrTemp$ = ""
EndIf
Select Lower(StrTemp)
Case "1",""
CreateConsoleMsg("LIST OF COMMANDS - PAGE 1/3")
CreateConsoleMsg("******************************")
CreateConsoleMsg("- asd")
CreateConsoleMsg("- status")
CreateConsoleMsg("- camerapick")
CreateConsoleMsg("- ending")
CreateConsoleMsg("- noclipspeed")
CreateConsoleMsg("- noclip")
CreateConsoleMsg("- injure [value]")
CreateConsoleMsg("- infect [value]")
CreateConsoleMsg("- heal")
CreateConsoleMsg("- teleport [room name]")
CreateConsoleMsg("- spawnitem [item name]")
CreateConsoleMsg("- wireframe")
CreateConsoleMsg("- 173speed")
CreateConsoleMsg("- 106speed")
CreateConsoleMsg("- 173state")
CreateConsoleMsg("- 106state")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Use "+Chr(34)+"help 2/3"+Chr(34)+" to find more commands.")
CreateConsoleMsg("Use "+Chr(34)+"help [command name]"+Chr(34)+" to get more information about a command.")
CreateConsoleMsg("******************************")
Case "2"
CreateConsoleMsg("LIST OF COMMANDS - PAGE 2/3")
CreateConsoleMsg("******************************")
CreateConsoleMsg("- spawn513-1")
CreateConsoleMsg("- spawn106")
CreateConsoleMsg("- reset096")
CreateConsoleMsg("- disable173")
CreateConsoleMsg("- enable173")
CreateConsoleMsg("- disable106")
CreateConsoleMsg("- enable106")
CreateConsoleMsg("- halloween")
CreateConsoleMsg("- sanic")
CreateConsoleMsg("- scp-420-j")
CreateConsoleMsg("- godmode")
CreateConsoleMsg("- revive")
CreateConsoleMsg("- noclip")
CreateConsoleMsg("- showfps")
CreateConsoleMsg("- 096state")
CreateConsoleMsg("- debughud")
CreateConsoleMsg("- camerafog [near] [far]")
CreateConsoleMsg("- brightness [value]")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Use "+Chr(34)+"help [command name]"+Chr(34)+" to get more information about a command.")
CreateConsoleMsg("******************************")
Case "3"
CreateConsoleMsg("- spawn [npc type]")
CreateConsoleMsg("- infinitestamina")
CreateConsoleMsg("- playmusic [clip + .wav/.ogg]")
CreateConsoleMsg("- notarget")
CreateConsoleMsg("- spawnnpcstate [npc type] [state]")
Case "asd"
CreateConsoleMsg("HELP - asd")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Actives godmode, noclip, wireframe and")
CreateConsoleMsg("sets fog distance to 20 near, 30 far")
CreateConsoleMsg("******************************")
Case "camerafog"
CreateConsoleMsg("HELP - camerafog")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Sets the draw distance of the fog.")
CreateConsoleMsg("The fog begins generating at 'CameraFogNear' units")
CreateConsoleMsg("away from the camera and becomes completely opaque")
CreateConsoleMsg("at 'CameraFogFar' units away from the camera.")
CreateConsoleMsg("Example: camerafog 20 40")
CreateConsoleMsg("******************************")
Case "noclip","fly"
CreateConsoleMsg("HELP - noclip")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Toggles noclip, unless a valid parameter")
CreateConsoleMsg("is specified (on/off).")
CreateConsoleMsg("Allows the camera to move in any direction while")
CreateConsoleMsg("bypassing collision.")
CreateConsoleMsg("******************************")
Case "godmode"
CreateConsoleMsg("HELP - godmode")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Toggles godmode, unless a valid parameter")
CreateConsoleMsg("is specified (on/off).")
CreateConsoleMsg("Prevents player death under normal circumstances.")
CreateConsoleMsg("******************************")
Case "wireframe"
CreateConsoleMsg("HELP - wireframe")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Toggles wireframe, unless a valid parameter")
CreateConsoleMsg("is specified (on/off).")
CreateConsoleMsg("Allows only the edges of geometry to be rendered,")
CreateConsoleMsg("making everything else transparent.")
CreateConsoleMsg("******************************")
Case "spawnitem"
CreateConsoleMsg("HELP - spawnitem")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Spawns an item at the player's location.")
CreateConsoleMsg("Any name that can appear in your inventory")
CreateConsoleMsg("is a valid parameter.")
CreateConsoleMsg("Example: spawnitem Key Card Omni")
CreateConsoleMsg("******************************")
Case "spawn"
CreateConsoleMsg("HELP - spawn")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Spawns an NPC at the player's location.")
CreateConsoleMsg("Valid parameters are:")
CreateConsoleMsg("049 / zombie (049-2) / 096 / 106 / 173 / 513-1")
CreateConsoleMsg("/ 966 / 1499-1 / guard / mtf")
CreateConsoleMsg("******************************")
Case "revive","undead","resurrect"
CreateConsoleMsg("HELP - revive")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Resets the player's death timer after the dying")
CreateConsoleMsg("animation triggers.")
CreateConsoleMsg("Does not affect injury, blood loss")
CreateConsoleMsg("or 008 infection values.")
CreateConsoleMsg("******************************")
Case "teleport"
CreateConsoleMsg("HELP - teleport")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Teleports the player to the first instance")
CreateConsoleMsg("of the specified room. Any room that appears")
CreateConsoleMsg("in rooms.ini is a valid parameter.")
CreateConsoleMsg("******************************")
Case "stopsound", "stfu"
CreateConsoleMsg("HELP - stopsound")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Stops all currently playing sounds.")
CreateConsoleMsg("******************************")
Case "camerapick"
CreateConsoleMsg("HELP - camerapick")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Prints the texture name and coordinates of")
CreateConsoleMsg("the model the camera is pointing at.")
CreateConsoleMsg("******************************")
Case "status"
CreateConsoleMsg("HELP - status")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Prints player, camera, and room information.")
CreateConsoleMsg("******************************")
Case "weed","scp-420-j","420"
CreateConsoleMsg("HELP - 420")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Generates dank memes.")
CreateConsoleMsg("******************************")
Case "playmusic"
CreateConsoleMsg("HELP - playmusic")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Will play tracks in .ogg/.wav format")
CreateConsoleMsg("from "+Chr(34)+"SFX\Music\Custom\"+Chr(34)+".")
CreateConsoleMsg("******************************")
Default
CreateConsoleMsg("There is no help available for that command.")
End Select
Case "asd"
WireFrame 1
WireframeState=1
GodMode = 1
NoClip = 1
CameraFogNear = 15
CameraFogFar = 20
Case "status"
CreateConsoleMsg("******************************")
CreateConsoleMsg("Status: ")
CreateConsoleMsg("Coordinates: ")
CreateConsoleMsg(" - collider: "+EntityX(Collider)+", "+EntityY(Collider)+", "+EntityZ(Collider))
CreateConsoleMsg(" - camera: "+EntityX(Camera)+", "+EntityY(Camera)+", "+EntityZ(Camera))
CreateConsoleMsg("Rotation: ")
CreateConsoleMsg(" - collider: "+EntityPitch(Collider)+", "+EntityYaw(Collider)+", "+EntityRoll(Collider))
CreateConsoleMsg(" - camera: "+EntityPitch(Camera)+", "+EntityYaw(Camera)+", "+EntityRoll(Camera))
CreateConsoleMsg("Room: "+PlayerRoom\RoomTemplate\Name)
For ev.Events = Each Events
If ev\room = PlayerRoom Then
CreateConsoleMsg("Room event: "+ev\EventName)
CreateConsoleMsg("- state: "+ev\EventState)
CreateConsoleMsg("- state2: "+ev\EventState2)
CreateConsoleMsg("- state3: "+ev\EventState3)
Exit
EndIf
Next
CreateConsoleMsg("Room coordinates: "+Floor(EntityX(PlayerRoom\obj) / 8.0 + 0.5)+", "+ Floor(EntityZ(PlayerRoom\obj) / 8.0 + 0.5))
CreateConsoleMsg("Stamina: "+Stamina)
CreateConsoleMsg("Death timer: "+KillTimer)
CreateConsoleMsg("Blinktimer: "+BlinkTimer)
CreateConsoleMsg("Injuries: "+Injuries)
CreateConsoleMsg("Bloodloss: "+Bloodloss)
CreateConsoleMsg("******************************")
Case "camerapick"
c = CameraPick(Camera,GraphicWidth/2, GraphicHeight/2)
If c = 0 Then
CreateConsoleMsg("******************************")
CreateConsoleMsg("No entity picked")
CreateConsoleMsg("******************************")
Else
CreateConsoleMsg("******************************")
CreateConsoleMsg("Picked entity:")
sf = GetSurface(c,1)
b = GetSurfaceBrush( sf )
t = GetBrushTexture(b,0)
texname$ = StripPath(TextureName(t))
CreateConsoleMsg("Texture name: "+texname)
CreateConsoleMsg("Coordinates: "+EntityX(c)+", "+EntityY(c)+", "+EntityZ(c))
CreateConsoleMsg("******************************")
EndIf
Case "hidedistance"
HideDistance = Float(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
CreateConsoleMsg("Hidedistance set to "+HideDistance)
Case "ending"
SelectedEnding = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
KillTimer = -0.1
;EndingTimer = -0.1
Case "noclipspeed"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
NoClipSpeed = Float(StrTemp)
Case "injure"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Injuries = Float(StrTemp)
Case "infect"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Infect = Float(StrTemp)
Case "heal"
Injuries = 0
Bloodloss = 0
Case "teleport"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Select StrTemp
Case "895", "scp-895"
StrTemp = "coffin"
Case "scp-914"
StrTemp = "914"
Case "offices", "office"
StrTemp = "room2offices"
End Select
For r.Rooms = Each Rooms
If r\RoomTemplate\Name = StrTemp Then
;PositionEntity (Collider, EntityX(r\obj), 0.7, EntityZ(r\obj))
PositionEntity (Collider, EntityX(r\obj), EntityY(r\obj)+0.7, EntityZ(r\obj))
ResetEntity(Collider)
UpdateDoors()
UpdateRooms()
For it.Items = Each Items
it\disttimer = 0
Next
PlayerRoom = r
Exit
EndIf
Next
If PlayerRoom\RoomTemplate\Name <> StrTemp Then CreateConsoleMsg("Room not found.")
Case "spawnitem"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
temp = False
For itt.Itemtemplates = Each ItemTemplates
If (Lower(itt\name) = StrTemp) Then
temp = True
CreateConsoleMsg(itt\name + " spawned.")
it.Items = CreateItem(itt\name, itt\tempname, EntityX(Collider), EntityY(Camera,True), EntityZ(Collider))
EntityType(it\collider, HIT_ITEM)
Exit
Else If (Lower(itt\tempname) = StrTemp) Then
temp = True
CreateConsoleMsg(itt\name + " spawned.")
it.Items = CreateItem(itt\name, itt\tempname, EntityX(Collider), EntityY(Camera,True), EntityZ(Collider))
EntityType(it\collider, HIT_ITEM)
Exit
End If
Next
If temp = False Then CreateConsoleMsg("Item not found.")
Case "wireframe"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Select StrTemp
Case "on", "1", "true"
WireframeState = True
Case "off", "0", "false"
WireframeState = False
Default
WireframeState = Not WireframeState
End Select
If WireframeState Then
CreateConsoleMsg("WIREFRAME ON")
Else
CreateConsoleMsg("WIREFRAME OFF")
EndIf
WireFrame WireframeState
Case "173speed"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Curr173\Speed = Float(StrTemp)
CreateConsoleMsg("173's speed set to " + StrTemp)
Case "106speed"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Curr106\Speed = Float(StrTemp)
CreateConsoleMsg("106's speed set to " + StrTemp)
Case "173state"
CreateConsoleMsg("SCP-173")
CreateConsoleMsg("Position: " + EntityX(Curr173\obj) + ", " + EntityY(Curr173\obj) + ", " + EntityZ(Curr173\obj))
CreateConsoleMsg("Idle: " + Curr173\Idle)
CreateConsoleMsg("State: " + Curr173\State)
Case "106state"
CreateConsoleMsg("SCP-106")
CreateConsoleMsg("Position: " + EntityX(Curr106\obj) + ", " + EntityY(Curr106\obj) + ", " + EntityZ(Curr106\obj))
CreateConsoleMsg("Idle: " + Curr106\Idle)
CreateConsoleMsg("State: " + Curr106\State)
Case "spawn513-1"
CreateNPC(NPCtype5131, 0,0,0)
Case "spawn106"
Curr106\State = -1
PositionEntity Curr106\Collider, EntityX(Collider), EntityY(Curr106\Collider), EntityZ(Collider)
Case "reset096"
For n.NPCs = Each NPCs
If n\NPCtype = NPCtype096 Then
RemoveNPC(n)
CreateEvent("lockroom096", "lockroom2", 0)
Exit
EndIf
Next
Case "disable173"
Curr173\Idle = 3 ;This phenominal comment is brought to you by PolyFox. His absolute wisdom in this fatigue of knowledge brought about a new era of 173 state checks.
HideEntity Curr173\obj
HideEntity Curr173\Collider
Case "enable173"
Curr173\Idle = False
ShowEntity Curr173\obj
ShowEntity Curr173\Collider
Case "disable106"
Curr106\Idle = True
Curr106\State = 200000
Contained106 = True
Case "enable106"
Curr106\Idle = False
Contained106 = False
ShowEntity Curr106\Collider
ShowEntity Curr106\obj
Case "halloween"
HalloweenTex = Not HalloweenTex
If HalloweenTex Then
Local tex = LoadTexture_Strict("GFX\npcs\173h.pt", 1)
EntityTexture Curr173\obj, tex, 0, 0
FreeTexture tex
CreateConsoleMsg("173 JACK-O-LANTERN ON")
Else
Local tex2 = LoadTexture_Strict("GFX\npcs\173texture.png", 1)
EntityTexture Curr173\obj, tex2, 0, 0
FreeTexture tex2
CreateConsoleMsg("173 JACK-O-LANTERN OFF")
EndIf
Case "sanic"
SuperMan = Not SuperMan
If SuperMan = True Then
CreateConsoleMsg("GOTTA GO FAST")
Else
CreateConsoleMsg("WHOA SLOW DOWN")
EndIf
Case "scp-420-j","420","weed"
For i = 1 To 20
If Rand(2)=1 Then
it.Items = CreateItem("Some SCP-420-J","420", EntityX(Collider,True)+Cos((360.0/20.0)*i)*Rnd(0.3,0.5), EntityY(Camera,True), EntityZ(Collider,True)+Sin((360.0/20.0)*i)*Rnd(0.3,0.5))
Else
it.Items = CreateItem("Joint","420s", EntityX(Collider,True)+Cos((360.0/20.0)*i)*Rnd(0.3,0.5), EntityY(Camera,True), EntityZ(Collider,True)+Sin((360.0/20.0)*i)*Rnd(0.3,0.5))
EndIf
EntityType (it\collider, HIT_ITEM)
Next
PlaySound_Strict LoadTempSound("SFX\Music\420J.ogg")
Case "godmode"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Select StrTemp
Case "on", "1", "true"
GodMode = True
Case "off", "0", "false"
GodMode = False
Default
GodMode = Not GodMode
End Select
If GodMode Then
CreateConsoleMsg("GODMODE ON")
Else
CreateConsoleMsg("GODMODE OFF")
EndIf
Case "revive","undead","resurrect"
DropSpeed = -0.1
HeadDropSpeed = 0.0
Shake = 0
CurrSpeed = 0
HeartBeatVolume = 0
CameraShake = 0
Shake = 0
LightFlash = 0
BlurTimer = 0
FallTimer = 0
MenuOpen = False
GodMode = 0
NoClip = 0
ShowEntity Collider
KillTimer = 0
KillAnim = 0
Case "noclip","fly"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Select StrTemp
Case "on", "1", "true"
NoClip = True
Playable = True
Case "off", "0", "false"
NoClip = False
RotateEntity Collider, 0, EntityYaw(Collider), 0
Default
NoClip = Not NoClip
If NoClip = False Then
RotateEntity Collider, 0, EntityYaw(Collider), 0
Else
Playable = True
EndIf
End Select
If NoClip Then
CreateConsoleMsg("NOCLIP ON")
Else
CreateConsoleMsg("NOCLIP OFF")
EndIf
DropSpeed = 0
Case "showfps"
ShowFPS = Not ShowFPS
CreateConsoleMsg("ShowFPS: "+Str(ShowFPS))
Case "096state"
For n.NPCs = Each NPCs
If n\NPCtype = NPCtype096 Then
CreateConsoleMsg("SCP-096")
CreateConsoleMsg("Position: " + EntityX(n\obj) + ", " + EntityY(n\obj) + ", " + EntityZ(n\obj))
CreateConsoleMsg("Idle: " + n\Idle)
CreateConsoleMsg("State: " + n\State)
Exit
EndIf
Next
CreateConsoleMsg("SCP-096 has not spawned.")
Case "debughud"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Select StrTemp
Case "on", "1", "true"
DebugHUD = True
Case "off", "0", "false"
DebugHUD = False
Default
DebugHUD = Not DebugHUD
End Select
If DebugHUD Then
CreateConsoleMsg("Debug Mode On")
Else
CreateConsoleMsg("Debug Mode Off")
EndIf
Case "stopsound", "stfu"
For snd.Sound = Each Sound
For i = 0 To 31
If snd\channels[i]<>0 Then
StopChannel snd\channels[i]
EndIf
Next
Next
For e.events = Each Events
If e\eventname = "alarm" Then
If e\room\NPC[0] <> Null Then RemoveNPC(e\room\NPC[0])
If e\room\NPC[1] <> Null Then RemoveNPC(e\room\NPC[1])
If e\room\NPC[2] <> Null Then RemoveNPC(e\room\NPC[2])
FreeEntity e\room\Objects[0]
FreeEntity e\room\Objects[1]
RemoveEvent(e)
Exit
EndIf
Next
CreateConsoleMsg("Stopped all sounds.")
Case "camerafog"
args$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
CameraFogNear = Float(Left(args, Len(args) - Instr(args, " ")))
CameraFogFar = Float(Right(args, Len(args) - Instr(args, " ")))
CreateConsoleMsg("Near set to: " + CameraFogNear + ", far set to: " + CameraFogFar)
Case "brightness"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Brightness = Int(StrTemp)
CreateConsoleMsg("Brightness set to " + Brightness)
Case "spawn"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Console_SpawnNPC(StrTemp$)
;new Console Commands in SCP:CB 1.3 - ENDSHN
Case "infinitestamina","infstam"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Select StrTemp
Case "on", "1", "true"
InfiniteStamina% = True
Case "off", "0", "false"
InfiniteStamina% = False
Default
InfiniteStamina% = Not InfiniteStamina%
End Select
If InfiniteStamina
CreateConsoleMsg("INFINITE STAMINA ON")
Else
CreateConsoleMsg("INFINITE STAMINA OFF")
EndIf
Case "asd2"
GodMode = 1
InfiniteStamina = 1
Curr173\Idle = 3
Curr106\Idle = True
Curr106\State = 200000
Contained106 = True
Case "spawnnpcstate"
args$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
StrTemp$ = Piece$(args$,1," ")
StrTemp2$ = Piece$(args$,2," ")
Console_SpawnNPC(StrTemp$,Int(StrTemp2$))
Case "toggle_warhead_lever"
For e.Events = Each Events
If e\EventName = "room2nuke" Then
e\EventState = (Not e\EventState)
Exit
EndIf
Next
Case "toggle_079_deal"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Select StrTemp
Case "a"
For e.Events = Each Events
If e\EventName="gateaentrance" Then
e\EventState3 = (Not e\EventState3)
Exit
EndIf
Next
Case "b"
For e.Events = Each Events
If e\EventName="exit1" Then
e\EventState3 = (Not e\EventState3)
Exit
EndIf
Next
End Select
Case "kill","suicide"
KillTimer = -1
Select Rand(4)
Case 1
DeathMSG = "[REDACTED]"
Case 2
DeathMSG = "Subject D-9341 found dead in Sector [REDACTED]. "
DeathMSG = DeathMSG + "The subject appears to have attained no physical damage, and there is no visible indication as to what killed him. "
DeathMSG = DeathMSG + "Body was sent for autopsy."
Case 3
DeathMSG = "EXCP_ACCESS_VIOLATION"
Case 4
DeathMSG = "Subject D-9341 found dead in Sector [REDACTED]. "
DeathMSG = DeathMSG + "The subject appears to have scribbled the letters "+Chr(34)+"kys"+Chr(34)+" in his own blood beside him. "
DeathMSG = DeathMSG + "No other signs of physical trauma or struggle can be observed. Body was sent for autopsy."
End Select