AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Survivor Spawn Position Fix (Gabu's Version) (https://forums.alliedmods.net/showthread.php?t=338979)

gabuch2 08-07-2022 22:31

[L4D2] Survivor Spawn Position Fix (Gabu's Version)
 
1 Attachment(s)
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

thewintersoldier97 08-09-2022 07:00

Re: [L4D2] Survivor Spawn Position Fix (Gabu's Version)
 
Nice work!

Dragokas 08-09-2022 16:42

Re: [L4D2] Survivor Spawn Position Fix (Gabu's Version)
 
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 (Post 2785834)
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.

gabuch2 08-10-2022 22:18

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

Originally Posted by Dragokas (Post 2786017)
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 (Post 2786017)
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.

Omixsat 08-30-2022 03:05

Re: [L4D2] Survivor Spawn Position Fix (Gabu's Version)
 
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 :)

Mi.Cura 08-30-2022 10:16

Re: [L4D2] Survivor Spawn Position Fix (Gabu's Version)
 
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 08-31-2022 09:40

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

Originally Posted by gabuch2 (Post 2786153)
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:05:33: SourceMod error session started
L 08/31/2022 - 00:05:33: Info (map "c14m2_lighthouse") (file "c:\tcafiles\users\sergiok\21700\left4dead2\a ddons\sourcemod\logs\errors_20220831.log")
L 08/31/2022 - 00:05:33: [SM] Exception reported: Cannot create new entity when no map is running
L 08/31/2022 - 00:05:33: [SM] Blaming: l4d2_spawnpos_fix.smx
L 08/31/2022 - 00:05:33: [SM] Call stack trace:
L 08/31/2022 - 00:05:33: [SM] [0] CreateEntityByName
L 08/31/2022 - 00:05:33: [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:05:33: [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:05:33: [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 - 00:30:30: Error log file session closed.

gabuch2 09-01-2022 01:04

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

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

yabi 09-01-2022 09:31

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

Originally Posted by gabuch2 (Post 2787882)
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

Mi.Cura 09-01-2022 10:03

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

Originally Posted by gabuch2 (Post 2787882)
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 - 10:39:15: SourceMod error session started
L 09/01/2022 - 10:39:15: Info (map "c4m1_milltown_a") (file "c:\tcafiles\users\sergiok\21700\left4dead2\a ddons\sourcemod\logs\errors_20220901.log")
L 09/01/2022 - 10:39:15: [SM] Exception reported: Cannot create new entity when no map is running
L 09/01/2022 - 10:39:15: [SM] Blaming: l4d2_spawnpos_fix.smx
L 09/01/2022 - 10:39:15: [SM] Call stack trace:
L 09/01/2022 - 10:39:15: [SM] [0] CreateEntityByName
L 09/01/2022 - 10:39: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 - 10:39: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 - 10:39: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.


All times are GMT -4. The time now is 17:31.

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