|
|
Рандомные модели
| |
HellMapper | Дата: Среда, 09.12.2009, 14:15 | Сообщение # 41 |
Scout
Группа: Проверенные
Сообщений: 588
Репутация: 27
Статус: Offline
| сегодня разберусь
Я живу в будущем City 15
Если Вы можете, играя в "Counter-Strike: Sourсe", посадить хедшот ножом через стену в попу своему противнику, который находится на другом конце карты, на другом сервере, и который играет в "Team Fortress 2" и находится под действием убер-заряда, то знайте, что в плане читерства вы достигли совершенства. ©IPa
|
|
| |
Hitmen | Дата: Среда, 09.12.2009, 17:54 | Сообщение # 42 |
Spy
Группа: Проверенные
Сообщений: 2104
Репутация: 84
Статус: Offline
| Я уже пытаюсь разобраться, только всё та жа ошибка. В perecache занёс, но не выходит. Добавлено (09.12.2009, 17:54) --------------------------------------------- Вот код, который у меня. в чём проблема, не знаю, может не так рандом задал? Code //========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: // //=============================================================================//
#include "cbase.h" #include "ai_default.h" #include "ai_task.h" #include "ai_schedule.h" #include "ai_node.h" #include "ai_hull.h" #include "ai_hint.h" #include "ai_squad.h" #include "ai_senses.h" #include "ai_navigator.h" #include "ai_motor.h" #include "ai_behavior.h" #include "ai_baseactor.h" #include "ai_behavior_lead.h" #include "ai_behavior_follow.h" #include "ai_behavior_standoff.h" #include "ai_behavior_assault.h" #include "npc_playercompanion.h" #include "soundent.h" #include "game.h" #include "npcevent.h" #include "activitylist.h" #include "vstdlib/random.h" #include "engine/IEngineSound.h" #include "sceneentity.h" #include "ai_behavior_functank.h"
// memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h"
ConVar sk_Bms_health( "sk_Bms_health","0");
//========================================================= // Barney activities //=========================================================
class CNPC_Bms : public CNPC_PlayerCompanion { public: DECLARE_CLASS( CNPC_Bms, CNPC_PlayerCompanion ); DECLARE_SERVERCLASS(); DECLARE_DATADESC();
void Spawn( void ); void SelectModel(); Class_T Classify( void ); void Weapon_Equip( CBaseCombatWeapon *pWeapon ); void HandleAnimEvent( animevent_t *pEvent ); void Precache();
bool CreateBehaviors( void ); bool ShouldLookForBetterWeapon() { return false; }
void OnChangeRunningBehavior( CAI_BehaviorBase *pOldBehavior, CAI_BehaviorBase *pNewBehavior );
void DeathSound( const CTakeDamageInfo &info ); void GatherConditions(); void UseFunc( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
CAI_FuncTankBehavior m_FuncTankBehavior; COutputEvent m_OnPlayerUse;
DEFINE_CUSTOM_AI; };
LINK_ENTITY_TO_CLASS( npc_bms, CNPC_Bms );
//--------------------------------------------------------- // //--------------------------------------------------------- IMPLEMENT_SERVERCLASS_ST(CNPC_Bms, DT_NPC_Bms) END_SEND_TABLE()
//--------------------------------------------------------- // Random models //---------------------------------------------------------
const static char *ModelNames[] = { "models/blackmesa/security/male_03.mdl", "models/blackmesa/security/male_05.mdl", "models/blackmesa/security/male_06.mdl", "models/blackmesa/security/male_09.mdl", };
//--------------------------------------------------------- // Save/Restore //--------------------------------------------------------- BEGIN_DATADESC( CNPC_Bms ) // m_FuncTankBehavior DEFINE_OUTPUT( m_OnPlayerUse, "OnPlayerUse" ), DEFINE_USEFUNC( UseFunc ), END_DATADESC()
//--------------------------------------------------------- // Perecache //---------------------------------------------------------
void CNPC_Bms::Precache() { // Prevents a warning SelectModel();
PrecacheModel("models/blackmesa/security/male_03.mdl"); PrecacheModel("models/blackmesa/security/male_05.mdl"); PrecacheModel("models/blackmesa/security/male_06.mdl"); PrecacheModel("models/blackmesa/security/male_09.mdl");
PrecacheScriptSound( "NPC_Barney.FootstepLeft" ); PrecacheScriptSound( "NPC_Barney.FootstepRight" ); PrecacheScriptSound( "NPC_Barney.Die" );
PrecacheInstancedScene( "scenes/Expressions/BarneyIdle.vcd" ); PrecacheInstancedScene( "scenes/Expressions/BarneyAlert.vcd" ); PrecacheInstancedScene( "scenes/Expressions/BarneyCombat.vcd" );
BaseClass::Precache(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CNPC_Bms::SelectModel() { SetModel( ModelNames[ random->RandomInt( 0, ARRAYSIZE( ModelNames ) - 1 ) ] ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CNPC_Bms::Spawn( void ) { Precache();
m_iHealth = 80;
m_iszIdleExpression = MAKE_STRING("scenes/Expressions/BarneyIdle.vcd"); m_iszAlertExpression = MAKE_STRING("scenes/Expressions/BarneyAlert.vcd"); m_iszCombatExpression = MAKE_STRING("scenes/Expressions/BarneyCombat.vcd");
BaseClass::Spawn();
AddEFlags( EFL_NO_DISSOLVE | EFL_NO_MEGAPHYSCANNON_RAGDOLL | EFL_NO_PHYSCANNON_INTERACTION );
NPCInit();
SetUse( &CNPC_Bms::UseFunc ); }
//----------------------------------------------------------------------------- // Purpose: // Output : //----------------------------------------------------------------------------- Class_T CNPC_Bms::Classify( void ) { return CLASS_PLAYER_ALLY_VITAL; }
//----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void CNPC_Bms::Weapon_Equip( CBaseCombatWeapon *pWeapon ) { BaseClass::Weapon_Equip( pWeapon );
if( hl2_episodic.GetBool() && FClassnameIs( pWeapon, "weapon_ar2" ) ) { // Allow Barney to defend himself at point-blank range in c17_05. pWeapon->m_fMinRange1 = 0.0f; } }
//--------------------------------------------------------- //--------------------------------------------------------- void CNPC_Bms::HandleAnimEvent( animevent_t *pEvent ) { switch( pEvent->event ) { case NPC_EVENT_LEFTFOOT: { EmitSound( "NPC_Barney.FootstepLeft", pEvent->eventtime ); } break; case NPC_EVENT_RIGHTFOOT: { EmitSound( "NPC_Barney.FootstepRight", pEvent->eventtime ); } break;
default: BaseClass::HandleAnimEvent( pEvent ); break; } }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void CNPC_Bms::DeathSound( const CTakeDamageInfo &info ) { // Sentences don't play on dead NPCs SentenceStop();
EmitSound( "npc_barney.die" );
}
bool CNPC_Bms::CreateBehaviors( void ) { BaseClass::CreateBehaviors(); AddBehavior( &m_FuncTankBehavior );
return true; }
void CNPC_Bms::OnChangeRunningBehavior( CAI_BehaviorBase *pOldBehavior, CAI_BehaviorBase *pNewBehavior ) { if ( pNewBehavior == &m_FuncTankBehavior ) { m_bReadinessCapable = false; } else if ( pOldBehavior == &m_FuncTankBehavior ) { m_bReadinessCapable = IsReadinessCapable(); }
BaseClass::OnChangeRunningBehavior( pOldBehavior, pNewBehavior ); }
//----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void CNPC_Bms::GatherConditions() { BaseClass::GatherConditions();
// Handle speech AI. Don't do AI speech if we're in scripts unless permitted by the EnableSpeakWhileScripting input. if ( m_NPCState == NPC_STATE_IDLE || m_NPCState == NPC_STATE_ALERT || m_NPCState == NPC_STATE_COMBAT || ( ( m_NPCState == NPC_STATE_SCRIPT ) && CanSpeakWhileScripting() ) ) { DoCustomSpeechAI(); } }
//----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void CNPC_Bms::UseFunc( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { m_bDontUseSemaphore = true; SpeakIfAllowed( TLK_USE ); m_bDontUseSemaphore = false;
m_OnPlayerUse.FireOutput( pActivator, pCaller ); }
//----------------------------------------------------------------------------- // // Schedules // //-----------------------------------------------------------------------------
AI_BEGIN_CUSTOM_NPC( npc_Bms, CNPC_Bms )
AI_END_CUSTOM_NPC()
Туториалы по программированию, мои и слегка изменённые чужие. :)
Sp@ce Project Blog Sp@ce Project Web-Site
I'm in spaaace! Я в контакте Я в Facebook'е
|
|
| |
HellMapper | Дата: Среда, 09.12.2009, 18:05 | Сообщение # 43 |
Scout
Группа: Проверенные
Сообщений: 588
Репутация: 27
Статус: Offline
| Quote (Hitmen) void CNPC_Bms::SelectModel() { SetModel( ModelNames[ random->RandomInt( 0, ARRAYSIZE( ModelNames ) - 1 ) ] ); } ты перед SetModel всобачь Precache();
Я живу в будущем City 15
Если Вы можете, играя в "Counter-Strike: Sourсe", посадить хедшот ножом через стену в попу своему противнику, который находится на другом конце карты, на другом сервере, и который играет в "Team Fortress 2" и находится под действием убер-заряда, то знайте, что в плане читерства вы достигли совершенства. ©IPa
|
|
| |
Strider | Дата: Среда, 09.12.2009, 18:09 | Сообщение # 44 |
Spy
Группа: Проверенные
Сообщений: 1465
Репутация: 51
Статус: Offline
| Hitmen, Ты забыл в void CNPC_Bms::Spawn прописать SelectModel();
|
|
| |
HellMapper | Дата: Среда, 09.12.2009, 20:09 | Сообщение # 45 |
Scout
Группа: Проверенные
Сообщений: 588
Репутация: 27
Статус: Offline
| Code //========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: This is the soldier version of the combine, analogous to the HL1 grunt. // //=============================================================================//
#include "cbase.h" #include "ai_hull.h" #include "ai_motor.h" #include "npc_combines.h" #include "bitstring.h" #include "engine/IEngineSound.h" #include "soundent.h" #include "ndebugoverlay.h" #include "npcevent.h" #include "hl2/hl2_player.h" #include "game.h" #include "ammodef.h" #include "explode.h" #include "ai_memory.h" #include "Sprite.h" #include "soundenvelope.h" #include "weapon_physcannon.h" #include "hl2_gamerules.h" #include "gameweaponmanager.h" #include "vehicle_base.h" #include <vstdlib/random.h>
// memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h"
ConVar sk_combine_s_health( "sk_combine_s_health","0"); ConVar sk_combine_s_kick( "sk_combine_s_kick","0");
ConVar sk_combine_guard_health( "sk_combine_guard_health", "0"); ConVar sk_combine_guard_kick( "sk_combine_guard_kick", "0"); // Whether or not the combine guard should spawn health on death ConVar combine_guard_spawn_health( "combine_guard_spawn_health", "1" );
extern ConVar sk_plr_dmg_buckshot; extern ConVar sk_plr_num_shotgun_pellets;
//Whether or not the combine should spawn health on death ConVar combine_spawn_health( "combine_spawn_health", "1" );
LINK_ENTITY_TO_CLASS( npc_combine_s, CNPC_CombineS );
#define AE_SOLDIER_BLOCK_PHYSICS 20 // trying to block an incoming physics object
extern Activity ACT_WALK_EASY; extern Activity ACT_WALK_MARCH;
//----------------------------------------------------------------------------- // Purpose: //-----------------------------------------------------------------------------
//----------------------------------------------------------------------------- // Purpose: // Input : // Output : //----------------------------------------------------------------------------- const static char *RandomModels[] = { /////////////////////RussianS_Troopers///////////////////////// "models/Taggart/RussianS_Troopers/beret_soldier.mdl", "models/Taggart/RussianS_Troopers/boonie_soldier.mdl", "models/Taggart/RussianS_Troopers/commander.mdl", "models/Taggart/RussianS_Troopers/gear_soldier.mdl", "models/Taggart/RussianS_Troopers/goggles_soldier.mdl", "models/Taggart/RussianS_Troopers/helmet_goggles_soldier.mdl", "models/Taggart/RussianS_Troopers/visor_soldier.mdl", "models/Taggart/RussianS_Troopers/visor_soldier_visor_up.mdl", ////////////////////woodomoh_Troopers//////////////////////// "models/Taggart/woodomoh_Troopers/beret_soldier.mdl", "models/Taggart/woodomoh_Troopers/boonie_soldier.mdl", "models/Taggart/woodomoh_Troopers/commander.mdl", "models/Taggart/woodomoh_Troopers/gear_soldier.mdl", "models/Taggart/woodomoh_Troopers/goggles_soldier.mdl", "models/Taggart/woodomoh_Troopers/helmet_goggles_soldier.mdl", "models/Taggart/woodomoh_Troopers/visor_soldier.mdl", "models/Taggart/woodomoh_Troopers/visor_soldier_visor_up.mdl", ///////////////////Woodsobr_Troopers///////////////////////// "models/Taggart/Woodsobr_Troopers/beret_soldier.mdl", "models/Taggart/Woodsobr_Troopers/boonie_soldier.mdl", "models/Taggart/Woodsobr_Troopers/commander.mdl", "models/Taggart/Woodsobr_Troopers/gear_soldier.mdl", "models/Taggart/Woodsobr_Troopers/goggles_soldier.mdl", "models/Taggart/Woodsobr_Troopers/helmet_goggles_soldier.mdl", "models/Taggart/Woodsobr_Troopers/visor_soldier.mdl", "models/Taggart/Woodsobr_Troopers/visor_soldier_visor_up.mdl", };
void CNPC_CombineS::Precache() { PrecacheModel("models/Taggart/RussianS_Troopers/beret_soldier.mdl"); PrecacheModel("models/Taggart/RussianS_Troopers/boonie_soldier.mdl"); PrecacheModel("models/Taggart/RussianS_Troopers/commander.mdl"); PrecacheModel("models/Taggart/RussianS_Troopers/gear_soldier.mdl"); PrecacheModel("models/Taggart/RussianS_Troopers/goggles_soldier.mdl"); PrecacheModel("models/Taggart/RussianS_Troopers/helmet_goggles_soldier.mdl"); PrecacheModel("models/Taggart/RussianS_Troopers/visor_soldier.mdl"); PrecacheModel("models/Taggart/RussianS_Troopers/visor_soldier_visor_up.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/beret_soldier.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/boonie_soldier.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/commander.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/gear_soldier.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/goggles_soldier.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/helmet_goggles_soldier.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/visor_soldier.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/visor_soldier_visor_up.mdl");
PrecacheModel("models/Taggart/Woodsobr_Troopers/beret_soldier.mdl"); PrecacheModel("models/Taggart/Woodsobr_Troopers/boonie_soldier.mdl"); PrecacheModel("models/Taggart/Woodsobr_Troopers/commander.mdl"); PrecacheModel("models/Taggart/Woodsobr_Troopers/gear_soldier.mdl"); PrecacheModel("models/Taggart/Woodsobr_Troopers/goggles_soldier.mdl"); PrecacheModel("models/Taggart/Woodsobr_Troopers/helmet_goggles_soldier.mdl"); PrecacheModel("models/Taggart/Woodsobr_Troopers/visor_soldier.mdl"); PrecacheModel("models/Taggart/Woodsobr_Troopers/visor_soldier_visor_up.mdl");[/color]
UTIL_PrecacheOther( "item_healthvial" ); UTIL_PrecacheOther( "weapon_frag" ); UTIL_PrecacheOther( "item_ammo_ar2_altfire" );
BaseClass::Precache(); } void CNPC_CombineS::SelectModel() { SetModel( RandomModels[ random->RandomInt( 0, ARRAYSIZE( RandomModels ) - 1 ) ] ); } void CNPC_CombineS::Spawn( void ) { Precache(); SelectModel(); if( IsElite() ) { // Stronger, tougher. SetHealth( sk_combine_guard_health.GetFloat() ); SetMaxHealth( sk_combine_guard_health.GetFloat() ); SetKickDamage( sk_combine_guard_kick.GetFloat() ); } else { SetHealth( sk_combine_s_health.GetFloat() ); SetMaxHealth( sk_combine_s_health.GetFloat() ); SetKickDamage( sk_combine_s_kick.GetFloat() ); }
CapabilitiesAdd( bits_CAP_ANIMATEDFACE ); CapabilitiesAdd( bits_CAP_MOVE_SHOOT ); CapabilitiesAdd( bits_CAP_DOORS_GROUP );
BaseClass::Spawn();
#if HL2_EPISODIC if (m_iUseMarch && !HasSpawnFlags(SF_NPC_START_EFFICIENT)) { Msg( "Soldier %s is set to use march anim, but is not an efficient AI. The blended march anim can only be used for dead-ahead walks!\n", GetDebugName() ); } #endif }
void CNPC_CombineS::DeathSound( const CTakeDamageInfo &info ) { // NOTE: The response system deals with this at the moment if ( GetFlags() & FL_DISSOLVING ) return;
GetSentences()->Speak( "COMBINE_DIE", SENTENCE_PRIORITY_INVALID, SENTENCE_CRITERIA_ALWAYS ); }
//----------------------------------------------------------------------------- // Purpose: Soldiers use CAN_RANGE_ATTACK2 to indicate whether they can throw // a grenade. Because they check only every half-second or so, this // condition must persist until it is updated again by the code // that determines whether a grenade can be thrown, so prevent the // base class from clearing it out. (sjb) //----------------------------------------------------------------------------- void CNPC_CombineS::ClearAttackConditions( ) { bool fCanRangeAttack2 = HasCondition( COND_CAN_RANGE_ATTACK2 );
// Call the base class. BaseClass::ClearAttackConditions();
if( fCanRangeAttack2 ) { // We don't allow the base class to clear this condition because we // don't sense for it every frame. SetCondition( COND_CAN_RANGE_ATTACK2 ); } }
void CNPC_CombineS::PrescheduleThink( void ) { /*//FIXME: This doesn't need to be in here, it's all debug info if( HasCondition( COND_HEAR_PHYSICS_DANGER ) ) { // Don't react unless we see the item!! CSound *pSound = NULL;
pSound = GetLoudestSoundOfType( SOUND_PHYSICS_DANGER );
if( pSound ) { if( FInViewCone( pSound->GetSoundReactOrigin() ) ) { DevMsg( "OH CRAP!\n" ); NDebugOverlay::Line( EyePosition(), pSound->GetSoundReactOrigin(), 0, 0, 255, false, 2.0f ); } } } */
BaseClass::PrescheduleThink(); }
//----------------------------------------------------------------------------- // Purpose: Allows for modification of the interrupt mask for the current schedule. // In the most cases the base implementation should be called first. //----------------------------------------------------------------------------- void CNPC_CombineS::BuildScheduleTestBits( void ) { //Interrupt any schedule with physics danger (as long as I'm not moving or already trying to block) if ( m_flGroundSpeed == 0.0 && !IsCurSchedule( SCHED_FLINCH_PHYSICS ) ) { SetCustomInterruptCondition( COND_HEAR_PHYSICS_DANGER ); }
BaseClass::BuildScheduleTestBits(); }
//----------------------------------------------------------------------------- // Purpose: // Input : // Output : //----------------------------------------------------------------------------- int CNPC_CombineS::SelectSchedule ( void ) { return BaseClass::SelectSchedule(); }
//----------------------------------------------------------------------------- //----------------------------------------------------------------------------- float CNPC_CombineS::GetHitgroupDamageMultiplier( int iHitGroup, const CTakeDamageInfo &info ) { switch( iHitGroup ) { case HITGROUP_HEAD: { // Soldiers take double headshot damage return 2.0f; } }
return BaseClass::GetHitgroupDamageMultiplier( iHitGroup, info ); }
//----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void CNPC_CombineS::HandleAnimEvent( animevent_t *pEvent ) { switch( pEvent->event ) { case AE_SOLDIER_BLOCK_PHYSICS: DevMsg( "BLOCKING!\n" ); m_fIsBlocking = true; break;
default: BaseClass::HandleAnimEvent( pEvent ); break; } }
void CNPC_CombineS::OnChangeActivity( Activity eNewActivity ) { // Any new sequence stops us blocking. m_fIsBlocking = false;
BaseClass::OnChangeActivity( eNewActivity );
#if HL2_EPISODIC // Give each trooper a varied look for his march. Done here because if you do it earlier (eg Spawn, StartTask), the // pose param gets overwritten. if (m_iUseMarch) { SetPoseParameter("casual", RandomFloat()); } #endif }
void CNPC_CombineS::OnListened() { BaseClass::OnListened();
if ( HasCondition( COND_HEAR_DANGER ) && HasCondition( COND_HEAR_PHYSICS_DANGER ) ) { if ( HasInterruptCondition( COND_HEAR_DANGER ) ) { ClearCondition( COND_HEAR_PHYSICS_DANGER ); } }
// debugging to find missed schedules #if 0 if ( HasCondition( COND_HEAR_DANGER ) && !HasInterruptCondition( COND_HEAR_DANGER ) ) { DevMsg("Ignore danger in %s\n", GetCurSchedule()->GetName() ); } #endif }
//----------------------------------------------------------------------------- // Purpose: // Input : &info - // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- void CNPC_CombineS::Event_Killed( const CTakeDamageInfo &info ) { // Don't bother if we've been told not to, or the player has a megaphyscannon if ( combine_spawn_health.GetBool() == false || PlayerHasMegaPhysCannon() ) { BaseClass::Event_Killed( info ); return; }
CBasePlayer *pPlayer = ToBasePlayer( info.GetAttacker() );
if ( !pPlayer ) { CPropVehicleDriveable *pVehicle = dynamic_cast<CPropVehicleDriveable *>( info.GetAttacker() ) ; if ( pVehicle && pVehicle->GetDriver() && pVehicle->GetDriver()->IsPlayer() ) { pPlayer = assert_cast<CBasePlayer *>( pVehicle->GetDriver() ); } }
if ( pPlayer != NULL ) { // Elites drop alt-fire ammo, so long as they weren't killed by dissolving. if( IsElite() ) { #ifdef HL2_EPISODIC if ( HasSpawnFlags( SF_COMBINE_NO_AR2DROP ) == false ) #endif { CBaseEntity *pItem = DropItem( "item_ammo_ar2_altfire", WorldSpaceCenter()+RandomVector(-4,4), RandomAngle(0,360) );
if ( pItem ) { IPhysicsObject *pObj = pItem->VPhysicsGetObject();
if ( pObj ) { Vector vel = RandomVector( -64.0f, 64.0f ); AngularImpulse angImp = RandomAngularImpulse( -300.0f, 300.0f );
vel[2] = 0.0f; pObj->AddVelocity( &vel, &angImp ); }
if( info.GetDamageType() & DMG_DISSOLVE ) { CBaseAnimating *pAnimating = dynamic_cast<CBaseAnimating*>(pItem);
if( pAnimating ) { pAnimating->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL ); } } else { WeaponManager_AddManaged( pItem ); } } } }
CHalfLife2 *pHL2GameRules = static_cast<CHalfLife2 *>(g_pGameRules);
// Attempt to drop health if ( pHL2GameRules->NPC_ShouldDropHealth( pPlayer ) ) { DropItem( "item_healthvial", WorldSpaceCenter()+RandomVector(-4,4), RandomAngle(0,360) ); pHL2GameRules->NPC_DroppedHealth(); } if ( HasSpawnFlags( SF_COMBINE_NO_GRENADEDROP ) == false ) { // Attempt to drop a grenade if ( pHL2GameRules->NPC_ShouldDropGrenade( pPlayer ) ) { DropItem( "weapon_frag", WorldSpaceCenter()+RandomVector(-4,4), RandomAngle(0,360) ); pHL2GameRules->NPC_DroppedGrenade(); } } }
BaseClass::Event_Killed( info ); }
//----------------------------------------------------------------------------- // Purpose: // Input : &info - // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- bool CNPC_CombineS::IsLightDamage( const CTakeDamageInfo &info ) { return BaseClass::IsLightDamage( info ); }
//----------------------------------------------------------------------------- // Purpose: // Input : &info - // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- bool CNPC_CombineS::IsHeavyDamage( const CTakeDamageInfo &info ) { // Combine considers AR2 fire to be heavy damage if ( info.GetAmmoType() == GetAmmoDef()->Index("AR2") ) return true;
// 357 rounds are heavy damage if ( info.GetAmmoType() == GetAmmoDef()->Index("357") ) return true;
// Shotgun blasts where at least half the pellets hit me are heavy damage if ( info.GetDamageType() & DMG_BUCKSHOT ) { int iHalfMax = sk_plr_dmg_buckshot.GetFloat() * sk_plr_num_shotgun_pellets.GetInt() * 0.5; if ( info.GetDamage() >= iHalfMax ) return true; }
// Rollermine shocks if( (info.GetDamageType() & DMG_SHOCK) && hl2_episodic.GetBool() ) { return true; }
return BaseClass::IsHeavyDamage( info ); }
#if HL2_EPISODIC //----------------------------------------------------------------------------- // Purpose: Translate base class activities into combot activites //----------------------------------------------------------------------------- Activity CNPC_CombineS::NPC_TranslateActivity( Activity eNewActivity ) { // If the special ep2_outland_05 "use march" flag is set, use the more casual marching anim. if ( m_iUseMarch && eNewActivity == ACT_WALK ) { eNewActivity = ACT_WALK_MARCH; }
return BaseClass::NPC_TranslateActivity( eNewActivity ); }
//--------------------------------------------------------- // Save/Restore //--------------------------------------------------------- BEGIN_DATADESC( CNPC_CombineS )
DEFINE_KEYFIELD( m_iUseMarch, FIELD_INTEGER, "usemarch" ),
END_DATADESC() #endif Красным выделено то что вызывает у меня подозрения с вылетом из мода
Я живу в будущем City 15
Если Вы можете, играя в "Counter-Strike: Sourсe", посадить хедшот ножом через стену в попу своему противнику, который находится на другом конце карты, на другом сервере, и который играет в "Team Fortress 2" и находится под действием убер-заряда, то знайте, что в плане читерства вы достигли совершенства. ©IPa
Было отредактированно - HellMapper - Среда, 09.12.2009, 20:12 |
|
| |
Andreazzz | Дата: Среда, 09.12.2009, 20:21 | Сообщение # 46 |
Spy
Группа: Проверенные
Сообщений: 996
Репутация: 55
Статус: Offline
| HellMapper,BB Тег [code] не обрабатывает другие теги а нём.
|
|
| |
HellMapper | Дата: Среда, 09.12.2009, 20:21 | Сообщение # 47 |
Scout
Группа: Проверенные
Сообщений: 588
Репутация: 27
Статус: Offline
| Code void CNPC_CombineS::Precache() {
PrecacheModel("models/Taggart/RussianS_Troopers/beret_soldier.mdl"); PrecacheModel("models/Taggart/RussianS_Troopers/boonie_soldier.mdl"); PrecacheModel("models/Taggart/RussianS_Troopers/commander.mdl"); PrecacheModel("models/Taggart/RussianS_Troopers/gear_soldier.mdl"); PrecacheModel("models/Taggart/RussianS_Troopers/goggles_soldier.mdl"); PrecacheModel("models/Taggart/RussianS_Troopers/helmet_goggles_soldier.mdl"); PrecacheModel("models/Taggart/RussianS_Troopers/visor_soldier.mdl"); PrecacheModel("models/Taggart/RussianS_Troopers/visor_soldier_visor_up.mdl");
PrecacheModel("models/Taggart/woodomoh_Troopers/beret_soldier.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/boonie_soldier.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/commander.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/gear_soldier.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/goggles_soldier.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/helmet_goggles_soldier.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/visor_soldier.mdl"); PrecacheModel("models/Taggart/woodomoh_Troopers/visor_soldier_visor_up.mdl");
PrecacheModel("models/Taggart/Woodsobr_Troopers/beret_soldier.mdl"); PrecacheModel("models/Taggart/Woodsobr_Troopers/boonie_soldier.mdl"); PrecacheModel("models/Taggart/Woodsobr_Troopers/commander.mdl"); PrecacheModel("models/Taggart/Woodsobr_Troopers/gear_soldier.mdl"); PrecacheModel("models/Taggart/Woodsobr_Troopers/goggles_soldier.mdl"); PrecacheModel("models/Taggart/Woodsobr_Troopers/helmet_goggles_soldier.mdl"); PrecacheModel("models/Taggart/Woodsobr_Troopers/visor_soldier.mdl"); PrecacheModel("models/Taggart/Woodsobr_Troopers/visor_soldier_visor_up.mdl");
UTIL_PrecacheOther( "item_healthvial" ); UTIL_PrecacheOther( "weapon_frag" ); UTIL_PrecacheOther( "item_ammo_ar2_altfire" );
BaseClass::Precache(); } void CNPC_CombineS::SelectModel() { SetModel( RandomModels[ random->RandomInt( 0, ARRAYSIZE( RandomModels ) - 1 ) ] ); } void CNPC_CombineS::Spawn( void ) { Precache(); SelectModel(); ............... } Вот как надо писать получение рандомной модели.
Я живу в будущем City 15
Если Вы можете, играя в "Counter-Strike: Sourсe", посадить хедшот ножом через стену в попу своему противнику, который находится на другом конце карты, на другом сервере, и который играет в "Team Fortress 2" и находится под действием убер-заряда, то знайте, что в плане читерства вы достигли совершенства. ©IPa
Было отредактированно - HellMapper - Среда, 09.12.2009, 20:22 |
|
| |
Hitmen | Дата: Среда, 09.12.2009, 22:20 | Сообщение # 48 |
Spy
Группа: Проверенные
Сообщений: 2104
Репутация: 84
Статус: Offline
| HellMapper, Ща оба варианта пробну, один точно сработает. Добавлено (09.12.2009, 21:06) --------------------------------------------- Первый вариант - нерабочий совершенно, выкинуло без всякой ошибки: "На", меня движок послал. biggrin Добавлено (09.12.2009, 22:20) --------------------------------------------- Заработало всё, HellMapper, + тебе.
Туториалы по программированию, мои и слегка изменённые чужие. :)
Sp@ce Project Blog Sp@ce Project Web-Site
I'm in spaaace! Я в контакте Я в Facebook'е
Было отредактированно - Hitmen - Среда, 09.12.2009, 21:38 |
|
| |
Strider | Дата: Четверг, 10.12.2009, 07:01 | Сообщение # 49 |
Spy
Группа: Проверенные
Сообщений: 1465
Репутация: 51
Статус: Offline
| Вообще ничего нового у тебя, хелл, я не увидел)))
|
|
| |
|
|
Помощь в разработке форума: HOMiE7 |
|
| |
|