Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor player follow #285

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Improved: ep1_citadel_00: Fixed T-pose on vortigaunt and remove leftover chapter messages.
- Improved: d3_breen_01: Get the functionality closer to the original.
- Improved: Add a button in the settings menu to revert colors.
- Improved: ep1_c17_05: Escorting the NPCs should be a bit more reliable now.
- Fixed: Transitioning doors have sometimes the wrong rotation.
- Fixed: HUD is now hidden when point_viewcontrol takes control.
- Fixed: Triggers not firing outputs when they are disabled and then enabled again while entities are touching it.
Expand Down
136 changes: 0 additions & 136 deletions entities/entities/lambda_player_follow.lua

This file was deleted.

16 changes: 13 additions & 3 deletions gamemode/gametypes/hl2ep1/mapscripts/ep1_c17_05.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,21 @@ MAPSCRIPT.Checkpoints = {}
function MAPSCRIPT:PostInit()
-- Force the NPCs to follow the player. Squads in Garry's Mod are a bit broken, the replacement
-- lambda_player_follow entity is a bit more reliable but also quite hacky.
local playerFollow = ents.Create("lambda_player_follow")
local playerFollow = ents.Create("ai_goal_follow")
playerFollow:SetName("lambda_follow_player")
playerFollow:SetKeyValue("actor", "citizen_refugees*")
playerFollow:SetKeyValue("goal", "!player")
playerFollow:SetKeyValue("Formation", "0")
playerFollow:SetKeyValue("MaximumState", "1")
playerFollow:SetKeyValue("StartActive", "0")
playerFollow:SetKeyValue("SearchType", "0")
playerFollow:Spawn()
playerFollow:Activate()

ents.WaitForEntityByName("relay_pickup_citizens", function(ent)
ent:Fire("AddOutput", "OnTrigger lambda_follow_player,Deactivate,,0,-1")
ent:Fire("AddOutput", "OnTrigger lambda_follow_player,Activate,,0.01,-1")
end)

-- Alyx should wait for everyone at the end before closing
ents.WaitForEntityByName(
"counter_everyone_in_place_for_barney_goodbye",
Expand All @@ -69,7 +79,7 @@ function MAPSCRIPT:PostInit()
ents.WaitForEntityByName(
"rallypoint_barney_lasttrain",
function(ent)
ent:Fire("AddOutput", "OnArrival lambda_close_doors,Enable,,0,-1", "0.0")
ent:Fire("AddOutput", "OnArrival lambda_close_doors,Enable,,0,-1")
end
)

Expand Down