Krzyhau / KrzyMod

Chaos Mod for Portal 2
Other
22 stars 2 forks source link

How did you develop this? #13

Closed karl-police closed 2 years ago

karl-police commented 2 years ago

How did you develop this?

Like, not sure.

But I don't think there's a documentation or something for Portal 2 or how to create plugins for Portal 2.

How did you create it?

misleadingname commented 2 years ago

It is called OSS for a reason :eyes:

karl-police commented 2 years ago

It is called OSS for a reason 👀

Yeah, but I don't understand everything. Like, does Portal 2 have a thing that let's people create stuff like that, or is it like an injector?

Krzyhau commented 2 years ago

Source Engine has a built-in support for server plugins, which allows you to load the plugin in the game without injecting it using plugin_load command, and also exposes several functions for you to work with. However, that's not nearly enough, so we supplement these with structures, references and hooks that we've either figured out from the source code of publicly available Source Engine branches or just reverse-engineering.

The plugin was heavily based on SourceAutoRecord. I recommend looking at its source code to see more examples of the crazy stuff that makes everything works.