Skip to content

Commit b1f25d5

Browse files
committed
Added fix for NPC movement
1 parent 063e487 commit b1f25d5

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,22 @@
22

33
## ***A Source Engine Plugin for Portal 2 Source Mods that fixes and adds some QoL features for them!***
44

5-
> I originally planned `WorkshopStopper9000` to simply fix the workshop downloading issue, but I hope to add a bit more features and fixes so now it has become `P2SourceModPlusPlus`. Hopefully I can implement some good features that will be used by the community until the fated day Portal 2: Community Edition is released. Basically this is gonna be a temporarily solution for mod makers.
5+
> I originally planned `WorkshopStopper9000` to simply fix the workshop downloading issue, but I hope to add a bit more features and fixes so now it has become `P2SourceModPlusPlus`. Hopefully I can implement some good features that will be used by the community until the fated day Portal 2: Community Edition is released. Basically this is gonna be a temporarily solution for mod makers. Once P2:CE's public beta and/or release occurs, I will most likely not work on this anymore as most of the stuff here is fixed over there.
6+
7+
> [!WARNING]
8+
> This plugin was designed in mind for SourceMods, meaning mods loaded through the `sourcemods` folder in Steam. Not for Portal 2 mods that are on Steam.
9+
>
10+
> While this plugin should be fine for a Steam Portal 2 mod, note that:
11+
> 1. I do not know if Valve will allows such modifications on the Steam platform, especially if it's involving one of their games.
12+
> 2. Compatibility will not be 100% so expect bugs or other issues.
13+
> 3. I am not responsible if anything bad happens to your mod's place on Steam if you are using this plugin with your mod.
14+
>
15+
> I will in the future try and add custom elements that will involve interactions with Steam's API, like achievements, but for now don't expect this to properly work with Steam mods. Plus again, in the end, P2:CE will do this properly in the future.
616
717
### Features Implemented/Plan to Implement:
818

919
* Stopped workshop maps from being downloaded by the game because the workshop folder isn't on path for Source Mods. Because of this it tries to get ***ALL*** of them at once, which caused the game to be unstable and on occasion crash.
10-
* **(NOT IMPLEMENTED)** Fix human NPC movement so they don't jitter when they move.
20+
* Fix human NPC movement so they don't jitter when they move.
1121
* **(NOT IMPLEMENTED)** Option to turn on or off Puzzlemaker functionality. Most mods don't use the puzzlemaker, but it still loads in. The plugin will try to disable as much of it as possible so console is not filled with any puzzlemaker related errors or messages or any other additional bloat.
1222
* **(NOT IMPLEMENTED)** Custom Discord RPC for Portal 2 Source Mods.
1323
* **(NOT IMPLEMENTED)** Additional achievement support and features. Like custom achievements that span multiple maps that have more parts than Door Prize and Smash TV.

main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ bool CP2SMPlusPlusPlugin::Load(CreateInterfaceFn interfaceFactory, CreateInterfa
104104
ConnectTier1Libraries(&interfaceFactory, 1);
105105
ConnectTier2Libraries(&interfaceFactory, 1);
106106
ConVar_Register(0);
107+
108+
// cl_localnetworkbackdoor is causing NPCs to not move correctly thanks to Valve networking "optimizations".
109+
// Turn it off, nothing else should turn it back automatically while in game.
110+
if (ConVar* lnbCVar = g_pCVar->FindVar("cl_localnetworkbackdoor"))
111+
lnbCVar->SetValue(0);
107112

108113
// big ol' try catch because game has a TerminateProcess handler for exceptions...
109114
// why this wasn't here is mystifying, - 10/2024 NULLderef

main.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#pragma once
99

10-
#define P2SMPLUSPLUS_PLUGIN_VERSION "1.0.0" // Update this when a new version of the plugin is released.
10+
#define P2SMPLUSPLUS_PLUGIN_VERSION "1.1.0" // Update this when a new version of the plugin is released.
1111
#define P2SMPLUSPLUS_PLUGIN_CONSOLE_COLOR Color(100, 192, 252, 255) // Light Blue
1212

1313
#include "engine/iserverplugin.h"

0 commit comments

Comments
 (0)