Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding

Reply
 
Thread Tools Display Modes
Old 12-28-2011, 11:54 AM   #1
ledjohnny
 
 
 
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.
ledjohnny is offline  
Reply With Quote
Old 12-28-2011, 07:44 PM   #2
shadow-killer
 
Join Date: Jul 2008
Reputation: 0
Posts: 389
What does CSDKPlayer::Spawn() look like
shadow-killer is offline   Reply With Quote
Old 12-28-2011, 11:10 PM   #3
Fredrikli
 
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.
Fredrikli is offline   Reply With Quote
Old 12-29-2011, 12:48 AM   #4
ledjohnny
 
 
 
Join Date: Dec 2011
Reputation: 0
Posts: 12
Quote:
Originally Posted by Fredrikli View Post
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!
Exactly, you get a HUD when a weapon is picked up. But yea there is no team/class selection!

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;
}
ledjohnny is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -7. The time now is 09:49 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2014, All Rights Reserved.