PLayer Models and Player Equip.

Jorg40

Spy
Joined
Dec 21, 2004
Messages
103
Reaction score
0
Ok, I've coded several things now, like the HUD and so on (currently working on this and walljumping)

1. What do I need to change so everybody always starts with the same player model in mp?

2. Where do I change so you only start with the crowbar in mp?

These are very two simple questions, but its alot to do alone for a coder, so I would preciate some help from the community. And if someone wants to join they can go here: http://unknown.gamemod.net

- Thx, The UL Dev Team
 
1 and 2 are not a lot to do alone. I assume you know how to use your compiler's search feature. Search for where in the code you are given a Gravity Gun (weapon_physcannon I think), and it should be just a case of commenting out lines.

As for player models, stick in the spawn function of the player "this->model([modelname])". Don't forget to add a precache.

-Angry Lawyer
 
When I said that it was alot to do, I meant the walljumping code, its very hard cause the code Im working on is based on SP not MP. But does "pev->rendermode = kRenderNormal;" work in HL2? I'm not so familiar with the HL2 sdk yet as I am to the SDK 2.3 for HL1, and I know how to use the search function (:P)

Thx for quick respond, and we will probably make a video soon to show off walljumping and some AI.
 
Anything preceded by "pev" doesn't work in HL2, because they removed the "Pev" class entirely, because it was a rather naff object.
HL1 tutorials are rather difficult to apply to HL2, the code has changed quite a bit.

-Angry Lawyer
 
I can see that I cant use old tutorials, I never used so many coding tut's for HL1 anyway. What shall I use for Rendering a target? For example when you fire pistol your player model renders kRenderGlow
 
It's all encapsulated in the actual entity, rather than in a "pev". On the client-side part of the object, use this->SetRenderColor(r,g,b,a), and this->SetRenderState([arguments that I don't really know]); Most weapons have some sort of GetOwner function, or something. Can't remember the specifics. Create a pointer to the player and run the effects on that.

-Angry Lawyer
 
Sounds cool :)

I'm starting to understand more and more of the SDK now as the time runs by and I am getting older... but wtf, time is an illusion.. so **** time...
 
I can't seem to figure out where the player is equiped with the weapons the hl2mp code. Were you able to change what weapons the player does and doesn't spawn with?
 
Hmm, I dont have my computer here, but I think its in player.cpp
 
Search for "GiveNamedItem(Weapon_Physcannon)" as it appears in the default loadout.

-Angry Lawyer
 
Ahaha! I'm such a n00b :D. Was searching the client section instead of the hl section. Found it in the hl\source\hl2mp_player.cpp
 
Back
Top