Custom Code in a Stand-Alone Mod

Avatar
wrathofmobius
216 Posts
Posted Jan 20, 2012
Just a quick note - I apologize for the large amount of questions I've been asking lately. I hope it's just because I'm ambitious and not because I'm an idiot. :lol: (Although those can overlap)

Anyway, my question is about env_projectedtextures. Only one can be active at once but I want more than one, so I found this fix: https://developer.valvesoftware.com/wik ... ture/fixes
It requires overriding Portal 2's code, but I'm not sure how to do it. I have a playable mod set up in the sourcemods folder but I wasn't able to find anything about overriding code for Portal 2. How do I do this?

Advertisement
Registered users don’t see ads! Register now!
Avatar
spongylover123
944 Posts
Posted Jan 20, 2012
Replied 1 minutes later
You can, you need the program to code it, I think the entity is hard-coded in the game, so it can't me modified, unless Valve gives out the source code.
Alien Swarm's engine is almost like Portal 2, the source code is released, and they have the env_projectedtexture entity, try tinkering with that.
Avatar
wrathofmobius
216 Posts
Posted Jan 20, 2012
Replied 2 minutes later
Which program? Can you send me a link?
(BTW, congrats on post #22222 on the Mapping Help and Discussion forum)
Avatar
spongylover123
944 Posts
Posted Jan 20, 2012
Replied 2 minutes later

http://www.microsoft.com/visualstudio/e ... pp-express.
If you're on a Mac, X-Code.

Avatar
angelsl
34 Posts
Posted Jan 21, 2012
Replied 2 hours later
Valve never released the source to Portal 2's branch of the Source engine.

If you use Alien Swarm's engine, you probably won't be able to use portals and a lot of other things that were stripped out of the Alien Swarm branch.

Essentially, you can't apply that patch.

Avatar
spongylover123
944 Posts
Posted Jan 21, 2012
Replied 19 minutes later
The OP only wants the code for that specific entity (env_projectedtexture) available in "ALL" Source games since EP2, so it doesn't matter where the/she gets it. It's the same.
Avatar
angelsl
34 Posts
Posted Jan 21, 2012
Replied 42 minutes later

spongylover123 wrote:
The OP only wants the code for that specific entity (env_projectedtexture) available in "ALL" Source games since EP2, so it doesn't matter where the/she gets it. It's the same.

You can't simply modify that one source file, compile it and stick it into the game.

It is not like textures, maps, sounds etc which are stored in loose files that you can easily change and replace.

Rather, this is compiled into native code as an executable file (.exe) or dynamic link library (.dll). You can't really 'open it up' like an archive and replace that 'entity'.

If you happen to know x86 assembly, you could take months to disassemble the engine and try to apply that patch.

Avatar
spongylover123
944 Posts
Posted Jan 21, 2012
Replied 39 minutes later
They gave you the code. Not exe, not dlls. It's disassembled already. Try it yourself.
Advertisement
Registered users don’t see ads! Register now!
Avatar
angelsl
34 Posts
Posted Jan 21, 2012
Replied 2 hours later

spongylover123 wrote:
They gave you the code. Not exe, not dlls. It's disassembled already. Try it yourself.

They gave you the code, but it's not the code for the Portal 2 engine. It's either Alien Swarm or Source 2007. If you have the code for Portal 2's engine branch, then show me. We'd all love to have it. But Valve never released it.

You can't compile only one class (taking the C++ file from Alien Swarm for example) and expect to shove it back into Portal 2. This isn't Java or .NET or a scripting language or the like where you can easily do this.

And you can't compile the code (with the patch applied) from another engine because that engine is not Portal 2's engine, and it will not have the Portal-specific engine modifications.

If you're so sure, why not you try it out? I'm not going to try something I know won't work.