User:Alvin/Sandbox: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎NPC State: new section)
(Sounds)
Line 45: Line 45:
Tagalog, pwede ba? :(
Tagalog, pwede ba? :(


== NPC State ==
Sounds
//
//-----------------------------------------------------
virtual CanPlaySequence_t CanPlaySequence( bool fDisregardState, int interruptLevel );


//-----------------------------------------------------
virtual bool CanPlaySentence( bool fDisregardState ) { return IsAlive(); }
//
virtual int PlaySentence( const char *pszSentence, float delay, float volume, soundlevel_t soundlevel, CBaseEntity *pListener = NULL );
// NPC State
virtual int PlayScriptedSentence( const char *pszSentence, float delay, float volume, soundlevel_t soundlevel, bool bConcurrent, CBaseEntity *pListener );
//
 
//-----------------------------------------------------
virtual bool FOkToMakeSound( int soundPriority = 0 );
inline void SetIdealState( NPC_STATE eIdealState );
virtual void JustMadeSound( int soundPriority = 0, float flSoundLength = 0.0f );
inline NPC_STATE GetIdealState();
virtual NPC_STATE SelectIdealState( void );


void SetState( NPC_STATE State );
virtual void DeathSound( const CTakeDamageInfo &info ) { return; };
virtual bool ShouldGoToIdleState( void ) { return ( false ); }
virtual void AlertSound( void ) { return; };
virtual void OnStateChange( NPC_STATE OldState, NPC_STATE NewState ) {/*Base class doesn't care*/};
virtual void IdleSound( void ) { return; };
virtual void PainSound( const CTakeDamageInfo &info ) { return; };
NPC_STATE GetState( void ) { return m_NPCState; }
virtual void FearSound( void ) { return; };
virtual void LostEnemySound( void ) { return; };
virtual void FoundEnemySound( void ) { return; };
virtual void BarnacleDeathSound( void ) { CTakeDamageInfo info; PainSound( info ); }


AI_Efficiency_t GetEfficiency() const { return m_Efficiency; }
virtual void SpeakSentence( int sentenceType ) { return; };
void SetEfficiency( AI_Efficiency_t efficiency ) { m_Efficiency = efficiency; }
virtual bool ShouldPlayIdleSound( void );
AI_MoveEfficiency_t GetMoveEfficiency() const { return m_MoveEfficiency; }
void SetMoveEfficiency( AI_MoveEfficiency_t efficiency ) { m_MoveEfficiency = efficiency; }
virtual void UpdateEfficiency( bool bInPVS );
void ForceDecisionThink() { m_flNextDecisionTime = 0; SetEfficiency( AIE_NORMAL ); }


bool IsFlaggedEfficient() const { return HasSpawnFlags( SF_NPC_START_EFFICIENT ); }
virtual void MakeAIFootstepSound( float volume, float duration = 0.5f );


AI_SleepState_t GetSleepState() const { return m_SleepState; }
//---------------------------------
void SetSleepState( AI_SleepState_t sleepState ) { m_SleepState = sleepState; }
void AddSleepFlags( int flags ) { m_SleepFlags |= flags; }
void RemoveSleepFlags( int flags ) { m_SleepFlags &= ~flags; }
bool HasSleepFlags( int flags ) { return (m_SleepFlags & flags) == flags; }


void UpdateSleepState( bool bInPVS );
virtual CAI_Expresser *GetExpresser() { return NULL; }
virtual void Wake( bool bFireOutput = true );
const CAI_Expresser *GetExpresser() const { return const_cast<CAI_BaseNPC *>(this)->GetExpresser(); }
void Sleep();
bool WokeThisTick() const;

Revision as of 20:03, 19 July 2011

Source Engine 2009

"Garry's Mod" (Tools > Options > Edit > Add)

Game Data Files: (orangebox/bin) HalfLife2.fgd = Ep2 (HL2 as well) base.fgd cstrike.fgd = CS:S dod.fgd = DoD:S hl2mp.fgd = HL2:DM (could be needed) portal.fgd = Portal tf.fgd = TF2 (garrysmod/garrysmod) Garrysmod.fgd (optional lang.)


Default Point Entity class: info_player_start

Default SolidEntity class: func_detail

Cordon Texture: tools/toolsskybox

Game Executable Directory: $SteamUserDir\garrysmod

Game Directory: $SteamUserDir\garrysmod\garrysmod

Hammer VMF Directory: (Where you want to save and load VMF saves for Garrysmod) i use.. $SteamUserDir\garrysmod\garrysmod\maps\vmf

Now go to the last Tab, Build programs..

Game Executable: $SteamUserDir\garrysmod\hl2.exe

BSP $SteamUserDir\sourcesdk\bin\orangebox\bin\vbsp.exe

VIS $SteamUserDir\sourcesdk\bin\orangebox\bin\vvis.exe

RAD $SteamUserDir\sourcesdk\bin\orangebox\bin\vrad.exe

Place compiled maps... $SteamUserDir\garrysmod\garrysmod\maps

It will say that the changes will show when you open hammer another time but you need to restart Source SDK if you made a new config in order to see your new config in the selection menu.


Tagalog, pwede ba? :(

Sounds // //----------------------------------------------------- virtual CanPlaySequence_t CanPlaySequence( bool fDisregardState, int interruptLevel );

virtual bool CanPlaySentence( bool fDisregardState ) { return IsAlive(); } virtual int PlaySentence( const char *pszSentence, float delay, float volume, soundlevel_t soundlevel, CBaseEntity *pListener = NULL ); virtual int PlayScriptedSentence( const char *pszSentence, float delay, float volume, soundlevel_t soundlevel, bool bConcurrent, CBaseEntity *pListener );

virtual bool FOkToMakeSound( int soundPriority = 0 ); virtual void JustMadeSound( int soundPriority = 0, float flSoundLength = 0.0f );

virtual void DeathSound( const CTakeDamageInfo &info ) { return; }; virtual void AlertSound( void ) { return; }; virtual void IdleSound( void ) { return; }; virtual void PainSound( const CTakeDamageInfo &info ) { return; }; virtual void FearSound( void ) { return; }; virtual void LostEnemySound( void ) { return; }; virtual void FoundEnemySound( void ) { return; }; virtual void BarnacleDeathSound( void ) { CTakeDamageInfo info; PainSound( info ); }

virtual void SpeakSentence( int sentenceType ) { return; }; virtual bool ShouldPlayIdleSound( void );

virtual void MakeAIFootstepSound( float volume, float duration = 0.5f );

//---------------------------------

virtual CAI_Expresser *GetExpresser() { return NULL; } const CAI_Expresser *GetExpresser() const { return const_cast<CAI_BaseNPC *>(this)->GetExpresser(); }