|
|
#1 |
|
Banned
Join Date: May 2010
Reputation: 852
Posts: 4,540
|
Making it so you can see your legs in source games
It's been done in Left 4 Dead and in Garry's Mod as a Client side addon
In gmod the legs change based on your player model ( even completely new custom models not just stock ones) but like all gmod addons it's in lua Is there a way to convert this into c++ for use in source mods? I'll get the code later so you can look at it. |
|
|
|
|
|
#2 |
![]() Join Date: Sep 2010
Reputation: 35
Posts: 453
|
I have always wanted this feature, but still haven't tried to code it yet.
The EP2 mod "1187 Episode 1" does a great job at showing legs in first person. http://www.moddb.com/mods/1187 Try sending them a message and maybe they will share some code or push you in the right direction... Pretty sure you would have to model and animate the legs yourself too. |
|
|
|
|
|
#3 | |
|
Banned
Join Date: May 2010
Reputation: 852
Posts: 4,540
|
Quote:
Its not a perfect system but it dosent require any models or animating just coding and it works in multiplayer I believe it puts a screen at the bottom of your view and a camera under the screen or something bt I'm not sure sense I never looked at the code yet I want this feature fOr my multiplayer mod |
|
|
|
|
|
|
#4 |
![]() Join Date: Jul 2007
Reputation: 0
Posts: 106
|
http://pastebin.com/EpD258aS this code works great i got the hole body to show up just need to figure out how to move the body back.
|
|
|
|
|
|
#5 | |
![]() Join Date: Apr 2011
Reputation: 0
Posts: 167
|
Quote:
|
|
|
|
|
|
|
#6 |
![]() Join Date: Mar 2011
Reputation: 38
Posts: 387
|
it says C_BasePlayer so put it in c_baseplayer.cpp, it wont work for single player i think.
Last edited by tingtom: 06-11-2011 at 04:06 AM. |
|
|
|
|
|
#7 | ||
![]() Join Date: Jul 2007
Reputation: 0
Posts: 106
|
Show your leg's in SP Mod
I was board figured i'd clean this up. add animations from this tut first https://developer.valvesoftware.com/..._6:_Animations Then open c_baseplayer.cpp and search for bool IsInFreezeCam( void ) after return false add this Quote:
bool IsInEye( void ); then go back to c_baseplayer.cpp and search for bool C_BasePlayer::ShouldDraw() and make it look like this Quote:
virtual int DrawModel( int flags ); and add this underneath it const Vector& C_BasePlayer::GetRenderOrigin(); that's it hope that helps. Last edited by Zombie Killa: 04-10-2012 at 12:04 PM. Reason: Clean up |
||
|
|
|
|
|
#8 |
![]() Join Date: Dec 2009
Reputation: 1
Posts: 281
|
|
|
|
|
|
|
#9 |
![]() Join Date: Apr 2011
Reputation: 0
Posts: 167
|
Do you think it works for MP too?
|
|
|
|
|
|
#10 |
![]() Join Date: Jul 2007
Reputation: 0
Posts: 106
|
i think that's what it was originally made for.
|
|
|
|
|
|
#11 |
![]() Join Date: Apr 2011
Reputation: 0
Posts: 167
|
|
|
|
|
|
|
#12 |
![]() Join Date: Apr 2011
Reputation: 0
Posts: 167
|
Nope.. Here is what i get:
Code:
1>------ Build started: Project: Client HL2MP, Configuration: Release Win32 ------ 1>Compiling... 1>cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release 1>c_baseplayer.cpp 1>.\c_baseplayer.cpp(1221) : error C2509: 'GetRenderOrigin' : member function not declared in 'C_BasePlayer' 1> c:\lwgmferdyfist\Mod\src\game\client\c_baseplayer.h(61) : see declaration of 'C_BasePlayer' 1>.\c_baseplayer.cpp(1244) : error C3861: 'IsInEye': identifier not found 1>.\c_baseplayer.cpp(1256) : error C2065: 'MATERIAL_HEIGHTCLIPMODE_RENDER_' : undeclared identifier 1>.\c_baseplayer.cpp(1256) : error C2146: syntax error : missing ')' before identifier 'BELOW_HEIGHT' 1>.\c_baseplayer.cpp(1256) : error C2059: syntax error : ')' 1>.\c_baseplayer.cpp(1257) : error C2065: 'cl_legs_clip_heig' : undeclared identifier 1>.\c_baseplayer.cpp(1257) : error C2146: syntax error : missing ')' before identifier 'ht' 1>.\c_baseplayer.cpp(1257) : error C2059: syntax error : ')' 1>Build log was saved at "file://c:\LWGMFERDYFIST\Mod\src\game\client\Release_hl2mp\BuildLog.htm" 1>Client HL2MP - 8 error(s), 1 warning(s) ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ========== |
|
|
|
|
|
#13 |
|
Volunteer Moderator
Join Date: Oct 2007
Reputation: 275
Posts: 721
|
What code base are you using? I was curious about adding this to our mod but then I realised that the example given is for the OrangeBox SDK and no the EP1 SDK.
A lot of the classes/functions this code needs are in the OB (2007) SDK version only. |
|
|
|
|
|
#14 |
|
Guest
Posts: n/a
|
Hmm it seems the code in the fourth post isn't working
|
|
|
|
#15 |
![]() Join Date: Jun 2007
Reputation: 16
Posts: 187
|
I decided to give it a try as well, this is an interesting approach however it had a few significant flaws for me. If someone is interested, this is how I went around them (2007 HL2MP SDK BTW):
- the clip distance to hide upper body part is a nice trick, doesn't work well while crouching though. I decided to move head/arms to a different bodygroup which is displayed only when rendering other player. Therefore, I only had to render the player model back its original position - trains and other moving objects: since such entities aren't predicted, once player gets over them the model will lag like crazy. A hack for this is just disabling render if the train moves, don't think there's a real solution other than adding prediction to such entities - player model trails if rotation speed is excessive, I just force m_bForceAimYaw = true in ComputePoseParam_AimYaw. Hoping this is only a performance optimization and doesn't damage something else. Let me know if you need any extra info. |
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|