Skip to content

Commit

Permalink
Merge pull request #255 from GMLambda/d1-canals-05
Browse files Browse the repository at this point in the history
Improve some section of d1_canals_05
  • Loading branch information
dounai2333 authored Aug 12, 2023
2 parents c5a2514 + 7b9d6b2 commit 3ddab34
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions gamemode/gametypes/hl2/mapscripts/d1_canals_05.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ end

local MAPSCRIPT = {}
MAPSCRIPT.PlayersLocked = false

MAPSCRIPT.DefaultLoadout = {
Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1"},
Ammo = {
Expand All @@ -17,19 +16,27 @@ MAPSCRIPT.DefaultLoadout = {

MAPSCRIPT.InputFilters = {}
MAPSCRIPT.EntityFilterByClass = {}

MAPSCRIPT.EntityFilterByName = {
["global_newgame_entmaker"] = true,
["relay_rockfall_start"] = true -- Don't do that, its trivial.
}

local function FreezeEntitiesAt(pos, extent)
local foundEnts = ents.FindInBox(pos - extent, pos + extent)
for _, v in pairs(foundEnts) do
local physObj = v:GetPhysicsObject()
if IsValid(physObj) then
physObj:EnableMotion(false)
end
end
end

function MAPSCRIPT:PostInit()
if SERVER then
local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(4149.820313, 3446.334229, -466.530853), Angle(0, -66, 0))
checkpoint1:SetVisiblePos(Vector(4240.543945, 3220.031982, -473.430939))
local checkpointTrigger1 = ents.Create("trigger_once")
checkpointTrigger1:SetupTrigger(Vector(4236.846191, 3261.946289, -474.814972), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180))

checkpointTrigger1.OnTrigger = function(_, activator)
GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator)
end
Expand All @@ -38,21 +45,24 @@ function MAPSCRIPT:PostInit()
checkpoint2:SetVisiblePos(Vector(6758.199219, 1572.104248, -447.968750))
local checkpointTrigger2 = ents.Create("trigger_once")
checkpointTrigger2:SetupTrigger(Vector(6770.862793, 1569.191040, -447.968750), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180))

checkpointTrigger2.OnTrigger = function(_, activator)
GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator)
end

ents.WaitForEntityByName("rotate_guncave_exit_wheel", function(ent)
ent:Fire("Unlock")
ent:Fire("AddOutput", "OnPressed relay_airboat_gateopen,Trigger")
ent:Fire("AddOutput", "OnPressed ss_arlene_opengate,Kill") -- In case the player opens it dont play the scene.
end)
end
end
ents.WaitForEntityByName(
"rotate_guncave_exit_wheel",
function(ent)
ent:Fire("Unlock")
ent:Fire("AddOutput", "OnPressed relay_airboat_gateopen,Trigger")
ent:Fire("AddOutput", "OnPressed ss_arlene_opengate,Kill") -- In case the player opens it dont play the scene.
end
)

function MAPSCRIPT:PostPlayerSpawn(ply)
--DbgPrint("PostPlayerSpawn")
-- Disable motion of some entities, they are odd to walk on in multiplayer.
FreezeEntitiesAt(Vector(4172.168457, 5346.647461, -124.435822), Vector(10, 10, 10))
FreezeEntitiesAt(Vector(4397.086914, 5241.035645, -121.793793), Vector(10, 10, 10))
FreezeEntitiesAt(Vector(4246.002441, 4931.557129, -121.530907), Vector(10, 10, 10))
end
end

return MAPSCRIPT

0 comments on commit 3ddab34

Please sign in to comment.