Raised This Month: $7 Target: $400
 1% 

[L4D2] Survivor Spawn Position Fix (Gabu's Version)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Plugin ID:
8145
Plugin Version:
2.1
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
6 
Plugin Description:
Fixes survivor spawns on some maps where other survivors might spawn in a non-intended area
Old 08-07-2022 , 22:31   [L4D2] Survivor Spawn Position Fix (Gabu's Version)
Reply With Quote #1

Survivor Spawn Position Fix (Gabu's Version)
This is my own version of the Survivor Spawn Position Fix. The way of achieving this is different from Dragokas' version hence a new thread.

This works by setting up an "optimal" startup position then moving all players whenever they need to. It will also work with the Director's ForceSurvivalPosition call where all the players are moved correctly to each position, no matter the survivor set.

ConVars
  • sm_l4d2_spawnpos_enabled
    • Determines if the plugin is active or not
      • Default: 1

Client Commands
  • sm_resetpos
    • Teleports you to the desired spawn point position.
      • Only usable if nobody has left the saferoom.

Changelog
  • 2.1
    • Fixed a bug where players could not move after a map change.
    • Deleted some unused functions from unreleased development versions.
  • 2.0
    • It now requires Left 4 DHooks Direct 1.119 or newer.
    • Changed the way the plugin works. Instead of creating entities the plugin will ensure every player will be in an "optimal" starting position. (Usually where Nick/Bill starts in the first map, or where the first player that enters the world in every other map).
      • This fixes erratic spawns in custom campaigns like Snow Den, Day Break, Deadbeat Escape while keeping compatibility with multiple branch spawns like the ones found in Resident Evil 3.
    • On spawn, the player will be teleported to this optimal position.
    • On ForceSurvivalPosition, every player will be forced to the position, not just the survivors set the map.*
      • It may be incompatible with plugins that allow you to be the L4D1 survivors in map where the holdout team appears.
      • This fixes the bug where the incorrect survivors might fall off the rescue vehicle. It may conflict with the same fix included in Dragoka's [L4D & L4D2] Special Exploit Fixes. Set l4d_sef_fall_transport_fix to 0 if you're using that plugin.
    • When the Director releases the survivor's positions (when the cutscene ends), the plugin will find an optimal spawn position again. This fixes changing spawnpoint positions in custom campaigns like Absolute Zero.
    • Added new command: sm_resetpos it will allow you to teleport to the desired spawnpoint if every fix failed. Only if nobody has left the safe room.
  • 1.2
    • Fixed a plugin failure where it would try to apply changes too soon.
    • Fixed several cases where it wouldn't apply the fix
    • Changed the generic spawn point from info_player_start to info_survivor_position, since it should work more consistently
  • 1.1
    • Fixed a plugin failure while trying to process ordered spawn points. (The plugin was incorrectly looking up for the wrong classname)
  • 1.0
    • Initial Release

Dependencies
Conflicts
Supported Games
  • Left 4 Dead 2 only
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_spawnpos_fix.sp - 369 views - 13.6 KB)
__________________

Last edited by gabuch2; 10-17-2022 at 20:43.
gabuch2 is offline
thewintersoldier97
Senior Member
Join Date: Aug 2021
Location: Vietnam
Old 08-09-2022 , 07:00   Re: [L4D2] Survivor Spawn Position Fix (Gabu's Version)
Reply With Quote #2

Nice work!
__________________

Looking for some fun!
thewintersoldier97 is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 08-09-2022 , 16:42   Re: [L4D2] Survivor Spawn Position Fix (Gabu's Version)
Reply With Quote #3

Good idea.

However, for mentioned Fort Noesis map in L4D1 game there are no broken located spawn entities.
There is absolutely nothing located next to coordinates where survivors spawned underground.

Quote:
Originally Posted by gabuch2 View Post
The plugin was tested only with L4D2, unaware if L4D1 works since I don't own that game.
It will not.
L4D1 doesn't have the native L4D2_GetSurvivorSetMap, and such prop names: m_iszGameMode, m_iszSurvivorName, m_order.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 08-09-2022 at 16:42.
Dragokas is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 08-10-2022 , 22:18   Re: [L4D2] Survivor Spawn Position Fix (Gabu's Version)
Reply With Quote #4

Quote:
Originally Posted by Dragokas View Post
Good idea.

However, for mentioned Fort Noesis map in L4D1 game there are no broken located spawn entities.
There is absolutely nothing located next to coordinates where survivors spawned underground.
I haven't gotten any situation where this can happen. I did however experienced many problems with other maps where they put the initial spawn in a location far away from the actual safe house/spot, most notorious case is the Day Break custom campaign. In other campaigns where the problem is not that big the spawn point is just outside the building (Like in Snow Den) but it's enough to cause a round start prematurely. This plugin fixes all of these cases.

Quote:
Originally Posted by Dragokas View Post
It will not.
L4D1 doesn't have the native L4D2_GetSurvivorSetMap, and such prop names: m_iszGameMode, m_iszSurvivorName, m_order.
This is good to know, thanks. I don't know if L4D1 has additional game modes so I'll mark this plugin as L4D2 only for the meantime.
__________________

Last edited by gabuch2; 08-10-2022 at 22:21.
gabuch2 is offline
Omixsat
Member
Join Date: Jul 2022
Old 08-30-2022 , 03:05   Re: [L4D2] Survivor Spawn Position Fix (Gabu's Version)
Reply With Quote #5

L4D1 only has a limited amount of game modes, which is a total of 4, namely "coop","teamversus","versus", and "survival". It does not have the mutation system that L4D2 has.

If in case you(or anyone else) would like to try making an L4D1 version of your implementation, you can also use the L4D CVar Reference and look for the sv_gametypes or mp_gamemode cvar. Nice work btw
Omixsat is offline
Mi.Cura
Veteran Member
Join Date: Dec 2016
Location: Brazil
Old 08-30-2022 , 10:16   Re: [L4D2] Survivor Spawn Position Fix (Gabu's Version)
Reply With Quote #6

Great! Thanks for sharing this fix.
But I did some tests, on the Snow Den map it really started all characters in the correct starting position.
But when testing the Deadbeat Escape campaign, two bots started underground, (buried under the house).
__________________
Mi.Cura | Modded Servers | L4D2
https://steamcommunity.com/groups/micuramodzombie

Last edited by Mi.Cura; 08-30-2022 at 10:31. Reason: report problems
Mi.Cura is offline
Mi.Cura
Veteran Member
Join Date: Dec 2016
Location: Brazil
Old 08-31-2022 , 09:40   Re: [L4D2] Survivor Spawn Position Fix (Gabu's Version)
Reply With Quote #7

Quote:
Originally Posted by gabuch2 View Post
I haven't gotten any situation where this can happen. I did however experienced many problems with other maps where they put the initial spawn in a location far away from the actual safe house/spot, most notorious case is the Day Break custom campaign. In other campaigns where the problem is not that big the spawn point is just outside the building (Like in Snow Den) but it's enough to cause a round start prematurely. This plugin fixes all of these cases.


This is good to know, thanks. I don't know if L4D1 has additional game modes so I'll mark this plugin as L4D2 only for the meantime.

L 08/31/2022 - 00:053: SourceMod error session started
L 08/31/2022 - 00:053: Info (map "c14m2_lighthouse") (file "c:\tcafiles\users\sergiok\21700\left4dead2\a ddons\sourcemod\logs\errors_20220831.log")
L 08/31/2022 - 00:053: [SM] Exception reported: Cannot create new entity when no map is running
L 08/31/2022 - 00:053: [SM] Blaming: l4d2_spawnpos_fix.smx
L 08/31/2022 - 00:053: [SM] Call stack trace:
L 08/31/2022 - 00:053: [SM] [0] CreateEntityByName
L 08/31/2022 - 00:053: [SM] [1] Line 146, E:\Games e Programas\Games\LEFT 4 DEAD 2\PLUGINS\SOURCEMODS\sourcemod-1.11.0-git6906-windows\addons\sourcemod\scripting\l4d2_spawn pos_fix.sp::CreateGenericSpawnPoint
L 08/31/2022 - 00:053: [SM] [2] Line 80, E:\Games e Programas\Games\LEFT 4 DEAD 2\PLUGINS\SOURCEMODS\sourcemod-1.11.0-git6906-windows\addons\sourcemod\scripting\l4d2_spawn pos_fix.sp::FixSpawns
L 08/31/2022 - 00:053: [SM] [3] Line 41, E:\Games e Programas\Games\LEFT 4 DEAD 2\PLUGINS\SOURCEMODS\sourcemod-1.11.0-git6906-windows\addons\sourcemod\scripting\l4d2_spawn pos_fix.sp::Event_RoundStart
L 08/31/2022 - 00:28:12: Error log file session closed.
L 08/31/2022 - 00:28:16: SourceMod error session started
L 08/31/2022 - 00:28:16: Info (map "2ee_01") (file "c:\tcafiles\users\sergiok\21700\left4dead2\a ddons\sourcemod\logs\errors_20220831.log")
L 08/31/2022 - 00:28:16: [SM] Exception reported: Property "m_order" not found (entity 54/info_player_start)
L 08/31/2022 - 00:28:16: [SM] Blaming: l4d2_spawnpos_fix.smx
L 08/31/2022 - 00:28:16: [SM] Call stack trace:
L 08/31/2022 - 00:28:16: [SM] [0] GetEntProp
L 08/31/2022 - 00:28:16: [SM] [1] Line 108, E:\Games e Programas\Games\LEFT 4 DEAD 2\PLUGINS\SOURCEMODS\sourcemod-1.11.0-git6906-windows\addons\sourcemod\scripting\l4d2_spawn pos_fix.sp::FixSpawns
L 08/31/2022 - 00:28:16: [SM] [2] Line 41, E:\Games e Programas\Games\LEFT 4 DEAD 2\PLUGINS\SOURCEMODS\sourcemod-1.11.0-git6906-windows\addons\sourcemod\scripting\l4d2_spawn pos_fix.sp::Event_RoundStart
L 08/31/2022 - 0000: Error log file session closed.
__________________
Mi.Cura | Modded Servers | L4D2
https://steamcommunity.com/groups/micuramodzombie
Mi.Cura is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 09-01-2022 , 01:04   Re: [L4D2] Survivor Spawn Position Fix (Gabu's Version)
Reply With Quote #8

1.1

Fixed a plugin failure while trying to process ordered spawn points. (The plugin was incorrectly looking up for the wrong classname)
__________________
gabuch2 is offline
yabi
Senior Member
Join Date: Jun 2021
Location: Taiwan
Old 09-01-2022 , 09:31   Re: [L4D2] Survivor Spawn Position Fix (Gabu's Version)
Reply With Quote #9

Quote:
Originally Posted by gabuch2 View Post
1.1

Fixed a plugin failure while trying to process ordered spawn points. (The plugin was incorrectly looking up for the wrong classname)
Thank you for your willingness to fix him,
because i was before
All player generated locations
There is a chance that the safe room will not be gathered

plus some errors
yabi is offline
Mi.Cura
Veteran Member
Join Date: Dec 2016
Location: Brazil
Old 09-01-2022 , 10:03   Re: [L4D2] Survivor Spawn Position Fix (Gabu's Version)
Reply With Quote #10

Quote:
Originally Posted by gabuch2 View Post
1.1

Fixed a plugin failure while trying to process ordered spawn points. (The plugin was incorrectly looking up for the wrong classname)

JUST REPORT:

L 09/01/2022 - 109:15: SourceMod error session started
L 09/01/2022 - 109:15: Info (map "c4m1_milltown_a") (file "c:\tcafiles\users\sergiok\21700\left4dead2\a ddons\sourcemod\logs\errors_20220901.log")
L 09/01/2022 - 109:15: [SM] Exception reported: Cannot create new entity when no map is running
L 09/01/2022 - 109:15: [SM] Blaming: l4d2_spawnpos_fix.smx
L 09/01/2022 - 109:15: [SM] Call stack trace:
L 09/01/2022 - 109:15: [SM] [0] CreateEntityByName
L 09/01/2022 - 109:15: [SM] [1] Line 146, E:\Games e Programas\Games\LEFT 4 DEAD 2\PLUGINS\SOURCEMODS\sourcemod-1.11.0-git6906-windows\addons\sourcemod\scripting\l4d2_spawn pos_fix.sp::CreateGenericSpawnPoint
L 09/01/2022 - 109:15: [SM] [2] Line 80, E:\Games e Programas\Games\LEFT 4 DEAD 2\PLUGINS\SOURCEMODS\sourcemod-1.11.0-git6906-windows\addons\sourcemod\scripting\l4d2_spawn pos_fix.sp::FixSpawns
L 09/01/2022 - 109:15: [SM] [3] Line 41, E:\Games e Programas\Games\LEFT 4 DEAD 2\PLUGINS\SOURCEMODS\sourcemod-1.11.0-git6906-windows\addons\sourcemod\scripting\l4d2_spawn pos_fix.sp::Event_RoundStart
L 09/01/2022 - 10:40:02: Error log file session closed.

I did some tests on custom maps, for example:
DeadBeat Escape map, two bots started stuck under the house buried in the ground.
__________________
Mi.Cura | Modded Servers | L4D2
https://steamcommunity.com/groups/micuramodzombie

Last edited by Mi.Cura; 09-01-2022 at 10:20.
Mi.Cura is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode