more work on intro

This commit is contained in:
Holly Stubbs 2025-04-02 01:09:19 +01:00
parent 492565b3a3
commit c57e2bd426
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E
10 changed files with 691 additions and 71 deletions

View file

@ -82,6 +82,11 @@ player_blink={
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null)
]
}
DEBUG_SPEED={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194323,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
[physics]

View file

@ -406,8 +406,8 @@ func UpdateParticles():
p.pvt.queue_free()
particles.erase(p)
var ParticleTextures = []
var DecalTextures = []
var ParticleTextures = Utils.Init1DArray(10)
var DecalTextures = Utils.Init1DArray(20)
var MenuOpen = false
var InvOpen = false
@ -838,6 +838,57 @@ var eventSystem: EventSystem
var lightTemplates: Array[LightTemplate]
var TempSounds = Utils.Init1DArray(10)
var PauseMenuIMG
var SprintIcon
var BlinkIcon
var CrouchIcon
var HandIcon
var HandIcon2
var StaminaMeterIMG
var KeypadHUD
var Panel294
var SoundEmitter: Node3D
var FogTexture
var GasMaskTexture
var NVTexture
var FogNVTexture
var TeslaTexture
var LiquidObj: Node3D
var MTFObj: Node3D
var GuardObj: Node3D
var ClassDObj: Node3D
var ApacheObj: Node3D
var ApacheRotorObj: Node3D
var NPC049OBJ: Node3D
var NPC0492OBJ: Node3D
var ClerkOBJ: Node3D
var mapDoorOBJ: Node3D
var DoorFrameOBJ: Node3D
var HeavyDoorObj = Utils.Init1DArray(2)
var DoorColl: Node3D
var ButtonOBJ: Node3D
var ButtonKeyOBJ: Node3D
var ButtonCodeOBJ: Node3D
var ButtonScannerOBJ: Node3D
var BigDoorOBJ = Utils.Init1DArray(2)
var LeverBaseOBJ: Node3D
var LeverOBJ: Node3D
var GorePics = Utils.Init1DArray(10)
var OldAiPics = Utils.Init1DArray(2)
var Monitor: Node3D
var MonitorTexture
var CamBaseOBJ: Node3D
var CamOBJ: Node3D
var Monitor2: Node3D
var Monitor3: Node3D
var MonitorTexture2
var MonitorTexture3
var MonitorTexture4
var LightConeModel: Node3D
var OBJTunnel = Utils.Init1DArray(7)
func AddTempLight(rt: RoomTemplate, x: float, y: float, z: float, ltype: int, range: float, r: int, g: int, b: int) -> LightTemplate:
var lt: LightTemplate = LightTemplate.new()
lightTemplates.push_back(lt)
@ -1128,7 +1179,7 @@ var decals: Array = []
func CreateDecal(id: int, x: float, y: float, z: float, pitch: float, yaw: float, roll: float):
var d:SCPDecal = SCPDecal.new()
d.x = x
d.x = -x
d.y = y
d.z = z
d.pitch = pitch
@ -1154,7 +1205,7 @@ func CreateDecal(id: int, x: float, y: float, z: float, pitch: float, yaw: float
d.ID = id
if d.obj != null:
if d.obj == null:
return null
return d
@ -1211,9 +1262,9 @@ func FillRoom(r:Room):
#CatchErrors("Uncaught (FillRoom)")
#Local d.Doors, d2.Doors, sc.SecurityCams, de.Decals, r2.Rooms, sc2.SecurityCams
#Local it.Items, i%
var xtemp = 0.0
var ytemp = 0.0
var ztemp = 0.0
#var xtemp = 0.0
#var ytemp = 0.0
#var ztemp = 0.0
var t1#, Bump
var rn = r.RoomTemplate.Name
@ -3533,7 +3584,6 @@ func FillRoom(r:Room):
#EntityParent(it\collider, r\obj)
#;[End Block]
elif rn == "173":
#;[Block]
r.Objects[0] = CreatePivot()
PositionEntity (r.Objects[0], EntityX(r.obj) + 40.0 * Constants.RoomScale, 460.0 * Constants.RoomScale, EntityZ(r.obj) + 1072.0 * Constants.RoomScale)
r.Objects[1] = CreatePivot()
@ -3562,19 +3612,17 @@ func FillRoom(r:Room):
FreeEntity(r.RoomDoors[1].buttons[1])
r.RoomDoors[1].buttons[1] = null
#de.Decals = CreateDecal(Rand(4, 5), EntityX(r\Objects[5], True), 0.002, EntityZ(r\Objects[5], True), 90, Rnd(360), 0)
#de\Size = 1.2
#ScaleSprite(de\obj, de\Size, de\Size)
#
#For xtemp% = 0 To 1
#For ztemp% = 0 To 1
#de.Decals = CreateDecal(Rand(4, 6), r\x + 700.0 * RoomScale + xtemp * 700.0 * RoomScale + Rnd(-0.5, 0.5), Rnd(0.001, 0.0018), r\z + 600 * ztemp * RoomScale + Rnd(-0.5, 0.5), 90, Rnd(360), 0)
#de\Size = Rnd(0.5, 0.8)
#de\Alpha = Rnd(0.8, 1.0)
#ScaleSprite(de\obj, de\Size, de\Size)
#Next
#Next
#
var de = CreateDecal(randi_range(4, 5), EntityX(r.Objects[5], true), 0.002, EntityZ(r.Objects[5], true), 90, randf_range(0, 360), 0)
de.Size = 1.2
ScaleSprite(de.obj, de.Size, de.Size)
for xtemp in range(0, 2):
for ztemp in range(0, 2):
de = CreateDecal(randi_range(4, 6), r.x - 700.0 * Constants.RoomScale - xtemp * 700.0 * Constants.RoomScale + randf_range(-0.5, 0.5), randf_range(0.001, 0.0018), r.z + 600 * ztemp * Constants.RoomScale + randf_range(-0.5, 0.5), 90, randf_range(0, 360), 0)
de.Size = randf_range(0.5, 0.8)
de.Alpha = randf_range(0.8, 1.0)
ScaleSprite(de.obj, de.Size, de.Size)
#;AddLight(r, r\x-224.0*RoomScale, r\y+640.0*RoomScale, r\z+128.0*RoomScale,2,2,200,200,200)
#;AddLight(r, r\x-1056.0*RoomScale, r\y+608.0*RoomScale, r\z+416.0*RoomScale,2,2,200,200,200)
@ -3623,40 +3671,48 @@ func FillRoom(r:Room):
d.locked = true
d.DisableWaypoint = true
#tex = LoadTexture_Strict("GFX\map\Door02.jpg")
#For ztemp = 0 To 1
#d.Doors = CreateDoor(r\zone, r\x - 5760 * RoomScale, 0, r\z + (320+896*ztemp) * RoomScale, 0, r, False)
#d\locked = True
#d\DisableWaypoint = True
#
#d.Doors = CreateDoor(r\zone, r\x - 8288 * RoomScale, 0, r\z + (320+896*ztemp) * RoomScale, 0, r, False)
#d\locked = True
#If ztemp = 0 Then d\open = True Else d\DisableWaypoint = True
#
#For xtemp = 0 To 2
#d.Doors = CreateDoor(r\zone, r\x - (7424.0-512.0*xtemp) * RoomScale, 0, r\z + (1008.0-480.0*ztemp) * RoomScale, 180*(Not ztemp), r, False)
var tex = Global.LoadTexture("GFX\\map\\Door02.jpg")
for ztemp in range(0, 2):
d = CreateDoor(r.zone, r.x + 5760 * Constants.RoomScale, 0, r.z + (320 + 896 * ztemp) * Constants.RoomScale, 0, r, false)
d.locked = true
d.DisableWaypoint = true
d = CreateDoor(r.zone, r.x + 8288 * Constants.RoomScale, 0, r.z + (320 + 896 * ztemp) * Constants.RoomScale, 0, r, false)
d.locked = true
if ztemp == 0:
d.open = true
else:
d.DisableWaypoint = true
for xtemp in range(0, 3):
d = CreateDoor(r.zone, r.x + (7424.0 - 512.0 * xtemp) * Constants.RoomScale, 0, r.z + (1008.0 - 480.0 * ztemp) * Constants.RoomScale, 180 * (-ztemp), r, false)
#EntityTexture d\obj, tex
#d\locked = True
#FreeEntity d\obj2 : d\obj2=0
#FreeEntity d\buttons[0] : d\buttons[0]=0
#FreeEntity d\buttons[1] : d\buttons[1]=0
#d\DisableWaypoint = True
#Next
#For xtemp = 0 To 4
#d.Doors = CreateDoor(r\zone, r\x - (5120.0-512.0*xtemp) * RoomScale, 0, r\z + (1008.0-480.0*ztemp) * RoomScale, 180*(Not ztemp), r, False)
d.locked = true
FreeEntity(d.obj2)
d.obj2 = null
FreeEntity(d.buttons[0])
d.buttons[0] = null
FreeEntity(d.buttons[1])
d.buttons[1] = null
d.DisableWaypoint = true
for xtemp in range(0, 5):
d = CreateDoor(r.zone, r.x + (5120.0 - 512.0 * xtemp) * Constants.RoomScale, 0, r.z + (1008.0 - 480.0 * ztemp) * Constants.RoomScale, 180 * (-ztemp), r, false)
#EntityTexture d\obj, tex
#d\locked = True
#FreeEntity d\obj2 : d\obj2=0
#FreeEntity d\buttons[0] : d\buttons[0]=0
#FreeEntity d\buttons[1] : d\buttons[1]=0
#d\DisableWaypoint = True
#
#If xtemp = 2 And ztemp = 1 Then r\RoomDoors[6] = d
#Next
#Next
#
d.locked = true
FreeEntity(d.obj2)
d.obj2 = null
FreeEntity(d.buttons[0])
d.buttons[0] = null
FreeEntity(d.buttons[1])
d.buttons[1] = null
d.DisableWaypoint = true
if xtemp == 2 and ztemp == 1:
r.RoomDoors[6] = d
#CreateItem("Class D Orientation Leaflet", "paper", r\x-(2914+1024)*RoomScale, 170.0*RoomScale, r\z+40*RoomScale)
#
#sc.SecurityCams = CreateSecurityCam(r\x - 4048.0 * RoomScale, r\y - 32.0 * RoomScale, r\z - 1232.0 * RoomScale, r, True)
#sc\angle = 270
#sc\turn = 45
@ -3670,11 +3726,13 @@ func FillRoom(r:Room):
#r\Objects[9] = LoadMesh_Strict("GFX\map\173_2.b3d",r\obj)
r.Objects[9] = B3D.Load("GFX\\map\\173_2.b3d", r.obj)
add_child(r.Objects[9])
#EntityType r\Objects[9],HIT_MAP
#EntityPickMode r\Objects[9],2
#r\Objects[10] = LoadMesh_Strict("GFX\map\intro_labels.b3d",r\obj)
r.Objects[10] = B3D.Load("GFX\\map\\intro_labels.b3d", r.obj)
add_child(r.Objects[10])
#;[End Block]
#Case "room2ccont"
#;[Block]

View file

@ -1667,26 +1667,25 @@ func UpdateEvents():
#e\EventState2 = 1
#EndIf
#
#If PlayerRoom = e\room Then
#If e\EventState >= 10 Then
if map.PlayerRoom == e.room:
#if e.EventState >= 10:
#CameraRange(Camera, 0.05, 15)
#If e\room\NPC[7]<>Null Then
#RemoveNPC(e\room\NPC[7])
#EndIf
#Else
#if e.room.NPC[7] != null:
#map.RemoveNPC(e.room.NPC[7])
#else:
#CameraRange(Camera, 0.05, 40)
#EndIf
#CameraFogMode(Camera, 0)
#AmbientLight (140, 140, 140)
#HideEntity(Fog)
#
#LightVolume = 4.0
#TempLightVolume = 4.0
#Else
#DebugLog "delete intro event"
#RemoveEvent(e)
#EndIf
#;[End Block]
map.env.fog_enabled = true
#AmbientLight (140, 140, 140)
map.env.ambient_light_energy = 140.0 / 255.0
#HideEntity(Fog)
map.LightVolume = 4.0
map.TempLightVolume = 4.0
else:
print("delete intro event")
RemoveEvent(e)
#Case "buttghost"
#;[Block]
#If PlayerRoom = e\room Then

View file

@ -25,7 +25,7 @@ var MISSING_TEXTURE = load("res://missing.png")
var TextureLoadFailed: bool = false
func LoadTexture(rawFileName: String):
func LoadTexture(rawFileName: String, flag: int = 0):
var fixedName = rawFileName.replace("\\", "/")
var fileName = Utils.GetCaseiFileName(str("" if rawFileName.contains("res://") else "res://", fixedName))
if fileName == null:

548
src/LoadEntities.gd Normal file
View file

@ -0,0 +1,548 @@
class_name LoadEntities
static func Go(map: DynamicMap):
#CatchErrors("Uncaught (LoadEntities)")
map.loadingScreen.LoadProgress(0)
for i in range(0, 10):
map.TempSounds[i] = null
map.PauseMenuIMG = Global.LoadTexture("GFX\\menu\\pausemenu.jpg")
#MaskImage PauseMenuIMG, 255,255,0
#ScaleImage PauseMenuIMG,MenuScale,MenuScale
map.SprintIcon = Global.LoadTexture("GFX\\sprinticon.png")
map.BlinkIcon = Global.LoadTexture("GFX\\blinkicon.png")
map.CrouchIcon = Global.LoadTexture("GFX\\sneakicon.png")
map.HandIcon = Global.LoadTexture("GFX\\handsymbol.png")
map.HandIcon2 = Global.LoadTexture("GFX\\handsymbol2.png")
map.StaminaMeterIMG = Global.LoadTexture("GFX\\staminameter.jpg")
map.KeypadHUD = Global.LoadTexture("GFX\\keypadhud.jpg")
#MaskImage(KeypadHUD, 255,0,255)
map.Panel294 = Global.LoadTexture("GFX\\294panel.jpg")
#MaskImage(Panel294, 255,0,255)
#Brightness = GetINIFloat("options.ini", "options", "brightness")
#CameraFogNear = GetINIFloat("options.ini", "options", "camera fog near")
#CameraFogFar = GetINIFloat("options.ini", "options", "camera fog far")
#StoredCameraFogFar# = CameraFogFar
#TextureLodBias
#map.AmbientLightRoomTex = CreateTexture(2,2,257)
#TextureBlend AmbientLightRoomTex,5
#SetBuffer(TextureBuffer(AmbientLightRoomTex))
#ClsColor 0,0,0
#Cls
#SetBuffer BackBuffer()
#AmbientLightRoomVal = 0
map.SoundEmitter = map.CreatePivot()
#Camera = CreateCamera()
#CameraViewport Camera,0,0,GraphicWidth,GraphicHeight
#CameraRange(Camera, 0.05, CameraFogFar)
#CameraFogMode (Camera, 1)
#CameraFogRange (Camera, CameraFogNear, CameraFogFar)
#CameraFogColor (Camera, GetINIInt("options.ini", "options", "fog r"), GetINIInt("options.ini", "options", "fog g"), GetINIInt("options.ini", "options", "fog b"))
#AmbientLight Brightness, Brightness, Brightness
#ScreenTexs[0] = CreateTexture(512, 512, 1+256)
#ScreenTexs[1] = CreateTexture(512, 512, 1+256)
#CreateBlurImage()
#CameraProjMode ark_blur_cam,0
#;Listener = CreateListener(Camera)
map.FogTexture = Global.LoadTexture("GFX\\fog.jpg", 1)
#Fog = CreateSprite(ark_blur_cam)
#ScaleSprite(Fog, Max(GraphicWidth / 1240.0, 1.0), Max(GraphicHeight / 960.0 * 0.8, 0.8))
#EntityTexture(Fog, FogTexture)
#EntityBlend (Fog, 2)
#EntityOrder Fog, -1000
#MoveEntity(Fog, 0, 0, 1.0)
map.GasMaskTexture = Global.LoadTexture("GFX\\GasmaskOverlay.jpg", 1)
#GasMaskOverlay = CreateSprite(ark_blur_cam)
#ScaleSprite(GasMaskOverlay, Max(GraphicWidth / 1024.0, 1.0), Max(GraphicHeight / 1024.0 * 0.8, 0.8))
#EntityTexture(GasMaskOverlay, GasMaskTexture)
#EntityBlend (GasMaskOverlay, 2)
#EntityFX(GasMaskOverlay, 1)
#EntityOrder GasMaskOverlay, -1003
#MoveEntity(GasMaskOverlay, 0, 0, 1.0)
#HideEntity(GasMaskOverlay)
#InfectTexture = LoadTexture_Strict("GFX\InfectOverlay.jpg", 1)
#InfectOverlay = CreateSprite(ark_blur_cam)
#ScaleSprite(InfectOverlay, Max(GraphicWidth / 1024.0, 1.0), Max(GraphicHeight / 1024.0 * 0.8, 0.8))
#EntityTexture(InfectOverlay, InfectTexture)
#EntityBlend (InfectOverlay, 3)
#EntityFX(InfectOverlay, 1)
#EntityOrder InfectOverlay, -1003
#MoveEntity(InfectOverlay, 0, 0, 1.0)
#;EntityAlpha (InfectOverlay, 255.0)
#HideEntity(InfectOverlay)
map.NVTexture = Global.LoadTexture("GFX\\NightVisionOverlay.jpg", 1)
#NVOverlay = CreateSprite(ark_blur_cam)
#ScaleSprite(NVOverlay, Max(GraphicWidth / 1024.0, 1.0), Max(GraphicHeight / 1024.0 * 0.8, 0.8))
#EntityTexture(NVOverlay, NVTexture)
#EntityBlend (NVOverlay, 2)
#EntityFX(NVOverlay, 1)
#EntityOrder NVOverlay, -1003
#MoveEntity(NVOverlay, 0, 0, 1.0)
#HideEntity(NVOverlay)
#NVBlink = CreateSprite(ark_blur_cam)
#ScaleSprite(NVBlink, Max(GraphicWidth / 1024.0, 1.0), Max(GraphicHeight / 1024.0 * 0.8, 0.8))
#EntityColor(NVBlink,0,0,0)
#EntityFX(NVBlink, 1)
#EntityOrder NVBlink, -1005
#MoveEntity(NVBlink, 0, 0, 1.0)
#HideEntity(NVBlink)
map.FogNVTexture = Global.LoadTexture("GFX\\fogNV.jpg", 1)
map.loadingScreen.LoadProgress(5)
#DarkTexture = CreateTexture(1024, 1024, 1 + 2)
#SetBuffer TextureBuffer(DarkTexture)
#Cls
#SetBuffer BackBuffer()
#Dark = CreateSprite(Camera)
#ScaleSprite(Dark, Max(GraphicWidth / 1240.0, 1.0), Max(GraphicHeight / 960.0 * 0.8, 0.8))
#EntityTexture(Dark, DarkTexture)
#EntityBlend (Dark, 1)
#EntityOrder Dark, -1002
#MoveEntity(Dark, 0, 0, 1.0)
#EntityAlpha Dark, 0.0
#LightTexture = CreateTexture(1024, 1024, 1 + 2+256)
#SetBuffer TextureBuffer(LightTexture)
#ClsColor 255, 255, 255
#Cls
#ClsColor 0, 0, 0
#SetBuffer BackBuffer()
map.TeslaTexture = Global.LoadTexture("GFX\\map\\tesla.jpg", 1 + 2)
#Light = CreateSprite(Camera)
#ScaleSprite(Light, Max(GraphicWidth / 1240.0, 1.0), Max(GraphicHeight / 960.0 * 0.8, 0.8))
#EntityTexture(Light, LightTexture)
#EntityBlend (Light, 1)
#EntityOrder Light, -1002
#MoveEntity(Light, 0, 0, 1.0)
#HideEntity Light
#Collider = CreatePivot()
#EntityRadius Collider, 0.15, 0.30
#EntityPickMode(Collider, 1)
#EntityType Collider, HIT_PLAYER
#Head = CreatePivot()
#EntityRadius Head, 0.15
#EntityType Head, HIT_PLAYER
map.LiquidObj = X.LoadModel("GFX\\items\\cupliquid.x") # optimized the cups dispensed by 294
#HideEntity LiquidObj
map.MTFObj = B3D.Load("GFX\\npcs\\MTF2.b3d") # optimized MTFs
map.GuardObj = B3D.Load("GFX\\npcs\\guard.b3d") # optimized Guards
#GuardTex = LoadTexture_Strict("GFX\\npcs\\body.jpg") # optimized the guards even more
#If BumpEnabled Then
# bump1 = LoadTexture_Strict("GFX\npcs\mtf_newnormal01.png")
# ;TextureBlend bump1, FE_BUMP ;USE DOT3
#
# For i = 2 To CountSurfaces(MTFObj)
# sf = GetSurface(MTFObj,i)
# b = GetSurfaceBrush( sf )
# t1 = GetBrushTexture(b,0)
#
# Select Lower(StripPath(TextureName(t1)))
# Case "MTF_newdiffuse02.png"
#
# BrushTexture b, bump1, 0, 0
# BrushTexture b, t1, 0, 1
# PaintSurface sf,b
# End Select
# FreeBrush b
# FreeTexture t1
# Next
# FreeTexture bump1
#EndIf
map.ClassDObj = B3D.Load("GFX\\npcs\\classd.b3d") # optimized Class-D's and scientists/researchers
map.ApacheObj = B3D.Load("GFX\\apache.b3d") # optimized Apaches (helicopters)
map.ApacheRotorObj = B3D.Load("GFX\\apacherotor.b3d") # optimized the Apaches even more
#HideEntity MTFObj
#HideEntity GuardObj
#HideEntity ClassDObj
#HideEntity ApacheObj
#HideEntity ApacheRotorObj
#Other NPCs pre-loaded
map.NPC049OBJ = B3D.Load("GFX\\npcs\\scp-049.b3d")
#HideEntity NPC049OBJ
map.NPC0492OBJ = B3D.Load("GFX\\npcs\\zombie1.b3d")
#HideEntity NPC0492OBJ
map.ClerkOBJ = B3D.Load("GFX\\npcs\\clerk.b3d")
#HideEntity ClerkOBJ
# For i=0 To 4
# Select True
# Case i=2
# tempStr="2c"
# Case i>2
# tempStr=Str(i)
# Default
# tempStr=Str(i+1)
# End Select
# OBJTunnel(i)=LoadRMesh("GFX\map\mt"+tempStr+".rmesh",Null)
# HideEntity OBJTunnel(i)
# Next
# OBJTunnel(0)=LoadRMesh("GFX\map\mt1.rmesh",Null)
# HideEntity OBJTunnel(0)
# OBJTunnel(1)=LoadRMesh("GFX\map\mt2.rmesh",Null)
# HideEntity OBJTunnel(1)
# OBJTunnel(2)=LoadRMesh("GFX\map\mt2c.rmesh",Null)
# HideEntity OBJTunnel(2)
# OBJTunnel(3)=LoadRMesh("GFX\map\mt3.rmesh",Null)
# HideEntity OBJTunnel(3)
# OBJTunnel(4)=LoadRMesh("GFX\map\mt4.rmesh",Null)
# HideEntity OBJTunnel(4)
# OBJTunnel(5)=LoadRMesh("GFX\map\mt_elevator.rmesh",Null)
# HideEntity OBJTunnel(5)
# OBJTunnel(6)=LoadRMesh("GFX\map\mt_generator.rmesh",Null)
# HideEntity OBJTunnel(6)
map.LightSpriteTex[0] = Global.LoadTexture("GFX\\light1.jpg", 1)
map.LightSpriteTex[1] = Global.LoadTexture("GFX\\light2.jpg", 1)
map.LightSpriteTex[2] = Global.LoadTexture("GFX\\lightsprite.jpg", 1)
map.loadingScreen.LoadProgress(10)
map.mapDoorOBJ = X.LoadModel("GFX\\map\\door01.x")
#HideEntity DoorOBJ
map.DoorFrameOBJ = X.LoadModel("GFX\\map\\doorframe.x")
#HideEntity DoorFrameOBJ
map.HeavyDoorObj[0] = X.LoadModel("GFX\\map\\heavydoor1.x")
#HideEntity HeavyDoorObj(0)
map.HeavyDoorObj[1] = X.LoadModel("GFX\\map\\heavydoor2.x")
#HideEntity HeavyDoorObj(1)
map.DoorColl = X.LoadModel("GFX\\map\\doorcoll.x")
#HideEntity DoorColl
map.ButtonOBJ = X.LoadModel("GFX\\map\\Button.x")
#HideEntity ButtonOBJ
map.ButtonKeyOBJ = X.LoadModel("GFX\\map\\ButtonKeycard.x")
#HideEntity ButtonKeyOBJ
map.ButtonCodeOBJ = X.LoadModel("GFX\\map\\ButtonCode.x")
#HideEntity ButtonCodeOBJ
map.ButtonScannerOBJ = X.LoadModel("GFX\\map\\ButtonScanner.x")
#HideEntity ButtonScannerOBJ
map.BigDoorOBJ[0] = X.LoadModel("GFX\\map\\ContDoorLeft.x")
#HideEntity BigDoorOBJ(0)
map.BigDoorOBJ[1] = X.LoadModel("GFX\\map\\ContDoorRight.x")
#HideEntity BigDoorOBJ(1)
map.LeverBaseOBJ = X.LoadModel("GFX\\map\\leverbase.x")
#HideEntity LeverBaseOBJ
map.LeverOBJ = X.LoadModel("GFX\\map\\leverhandle.x")
#HideEntity LeverOBJ
#For i = 0 To 1
# HideEntity BigDoorOBJ(i)
# ;If BumpEnabled And 0 Then
# If BumpEnabled
#
# Local bumptex = LoadTexture_Strict("GFX\map\containmentdoorsbump.jpg")
# ;TextureBlend bumptex, FE_BUMP
# Local tex = LoadTexture_Strict("GFX\map\containment_doors.jpg")
# EntityTexture BigDoorOBJ(i), bumptex, 0, 0
# EntityTexture BigDoorOBJ(i), tex, 0, 1
#
# ;FreeEntity tex
# ;FreeEntity bumptex
# FreeTexture tex
# FreeTexture bumptex
# EndIf
#Next
map.loadingScreen.LoadProgress(15)
for i in range(0, 6):
map.GorePics[i] = Global.LoadTexture("GFX\\895pics\\pic" + str(i + 1) + ".jpg")
map.OldAiPics[0] = Global.LoadTexture("GFX\\AIface.jpg")
map.OldAiPics[1] = Global.LoadTexture("GFX\\AIface2.jpg")
map.loadingScreen.LoadProgress(20)
for i in range(0, 7):
map.DecalTextures[i] = Global.LoadTexture("GFX\\decal" + str(i + 1) + ".png", 1 + 2)
map.DecalTextures[7] = Global.LoadTexture("GFX\\items\\INVpaperstrips.jpg", 1 + 2)
for i in range(8, 13):
map.DecalTextures[i] = Global.LoadTexture("GFX\\decalpd" + str(i - 7) + ".jpg", 1 + 2)
for i in range(13, 15):
map.DecalTextures[i] = Global.LoadTexture("GFX\\bullethole" + str(i - 12) + ".jpg", 1 + 2)
for i in range(15, 17):
map.DecalTextures[i] = Global.LoadTexture("GFX\\blooddrop" + str(i - 14) + ".png", 1 + 2)
map.DecalTextures[17] = Global.LoadTexture("GFX\\decal8.png", 1 + 2)
map.DecalTextures[18] = Global.LoadTexture("GFX\\decalpd6.dc", 1 + 2)
map.DecalTextures[19] = Global.LoadTexture("GFX\\decal19.png", 1 + 2)
map.DecalTextures[20] = Global.LoadTexture("GFX\\decal427.png", 1 + 2)
map.loadingScreen.LoadProgress(25)
map.Monitor = B3D.Load("GFX\\map\\monitor.b3d")
#HideEntity Monitor
map.MonitorTexture = Global.LoadTexture("GFX\\monitortexture.jpg")
map.CamBaseOBJ = X.LoadModel("GFX\\map\\cambase.x")
#HideEntity(CamBaseOBJ)
map.CamOBJ = B3D.Load("GFX\\map\\CamHead.b3d")
#HideEntity(CamOBJ)
map.Monitor2 = B3D.Load("GFX\\map\\monitor_checkpoint.b3d")
#HideEntity Monitor2
map.Monitor3 = B3D.Load("GFX\\map\\monitor_checkpoint.b3d")
#HideEntity Monitor3
map.MonitorTexture2 = Global.LoadTexture("GFX\\map\\LockdownScreen2.jpg")
map.MonitorTexture3 = Global.LoadTexture("GFX\\map\\LockdownScreen.jpg")
map.MonitorTexture4 = Global.LoadTexture("GFX\\map\\LockdownScreen3.jpg")
#MonitorTextureOff = CreateTexture(1,1)
#SetBuffer TextureBuffer(MonitorTextureOff)
#ClsColor 0,0,0
#Cls
#SetBuffer BackBuffer()
map.LightConeModel = B3D.Load("GFX\\lightcone.b3d")
#HideEntity LightConeModel
#for i = 2 To CountSurfaces(Monitor2)
# sf = GetSurface(Monitor2,i)
# b = GetSurfaceBrush(sf)
# If b<>0 Then
# t1 = GetBrushTexture(b,0)
# If t1<>0 Then
# name$ = StripPath(TextureName(t1))
# If Lower(name) <> "monitortexture.jpg"
# BrushTexture b, MonitorTextureOff, 0, 0
# PaintSurface sf,b
# EndIf
# If name<>"" Then FreeTexture t1
# EndIf
# FreeBrush b
# EndIf
#Next
#For i = 2 To CountSurfaces(Monitor3)
# sf = GetSurface(Monitor3,i)
# b = GetSurfaceBrush(sf)
# If b<>0 Then
# t1 = GetBrushTexture(b,0)
# If t1<>0 Then
# name$ = StripPath(TextureName(t1))
# If Lower(name) <> "monitortexture.jpg"
# BrushTexture b, MonitorTextureOff, 0, 0
# PaintSurface sf,b
# EndIf
# If name<>"" Then FreeTexture t1
# EndIf
# FreeBrush b
# EndIf
#Next
#UserTrackMusicAmount% = 0
#If EnableUserTracks Then
# Local dirPath$ = "SFX\Radio\UserTracks\"
# If FileType(dirPath)<>2 Then
# CreateDir(dirPath)
# EndIf
#
# Local Dir% = ReadDir("SFX\Radio\UserTracks\")
# Repeat
# file$=NextFile(Dir)
# If file$="" Then Exit
# If FileType("SFX\Radio\UserTracks\"+file$) = 1 Then
# test = LoadSound("SFX\Radio\UserTracks\"+file$)
# If test<>0
# UserTrackName$(UserTrackMusicAmount%) = file$
# UserTrackMusicAmount% = UserTrackMusicAmount% + 1
# EndIf
# FreeSound test
# EndIf
# Forever
# CloseDir Dir
#EndIf
#If EnableUserTracks Then DebugLog "User Tracks found: "+UserTrackMusicAmount
#InitItemTemplates(map)
map.ParticleTextures[0] = Global.LoadTexture("GFX\\smoke.png", 1 + 2)
map.ParticleTextures[1] = Global.LoadTexture("GFX\\flash.jpg", 1 + 2)
map.ParticleTextures[2] = Global.LoadTexture("GFX\\dust.jpg", 1 + 2)
map.ParticleTextures[3] = Global.LoadTexture("GFX\\npcs\\hg.pt", 1 + 2)
map.ParticleTextures[4] = Global.LoadTexture("GFX\\map\\sun.jpg", 1 + 2)
map.ParticleTextures[5] = Global.LoadTexture("GFX\\bloodsprite.png", 1 + 2)
map.ParticleTextures[6] = Global.LoadTexture("GFX\\smoke2.png", 1 + 2)
map.ParticleTextures[7] = Global.LoadTexture("GFX\\spark.jpg", 1 + 2)
map.ParticleTextures[8] = Global.LoadTexture("GFX\\particle.png", 1 + 2)
#SetChunkDataValues()
#;NPCtypeD - different models with different textures (loaded using "CopyEntity") - ENDSHN
#;[Block]
#For i=1 To MaxDTextures
# DTextures[i] = CopyEntity(ClassDObj)
# HideEntity DTextures[i]
#Next
#;Gonzales
#tex = LoadTexture_Strict("GFX\npcs\gonzales.jpg")
#EntityTexture DTextures[1],tex
#FreeTexture tex
#;SCP-970 corpse
#tex = LoadTexture_Strict("GFX\npcs\corpse.jpg")
#EntityTexture DTextures[2],tex
#FreeTexture tex
#;scientist 1
#tex = LoadTexture_Strict("GFX\npcs\scientist.jpg")
#EntityTexture DTextures[3],tex
#FreeTexture tex
#;scientist 2
#tex = LoadTexture_Strict("GFX\npcs\scientist2.jpg")
#EntityTexture DTextures[4],tex
#FreeTexture tex
#;janitor
#tex = LoadTexture_Strict("GFX\npcs\janitor.jpg")
#EntityTexture DTextures[5],tex
#FreeTexture tex
#;106 Victim
#tex = LoadTexture_Strict("GFX\npcs\106victim.jpg")
#EntityTexture DTextures[6],tex
#FreeTexture tex
#;2nd ClassD
#tex = LoadTexture_Strict("GFX\npcs\classd2.jpg")
#EntityTexture DTextures[7],tex
#FreeTexture tex
#;035 victim
#tex = LoadTexture_Strict("GFX\npcs\035victim.jpg")
#EntityTexture DTextures[8],tex
#FreeTexture tex
#;[End Block]
#LoadMaterials("DATA\materials.ini")
map.OBJTunnel[0] = RMesh.LoadRMesh("GFX\\map\\mt1.rmesh", null, map)
#HideEntity OBJTunnel(0)
map.OBJTunnel[1] = RMesh.LoadRMesh("GFX\\map\\mt2.rmesh", null, map)
#HideEntity OBJTunnel(1)
map.OBJTunnel[2] = RMesh.LoadRMesh("GFX\\map\\mt2c.rmesh", null, map)
#HideEntity OBJTunnel(2)
map.OBJTunnel[3] = RMesh.LoadRMesh("GFX\\map\\mt3.rmesh", null, map)
#HideEntity OBJTunnel(3)
map.OBJTunnel[4] = RMesh.LoadRMesh("GFX\\map\\mt4.rmesh", null, map)
#HideEntity OBJTunnel(4)
map.OBJTunnel[5] = RMesh.LoadRMesh("GFX\\map\\mt_elevator.rmesh", null, map)
#HideEntity OBJTunnel(5)
map.OBJTunnel[6] = RMesh.LoadRMesh("GFX\\map\\mt_generator.rmesh", null, map)
#HideEntity OBJTunnel(6)
#;TextureLodBias TextureBias
#;TextureLodBias TextureFloat#
#;Devil Particle System
#;ParticleEffect[] numbers:
#; 0 - electric spark
#; 1 - smoke effect
#Local t0
#InitParticles(Camera)
#;Spark Effect (short)
#ParticleEffect[0] = CreateTemplate()
#SetTemplateEmitterBlend(ParticleEffect[0], 3)
#SetTemplateInterval(ParticleEffect[0], 1)
#SetTemplateParticlesPerInterval(ParticleEffect[0], 6)
#SetTemplateEmitterLifeTime(ParticleEffect[0], 6)
#SetTemplateParticleLifeTime(ParticleEffect[0], 20, 30)
#SetTemplateTexture(ParticleEffect[0], "GFX\Spark.png", 2, 3)
#SetTemplateOffset(ParticleEffect[0], -0.1, 0.1, -0.1, 0.1, -0.1, 0.1)
#SetTemplateVelocity(ParticleEffect[0], -0.0375, 0.0375, -0.0375, 0.0375, -0.0375, 0.0375)
#SetTemplateAlignToFall(ParticleEffect[0], True, 45)
#SetTemplateGravity(ParticleEffect[0], 0.001)
#SetTemplateAlphaVel(ParticleEffect[0], True)
#;SetTemplateSize(ParticleEffect[0], 0.0625, 0.125, 0.7, 1)
#SetTemplateSize(ParticleEffect[0], 0.03125, 0.0625, 0.7, 1)
#SetTemplateColors(ParticleEffect[0], $0000FF, $6565FF)
#SetTemplateFloor(ParticleEffect[0], 0.0, 0.5)
#;Smoke effect (for some vents)
#ParticleEffect[1] = CreateTemplate()
#SetTemplateEmitterBlend(ParticleEffect[1], 1)
#SetTemplateInterval(ParticleEffect[1], 1)
#SetTemplateEmitterLifeTime(ParticleEffect[1], 3)
#SetTemplateParticleLifeTime(ParticleEffect[1], 30, 45)
#SetTemplateTexture(ParticleEffect[1], "GFX\smoke2.png", 2, 1)
#;SetTemplateOffset(ParticleEffect[1], -.3, .3, -.3, .3, -.3, .3)
#SetTemplateOffset(ParticleEffect[1], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
#;SetTemplateVelocity(ParticleEffect[1], -.04, .04, .1, .2, -.04, .04)
#SetTemplateVelocity(ParticleEffect[1], 0.0, 0.0, 0.02, 0.025, 0.0, 0.0)
#SetTemplateAlphaVel(ParticleEffect[1], True)
#;SetTemplateSize(ParticleEffect[1], 3, 3, .5, 1.5)
#SetTemplateSize(ParticleEffect[1], 0.4, 0.4, 0.5, 1.5)
#SetTemplateSizeVel(ParticleEffect[1], .01, 1.01)
#;Smoke effect (for decontamination gas)
#ParticleEffect[2] = CreateTemplate()
#SetTemplateEmitterBlend(ParticleEffect[2], 1)
#SetTemplateInterval(ParticleEffect[2], 1)
#SetTemplateEmitterLifeTime(ParticleEffect[2], 3)
#SetTemplateParticleLifeTime(ParticleEffect[2], 30, 45)
#SetTemplateTexture(ParticleEffect[2], "GFX\smoke.png", 2, 1)
#SetTemplateOffset(ParticleEffect[2], -0.1, 0.1, -0.1, 0.1, -0.1, 0.1)
#SetTemplateVelocity(ParticleEffect[2], -0.005, 0.005, 0.0, -0.03, -0.005, 0.005)
#SetTemplateAlphaVel(ParticleEffect[2], True)
#SetTemplateSize(ParticleEffect[2], 0.4, 0.4, 0.5, 1.5)
#SetTemplateSizeVel(ParticleEffect[2], .01, 1.01)
#SetTemplateGravity(ParticleEffect[2], 0.005)
#t0 = CreateTemplate()
#SetTemplateEmitterBlend(t0, 1)
#SetTemplateInterval(t0, 1)
#SetTemplateEmitterLifeTime(t0, 3)
#SetTemplateParticleLifeTime(t0, 30, 45)
#SetTemplateTexture(t0, "GFX\smoke2.png", 2, 1)
#SetTemplateOffset(t0, -0.1, 0.1, -0.1, 0.1, -0.1, 0.1)
#SetTemplateVelocity(t0, -0.005, 0.005, 0.0, -0.03, -0.005, 0.005)
#SetTemplateAlphaVel(t0, True)
#SetTemplateSize(t0, 0.4, 0.4, 0.5, 1.5)
#SetTemplateSizeVel(t0, .01, 1.01)
#SetTemplateGravity(ParticleEffect[2], 0.005)
#SetTemplateSubTemplate(ParticleEffect[2], t0)
#Room2slCam = CreateCamera()
#CameraViewport(Room2slCam, 0, 0, 128, 128)
#CameraRange Room2slCam, 0.05, 6.0
#CameraZoom(Room2slCam, 0.8)
#HideEntity(Room2slCam)
map.loadingScreen.LoadProgress(30)
#LoadRoomMeshes()
#CatchErrors("LoadEntities")

1
src/LoadEntities.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://jyv0xhxje1qq

View file

@ -20,6 +20,7 @@ var frameDelay = 1
func _process(delta: float) -> void:
if loadStage == 0 and frameDelay == 0:
LoadEntities.Go(map)
LoadAllSounds.Go(map)

View file

@ -110,6 +110,11 @@ func GetStepSound():
var movementVector = Vector3()
func _process(delta: float) -> void:
if Input.is_action_pressed("DEBUG_SPEED"):
Engine.time_scale = 10
else:
Engine.time_scale = 1
if (abs(cameraMoveByVector.x) > 0 or abs(cameraMoveByVector.y) > 0):
Rotation.x -= rad_to_deg(cameraMoveByVector.x * 120 * delta);
Rotation.y -= rad_to_deg(cameraMoveByVector.y * 120 * delta);

View file

@ -28,7 +28,10 @@ static func LoadRMesh(file: String, rt: RoomTemplate, map: DynamicMap):
print("\"", header, "\"")
var scene = Node3D.new()
scene.name = str(fileName, "_", rt.Name, "_", RMESH_LOAD_COUNT)
if rt:
scene.name = str(fileName, "_", rt.Name, "_", RMESH_LOAD_COUNT)
else:
scene.name = str(fileName, "_", RMESH_LOAD_COUNT)
# debug rot and name!
var text3 = Label3D.new()
text3.position.y = 10

View file

@ -113,7 +113,7 @@ func FindNextNonWhiteSpace():
break
static func LoadModel(filePath: String):
var sillyPath = str("" if filePath.contains("res://") else "res://", filePath.replace("/Map/", "/map/"))
var sillyPath = str("" if filePath.contains("res://") else "res://", filePath.replace("/Map/", "/map/")).replace("\\", "/")
var file = FileAccess.open(sillyPath, FileAccess.READ)
# Do a case insensitive lookup only if we have to, it's more expensive.