From 5ddfd3fa7b0ecf466d96861e478c83cd226ee246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 15:20:30 +0300 Subject: [PATCH 01/27] Add VisiblePos to checkpoint data, format file --- gamemode/sv_checkpoints.lua | 88 ++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 51 deletions(-) diff --git a/gamemode/sv_checkpoints.lua b/gamemode/sv_checkpoints.lua index f345b035..c0987cb7 100644 --- a/gamemode/sv_checkpoints.lua +++ b/gamemode/sv_checkpoints.lua @@ -20,7 +20,6 @@ local VEHICLE_HULL_Z = 100 local CHECKPOINT_VEHICLE_MINS = Vector(-(VEHICLE_HULL_X / 2), -(VEHICLE_HULL_Y / 2), 0) local CHECKPOINT_VEHICLE_MAXS = Vector(VEHICLE_HULL_X / 2, VEHICLE_HULL_Y / 2, VEHICLE_HULL_Z) local MAP_MAX = 16000 - function GM:GetGridData(x, y, z) local posX = math.floor(x / GRID_SIZE) * GRID_SIZE local posY = math.floor(y / GRID_SIZE) * GRID_SIZE @@ -33,7 +32,6 @@ function GM:GetGridData(x, y, z) local gridZ = math.floor(z / GRID_SIZE_Z) self.GridData = self.GridData or {} local mapZ = self.GridData[gridZ] - if mapZ == nil then mapZ = {} self.GridData[gridZ] = mapZ @@ -42,7 +40,6 @@ function GM:GetGridData(x, y, z) local key = bit.bor(bit.lshift(gridX, 16), gridY) --print(gridX, gridY, gridZ, key) local data = mapZ[key] - if data == nil then data = {} data.gridX = gridX @@ -107,7 +104,6 @@ local function CreateCheckpointWithTrigger(data) end local triggerData = data.Trigger - if triggerData == nil then error("Missing Trigger data") end @@ -125,9 +121,12 @@ local function CreateCheckpointWithTrigger(data) end local checkpoint = GAMEMODE:CreateCheckpoint(data.Pos, data.Ang) + if data.VisiblePos ~= nil then + checkpoint:SetVisiblePos(data.VisiblePos) + end + local checkpointTrigger = ents.Create("trigger_once") checkpointTrigger:SetupTrigger(triggerData.Pos, triggerData.Ang or Angle(0, 0, 0), triggerData.Mins, triggerData.Maxs) - checkpointTrigger.OnTrigger = function(_, activator) GAMEMODE:SetPlayerCheckpoint(checkpoint, activator) end @@ -142,13 +141,14 @@ end function GM:SetPlayerCheckpoint(checkpoint, activator, gridData) local gameType = self:GetGameType() if gameType.UsingCheckpoints == false then return end - if istable(checkpoint) then checkpoint = self:CreatePlayerCheckpoint(checkpoint) elseif isvector(checkpoint) then - checkpoint = self:CreatePlayerCheckpoint({ - Pos = checkpoint - }) + checkpoint = self:CreatePlayerCheckpoint( + { + Pos = checkpoint + } + ) end DbgPrint("Assigned new checkpoint to: " .. tostring(checkpoint)) @@ -157,11 +157,9 @@ function GM:SetPlayerCheckpoint(checkpoint, activator, gridData) self.CurrentCheckpointPos = cpPos gridData = gridData or self:GetGridData(cpPos.x, cpPos.y, cpPos.z) gridData.checkpoint = true - if IsValid(checkpoint) and checkpoint:GetClass() == "lambda_checkpoint" then checkpoint:SetActivated() self:ResetPlayerRespawnQueue() - if IsValid(activator) and activator:IsPlayer() then self:AddHint("Checkpoint activated", 10, activator) end @@ -174,7 +172,6 @@ end function GM:UpdateQueuedVehicleCheckpoints() self.VehicleCheckpointQueue = self.VehicleCheckpointQueue or {} - while #self.VehicleCheckpointQueue > 0 do self.VehicleCheckpoint = self.VehicleCheckpointQueue[1] DbgPrint("Assigned vehicle checkpoint (Queued)") @@ -193,14 +190,16 @@ local ENEMY_CLASS_WHITELIST = { } local function checkDirectionalSpot(pos, offset, filter) - local tr = util.TraceHull({ - start = pos, - endpos = pos + offset, - filter = filter, - mins = CHECKPOINT_PLAYER_MINS, - maxs = CHECKPOINT_PLAYER_MAXS, - mask = MASK_SOLID - }) + local tr = util.TraceHull( + { + start = pos, + endpos = pos + offset, + filter = filter, + mins = CHECKPOINT_PLAYER_MINS, + maxs = CHECKPOINT_PLAYER_MAXS, + mask = MASK_SOLID + } + ) --debugoverlay.Box(pos + offset, CHECKPOINT_PLAYER_MINS, CHECKPOINT_PLAYER_MAXS, 5, Color( 255, 255, 255, 50 )) return tr.Fraction == 1 @@ -216,7 +215,6 @@ function GM:UpdateCheckoints() local plys = {} local centerPos = Vector(0, 0, 0) local bestPos - for _, v in pairs(util.GetAllPlayers()) do local ply = v if ply:Alive() == false then continue end @@ -225,7 +223,6 @@ function GM:UpdateCheckoints() local filter local checkpointMins local checkpointMaxs - if not IsValid(vehicle) then if v:OnGround() == false then continue end local groundEnt = ply:GetGroundEntity() @@ -244,7 +241,6 @@ function GM:UpdateCheckoints() local contents = util.PointContents(pos - Vector(0, 0, 0)) local isSlime = bit.band(contents, CONTENTS_SLIME) ~= 0 local isWater = bit.band(contents, CONTENTS_WATER) ~= 0 - if isSlime == true then DbgPrint("On slime, can't use checkpoint.") continue @@ -257,28 +253,30 @@ function GM:UpdateCheckoints() centerPos = centerPos + pos local trPos = pos -- We add the max step height - - local tr = util.TraceHull({ - start = trPos + Vector(0, 0, 1), - endpos = trPos, - filter = filter, - mins = checkpointMins, - maxs = checkpointMaxs, - mask = MASK_SOLID - }) + local tr = util.TraceHull( + { + start = trPos + Vector(0, 0, 1), + endpos = trPos, + filter = filter, + mins = checkpointMins, + maxs = checkpointMaxs, + mask = MASK_SOLID + } + ) --debugoverlay.Box(tr.HitPos, checkpointMins, checkpointMaxs, 5, Color( 255, 0, 0, 100 )) if tr.Fraction == 1 and tr.HitSky == false and tr.HitWorld == false then - tr = util.TraceLine({ - start = pos, - endpos = pos - Vector(0, 0, 128), - filter = filter, - mask = MASK_SOLID - }) + tr = util.TraceLine( + { + start = pos, + endpos = pos - Vector(0, 0, 128), + filter = filter, + mask = MASK_SOLID + } + ) --debugoverlay.Box(tr.HitPos, Vector(-1, -1, -1), Vector(1, 1, 1), 5, Color( 255, 255, 255, 100 )) local dist = pos:Distance(tr.HitPos) - if tr.HitWorld == true and dist <= 45 then table.insert(plys, v) end @@ -295,11 +293,9 @@ function GM:UpdateCheckoints() -- See which player is closest to the center. local nearestCenter = 999999 local selectedPlayer = nil - for _, v in pairs(plys) do local pos = v:GetPos() local dist = pos:Distance(centerPos) - if dist < nearestCenter then bestPos = pos nearestCenter = dist @@ -308,7 +304,6 @@ function GM:UpdateCheckoints() end local data = self:GetGridData(bestPos.x, bestPos.y, bestPos.z) - if data.checkpoint == true then DbgPrint("Map section already has checkpoint.") @@ -318,7 +313,6 @@ function GM:UpdateCheckoints() -- Only update if players have enough distance to the previous checkpoint. if IsValid(self.CurrentCheckpoint) then local dist = self.CurrentCheckpoint:GetPos():Distance(bestPos) - if dist < MIN_CHECKPOINT_DISTANCE then DbgPrint("Checkpoint distance condition not met", dist) @@ -329,13 +323,11 @@ function GM:UpdateCheckoints() -- Make sure we don't have a spawnpoint in enemy terrority. local entsInGrid = ents.FindInSphere(bestPos, MIN_ENEMY_DISTANCE) local enemyNearby = false - for _, v in pairs(entsInGrid) do local entPos = v:GetPos() if entPos:Distance(bestPos) >= MIN_ENEMY_DISTANCE then continue end local entClass = v:GetClass() local npcClass = nil - if v:IsNPC() == true then npcClass = entClass end @@ -361,7 +353,6 @@ function GM:UpdateCheckoints() local vehicle = selectedPlayer:GetVehicle() local ang = Angle(0, 0, 0) local vehiclePos = nil - if IsValid(vehicle) and vehicle.AllowVehicleCheckpoint == true then -- Check if we can place it right local plyRight = vehicle:GetRight() @@ -370,7 +361,6 @@ function GM:UpdateCheckoints() local vehicleAng = vehicle:GetAngles() local len = 80 vehiclePos = vehicle:GetPos() + Vector(0, 0, 10) - -- NOTE: Order was handpicked, do not change it, having players infront should be the last resort. if checkDirectionalSpot(vehiclePos, plyRight * -len, filter) == true then bestPos = vehiclePos + plyRight * -len @@ -390,7 +380,6 @@ function GM:UpdateCheckoints() end ang = selectedPlayer:GetAngles() - if vehiclePos ~= nil then ang = (vehiclePos - bestPos):Angle() end @@ -403,15 +392,12 @@ end function GM:SetVehicleCheckpoint(pos, ang) local delaySwitch = false - if self.LastSelectedSpawnPoint ~= nil and IsValid(self.LastSelectedSpawnPoint) then local checkpointPos = self.LastSelectedSpawnPoint:GetPos() - for _, v in pairs(util.GetAllPlayers()) do if v:Alive() == false or v:InVehicle() == true then continue end local plyPos = v:GetPos() local dist = plyPos:Distance(checkpointPos) - if dist < 500 then delaySwitch = true break From bc4ffca0fa1aed9c5765350000895c5232142e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 15:20:39 +0300 Subject: [PATCH 02/27] Refactor d1_canals_01 checkpoints --- .../gametypes/hl2/mapscripts/d1_canals_01.lua | 118 ++++++++++-------- 1 file changed, 66 insertions(+), 52 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d1_canals_01.lua b/gamemode/gametypes/hl2/mapscripts/d1_canals_01.lua index 85b02d6c..05124c83 100644 --- a/gamemode/gametypes/hl2/mapscripts/d1_canals_01.lua +++ b/gamemode/gametypes/hl2/mapscripts/d1_canals_01.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar"}, Ammo = {}, @@ -18,7 +17,6 @@ MAPSCRIPT.InputFilters = { } MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["start_item_template"] = true } @@ -28,6 +26,50 @@ MAPSCRIPT.ImportantPlayerNPCNames = { ["boxcar_vort"] = true } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(650.433105, -6424.663086, 540.031250), + Ang = Angle(0, 0, 0), + VisiblePos = Vector(619.656433, -6512.142578, 540.031250), + Trigger = { + Pos = Vector(614.625732, -6519.078613, 540.031250), + Mins = Vector(-100, -100, 0), + Maxs = Vector(100, 100, 180) + } + }, + { + Pos = Vector(877.780457, 2621.807617, -55.060749), + Ang = Angle(0, 180, 0), + VisiblePos = Vector(853.600281, 2638.468018, 73.964828), + Trigger = { + Pos = Vector(855.660400, 2638.366943, 30), + Mins = Vector(-100, -100, 0), + Maxs = Vector(100, 100, 180) + } + }, + -- Boxcar checkpoint + { + Pos = Vector(447.302185, -2656.709961, 576.031250), + Ang = Angle(0, 180, 0), + VisiblePos = Vector(853.600281, 2638.468018, 73.964828), + Trigger = { + Pos = Vector(447.302185, -2656.709961, 576.031250), + Mins = Vector(-50, -50, 0), + Maxs = Vector(50, 50, 180) + } + }, + { + Pos = Vector(473.498352, -3530.257324, 256.031250), + Ang = Angle(0, 90, 0), + VisiblePos = Vector(853.600281, 2638.468018, 73.964828), + Trigger = { + Pos = Vector(544.810791, -3423.548584, 322.719330), + Mins = Vector(-70, -70, -50), + Maxs = Vector(70, 70, 100) + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then local jumpBox = ents.Create("prop_physics") @@ -37,63 +79,35 @@ function MAPSCRIPT:PostInit() jumpBox:Spawn() jumpBox:SetHealth(1000) local phys = jumpBox:GetPhysicsObject() - if IsValid(phys) then phys:SetMass(200) end - GAMEMODE:WaitForInput("boxcar_human", "StopScripting", function() - -- No longer mission relevant. - ents.WaitForEntityByName("boxcar_human", function(ent) - GAMEMODE:UnregisterMissionCriticalNPC(ent) - end) - - ents.WaitForEntityByName("boxcar_vort", function(ent) - GAMEMODE:UnregisterMissionCriticalNPC(ent) - end) - end) - - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(650.433105, -6424.663086, 540.031250)) - checkpoint1:SetVisiblePos(Vector(619.656433, -6512.142578, 540.031250)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(614.625732, -6519.078613, 540.031250), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - -- Boxcar checkpoint - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(877.780457, 2621.807617, -55.060749), Angle(0, 180, 0)) - checkpoint2:SetVisiblePos(Vector(853.600281, 2638.468018, 73.964828)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(855.660400, 2638.366943, 30), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180)) - - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) - end - - -- 447.302185 -2656.709961 576.031250 - local checkpoint3 = GAMEMODE:CreateCheckpoint(Vector(447.302185, -2656.709961, 576.031250), Angle(0, 180, 0)) - local checkpointTrigger3 = ents.Create("trigger_once") - checkpointTrigger3:SetupTrigger(Vector(447.302185, -2656.709961, 576.031250), Angle(0, 0, 0), Vector(-50, -50, 0), Vector(50, 50, 180)) - - checkpointTrigger3.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint3, activator) - end - - -- 544.810791 -3423.548584 322.719330 - local checkpoint4 = GAMEMODE:CreateCheckpoint(Vector(473.498352, -3530.257324, 256.031250), Angle(0, 90, 0)) - local checkpointTrigger4 = ents.Create("trigger_once") - checkpointTrigger4:SetupTrigger(Vector(544.810791, -3423.548584, 322.719330), Angle(0, 0, 0), Vector(-70, -70, -50), Vector(70, 70, 100)) - - checkpointTrigger4.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint4, activator) - end + GAMEMODE:WaitForInput( + "boxcar_human", + "StopScripting", + function() + -- No longer mission relevant. + ents.WaitForEntityByName( + "boxcar_human", + function(ent) + GAMEMODE:UnregisterMissionCriticalNPC(ent) + end + ) + + ents.WaitForEntityByName( + "boxcar_vort", + function(ent) + GAMEMODE:UnregisterMissionCriticalNPC(ent) + end + ) + end + ) end end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end -return MAPSCRIPT \ No newline at end of file +return MAPSCRIPT +--DbgPrint("PostPlayerSpawn") \ No newline at end of file From a5fcbbfd0971478e6d1c5a4ed33a597c502db92c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 15:28:39 +0300 Subject: [PATCH 03/27] Refactor d1_canals_01a checkpoints --- .../hl2/mapscripts/d1_canals_01a.lua | 139 ++++++++++-------- 1 file changed, 75 insertions(+), 64 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d1_canals_01a.lua b/gamemode/gametypes/hl2/mapscripts/d1_canals_01a.lua index d791a226..c3ea791e 100644 --- a/gamemode/gametypes/hl2/mapscripts/d1_canals_01a.lua +++ b/gamemode/gametypes/hl2/mapscripts/d1_canals_01a.lua @@ -5,7 +5,6 @@ end local DbgPrint = GetLogging("MapScript") local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol"}, Ammo = { @@ -17,37 +16,42 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["spawnitems_template"] = true } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(-1183.380615, 6344.419922, -59.326172), + Ang = Angle(0, -180, 0), + Trigger = { + Pos = Vector(-1183.380615, 6344.419922, 6.326172), + Mins = Vector(-100, -100, 0), + Maxs = Vector(100, 100, 180) + } + }, + { + Pos = Vector(-3002.406494, 7870.711426, 12.031250), + Ang = Angle(0, 90, 0), + Trigger = { + Pos = Vector(-3002.406494, 7870.711426, 48.031250), + Mins = Vector(-100, -100, 0), + Maxs = Vector(100, 100, 180) + } + }, + { + Pos = Vector(2104.908447, 5759.881348, -95.968750), + Ang = Angle(0, 45, 0), + Trigger = { + Pos = Vector(2104.908447, 5759.881348, -95.968750), + Mins = Vector(-100, -100, 0), + Maxs = Vector(100, 100, 180) + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-1183.380615, 6344.419922, -59.326172), Angle(0, -180, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(-1183.380615, 6344.419922, 6.326172), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(-3002.406494, 7870.711426, 12.031250), Angle(0, 90, 0)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(-3002.406494, 7870.711426, 48.031250), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180)) - - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) - end - - local checkpoint3 = GAMEMODE:CreateCheckpoint(Vector(2104.908447, 5759.881348, -95.968750), Angle(0, 45, 0)) - local checkpointTrigger3 = ents.Create("trigger_once") - checkpointTrigger3:SetupTrigger(Vector(2104.908447, 5759.881348, -95.968750), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180)) - - checkpointTrigger3.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint3, activator) - end - local npcMaker1 = ents.Create("npc_maker") npcMaker1:SetPos(Vector(-2174.593262, 9086.971680, 288.031250)) npcMaker1:SetAngles(Angle(0, 180, 0)) @@ -71,45 +75,52 @@ function MAPSCRIPT:PostInit() npcMaker2:SetKeyValue("Radius", "200") npcMaker2:SetName("lambda_npc_maker2") npcMaker2:Spawn() - -- gallery_destgroup_1 - ents.WaitForEntityByName("gallery_destgroup_1", function(ent) - ent:SetPos(Vector(-47.880901, 6160.045898, -58.842937)) - end, true) + ents.WaitForEntityByName( + "gallery_destgroup_1", + function(ent) + ent:SetPos(Vector(-47.880901, 6160.045898, -58.842937)) + end, true + ) -- room3_cop -- Lets not wait for the explosion, thats boring. - ents.WaitForEntityByName("room3_cop", function(ent) - ent:Fire("AddOutput", "OnDeath gallerycop_maker2,Enable") - ent:Fire("AddOutput", "OnDeath gallerycop_maker3,Enable") - end) - - ents.WaitForEntityByName("massacre_initiate_trigger", function(ent) - ent:Fire("AddOutput", "OnTrigger gallery_start_relay,Trigger,,0.0") - ent:Fire("AddOutput", "OnTrigger gallerycop_maker1,Enable,,0.0") - ent:Fire("AddOutput", "OnTrigger lambda_npc_maker2,Enable,,0.0") - end) + ents.WaitForEntityByName( + "room3_cop", + function(ent) + ent:Fire("AddOutput", "OnDeath gallerycop_maker2,Enable") + ent:Fire("AddOutput", "OnDeath gallerycop_maker3,Enable") + end + ) + + ents.WaitForEntityByName( + "massacre_initiate_trigger", + function(ent) + ent:Fire("AddOutput", "OnTrigger gallery_start_relay,Trigger,,0.0") + ent:Fire("AddOutput", "OnTrigger gallerycop_maker1,Enable,,0.0") + ent:Fire("AddOutput", "OnTrigger lambda_npc_maker2,Enable,,0.0") + end + ) -- -2849.247314 8805.366211 47.039879 local trigger2 = ents.Create("trigger_once") trigger2:SetupTrigger(Vector(-2849.247314, 8805.366211, 47.039879), Angle(0, 0, 0), Vector(-150, -150, 0), Vector(150, 150, 180)) - trigger2.OnTrigger = function() npcMaker1:Fire("Enable") npcMaker2:Fire("Enable") end local BridgePositions = {Vector(-2809.293701, 6795.291992, 144.031250), Vector(-2875.369141, 6793.270996, 144.031250), Vector(-2960.664307, 6790.913574, 144.031250), Vector(-3056.151855, 6790.148438, 144.031250), Vector(-3138.704102, 6790.096191, 144.031250)} - local function SendNPCToBridge(npc) local bridgePos = table.Random(BridgePositions) - - util.RunDelayed(function() - if not IsValid(npc) then return end - npc:SetLastPosition(bridgePos) - npc:SetSchedule(SCHED_FORCED_GO_RUN) - DbgPrint("Sending NPC to Bridge") - end, CurTime() + 1) + util.RunDelayed( + function() + if not IsValid(npc) then return end + npc:SetLastPosition(bridgePos) + npc:SetSchedule(SCHED_FORCED_GO_RUN) + DbgPrint("Sending NPC to Bridge") + end, CurTime() + 1 + ) end -- -2956.739746 6570.918945 -95.968781 @@ -126,7 +137,6 @@ function MAPSCRIPT:PostInit() --npcMaker4:SetKeyValue("Radius", "300") npcMaker3:SetName("lambda_npc_maker3") npcMaker3:Spawn() - npcMaker3.OnSpawnNPC = function(s, ent) SendNPCToBridge(ent) end @@ -145,7 +155,6 @@ function MAPSCRIPT:PostInit() --npcMaker5:SetKeyValue("Radius", "300") npcMaker4:SetName("lambda_npc_maker4") npcMaker4:Spawn() - npcMaker4.OnSpawnNPC = function(s, ent) SendNPCToBridge(ent) end @@ -156,11 +165,9 @@ function MAPSCRIPT:PostInit() bridgeKillTrigger:SetKeyValue("targetname", "lambda_bridge_killbox") bridgeKillTrigger:SetKeyValue("StartDisabled", "1") bridgeKillTrigger:SetKeyValue("spawnflags", SF_TRIGGER_ALLOW_NPCS) - bridgeKillTrigger.OnTrigger = function(ent) DbgPrint("Killing all bridge NPCs") local t = ent:GetTouchingObjects() - for _, v in pairs(t) do DbgPrint("Killing: " .. tostring(v)) local world = game.GetWorld() @@ -178,7 +185,6 @@ function MAPSCRIPT:PostInit() prop:AddEffects(EF_NODRAW) prop:Spawn() local phys = prop:GetPhysicsObject() - if IsValid(phys) then phys:EnableMotion(false) end @@ -187,25 +193,30 @@ function MAPSCRIPT:PostInit() -- -2620.882813 5306.772949 -45.723671 local trigger3 = ents.Create("trigger_once") trigger3:SetupTrigger(Vector(-2620.882813, 5306.772949, -45.723671), Angle(0, 0, 0), Vector(-150, -150, 0), Vector(150, 150, 180)) - trigger3.OnTrigger = function() npcMaker3:Fire("Enable") npcMaker4:Fire("Enable") end - ents.WaitForEntityByName("mud_bridge_collapse_relay", function(ent) - ent:Fire("AddOutput", "OnTrigger lambda_bridge_killbox,Enable,,0") - end) + ents.WaitForEntityByName( + "mud_bridge_collapse_relay", + function(ent) + ent:Fire("AddOutput", "OnTrigger lambda_bridge_killbox,Enable,,0") + end + ) - ents.WaitForEntityByName("mud_bridge_barrels", function(ent) - ent:Fire("AddOutput", "OnBreak lambda_npc_maker3,Kill,,0") - ent:Fire("AddOutput", "OnBreak lambda_npc_maker4,Kill,,0") - end) + ents.WaitForEntityByName( + "mud_bridge_barrels", + function(ent) + ent:Fire("AddOutput", "OnBreak lambda_npc_maker3,Kill,,0") + ent:Fire("AddOutput", "OnBreak lambda_npc_maker4,Kill,,0") + end + ) end end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end -return MAPSCRIPT \ No newline at end of file +return MAPSCRIPT +--DbgPrint("PostPlayerSpawn") \ No newline at end of file From f587a4689cd8d4bd97d4cc2878c8e3ed592de4b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 15:30:46 +0300 Subject: [PATCH 04/27] Refactor d1_canals_02 checkpoints --- .../gametypes/hl2/mapscripts/d1_canals_02.lua | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d1_canals_02.lua b/gamemode/gametypes/hl2/mapscripts/d1_canals_02.lua index 1d66b908..32e060ac 100644 --- a/gamemode/gametypes/hl2/mapscripts/d1_canals_02.lua +++ b/gamemode/gametypes/hl2/mapscripts/d1_canals_02.lua @@ -5,7 +5,6 @@ end local DbgPrint = GetLogging("MapScript") local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol"}, Ammo = { @@ -17,13 +16,24 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["global_newgame_spawner_suit"] = true, ["global_newgame_spawner_crowbar"] = true, ["global_newgame_spawner_pistol"] = true } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(-114.632774, -1179.170288, -847.968750), + Ang = Angle(0, 90, 0), + Trigger = { + Pos = Vector(-114.632774, -1179.170288, -847.968750), + Mins = Vector(-100, -100, 0), + Maxs = Vector(100, 100, 180) + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then -- The map has two spawns both with the priority flag, so we gonna wipe them. @@ -33,26 +43,21 @@ function MAPSCRIPT:PostInit() end -- And create a default one. - local spawn = ents.CreateSimple("info_player_start", { - Pos = Vector(2896, -2272, -604), - Ang = Angle(0, 90, 0) - }) + local spawn = ents.CreateSimple( + "info_player_start", + { + Pos = Vector(2896, -2272, -604), + Ang = Angle(0, 90, 0) + } + ) spawn.MasterSpawn = true ents.RemoveByClass("prop_physics", Vector(367, 70, -846.01397705078)) -- wooden plate shortcut - -- -114.632774 -1179.170288 -847.968750 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-114.632774, -1179.170288, -847.968750), Angle(0, 90, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(-114.632774, -1179.170288, -847.968750), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end end end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end -return MAPSCRIPT \ No newline at end of file +return MAPSCRIPT +--DbgPrint("PostPlayerSpawn") \ No newline at end of file From 68d0d20f9f1bebdcc69d97cc4f24799301623af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 15:46:47 +0300 Subject: [PATCH 05/27] Refactor d1_canals_03 checkpoints --- .../gametypes/hl2/mapscripts/d1_canals_03.lua | 175 ++++++++++-------- 1 file changed, 98 insertions(+), 77 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d1_canals_03.lua b/gamemode/gametypes/hl2/mapscripts/d1_canals_03.lua index cffb94e9..c144373c 100644 --- a/gamemode/gametypes/hl2/mapscripts/d1_canals_03.lua +++ b/gamemode/gametypes/hl2/mapscripts/d1_canals_03.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol"}, Ammo = { @@ -16,7 +15,6 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.ImportantPlayerNPCNames = { ["matt"] = true } @@ -25,97 +23,120 @@ MAPSCRIPT.EntityFilterByName = { ["global_newgame_template"] = true } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(-722.162354, 1341.204834, -831.968750), + Ang = Angle(0, 135, 0), + Trigger = { + Pos = Vector(-722.162354, 1341.204834, -831.968750), + Mins = Vector(-100, -100, 0), + Maxs = Vector(100, 100, 180), + } + }, + { + Pos = Vector(-1368.427856, -69.149689, -1023.968750), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(-1058.438110, -66.407013, -959.968750), + Mins = Vector(-100, -100, 0), + Maxs = Vector(100, 100, 180), + } + }, + { + Pos = Vector(-1833.402344, -775.765564, -895.968750), + Ang = Angle(0, -110, 0), + Trigger = { + Pos = Vector(-1808.799927, -958.450073, -895.968750), + Mins = Vector(-100, -100, 0), + Maxs = Vector(100, 100, 180), + } + }, + { + Pos = Vector(-347.239502, -525.000366, -1017.968750), + Ang = Angle(0, -180, 0), + Trigger = { + Pos = Vector(-446.415466, -526.288147, -1017.968750), + Mins = Vector(-60, -60, 0), + Maxs = Vector(60, 60, 60), + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-722.162354, 1341.204834, -831.968750), Angle(0, 135, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(-722.162354, 1341.204834, -831.968750), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(-1368.427856, -69.149689, -1023.968750), Angle(0, 0, 0)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(-1058.438110, -66.407013, -959.968750), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180)) - - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) - end - -- Let him stay alive if no one kills him. ents.RemoveByClass("trigger_once", Vector(378, 2620, -770)) local matt - - ents.WaitForEntityByName("matt", function(ent) - matt = ent - -- The NPC doesn't start with 100 health. - matt:SetHealth(100) - end) - - GAMEMODE:WaitForInput("door_manhack_break_1p", "EnableMotion", function(ent) - if IsValid(matt) then - -- No longer relevant when this input fires. - GAMEMODE:UnregisterMissionCriticalNPC(matt) + ents.WaitForEntityByName( + "matt", + function(ent) + matt = ent + -- The NPC doesn't start with 100 health. + matt:SetHealth(100) + end + ) + + GAMEMODE:WaitForInput( + "door_manhack_break_1p", + "EnableMotion", + function(ent) + if IsValid(matt) then + -- No longer relevant when this input fires. + GAMEMODE:UnregisterMissionCriticalNPC(matt) + end end - end) + ) -- Rename it, we fire it via a different output - ents.WaitForEntityByName("math_manhack_death_coutner", function(ent) - ent:SetName("stub_math_manhack_death_coutner") - end) - - ents.WaitForEntityByName("underground_script_matt_spawn_mh1", function(ent) - ent:Fire("AddOutput", "OnAllSpawnedDead logic_matt_survival,Trigger") - end) - - local checkpoint3 = GAMEMODE:CreateCheckpoint(Vector(-1833.402344, -775.765564, -895.968750), Angle(0, -110, 0)) - local checkpointTrigger3 = ents.Create("trigger_once") - checkpointTrigger3:SetupTrigger(Vector(-1808.799927, -958.450073, -895.968750), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180)) - - checkpointTrigger3.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint3, activator) - end - - -- -446.415466 -526.288147 -1017.968750 - local checkpoint4 = GAMEMODE:CreateCheckpoint(Vector(-347.239502, -525.000366, -1017.968750), Angle(0, -180, 0)) - local checkpointTrigger4 = ents.Create("trigger_once") - checkpointTrigger4:SetupTrigger(Vector(-446.415466, -526.288147, -1017.968750), Angle(0, 0, 0), Vector(-60, -60, 0), Vector(60, 60, 60)) - - checkpointTrigger4.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint4, activator) - end + ents.WaitForEntityByName( + "math_manhack_death_coutner", + function(ent) + ent:SetName("stub_math_manhack_death_coutner") + end + ) - local a = ents.CreateSimple("prop_physics_override", { - Pos = Vector(-2153.951416, -852.403381, -1028.920410), - Ang = Angle(0.107, -1.445, 8.021), - Model = "models/props_wasteland/dockplank01a.mdl", - SpawnFlags = bit.bor(2, 8), - KeyValues = { - ["health"] = 0 - }, - UnFreezable = true - }) + ents.WaitForEntityByName( + "underground_script_matt_spawn_mh1", + function(ent) + ent:Fire("AddOutput", "OnAllSpawnedDead logic_matt_survival,Trigger") + end + ) + + local a = ents.CreateSimple( + "prop_physics_override", + { + Pos = Vector(-2153.951416, -852.403381, -1028.920410), + Ang = Angle(0.107, -1.445, 8.021), + Model = "models/props_wasteland/dockplank01a.mdl", + SpawnFlags = bit.bor(2, 8), + KeyValues = { + ["health"] = 0 + }, + UnFreezable = true + } + ) a:Activate() - - local b = ents.CreateSimple("prop_physics_override", { - Pos = Vector(-2133.457275, -851.055847, -1028.304565), - Ang = Angle(-0.798, 175.696, -7.717), - Model = "models/props_wasteland/dockplank01b.mdl", - SpawnFlags = bit.bor(2, 8), - KeyValues = { - ["health"] = 0 - }, - UnFreezable = true - }) + local b = ents.CreateSimple( + "prop_physics_override", + { + Pos = Vector(-2133.457275, -851.055847, -1028.304565), + Ang = Angle(-0.798, 175.696, -7.717), + Model = "models/props_wasteland/dockplank01b.mdl", + SpawnFlags = bit.bor(2, 8), + KeyValues = { + ["health"] = 0 + }, + UnFreezable = true + } + ) b:Activate() end end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end -return MAPSCRIPT \ No newline at end of file +return MAPSCRIPT +--DbgPrint("PostPlayerSpawn") \ No newline at end of file From 8461a1e4f5ebfabf6d62ae1e2633536ec3fa858c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 15:49:28 +0300 Subject: [PATCH 06/27] Refactor d1_canals_05 checkpoints --- .../gametypes/hl2/mapscripts/d1_canals_05.lua | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d1_canals_05.lua b/gamemode/gametypes/hl2/mapscripts/d1_canals_05.lua index 2fc63b09..c33674c1 100644 --- a/gamemode/gametypes/hl2/mapscripts/d1_canals_05.lua +++ b/gamemode/gametypes/hl2/mapscripts/d1_canals_05.lua @@ -23,26 +23,31 @@ MAPSCRIPT.EntityFilterByName = { ["relay_rockfall_start"] = true -- Don't do that, its trivial. } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(4149.820313, 3446.334229, -466.530853), + Ang = Angle(0, -66, 0), + VisiblePos = Vector(4240.543945, 3220.031982, -473.430939), + Trigger = { + Pos = Vector(4236.846191, 3261.946289, -474.814972), + Mins = Vector(-100, -100, 0), + Maxs = Vector(100, 100, 180), + } + }, + { + Pos = Vector(7352.527344, 1597.768555, -447.968750), + Ang = Angle(0, -90, 0), + VisiblePos = Vector(6758.199219, 1572.104248, -447.968750), + Trigger = { + Pos = Vector(6770.862793, 1569.191040, -447.968750), + Mins = Vector(-100, -100, 0), + Maxs = Vector(100, 100, 180), + } + }, +} + 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 - - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(7352.527344, 1597.768555, -447.968750), Angle(0, -90, 0)) - 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") From 7e917776abb1950215f7598a3413b8c31e0a06bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:03:58 +0300 Subject: [PATCH 07/27] Refactor d2_prison_01 checkpoints --- .../gametypes/hl2/mapscripts/d2_prison_01.lua | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d2_prison_01.lua b/gamemode/gametypes/hl2/mapscripts/d2_prison_01.lua index d80fe455..950b3d91 100644 --- a/gamemode/gametypes/hl2/mapscripts/d2_prison_01.lua +++ b/gamemode/gametypes/hl2/mapscripts/d2_prison_01.lua @@ -35,6 +35,27 @@ MAPSCRIPT.GlobalStates = { ["antlion_allied"] = GLOBAL_ON } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(1726.193115, -3289.614502, 1280.03125), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(1726.193115, -3289.614502, 1280.03125), + Mins = Vector(-100, -250, 0), + Maxs = Vector(100, 250, 200), + } + }, + { + Pos = Vector(1645.749756, -2053.893066, 1600.687744), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(1645.749756, -2053.893066, 1600.687744), + Mins = Vector(-100, -250, 0), + Maxs = Vector(100, 250, 200), + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then ents.WaitForEntityByName("tower_4_spawner", function(ent) @@ -53,24 +74,6 @@ function MAPSCRIPT:PostInit() ent:Fire("Enable") end) - --1726.193115 -3289.614502 1344.031250 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(1726.193115, -3289.614502, 1280.03125), Angle(0, 0, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(1726.193115, -3289.614502, 1280.03125), Angle(0, 0, 0), Vector(-100, -250, 0), Vector(100, 250, 200)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - --1645.749756 -2053.893066 1664.687744 - local checkpoint3 = GAMEMODE:CreateCheckpoint(Vector(1645.749756, -2053.893066, 1600.687744), Angle(0, 0, 0)) - local checkpointTrigger3 = ents.Create("trigger_once") - checkpointTrigger3:SetupTrigger(Vector(1645.749756, -2053.893066, 1600.687744), Angle(0, 0, 0), Vector(-100, -250, 0), Vector(100, 250, 200)) - - checkpointTrigger3.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint3, activator) - end - -- Rock falling at the end GAMEMODE:WaitForInput("relay_start_rockfall", "Trigger", function(ent) TriggerOutputs({{"ambient_rockfall_creak", "PlaySound", 0, ""}, {"door_2", "Unlock", 0, ""}}) From f98d70bce3f9734cf19e3ffb59fb5d6796864b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:05:04 +0300 Subject: [PATCH 08/27] Refactor d2_prison_02 checkpoints --- .../gametypes/hl2/mapscripts/d2_prison_02.lua | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d2_prison_02.lua b/gamemode/gametypes/hl2/mapscripts/d2_prison_02.lua index cadeca73..0141fb8b 100644 --- a/gamemode/gametypes/hl2/mapscripts/d2_prison_02.lua +++ b/gamemode/gametypes/hl2/mapscripts/d2_prison_02.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -24,7 +23,6 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["global_newgame_template_base_items"] = true, ["global_newgame_template_local_items"] = true, @@ -35,35 +33,39 @@ MAPSCRIPT.GlobalStates = { ["antlion_allied"] = GLOBAL_ON } -function MAPSCRIPT:PostInit() - ents.WaitForEntityByName("door_2", function(ent) - ent:Fire("Unlock") - end) - - if SERVER then - --setpos -1384.557129 2894.679688 448.031250;setang -1.010203 -63.622845 0.000000 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-1384.557129, 2894.679688, 384.031250), Angle(0, 45, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(-1384.557129, 2894.679688, 384.031250), Angle(0, 0, 0), Vector(-100, -130, 0), Vector(50, 100, 200)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - -- cp 2 setpos -1951.139526 2554.889893 576.031250;setang 6.475924 -93.248947 0.000000 - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(-1951.139526, 2554.889893, 576.031250), Angle(0, 45, 0)) - checkpoint2:SetVisiblePos(Vector(-1950.105469, 2715.927734, 512.031250)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(-1952.149292, 2550.710938, 512.023621), Angle(0, 0, 0), Vector(-100, -250, 0), Vector(100, 250, 200)) +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(-1384.557129, 2894.679688, 384.031250), + Ang = Angle(0, 45, 0), + Trigger = { + Pos = Vector(-1384.557129, 2894.679688, 384.031250), + Mins = Vector(-100, -130, 0), + Maxs = Vector(50, 100, 200), + } + }, + { + Pos = Vector(-1951.139526, 2554.889893, 576.031250), + Ang = Angle(0, 45, 0), + VisiblePos = Vector(-1950.105469, 2715.927734, 512.031250), + Trigger = { + Pos = Vector(-1952.149292, 2550.710938, 512.023621), + Mins = Vector(-100, -250, 0), + Maxs = Vector(100, 250, 200), + } + }, +} - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) +function MAPSCRIPT:PostInit() + ents.WaitForEntityByName( + "door_2", + function(ent) + ent:Fire("Unlock") end - end + ) end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end -return MAPSCRIPT \ No newline at end of file +return MAPSCRIPT +--DbgPrint("PostPlayerSpawn") \ No newline at end of file From b05831485934191d0994a97fb04bad53ffe7f949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:05:55 +0300 Subject: [PATCH 09/27] Refactor d2_prison_03 checkpoints --- .../gametypes/hl2/mapscripts/d2_prison_03.lua | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d2_prison_03.lua b/gamemode/gametypes/hl2/mapscripts/d2_prison_03.lua index e405050c..d6b3c264 100644 --- a/gamemode/gametypes/hl2/mapscripts/d2_prison_03.lua +++ b/gamemode/gametypes/hl2/mapscripts/d2_prison_03.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -24,7 +23,6 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["playerclip_shower_dropdown"] = true, ["global_newgame_template_base_items"] = true, @@ -36,27 +34,22 @@ MAPSCRIPT.GlobalStates = { ["antlion_allied"] = GLOBAL_ON } -function MAPSCRIPT:PostInit() - if SERVER then - -- Make sure the player spawns at the correct spot. - local spawn = ents.Create("info_player_start") - spawn:SetPos(Vector(-2378.219971, 3190.000000, 128.000000)) - spawn:SetAngles(Angle(0, 180, 0)) - spawn:SetKeyValue("spawnflags", "1") - spawn:Spawn() - -- -3566.677979 4935.034668 64.031250 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-3584.677979, 4911.034668, 0.031250), Angle(0, 45, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(-3584.677979, 4911.034668, 0.031250), Angle(0, 0, 0), Vector(-100, -150, 0), Vector(100, 150, 100)) +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(-3584.677979, 4911.034668, 0.031250), + Ang = Angle(0, 45, 0), + Trigger = { + Pos = Vector(-3584.677979, 4911.034668, 0.031250), + Mins = Vector(-100, -150, 0), + Maxs = Vector(100, 150, 100), + } + }, +} - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - end +function MAPSCRIPT:PostInit() end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From 76c890b80c96ca250de7a8483c00bf278b379c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:08:12 +0300 Subject: [PATCH 10/27] Refactor d2_prison_04 checkpoints --- .../gametypes/hl2/mapscripts/d2_prison_04.lua | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d2_prison_04.lua b/gamemode/gametypes/hl2/mapscripts/d2_prison_04.lua index a2807d75..6f5ba9e5 100644 --- a/gamemode/gametypes/hl2/mapscripts/d2_prison_04.lua +++ b/gamemode/gametypes/hl2/mapscripts/d2_prison_04.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -24,7 +23,6 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["global_newgame_template_base_items"] = true, ["global_newgame_template_local_items"] = true, @@ -35,21 +33,22 @@ MAPSCRIPT.GlobalStates = { ["antlion_allied"] = GLOBAL_ON } -function MAPSCRIPT:PostInit() - if SERVER then - -- -563.311829 1569.210205 448.031250 - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(-563.311829, 1569.210205, 384.163727), Angle(0, 45, 0)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(-563.311829, 1569.210205, 384.163727), Angle(0, 0, 0), Vector(-100, -250, 0), Vector(100, 250, 100)) +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(-563.311829, 1569.210205, 384.163727), + Ang = Angle(0, 45, 0), + Trigger = { + Pos = Vector(-563.311829, 1569.210205, 384.163727), + Mins = Vector(-100, -250, 0), + Maxs = Vector(100, 250, 100), + } + }, +} - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) - end - end +function MAPSCRIPT:PostInit() end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From 8c2d54f0ca93d43b418b4dae6d22d0205b10624b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:09:17 +0300 Subject: [PATCH 11/27] Refactor d2_prison_05 checkpoints --- .../gametypes/hl2/mapscripts/d2_prison_05.lua | 113 ++++++++++-------- 1 file changed, 64 insertions(+), 49 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d2_prison_05.lua b/gamemode/gametypes/hl2/mapscripts/d2_prison_05.lua index 3a0fc6c1..b69c3b7a 100644 --- a/gamemode/gametypes/hl2/mapscripts/d2_prison_05.lua +++ b/gamemode/gametypes/hl2/mapscripts/d2_prison_05.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -24,7 +23,6 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["global_newgame_template_local_items"] = true, ["global_newgame_template_ammo"] = true @@ -34,28 +32,73 @@ MAPSCRIPT.GlobalStates = { ["antlion_allied"] = GLOBAL_ON } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(-497.127838, 29.422707, 512.03009), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(-497.127838, 29.422707, 576.030090), + Mins = Vector(-100, -250, 0), + Maxs = Vector(100, 250, 200), + } + }, + { + Pos = Vector(-2766.497314, 166.390900, 662.811646), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(-2766.497314, 166.390900, 662.811646), + Mins = Vector(-100, -150, 0), + Maxs = Vector(100, 150, 100), + } + }, + { + Pos = Vector(-4656.063477, -734.348145, 640.03125), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(-2744.281250, 191.008423, 658.094666), + Mins = Vector(-100, -250, 0), + Maxs = Vector(100, 250, 100), + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then -- Rename some things. - ents.WaitForEntityByName("combine_crusherwall1_ss", function(ent) - ent:SetName("lambda_combine_crusherwall1_ss") - end) - - ents.WaitForEntityByName("combine_crusherwall2_ss", function(ent) - ent:SetName("lambda_combine_crusherwall2_ss") - end) - - ents.WaitForEntityByName("combine_crusherwall3_ss", function(ent) - ent:SetName("lambda_combine_crusherwall3_ss") - end) - - ents.WaitForEntityByName("combine_crusherwall4_ss", function(ent) - ent:SetName("lambda_combine_crusherwall4_ss") - end) - - ents.WaitForEntityByName("point_of_no_return", function(ent) - ent:SetName("lambda_point_of_no_return") - end) + ents.WaitForEntityByName( + "combine_crusherwall1_ss", + function(ent) + ent:SetName("lambda_combine_crusherwall1_ss") + end + ) + + ents.WaitForEntityByName( + "combine_crusherwall2_ss", + function(ent) + ent:SetName("lambda_combine_crusherwall2_ss") + end + ) + + ents.WaitForEntityByName( + "combine_crusherwall3_ss", + function(ent) + ent:SetName("lambda_combine_crusherwall3_ss") + end + ) + + ents.WaitForEntityByName( + "combine_crusherwall4_ss", + function(ent) + ent:SetName("lambda_combine_crusherwall4_ss") + end + ) + + ents.WaitForEntityByName( + "point_of_no_return", + function(ent) + ent:SetName("lambda_point_of_no_return") + end + ) -- 1386.760010 946.409973 385.000000 -- Make sure the player spawns at the correct spot. @@ -64,33 +107,6 @@ function MAPSCRIPT:PostInit() spawn:SetAngles(Angle(0, -180, 0)) spawn:SetKeyValue("spawnflags", "1") spawn:Spawn() - -- setpos -497.127838 29.422707 576.030090;setang 1.708000 -178.566528 0.000000 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-497.127838, 29.422707, 512.03009), Angle(0, 0, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(-497.127838, 29.422707, 576.030090), Angle(0, 0, 0), Vector(-100, -250, 0), Vector(100, 250, 200)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - -- setpos -2622.549316 191.525955 704.031250;setang 4.698761 -175.380798 0.000000 - local checkpoint3 = GAMEMODE:CreateCheckpoint(Vector(-2766.497314, 166.390900, 662.811646)) - local checkpointTrigger3 = ents.Create("trigger_once") - checkpointTrigger3:SetupTrigger(Vector(-2766.497314, 166.390900, 662.811646), Angle(0, 0, 0), Vector(-100, -150, 0), Vector(100, 150, 100)) - - checkpointTrigger3.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint3, activator) - end - - -- setpos -4656.063477 -734.348145 704.031250;setang 3.504144 -4.528329 0.000000 - local checkpoint4 = GAMEMODE:CreateCheckpoint(Vector(-4656.063477, -734.348145, 640.03125), Angle(0, 0, 0)) - local checkpointTrigger4 = ents.Create("trigger_once") - checkpointTrigger4:SetupTrigger(Vector(-2744.281250, 191.008423, 658.094666), Angle(0, 0, 0), Vector(-100, -250, 0), Vector(100, 250, 100)) - - checkpointTrigger4.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint4, activator) - end - -- Allow all players to be crushed in a safe non game breaking way. -- -4733.655273 -775.621887 498.795654 local crushTrigger = ents.Create("trigger_once") @@ -106,7 +122,6 @@ function MAPSCRIPT:PostInit() end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From 78860e7850596295f6b357470b9a642ee0152f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:11:55 +0300 Subject: [PATCH 12/27] Refactor d3_c17_01 checkpoints --- .../gametypes/hl2/mapscripts/d3_c17_01.lua | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d3_c17_01.lua b/gamemode/gametypes/hl2/mapscripts/d3_c17_01.lua index 1952b989..3856acee 100644 --- a/gamemode/gametypes/hl2/mapscripts/d3_c17_01.lua +++ b/gamemode/gametypes/hl2/mapscripts/d3_c17_01.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -30,7 +29,6 @@ MAPSCRIPT.InputFilters = { } MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["global_newgame_template_base_items"] = true, ["global_newgame_template_local_items"] = true, @@ -39,25 +37,30 @@ MAPSCRIPT.EntityFilterByName = { ["teleport_screenoverlay_Kleiner_1"] = true } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(-497.127838, 29.422707, 512.03009), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(-497.127838, 29.422707, 576.030090), + Mins = Vector(-100, -250, 0), + Maxs = Vector(100, 250, 200), + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then - -- setpos -497.127838 29.422707 576.030090;setang 1.708000 -178.566528 0.000000 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-497.127838, 29.422707, 512.03009), Angle(0, 0, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(-497.127838, 29.422707, 576.030090), Angle(0, 0, 0), Vector(-100, -250, 0), Vector(100, 250, 200)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - ents.WaitForEntityByName("kleiner", function(ent) - ent:SetHealth(100) - end) + ents.WaitForEntityByName( + "kleiner", + function(ent) + ent:SetHealth(100) + end + ) end end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From 6fe6870ee11ac518b9fe8db9997c176a6bfa7112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:14:17 +0300 Subject: [PATCH 13/27] Refactor d3_c17_03 checkpoints --- .../gametypes/hl2/mapscripts/d3_c17_03.lua | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d3_c17_03.lua b/gamemode/gametypes/hl2/mapscripts/d3_c17_03.lua index a5491420..b7ed5319 100644 --- a/gamemode/gametypes/hl2/mapscripts/d3_c17_03.lua +++ b/gamemode/gametypes/hl2/mapscripts/d3_c17_03.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -24,7 +23,6 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} --["env_global"] = true, - MAPSCRIPT.EntityFilterByName = { ["pclip_gate1"] = true, ["global_newgame_template_base_items"] = true, @@ -32,26 +30,31 @@ MAPSCRIPT.EntityFilterByName = { ["global_newgame_template_ammo"] = true } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(-2706.719727, -2843.710449, -3.968750), + Ang = Angle(0, 90, 0), + Trigger = { + Pos = Vector(-2706.719727, -2843.710449, -3.968750), + Mins = Vector(-350, -300, 0), + Maxs = Vector(350, 300, 100), + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then - ents.WaitForEntityByName("trigger_tower", function(ent) - -- Fail safe in case one decides to kill his allies. - ent:Fire("AddOutput", "OnTrigger plaza_exit_relay,Trigger,,40,-1") - end) - - -- setpos -497.127838 29.422707 576.030090;setang 1.708000 -178.566528 0.000000 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-2706.719727, -2843.710449, -3.968750), Angle(0, 90, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(-2706.719727, -2843.710449, -3.968750), Angle(0, 0, 0), Vector(-350, -300, 0), Vector(350, 300, 100)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end + ents.WaitForEntityByName( + "trigger_tower", + function(ent) + -- Fail safe in case one decides to kill his allies. + ent:Fire("AddOutput", "OnTrigger plaza_exit_relay,Trigger,,40,-1") + end + ) end end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From 055a7882e66d82e7f31bd8432b8519ff374aed75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:14:22 +0300 Subject: [PATCH 14/27] Refactor d3_c17_04 checkpoints --- .../gametypes/hl2/mapscripts/d3_c17_04.lua | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d3_c17_04.lua b/gamemode/gametypes/hl2/mapscripts/d3_c17_04.lua index be4eefc9..3b31354f 100644 --- a/gamemode/gametypes/hl2/mapscripts/d3_c17_04.lua +++ b/gamemode/gametypes/hl2/mapscripts/d3_c17_04.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -24,27 +23,27 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["pclip_gate1"] = true, ["player_spawn_template"] = true } -function MAPSCRIPT:PostInit() - if SERVER then - -- -1468.447632 -4747.628418 320.031250 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-1468.447632, -4747.628418, 320.031250), Angle(0, -90, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(-1468.447632, -4747.628418, 320.031250), Angle(0, 0, 0), Vector(-50, -50, 0), Vector(50, 50, 130)) +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(-1468.447632, -4747.628418, 320.031250), + Ang = Angle(0, -90, 0), + Trigger = { + Pos = Vector(-1468.447632, -4747.628418, 320.031250), + Mins = Vector(-50, -50, 0), + Maxs = Vector(50, 50, 130), + } + }, +} - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - end +function MAPSCRIPT:PostInit() end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From d1bb644d5d2e806433b2d5699b5682756d4da708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:15:17 +0300 Subject: [PATCH 15/27] Refactor d3_c17_05 checkpoints --- .../gametypes/hl2/mapscripts/d3_c17_05.lua | 79 +++++++++---------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d3_c17_05.lua b/gamemode/gametypes/hl2/mapscripts/d3_c17_05.lua index 06e676f5..dfae0bbc 100644 --- a/gamemode/gametypes/hl2/mapscripts/d3_c17_05.lua +++ b/gamemode/gametypes/hl2/mapscripts/d3_c17_05.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -24,54 +23,54 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["pclip_gate1"] = true, ["spawn_items_template"] = true } -function MAPSCRIPT:PostInit() - if SERVER then - -- 1921.614014 -5632.266602 320.031250 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(1921.614014, -5632.266602, 320.031250), Angle(0, 180, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(1921.614014, -5632.266602, 320.031250), Angle(0, 0, 0), Vector(-110, -110, 0), Vector(110, 110, 100)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - -- 896.339966 -4236.764160 384.031250 - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(830.641296, -4235.453125, 128.031250), Angle(0, 90, 0)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(838.730957, -4208.859375, 128.031250), Angle(0, 0, 0), Vector(-50, -50, 0), Vector(50, 50, 100)) - - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) - end - - -- 1793.683350 -3479.405762 320.031250 - local checkpoint3 = GAMEMODE:CreateCheckpoint(Vector(1793.683350, -3479.405762, 320.031250), Angle(0, 0, 0)) - local checkpointTrigger3 = ents.Create("trigger_once") - checkpointTrigger3:SetupTrigger(Vector(1793.683350, -3479.405762, 320.031250), Angle(0, 0, 0), Vector(-100, -80, 0), Vector(100, 80, 100)) - - checkpointTrigger3.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint3, activator) - end - - -- 1600.604126 -3304.045898 -63.968750 - local checkpoint4 = GAMEMODE:CreateCheckpoint(Vector(1597.989380, -3329.118408, -63.968750), Angle(0, 0, 0)) - local checkpointTrigger4 = ents.Create("trigger_once") - checkpointTrigger4:SetupTrigger(Vector(1597.989380, -3329.118408, -63.968750), Angle(0, 0, 0), Vector(-60, -60, 0), Vector(60, 60, 100)) +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(1921.614014, -5632.266602, 320.031250), + Ang = Angle(0, 180, 0), + Trigger = { + Pos = Vector(1921.614014, -5632.266602, 320.031250), + Mins = Vector(-110, -110, 0), + Maxs = Vector(110, 110, 100), + } + }, + { + Pos = Vector(830.641296, -4235.453125, 128.031250), + Ang = Angle(0, 90, 0), + Trigger = { + Pos = Vector(838.730957, -4208.859375, 128.031250), + Mins = Vector(-50, -50, 0), + Maxs = Vector(50, 50, 100), + } + }, + { + Pos = Vector(1793.683350, -3479.405762, 320.031250), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(1793.683350, -3479.405762, 320.031250), + Mins = Vector(-100, -80, 0), + Maxs = Vector(100, 80, 100), + } + }, + { + Pos = Vector(1597.989380, -3329.118408, -63.968750), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(1597.989380, -3329.118408, -63.968750), + Mins = Vector(-60, -60, 0), + Maxs = Vector(60, 60, 100), + } + }, +} - checkpointTrigger4.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint4, activator) - end - end +function MAPSCRIPT:PostInit() end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From 04e23d308a79f7130e923e6013cdf0f1de75d412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:16:21 +0300 Subject: [PATCH 16/27] Refactor d3_c17_06a checkpoints --- .../gametypes/hl2/mapscripts/d3_c17_06a.lua | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d3_c17_06a.lua b/gamemode/gametypes/hl2/mapscripts/d3_c17_06a.lua index 4f743d8a..46ac41a6 100644 --- a/gamemode/gametypes/hl2/mapscripts/d3_c17_06a.lua +++ b/gamemode/gametypes/hl2/mapscripts/d3_c17_06a.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -24,37 +23,37 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["pclip_gate1"] = true, ["player_spawn_template"] = true } -function MAPSCRIPT:PostInit() - if SERVER then - -- 1921.614014 -5632.266602 320.031250 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(3187.333984, 2184.848145, -312.009857), Angle(0, 180, 0)) - checkpoint1:SetVisiblePos(Vector(3034.239258, 2188.360840, -318.995728)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(3187.333984, 2184.848145, -312.009857), Angle(0, 0, 0), Vector(-250, -110, 0), Vector(110, 110, 100)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - -- 2937.786865 2507.701416 -319.968750 6.483 89.871 0.000 - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(2667.206787, 3911.651367, -323.968750), Angle(0, 90, 0)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(2945.403076, 2563.369629, -319.968750), Angle(0, 0, 0), Vector(-30, -30, 0), Vector(30, 30, 100)) +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(3187.333984, 2184.848145, -312.009857), + Ang = Angle(0, 180, 0), + VisiblePos = Vector(3034.239258, 2188.360840, -318.995728), + Trigger = { + Pos = Vector(3187.333984, 2184.848145, -312.009857), + Mins = Vector(-250, -110, 0), + Maxs = Vector(110, 110, 100), + } + }, + { + Pos = Vector(2667.206787, 3911.651367, -323.968750), + Ang = Angle(0, 90, 0), + Trigger = { + Pos = Vector(2945.403076, 2563.369629, -319.968750), + Mins = Vector(-30, -30, 0), + Maxs = Vector(30, 30, 100), + } + }, +} - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) - end - end +function MAPSCRIPT:PostInit() end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From 62acf2b7ddf8dc976982b6e1198163d4ed1f7285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:17:58 +0300 Subject: [PATCH 17/27] Refactor d3_c17_06b checkpoints --- .../gametypes/hl2/mapscripts/d3_c17_06b.lua | 133 ++++++++++-------- 1 file changed, 71 insertions(+), 62 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d3_c17_06b.lua b/gamemode/gametypes/hl2/mapscripts/d3_c17_06b.lua index ede81817..5e7d5639 100644 --- a/gamemode/gametypes/hl2/mapscripts/d3_c17_06b.lua +++ b/gamemode/gametypes/hl2/mapscripts/d3_c17_06b.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -24,78 +23,88 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["pclip_gate1"] = true, ["player_spawn_template"] = true } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(2843.645508, 1058.373169, 64.031250), + Ang = Angle(0, 0, 0), + VisiblePos = Vector(2904.702881, 1060.976196, 64.031250), + Trigger = { + Pos = Vector(2894.431396, 1052.031250, 64.031250), + Mins = Vector(-20, -20, 0), + Maxs = Vector(20, 20, 100), + } + }, + { + Pos = Vector(3477.289062, 1116.633179, 0.031250), + Ang = Angle(0, -90, 0), + Trigger = { + Pos = Vector(3477.289062, 1116.633179, 0.031250), + Mins = Vector(-60, -60, 0), + Maxs = Vector(60, 60, 100), + } + }, + { + Pos = Vector(3648.722412, 1569.612793, 256.031250), + Ang = Angle(0, 90, 0), + Trigger = { + Pos = Vector(3575.494873, 1570.045532, 256.031250), + Mins = Vector(-60, -60, 0), + Maxs = Vector(60, 60, 100), + } + }, + { + Pos = Vector(3314.308350, 1882.039551, 0.031250), + Ang = Angle(0, -90, 0), + Trigger = { + Pos = Vector(3314.308350, 1882.039551, 0.031250), + Mins = Vector(-30, -30, 0), + Maxs = Vector(30, 30, 100), + } + }, + { + Pos = Vector(3940.753906, 1200.170898, 384.031250), + Ang = Angle(0, 180, 0), + Trigger = { + Pos = Vector(4022.167480, 1330.496826, 387.531250), + Mins = Vector(-40, -40, 0), + Maxs = Vector(40, 40, 100), + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then -- This NPC should not can be killed by player. - ents.WaitForEntityByName("citizen_2_ct_mkr", function(ent) - ent:ClearOutputs() - ent:Fire("AddOutput", "OnSpawnNPC citizen_2_ct_aiss_1,StartSchedule,,0.1,1") - end) - - -- 2894.431396 1052.031250 64.031250 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(2843.645508, 1058.373169, 64.031250), Angle(0, 0, 0)) - checkpoint1:SetVisiblePos(Vector(2904.702881, 1060.976196, 64.031250)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(2894.431396, 1052.031250, 64.031250), Angle(0, 0, 0), Vector(-20, -20, 0), Vector(20, 20, 100)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - -- 3477.289062 1116.633179 0.031250 -0.188 -90.478 0.000 - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(3477.289062, 1116.633179, 0.031250), Angle(0, -90, 0)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(3477.289062, 1116.633179, 0.031250), Angle(0, 0, 0), Vector(-60, -60, 0), Vector(60, 60, 100)) - - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) - end - - -- 3575.494873 1570.045532 256.031250 26.014 90.459 0.000 - local checkpoint3 = GAMEMODE:CreateCheckpoint(Vector(3648.722412, 1569.612793, 256.031250), Angle(0, 90, 0)) - local checkpointTrigger3 = ents.Create("trigger_once") - checkpointTrigger3:SetupTrigger(Vector(3575.494873, 1570.045532, 256.031250), Angle(0, 0, 0), Vector(-60, -60, 0), Vector(60, 60, 100)) - - checkpointTrigger3.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint3, activator) - end - - ents.WaitForEntityByName("wench_1_lever_1", function(ent) - ent:SetKeyValue("spawnflags", "122") - end) - - -- 3314.308350 1882.039551 0.031250 10.966 -88.900 0.000 - local checkpoint4 = GAMEMODE:CreateCheckpoint(Vector(3648.722412, 1569.612793, 256.031250), Angle(0, -90, 0)) - local checkpointTrigger4 = ents.Create("trigger_once") - checkpointTrigger4:SetupTrigger(Vector(3314.308350, 1882.039551, 0.031250), Angle(0, 0, 0), Vector(-30, -30, 0), Vector(30, 30, 100)) - - checkpointTrigger4.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint4, activator) - end - - ents.WaitForEntityByName("wench_2_lever_1", function(ent) - ent:Fire("AddOutput", "OnOpen !self,Lock") - end) - - -- 4022.167480 1330.496826 387.531250 3.706 -140.541 0.000 - local checkpoint5 = GAMEMODE:CreateCheckpoint(Vector(3940.753906, 1200.170898, 384.031250), Angle(0, 180, 0)) - local checkpointTrigger5 = ents.Create("trigger_once") - checkpointTrigger5:SetupTrigger(Vector(4022.167480, 1330.496826, 387.531250), Angle(0, 0, 0), Vector(-40, -40, 0), Vector(40, 40, 100)) - - checkpointTrigger5.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint5, activator) - end + ents.WaitForEntityByName( + "citizen_2_ct_mkr", + function(ent) + ent:ClearOutputs() + ent:Fire("AddOutput", "OnSpawnNPC citizen_2_ct_aiss_1,StartSchedule,,0.1,1") + end + ) + + ents.WaitForEntityByName( + "wench_1_lever_1", + function(ent) + ent:SetKeyValue("spawnflags", "122") + end + ) + + ents.WaitForEntityByName( + "wench_2_lever_1", + function(ent) + ent:Fire("AddOutput", "OnOpen !self,Lock") + end + ) end end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end -return MAPSCRIPT +return MAPSCRIPT \ No newline at end of file From 23afaa552517debd7e26a5276ab22577449ab633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:19:41 +0300 Subject: [PATCH 18/27] Refactor d3_c17_08 checkpoints --- .../gametypes/hl2/mapscripts/d3_c17_08.lua | 97 +++++++++---------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d3_c17_08.lua b/gamemode/gametypes/hl2/mapscripts/d3_c17_08.lua index df248302..2a2e5e94 100644 --- a/gamemode/gametypes/hl2/mapscripts/d3_c17_08.lua +++ b/gamemode/gametypes/hl2/mapscripts/d3_c17_08.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -24,62 +23,62 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["player_spawn_items_maker"] = true } -function MAPSCRIPT:PostInit() - if SERVER then - -- -1478.292725 -1717.604614 104.600342 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-1478.292725, -1717.604614, 104.600342), Angle(0, 90, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(-1478.292725, -1717.604614, 104.600342), Angle(0, 0, 0), Vector(-130, -130, 0), Vector(130, 130, 100)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - -- 1119.968750 -840.288269 -559.968750 - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(299.584564, -1424.746704, -287.968750), Angle(0, 0, 0)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(227.741821, -1265.945923, -287.968750), Angle(0, 0, 0), Vector(-130, -130, 0), Vector(130, 130, 100)) - - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) - end - - -- 1537.006226 -813.546021 80.031250 - local checkpoint3 = GAMEMODE:CreateCheckpoint(Vector(1488.074829, -900.734985, 80.031250), Angle(0, 90, 0)) - local checkpointTrigger3 = ents.Create("trigger_once") - checkpointTrigger3:SetupTrigger(Vector(1537.006226, -813.546021, 80.031250), Angle(0, 0, 0), Vector(-130, -130, 0), Vector(130, 130, 100)) - - checkpointTrigger3.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint3, activator) - end - - -- 1392.383179 -76.121971 372.128113 - local checkpoint4 = GAMEMODE:CreateCheckpoint(Vector(1286.711914, 610.125366, 400.031250), Angle(0, -90, 0)) - local checkpointTrigger4 = ents.Create("trigger_once") - checkpointTrigger4:SetupTrigger(Vector(1392.383179, -76.121971, 372.128113), Angle(0, 0, 0), Vector(-500, -500, 0), Vector(500, 500, 250)) - - checkpointTrigger4.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint4, activator) - end - - -- 1650.219482 -89.667931 624.031250 - local checkpoint5 = GAMEMODE:CreateCheckpoint(Vector(1650.219482, -89.667931, 624.031250), Angle(0, 0, 0)) - local checkpointTrigger5 = ents.Create("trigger_once") - checkpointTrigger5:SetupTrigger(Vector(1650.219482, -89.667931, 624.031250), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 100)) +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(-1478.292725, -1717.604614, 104.600342), + Ang = Angle(0, 90, 0), + Trigger = { + Pos = Vector(-1478.292725, -1717.604614, 104.600342), + Mins = Vector(-130, -130, 0), + Maxs = Vector(130, 130, 100), + } + }, + { + Pos = Vector(299.584564, -1424.746704, -287.968750), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(227.741821, -1265.945923, -287.968750), + Mins = Vector(-130, -130, 0), + Maxs = Vector(130, 130, 100), + } + }, + { + Pos = Vector(1488.074829, -900.734985, 80.031250), + Ang = Angle(0, 90, 0), + Trigger = { + Pos = Vector(1537.006226, -813.546021, 80.031250), + Mins = Vector(-130, -130, 0), + Maxs = Vector(130, 130, 100), + } + }, + { + Pos = Vector(1286.711914, 610.125366, 400.031250), + Ang = Angle(0, -90, 0), + Trigger = { + Pos = Vector(1392.383179, -76.121971, 372.128113), + Mins = Vector(-500, -500, 0), + Maxs = Vector(500, 500, 250), + } + }, + { + Pos = Vector(1650.219482, -89.667931, 624.031250), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(1650.219482, -89.667931, 624.031250), + Mins = Vector(-100, -100, 0), + Maxs = Vector(100, 100, 100), + } + }, +} - checkpointTrigger5.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint5, activator) - end - end +function MAPSCRIPT:PostInit() end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From 9594d62b412461e218398fe9500ee9b8de6b91c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:22:43 +0300 Subject: [PATCH 19/27] Refactor d3_c17_09 checkpoints --- .../gametypes/hl2/mapscripts/d3_c17_09.lua | 64 ++++++------------- 1 file changed, 21 insertions(+), 43 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d3_c17_09.lua b/gamemode/gametypes/hl2/mapscripts/d3_c17_09.lua index 10a42d53..96d09fce 100644 --- a/gamemode/gametypes/hl2/mapscripts/d3_c17_09.lua +++ b/gamemode/gametypes/hl2/mapscripts/d3_c17_09.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -28,56 +27,35 @@ MAPSCRIPT.InputFilters = { } MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["player_spawn_items_maker"] = true } -function MAPSCRIPT:PostInit() - if SERVER then - -- 7099.762695 6237.561523 0.031250 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(7405.353516, 6305.318848, 0.031250), Angle(0, 180, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(7099.762695, 6237.561523, 0.031250), Angle(0, 0, 0), Vector(-130, -130, 0), Vector(130, 130, 100)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - -- 6000.681641 6446.313477 96.031250 - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(6000.681641, 6446.313477, 96.031250), Angle(0, 0, 0)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(6000.681641, 6446.313477, 96.031250), Angle(0, 0, 0), Vector(-130, -130, 0), Vector(130, 130, 100)) - - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) - end - --[[ - ents.WaitForEntityByName("sniper1", function(ent) - ent:SetName("lambda_sniper1") - end) - - ents.WaitForEntityByName("sniper2", function(ent) - ent:SetName("lambda_sniper2") - end) - - ents.WaitForEntityByName("sniper3", function(ent) - ent:SetName("lambda_sniper3") - end) - - ents.WaitForEntityByName("sniper4", function(ent) - ent:SetName("lambda_sniper4") - end) +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(7405.353516, 6305.318848, 0.031250), + Ang = Angle(0, 180, 0), + Trigger = { + Pos = Vector(7099.762695, 6237.561523, 0.031250), + Mins = Vector(-130, -130, 0), + Maxs = Vector(130, 130, 100), + } + }, + { + Pos = Vector(6000.681641, 6446.313477, 96.031250), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(6000.681641, 6446.313477, 96.031250), + Mins = Vector(-130, -130, 0), + Maxs = Vector(130, 130, 100), + } + }, +} - ents.WaitForEntityByName("sniper5", function(ent) - ent:SetName("lambda_sniper5") - end) - ]] - end +function MAPSCRIPT:PostInit() end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From d07c3357b3612ba82c70edb206ff57840d5f7a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:23:43 +0300 Subject: [PATCH 20/27] Refactor d3_c17_10a checkpoints --- .../gametypes/hl2/mapscripts/d3_c17_10a.lua | 75 ++++++++++--------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d3_c17_10a.lua b/gamemode/gametypes/hl2/mapscripts/d3_c17_10a.lua index 47d42977..104af8f3 100644 --- a/gamemode/gametypes/hl2/mapscripts/d3_c17_10a.lua +++ b/gamemode/gametypes/hl2/mapscripts/d3_c17_10a.lua @@ -5,7 +5,6 @@ end local DbgPrint = GetLogging("MapScript") local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -25,12 +24,32 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["player_spawn_items"] = true, ["lobby_frontdoors_counter"] = true -- Use custom counter. } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(-2672.437500, 6479.918945, 512.031250), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(-2672.437500, 6479.918945, 512.031250), + Mins = Vector(-60, -60, 0), + Maxs = Vector(60, 60, 100), + } + }, + { + Pos = Vector(-1404.743896, 8211.465820, 128.031250), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(-1404.743896, 8161.465820, 128.031250), + Mins = Vector(-60, -60, 0), + Maxs = Vector(60, 60, 100), + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then for _, v in pairs(ents.FindByName("steps_soldier_makers")) do @@ -45,7 +64,6 @@ function MAPSCRIPT:PostInit() newCounter:Fire("AddOutput", "OnHitMax atrium_securitydoors,Close,,4.0,-1") newCounter:Fire("AddOutput", "OnHitMax lobby_frontdoors_sounds,StopSound,,14.0,-1") newCounter:Spawn() - for k, v in pairs(ents.FindByName("lobby_frontdoors_soldier_makers")) do v:Fire("AddOutput", "OnSpawnNPC lobby_frontdoors_assault,Activate,,0.05,-1") v:Fire("AddOutput", "OnSpawnNPC lobby_frontdoors_assault,BeginAssault,,0.50,-1") @@ -58,48 +76,33 @@ function MAPSCRIPT:PostInit() spawn:SetAngles(Angle(0, 0, 0)) spawn:SetKeyValue("spawnflags", "1") spawn:Spawn() - -- -2672.437500 6479.918945 512.031250 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-2672.437500, 6479.918945, 512.031250), Angle(0, 0, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(-2672.437500, 6479.918945, 512.031250), Angle(0, 0, 0), Vector(-60, -60, 0), Vector(60, 60, 100)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - -- -1404.743896 8211.465820 128.031250 - local checkpoint3 = GAMEMODE:CreateCheckpoint(Vector(-1404.743896, 8211.465820, 128.031250), Angle(0, 0, 0)) - local checkpointTrigger3 = ents.Create("trigger_once") - checkpointTrigger3:SetupTrigger(Vector(-1404.743896, 8161.465820, 128.031250), Angle(0, 0, 0), Vector(-60, -60, 0), Vector(60, 60, 100)) - - checkpointTrigger3.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint3, activator) - end end end function MAPSCRIPT:OnMapTransition() DbgPrint("OnMapTransition") - -- Make sure we have barney around. - util.RunDelayed(function() - local foundBarney = false - - for k, v in pairs(ents.FindByName("barney")) do - foundBarney = true - break - end - - if foundBarney == false then - ents.WaitForEntityByName("player_spawn_items_maker", function(ent) - ent:Fire("ForceSpawn") - end) - end - end, CurTime() + 0.1) + util.RunDelayed( + function() + local foundBarney = false + for k, v in pairs(ents.FindByName("barney")) do + foundBarney = true + break + end + + if foundBarney == false then + ents.WaitForEntityByName( + "player_spawn_items_maker", + function(ent) + ent:Fire("ForceSpawn") + end + ) + end + end, CurTime() + 0.1 + ) end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From e81bd41d181c93df9149d5e1397335a5a60ec43b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:25:27 +0300 Subject: [PATCH 21/27] Refactor d3_c17_11 checkpoints --- .../gametypes/hl2/mapscripts/d3_c17_11.lua | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d3_c17_11.lua b/gamemode/gametypes/hl2/mapscripts/d3_c17_11.lua index cadc4867..a3e6bc1d 100644 --- a/gamemode/gametypes/hl2/mapscripts/d3_c17_11.lua +++ b/gamemode/gametypes/hl2/mapscripts/d3_c17_11.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -24,32 +23,37 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["player_items_template"] = true, ["pclip_gate1"] = true } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(917.399902, 4806.428223, 960.031250), + Ang = Angle(0, 0, 0), + VisiblePos = Vector(1350.315063, 4729.931641, 960.031250), + Trigger = { + Pos = Vector(1448.796265, 4695.322266, 960.031250), + Ang = Angle(0, 0, 0), + Mins = Vector(-160, -40, 0), + Maxs = Vector(60, 40, 100), + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then - -- 1448.796265 4695.322266 960.031250 - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(917.399902, 4806.428223, 960.031250), Angle(0, 0, 0)) - checkpoint2:SetVisiblePos(Vector(1350.315063, 4729.931641, 960.031250)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(1448.796265, 4695.322266, 960.031250), Angle(0, 0, 0), Vector(-160, -40, 0), Vector(60, 40, 100)) - - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) - end - - ents.WaitForEntityByName("dropship_maker", function(ent) - ent:Fire("AddOutput", "OnSpawnNPC !self,Kill,,0.0,-1") - end) + ents.WaitForEntityByName( + "dropship_maker", + function(ent) + ent:Fire("AddOutput", "OnSpawnNPC !self,Kill,,0.0,-1") + end + ) end end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From dc990868899157196697415ef20044c1240bc82f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:26:51 +0300 Subject: [PATCH 22/27] Refactor d3_c17_12 checkpoints --- .../gametypes/hl2/mapscripts/d3_c17_12.lua | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d3_c17_12.lua b/gamemode/gametypes/hl2/mapscripts/d3_c17_12.lua index d01fcda3..4a2526b2 100644 --- a/gamemode/gametypes/hl2/mapscripts/d3_c17_12.lua +++ b/gamemode/gametypes/hl2/mapscripts/d3_c17_12.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -24,43 +23,47 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["player_spawn_items"] = true, ["pclip_gate1"] = true } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(645.813293, 3391.362061, 192.031250), + Ang = Angle(0, -180, 0), + Trigger = { + Pos = Vector(645.813293, 3391.362061, 192.031250), + Ang = Angle(0, 0, 0), + Mins = Vector(-50, -50, 0), + Maxs = Vector(50, 50, 100), + } + }, + { + Pos = Vector(-2476.636963, 6708.353516, 128.031250), + Ang = Angle(0, 90, 0), + VisiblePos = Vector(-2494.347412, 6463.139648, 128.031250), + Trigger = { + Pos = Vector(-2494.347412, 6463.139648, 128.031250), + Ang = Angle(0, 0, 0), + Mins = Vector(-50, -50, 0), + Maxs = Vector(50, 50, 100), + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then - -- 1200.359985 3379.639893 768.816528 -- Make sure the player spawns at the correct spot. local spawn = ents.Create("info_player_start") spawn:SetPos(Vector(1200.359985, 3379.639893, 768.816528)) spawn:SetAngles(Angle(0, -130, 0)) spawn:SetKeyValue("spawnflags", "1") spawn:Spawn() - -- 645.813293 3391.362061 192.031250 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(645.813293, 3391.362061, 192.031250), Angle(0, -180, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(645.813293, 3391.362061, 192.031250), Angle(0, 0, 0), Vector(-50, -50, 0), Vector(50, 50, 100)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(-2476.636963, 6708.353516, 128.031250), Angle(0, 90, 0)) - checkpoint2:SetVisiblePos(Vector(-2494.347412, 6463.139648, 128.031250)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(-2494.347412, 6463.139648, 128.031250), Angle(0, 0, 0), Vector(-50, -50, 0), Vector(50, 50, 100)) - - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) - end end end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From 4ef632bcac243ec31b572548ad9146d900d4880e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:28:02 +0300 Subject: [PATCH 23/27] Refactor d3_c17_12b checkpoints --- .../gametypes/hl2/mapscripts/d3_c17_12b.lua | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d3_c17_12b.lua b/gamemode/gametypes/hl2/mapscripts/d3_c17_12b.lua index c58ae555..171767dd 100644 --- a/gamemode/gametypes/hl2/mapscripts/d3_c17_12b.lua +++ b/gamemode/gametypes/hl2/mapscripts/d3_c17_12b.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -23,7 +22,6 @@ MAPSCRIPT.DefaultLoadout = { } MAPSCRIPT.InputFilters = {} - MAPSCRIPT.EntityFilterByClass = { ["npc_cscanner"] = true } @@ -35,25 +33,31 @@ MAPSCRIPT.EntityFilterByName = { ["entry_ceiling_debris_clip_1"] = true } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(-4438.691406, 274.473907, -319.968750), + Ang = Angle(0, 0, 0), + Trigger = { + Pos = Vector(-4493.349121, 297.115906, -319.968750), + Ang = Angle(0, 0, 0), + Mins = Vector(-20, -20, 0), + Maxs = Vector(20, 20, 100), + } + }, + { + Pos = Vector(-4295.874023, 430.960907, 96.031250), + Ang = Angle(0, 90, 0), + Trigger = { + Pos = Vector(-4295.874023, 430.960907, 96.031250), + Ang = Angle(0, 0, 0), + Mins = Vector(-20, -20, 0), + Maxs = Vector(20, 20, 100), + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-4438.691406, 274.473907, -319.968750), Angle(0, 0, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(-4493.349121, 297.115906, -319.968750), Angle(0, 0, 0), Vector(-20, -20, 0), Vector(20, 20, 100)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - -- -4295.874023 430.960907 96.031250 - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(-4295.874023, 430.960907, 96.031250), Angle(0, 90, 0)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(-4295.874023, 430.960907, 96.031250), Angle(0, 0, 0), Vector(-20, -20, 0), Vector(20, 20, 100)) - - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) - end - -- UGH --- -5204.569824 -29.101088 0.031250 local striderTrigger = ents.Create("trigger_once") @@ -66,7 +70,6 @@ function MAPSCRIPT:PostInit() end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From e4a545fbb90c56763a81b7da18f600bbf4c09aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:29:02 +0300 Subject: [PATCH 24/27] Refactor d3_c17_13 checkpoints --- .../gametypes/hl2/mapscripts/d3_c17_13.lua | 114 ++++++++++-------- 1 file changed, 66 insertions(+), 48 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d3_c17_13.lua b/gamemode/gametypes/hl2/mapscripts/d3_c17_13.lua index ca6c6790..d6309a18 100644 --- a/gamemode/gametypes/hl2/mapscripts/d3_c17_13.lua +++ b/gamemode/gametypes/hl2/mapscripts/d3_c17_13.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -28,7 +27,6 @@ MAPSCRIPT.InputFilters = { } MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["player_spawn_items"] = true, ["escape_attempt_killtrigger"] = true, @@ -39,46 +37,62 @@ MAPSCRIPT.EntityFilterByName = { ["damagefilter_barney"] = true } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(5895.568359, -1049.733887, -127.968750), + Ang = Angle(0, -180, 0), + Trigger = { + Pos = Vector(5629.913086, -1056.541016, -127.968750), + Ang = Angle(0, 0, 0), + Mins = Vector(-200, -300, 0), + Maxs = Vector(400, 150, 100), + } + }, + { + Pos = Vector(5961.045898, 43.669514, 0.031250), + Ang = Angle(0, -180, 0), + Trigger = { + Pos = Vector(5949.389648, 125.043320, 0.031250), + Ang = Angle(0, 0, 0), + Mins = Vector(-20, -120, 0), + Maxs = Vector(20, 120, 100), + } + }, + { + Pos = Vector(5366.176758, 302.146027, 0.031250), + Ang = Angle(0, 90, 0), + Trigger = { + Pos = Vector(5077.874512, 405.469330, -3.968750), + Ang = Angle(0, 0, 0), + Mins = Vector(-250, -120, 0), + Maxs = Vector(400, 320, 200), + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(5895.568359, -1049.733887, -127.968750), Angle(0, -180, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(5629.913086, -1056.541016, -127.968750), Angle(0, 0, 0), Vector(-200, -300, 0), Vector(400, 150, 100)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - -- 5949.389648 125.043320 0.031250 - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(5961.045898, 43.669514, 0.031250), Angle(0, -180, 0)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(5949.389648, 125.043320, 0.031250), Angle(0, 0, 0), Vector(-20, -120, 0), Vector(20, 120, 100)) - - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) - end - - -- 5077.874512 405.469330 -3.968750 - local checkpoint3 = GAMEMODE:CreateCheckpoint(Vector(5366.176758, 302.146027, 0.031250), Angle(0, 90, 0)) - local checkpointTrigger3 = ents.Create("trigger_once") - checkpointTrigger3:SetupTrigger(Vector(5077.874512, 405.469330, -3.968750), Angle(0, 0, 0), Vector(-250, -120, 0), Vector(400, 320, 200)) - - checkpointTrigger3.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint3, activator) - end - -- Make sure they are only used once. - ents.WaitForEntityByName("bigdestroy1_relay", function(ent) - ent:Fire("AddOutput", "OnTrigger !self,Kill,,0.1,-1") - end) - - ents.WaitForEntityByName("bigdestroy2_relay", function(ent) - ent:Fire("AddOutput", "OnTrigger !self,Kill,,0.1,-1") - end) - - ents.WaitForEntityByName("bigdestroy3_relay", function(ent) - ent:Fire("AddOutput", "OnTrigger !self,Kill,,0.1,-1") - end) + ents.WaitForEntityByName( + "bigdestroy1_relay", + function(ent) + ent:Fire("AddOutput", "OnTrigger !self,Kill,,0.1,-1") + end + ) + + ents.WaitForEntityByName( + "bigdestroy2_relay", + function(ent) + ent:Fire("AddOutput", "OnTrigger !self,Kill,,0.1,-1") + end + ) + + ents.WaitForEntityByName( + "bigdestroy3_relay", + function(ent) + ent:Fire("AddOutput", "OnTrigger !self,Kill,,0.1,-1") + end + ) -- Last resort. local striderCounter = ents.Create("math_counter") @@ -89,19 +103,23 @@ function MAPSCRIPT:PostInit() striderCounter:Fire("AddOutput", "OnHitMax bigdestroy2_relay,Trigger,,0.0,-1") striderCounter:Fire("AddOutput", "OnHitMax bigdestroy3_relay,Trigger,,0.0,-1") striderCounter:Spawn() - - ents.WaitForEntityByName("strider1", function(ent) - ent:Fire("AddOutput", "OnDeath lambda_strider_counter,Add,1,0.0,-1") - end) - - ents.WaitForEntityByName("strider2", function(ent) - ent:Fire("AddOutput", "OnDeath lambda_strider_counter,Add,1,0.0,-1") - end) + ents.WaitForEntityByName( + "strider1", + function(ent) + ent:Fire("AddOutput", "OnDeath lambda_strider_counter,Add,1,0.0,-1") + end + ) + + ents.WaitForEntityByName( + "strider2", + function(ent) + ent:Fire("AddOutput", "OnDeath lambda_strider_counter,Add,1,0.0,-1") + end + ) end end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From bc4de858950bcf3a2880ecfe716e0163a3f101d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:30:35 +0300 Subject: [PATCH 25/27] Refactor d3_citadel_01 checkpoints --- .../hl2/mapscripts/d3_citadel_01.lua | 103 ++++++++++-------- 1 file changed, 56 insertions(+), 47 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d3_citadel_01.lua b/gamemode/gametypes/hl2/mapscripts/d3_citadel_01.lua index acb0fa9c..1d124e2c 100644 --- a/gamemode/gametypes/hl2/mapscripts/d3_citadel_01.lua +++ b/gamemode/gametypes/hl2/mapscripts/d3_citadel_01.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, Ammo = { @@ -24,7 +23,6 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["global_newgame_template_base_items"] = true, ["global_newgame_template_local_items"] = true, @@ -40,64 +38,74 @@ function MAPSCRIPT:PostInit() end local triggers = ents.FindByPos(Vector(10624, 4592, -1664), "trigger_once") - for _, v in pairs(triggers) do v:Remove() end triggers = ents.FindByPos(Vector(11880, 5888, -1672), "trigger_multiple") - for _, v in pairs(triggers) do v:Remove() end triggers = ents.FindByPos(Vector(11176, 5888, -1672), "trigger_once") - for _, v in pairs(triggers) do v:Remove() end - ents.WaitForEntityByName("fade_out", function(ent) - ent:SetKeyValue("spawnflags", "4") -- Activator only - ent:SetKeyValue("holdtime", "9999") -- Make this long enough. - end) + ents.WaitForEntityByName( + "fade_out", + function(ent) + ent:SetKeyValue("spawnflags", "4") -- Activator only + ent:SetKeyValue("holdtime", "9999") -- Make this long enough. + end + ) -- Create better fade-out trigger. local fadeTrigger = ents.Create("trigger_multiple") fadeTrigger:SetupTrigger(Vector(11176, 5888, -1672), Angle(0, 0, 0), Vector(-90, -90, -50), Vector(150, 90, 100), true, SF_TRIGGER_ONLY_CLIENTS_IN_VEHICLES) fadeTrigger:Fire("AddOutput", "OnStartTouch fade_out,Fade,,0,-1") - - ents.WaitForEntityByName("player_track4", function(ent) - local newTrack = ents.Create("path_track") - newTrack:SetPos(ent:GetPos()) - newTrack:SetAngles(ent:GetAngles()) - newTrack:SetKeyValue("speed", "0") - newTrack:SetKeyValue("orientationtype", "0") - newTrack:SetKeyValue("target", "pod_bay_track1") - newTrack:SetName("lambda_player_track4") - newTrack:Spawn() - newTrack:Activate() - ent:Remove() - end) - - ents.WaitForEntityByName("player_track2", function(ent) - ent:Fire("AddOutput", "OnPass playerpod_ready_relay,Trigger,,0,-1") - end) - - ents.WaitForEntityByName("player_track3", function(ent) - ent:Fire("AddOutput", "OnPass playerpod_ready_relay,Trigger,,0,-1") - ent:SetKeyValue("target", "lambda_player_track4") - ent:Activate() - end) - - ents.WaitForEntityByName("pod_bay_track9", function(ent) - ent:Fire("EnableAlternatePath") - end) + ents.WaitForEntityByName( + "player_track4", + function(ent) + local newTrack = ents.Create("path_track") + newTrack:SetPos(ent:GetPos()) + newTrack:SetAngles(ent:GetAngles()) + newTrack:SetKeyValue("speed", "0") + newTrack:SetKeyValue("orientationtype", "0") + newTrack:SetKeyValue("target", "pod_bay_track1") + newTrack:SetName("lambda_player_track4") + newTrack:Spawn() + newTrack:Activate() + ent:Remove() + end + ) + + ents.WaitForEntityByName( + "player_track2", + function(ent) + ent:Fire("AddOutput", "OnPass playerpod_ready_relay,Trigger,,0,-1") + end + ) + + ents.WaitForEntityByName( + "player_track3", + function(ent) + ent:Fire("AddOutput", "OnPass playerpod_ready_relay,Trigger,,0,-1") + ent:SetKeyValue("target", "lambda_player_track4") + ent:Activate() + end + ) + + ents.WaitForEntityByName( + "pod_bay_track9", + function(ent) + ent:Fire("EnableAlternatePath") + end + ) -- Kick players out of vehicle local kickTrigger = ents.Create("trigger_multiple") kickTrigger:SetupTrigger(Vector(11776, 5888, -1672), Angle(0, 0, 0), Vector(-40, -90, -70), Vector(60, 90, 100), true, SF_TRIGGER_ONLY_CLIENTS_IN_VEHICLES) - kickTrigger.OnStartTouch = function(s, ent) ent:ExitVehicle() ent:TeleportPlayer(Vector(12091.439453, 5889.092773, -1775.968750)) @@ -110,13 +118,15 @@ function MAPSCRIPT:PostInit() changelevelTrigger:SetupTrigger(Vector(11776, 5888, -1672), Angle(0, 0, 0), Vector(-40, -90, -70), Vector(370, 90, 100)) changelevelTrigger:SetKeyValue("map", "d3_citadel_02") changelevelTrigger:SetKeyValue("landmark", "trans_cit01_cit02") - - ents.WaitForEntityByName("terd", function(ent) - ent:Fire("SetDensity", "1.0") - ent:SetKeyValue("spawnflags", "1") - ent:SetKeyValue("ParticleDrawWidth", "800") - ent:Activate() - end) + ents.WaitForEntityByName( + "terd", + function(ent) + ent:Fire("SetDensity", "1.0") + ent:SetKeyValue("spawnflags", "1") + ent:SetKeyValue("ParticleDrawWidth", "800") + ent:Activate() + end + ) local test = ents.Create("env_lightglow") test:SetKeyValue("origin", "12064 5886 -1671") @@ -130,7 +140,6 @@ function MAPSCRIPT:PostInit() test:SetKeyValue("rendercolor", "211 211 211") test:Spawn() test:Activate() - for _, v in pairs(ents.FindByClass("prop_vehicle_prisoner_pod")) do v:Fire("AddOutput", "PlayerOn !self,Close,,0,-1") v:Fire("AddOutput", "PlayerOn !self,Lock,,0.01,-1") @@ -139,7 +148,7 @@ function MAPSCRIPT:PostInit() end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end -return MAPSCRIPT \ No newline at end of file +return MAPSCRIPT +--DbgPrint("PostPlayerSpawn") \ No newline at end of file From 5f1c36bc2e5b486360dca65c7bd22ebc44409ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:31:19 +0300 Subject: [PATCH 26/27] Refactor d1_town_01 checkpoints --- .../gametypes/hl2/mapscripts/d1_town_01.lua | 53 ++++++++++--------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d1_town_01.lua b/gamemode/gametypes/hl2/mapscripts/d1_town_01.lua index db2902a4..9ec2ea81 100644 --- a/gamemode/gametypes/hl2/mapscripts/d1_town_01.lua +++ b/gamemode/gametypes/hl2/mapscripts/d1_town_01.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon"}, Ammo = { @@ -18,40 +17,46 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["player_spawn_template"] = true } +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(2643.776611, -1465.673584, -3839.968750), + Ang = Angle(0, 90, 0), + Trigger = { + Pos = Vector(3007.881836, -1393.500732, -3783.968750), + Ang = Angle(0, 0, 0), + Mins = Vector(-50, -50, 0), + Maxs = Vector(50, 50, 70), + } + }, + { + Pos = Vector(2018.717896, -1513.990112, -3839.968750), + Ang = Angle(0, 90, 0), + Trigger = { + Pos = Vector(2029.538086, -1425.406128, -3839.968750), + Ang = Angle(0, 0, 0), + Mins = Vector(-90, -100, 0), + Maxs = Vector(70, 200, 50), + } + }, +} + function MAPSCRIPT:PostInit() if SERVER then -- 2849.690674 -1397.864624 -3839.968750 - ents.WaitForEntityByName("null_filter", function(ent) - ent:Remove() - end) - - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(2643.776611, -1465.673584, -3839.968750), Angle(0, 90, 0)) - checkpoint1:SetVisiblePos(Vector(3005.009521, -1394.904053, -3783.968750)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(3007.881836, -1393.500732, -3783.968750), Angle(0, 0, 0), Vector(-50, -50, 0), Vector(50, 50, 70)) - - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - - local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(2018.717896, -1513.990112, -3839.968750), Angle(0, 90, 0)) - checkpoint2:SetVisiblePos(Vector(2029.538086, -1425.406128, -3839.968750)) - local checkpointTrigger2 = ents.Create("trigger_once") - checkpointTrigger2:SetupTrigger(Vector(2029.538086, -1425.406128, -3839.968750), Angle(0, 0, 0), Vector(-90, -100, 0), Vector(70, 200, 50)) - - checkpointTrigger2.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) - end + ents.WaitForEntityByName( + "null_filter", + function(ent) + ent:Remove() + end + ) end end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file From 5b3826f38ddbe1a4c4c20a5f4cc4204af603ba40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:32:22 +0300 Subject: [PATCH 27/27] Refactor d1_town_04 checkpoints --- .../gametypes/hl2/mapscripts/d1_town_04.lua | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/gamemode/gametypes/hl2/mapscripts/d1_town_04.lua b/gamemode/gametypes/hl2/mapscripts/d1_town_04.lua index 4a5d8db5..9a7d1fef 100644 --- a/gamemode/gametypes/hl2/mapscripts/d1_town_04.lua +++ b/gamemode/gametypes/hl2/mapscripts/d1_town_04.lua @@ -4,7 +4,6 @@ end local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false - MAPSCRIPT.DefaultLoadout = { Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun"}, Ammo = { @@ -20,26 +19,27 @@ MAPSCRIPT.DefaultLoadout = { MAPSCRIPT.InputFilters = {} MAPSCRIPT.EntityFilterByClass = {} - MAPSCRIPT.EntityFilterByName = { ["player_spawn_template"] = true } -function MAPSCRIPT:PostInit() - if SERVER then - -- 1915.561768 -19.246124 -5120.762695 - local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(1893.508423, 365.617035, -5120.287109), Angle(0, -90, 0)) - local checkpointTrigger1 = ents.Create("trigger_once") - checkpointTrigger1:SetupTrigger(Vector(1915.561768, -19.246124, -5120.762695), Angle(0, 0, 0), Vector(-150, -50, 0), Vector(150, 50, 70)) +MAPSCRIPT.Checkpoints = { + { + Pos = Vector(1893.508423, 365.617035, -5120.287109), + Ang = Angle(0, -90, 0), + Trigger = { + Pos = Vector(1915.561768, -19.246124, -5120.762695), + Ang = Angle(0, 0, 0), + Mins = Vector(-150, -50, 0), + Maxs = Vector(150, 50, 70), + } + }, +} - checkpointTrigger1.OnTrigger = function(_, activator) - GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) - end - end +function MAPSCRIPT:PostInit() end function MAPSCRIPT:PostPlayerSpawn(ply) - --DbgPrint("PostPlayerSpawn") end return MAPSCRIPT \ No newline at end of file