Skip to content

v1.1.0 Merge From Dev to Main #1

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

Merged
merged 33 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b1f25d5
Added fix for NPC movement
OrsellGaming Mar 9, 2025
fe342d7
Added statement to make r_drawscreenoverlay enabled by default
OrsellGaming Mar 11, 2025
c5f43b8
Updated README with new fixes.
OrsellGaming Mar 11, 2025
1a94130
Renamed main to p2sm
OrsellGaming Mar 11, 2025
4fbc01d
Updated includes
OrsellGaming Mar 12, 2025
512be62
Removed non established header file or github build builds
OrsellGaming Mar 12, 2025
efd3e21
Added sdk and global files from P2MM because they have some use funct…
OrsellGaming Mar 23, 2025
9049aaa
Updated logging and moved some stuff around to work with new sdk and …
OrsellGaming Mar 23, 2025
0dfd58c
Made r_drawscreenoverlay enable on clients who join hosts for multipl…
OrsellGaming Mar 23, 2025
2504550
Update README.md
OrsellGaming Mar 25, 2025
97b8888
Update README.md
OrsellGaming Mar 25, 2025
825987b
Fixed some small bits that I forgot to update.
OrsellGaming Mar 25, 2025
7700fc0
Updated working and info on the README.
OrsellGaming Apr 16, 2025
55db06e
Updated comments and string descriptions
OrsellGaming Apr 16, 2025
6ee69fd
Added member variable to store the Window Handle for the game.
OrsellGaming Apr 16, 2025
bc2c941
Added plugin "logo" when loading plugin.
OrsellGaming Apr 16, 2025
202bac3
Updated list of things that are implemented and what needs to be impl…
OrsellGaming Apr 16, 2025
9c98b56
Update .gitignore
OrsellGaming Apr 16, 2025
bf1673f
Added debug and release build modes for the plugin
OrsellGaming Apr 16, 2025
2edff84
Removed extra include
OrsellGaming Apr 16, 2025
54d35bf
Minor cleaning
OrsellGaming Apr 16, 2025
0aaea2d
Moved m_hWnd to be a global variable as hWnd
OrsellGaming Apr 16, 2025
88a5532
Added g_pGlobals and IPlayerInfoManager as available interfaces to lo…
OrsellGaming Apr 16, 2025
41e2252
Removed UTIL_GetLocalPlayer fix for dedicated servers
OrsellGaming Apr 16, 2025
893574d
Added CPortal_Player flashlight on and off hooks
OrsellGaming Apr 16, 2025
92d495a
Replaced workshop stopping hooks with improved one that is more stable
OrsellGaming Apr 16, 2025
fc78960
Reordered operations in plugin load and unload as well as adding new …
OrsellGaming Apr 16, 2025
187cad0
Fix: Made sure that unloading actually reset ConVars
OrsellGaming Apr 16, 2025
5da86f0
Updated README to include what features are now available
OrsellGaming Apr 16, 2025
9aa622b
Included both P2MM and P2SM++ licenses on repo
OrsellGaming Apr 16, 2025
0115aab
Removed P2MM's license from the README because now the file itself is…
OrsellGaming Apr 16, 2025
a80811b
Update README.md
OrsellGaming Apr 16, 2025
6153e8a
Cleaned up wording of sentences
OrsellGaming Apr 16, 2025
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@
/Release
p2sm.vcxproj.user
/.idea
p2sm.sln.DotSettings.user
copy.bat
/Build
21 changes: 21 additions & 0 deletions LICENSE_P2MM
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Portal 2: Multiplayer Mod Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
File renamed without changes.
85 changes: 45 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,56 @@
# ***P2SourceModPlusPlus*** (Formerly ***WorkshopStopper9000***)

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

> [!NOTE]
> I originally planned `WorkshopStopper9000` to fix the workshop downloading issue, but I hope to add more features and fixes, so now it has become `P2SourceModPlusPlus`. I plan to implement some good features the community will use until the fated day Portal 2: Community Edition (P2:CE) is released. This plugin will act as a temporary solution for mod makers. Once P2:CE's public beta and/or release occurs, I will probably not work on this anymore, as most of the stuff here is fixed over there.

> [!WARNING]
> This plugin was designed in mind for SourceMods, meaning mods loaded through the `sourcemods` folder in Steam. This is not for Portal 2 mods on Steam's store, which can be installed through Steam.
>
> While this plugin should be ok for a Steam Portal 2 mod, note that:
>
> 1. I do not know if Valve will allow such modifications on the Steam platform, especially if it involves one of their games.
> 2. Compatibility will not be 100%, so expect bugs or other issues.
> 3. If you are using this plugin with your mod, I am not responsible if anything bad happens to your mod's page on Steam.
>
> Ideally, if you wish to have some of these features but want to be able to have your mod on Steam, wait for P2:CE to release rather than using this.
>
> I will, in the future, try to add custom elements involving interactions with Steam's API, like achievements, but for now, I don't expect this to work correctly with Steam mods. Plus, in the end, P2:CE will do this properly in the future.

### Features Implemented/Potentially Plan to Implement:

* Stopped workshop maps from being downloaded by the game because the base game's workshop folder isn't on path for SourceMods. Because of this, it tries to get ***ALL*** of them at once, which causes the game to be unstable and occasionally crash.
* Fixed human NPC movement so they don't jitter when they move. `cl_localnetworkbackdoor` is automatically set to 0 without manual adjustment.
* Made `r_screenoverlay` ConVar be enabled by default and not need cheats so `env_screenoverlay` entities can work correctly without `sv_cheats` being needed.
* Added a ConVar to enable instant respawns for multiplayer. Skips those moments in the third-person death cam before respawn.
* Fixed linked portal doors causing crashes on multiplayer when players enter them.
* Increased the max VScript VM runtime so that VScript operations like `for` and `while` loops run without problems. This helps give more leeway in doing things in VScript without the engine complaining and shutting down the rest of the script, spewing errors in the console. While it depends on how the script was programmed and what it is doing, I occasionally notice this, and this fix helps eliminate it.
* Fixed the player flashlight impulse ConCommand, so it no longer requires cheats to be enabled. All that is needed is a key bound to `impulse 100`. However, the flashlight doesn't work perfectly with portals, snapping to odd positions when moving through and unable to shine through portals.
* **(NOT IMPLEMENTED)** Add a ConVar to disable multiplayer death icons.
* **(NOT IMPLEMENTED)** Allow more than one env_projectedtexture to be on at once. However, the engine limit of eight is still enforced! That can not be fixed.
* **(NOT IMPLEMENTED)** Option to turn on or off puzzle maker functionality. Most mods don't use the puzzle maker, but it still loads in. The plugin will try to disable as much of it as possible so the console is not filled with any puzzle-maker-related errors, messages, or other additional bloat.
* **(NOT IMPLEMENTED)** Custom Discord RPC for Portal 2 SourceMods.
* **(NOT IMPLEMENTED)** Additional achievement support and features. Like custom achievements that span multiple maps and have more parts than Door Prize and Smash TV.
* **(NOT IMPLEMENTED)** As informed by MarvinG, `env_sun` disappears when over player crosshair. I have not been able to confirm this and have never noticed it in general.
* **(NOT IMPLEMENTED)** When in water, the player is pushed to the world's origin.
* **(NOT IMPLEMENTED)** Fix SourceMods only getting a small 2 MB of memory for material system render context allocation, increasing it to 6 MB. This could happen if this gets ported to SAR or P2SRM.
* **(NOT IMPLEMENTED)** Linux support.
* **(NOT IMPLEMENTED)** Implement some VScript functions and hooks to capture specific events, turn ConVars on or off, and fix and add new VScript functions.

> 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.

### Features Implemented/Plan to Implement:
### Download and Install Instructions:

* 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.
* **(NOT IMPLEMENTED)** Fix human NPC movement so they don't jitter when they move.
* **(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.
* **(NOT IMPLEMENTED)** Custom Discord RPC for Portal 2 Source Mods.
* **(NOT IMPLEMENTED)** Additional achievement support and features. Like custom achievements that span multiple maps that have more parts than Door Prize and Smash TV.
* **(NOT IMPLEMENTED)** Use of player flashlight without needing cheats enabled.
* **(NOT IMPLEMENTED)** By default have env_screenoverlay entities not need the `r_screenoverlay` ConVar be enabled.
Download the latest `addons.zip` under the `Releases` tab on GitHub and extract its folder into the base directory of your SourceMod. Portal 2 should automatically start the plugin up with the game. You should be able to see log messages from the plugin in the developer console if it is loaded. That's it. Please create an Issue post on the plugin's repository if there are any issues. I'll get to it within the next 20 years. (Hopefully not).

### Download and Install Instructions:
> [!IMPORTANT]
> If Portal 2: Multiplayer Mod is running along with P2SM++, P2SM++'s hooks, configs, and settings will take priority over Portal 2: Multiplayer Mod's. If P2SM++ patches the same things that P2:MM does, P2:MM ignores patching as P2SM++ has already done it. Note: P2:MM assumes that it is being loaded second based on how it is loaded normally with the launcher and with a `tempcontent` folder.

Download the latest `addons.zip` under the `Releases` tab on GitHub and extract its folder into the base directory of your Source Mod. Portal 2 should automatically start the plugin up with the game and thus stop the game from downloading workshop maps. You should be able to see a message in the developer console from the plugin if it loaded. That's it. This took about 20 minutes to make, so please create an Issue post on the plugin's repository if there are any issues. I'll get to it within the next 20 years.
**As of writing, 11/10/2024, the plugin is only compatible with Windows. The signature scanner it uses still needs to be compatible with Linux, plus overall, the way the P2:MM plugin is structured (this plugin is built off of some of the P2:MM plugin code as a base), it's impossible to compile for Linux anyway. Literally 1984, I know, but I don't have enough time or experience to figure it out by myself. Linux users should still be able to get away with using Proton or similar to be able to use the plugin's Windows `.dll`. Hopefully, one day, this can be fixed...**

**As of writing, 11/10/2024, the plugin is only compatible with Windows. The signature scanner it uses still needs to be compatible with Linux, plus overall, the way the P2:MM plugin is structured (this plugin is built off of some of P2:MM plugin code as a base), it's impossible to compile for Linux anyway. Literally 1984, I know, but I don't have enough time or experience to figure it out by myself. Linux users should still be able to get away with using Proton or similar to be able to use the plugin's Windows `.dll`. Hopefully, one day, this can be fixed...**
**Update 3/24/2025: I plan to move this over to a forked version of SAR using its code base as a base for this plugin. Its structure is much better, it has more engine functionality accessible in the plugin, and it compiles for Linux. However, do not expect this switch to happen anytime soon. Thank you for being so patient.**

***
Please credit either Orsell/OrsellGaming, Nanoman2525, and NULLderef, or the `Portal 2: Multiplayer Mod Team` if you use this plugin or its code in any way with your Source Mod.
You must also include this repository and P2:MM's license file with the plugin.
Please credit Orsell/OrsellGaming, Nanoman2525, NULLderef, and/or the `Portal 2: Multiplayer Mod Team` if you use this plugin or its code in any way with your SourceMod.
You'll also need to include this repository and P2:MM's license file with the plugin.
Both licenses will be included with the `addon.zip` file you download to get the plugin.
***

```c++
MIT License

Copyright (c) 2024 Portal 2: Multiplayer Mod Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
Loading
Loading