|
|
#1 |
![]() Join Date: Dec 2011
Reputation: 0
Posts: 12
|
SDK Template: missing HUD and general usability
I currently have a problem where I can compile the template just fine but once I load a map or create a server I do not have a HUD nor the sprint ability and chat usage. These are just some of the problems.
|
|
|
|
|
|
#2 |
![]() Join Date: Jul 2008
Reputation: 0
Posts: 389
|
What does CSDKPlayer::Spawn() look like
|
|
|
|
|
|
#3 |
![]() Join Date: Sep 2009
Reputation: 0
Posts: 122
|
is a modification of hl2 single player? if so, remember that you'd have to spawn with the suit to see hud and be able to use any function besides pciking up cans and shooting (if you'd pick upp a weapon). i belive there's an item called "item_suit" in hammer which spawns a suit much like the one you pick upp in the first game. let us know on your progress!
Edit: just noticed that it wasn't...my bad, never mind me! second edit: I'm currently working on a mod based on template, and the problem i find is (using teams, and classes) that there is no player start for the red nor the blue team in hammer. i don't remember what problems this gave me, but i had to open the SDK maps and copy the "player_red/blue_start" or whatever it was called. you might want to check that out if you havn't! Last edited by Fredrikli: 12-28-2011 at 11:17 PM. |
|
|
|
|
|
#4 | |
![]() Join Date: Dec 2011
Reputation: 0
Posts: 12
|
Quote:
Here's a raw dump of my CSDKPlayer::Spawn() (sorry for the spam )Code:
void CSDKPlayer::Spawn()
{
SetModel( SDK_PLAYER_MODEL ); //Tony; basically, leave this alone ;) unless you're not using classes or teams, then you can change it to whatever.
SetBloodColor( BLOOD_COLOR_RED );
SetMoveType( MOVETYPE_WALK );
RemoveSolidFlags( FSOLID_NOT_SOLID );
//Tony; if we're spawning in active state, equip the suit so the hud works. -- Gotta love base code !
if ( State_Get() == STATE_ACTIVE )
{
EquipSuit( false );
//Tony; bleh, don't do this here.
// GiveDefaultItems();
}
m_hRagdoll = NULL;
BaseClass::Spawn();
#if defined ( SDK_USE_STAMINA ) || defined ( SDK_USE_SPRINTING )
m_Shared.SetStamina( 100 );
#endif
#if defined ( SDK_USE_TEAMS )
m_bTeamChanged = false;
#endif
#if defined ( SDK_USE_PRONE )
InitProne();
#endif
#if defined ( SDK_USE_SPRINTING )
InitSprinting();
#endif
// update this counter, used to not interp players when they spawn
m_bSpawnInterpCounter = !m_bSpawnInterpCounter;
InitSpeeds(); //Tony; initialize player speeds.
SetArmorValue(SpawnArmorValue());
SetContextThink( &CSDKPlayer::SDKPushawayThink, gpGlobals->curtime + PUSHAWAY_THINK_INTERVAL, SDK_PUSHAWAY_THINK_CONTEXT );
pl.deadflag = false;
}
bool CSDKPlayer::SelectSpawnSpot( const char *pEntClassName, CBaseEntity* &pSpot )
{
// Find the next spawn spot.
pSpot = gEntList.FindEntityByClassname( pSpot, pEntClassName );
if ( pSpot == NULL ) // skip over the null point
pSpot = gEntList.FindEntityByClassname( pSpot, pEntClassName );
CBaseEntity *pFirstSpot = pSpot;
do
{
if ( pSpot )
{
// check if pSpot is valid
if ( g_pGameRules->IsSpawnPointValid( pSpot, this ) )
{
if ( pSpot->GetAbsOrigin() == Vector( 0, 0, 0 ) )
{
pSpot = gEntList.FindEntityByClassname( pSpot, pEntClassName );
continue;
}
// if so, go to pSpot
return true;
}
}
// increment pSpot
pSpot = gEntList.FindEntityByClassname( pSpot, pEntClassName );
} while ( pSpot != pFirstSpot ); // loop if we're not back to the start
DevMsg("CSDKPlayer::SelectSpawnSpot: couldn't find valid spawn point.\n");
return true;
}
|
|
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|