
Oh: I have finished the Gnosis, the Shiva is WIP actually.
//======================================
// Mostrar-Esconder HUD HUD
//======================================
if ( g_bShowHudToggle )
{
gHUD.m_iHideHUDDisplay &= ~ HIDEHUD_WEAPONS;
gHUD.m_iHideHUDDisplay &= ~ HIDEHUD_HEALTH;
gHUD.m_iHideHUDDisplay &= ~ HIDEHUD_ALL;
gHUD.m_iHideHUDDisplay &= ~HIDEHUD_FLASHLIGHT;
if ( CL_IsThirdPerson ()) { gViewPort->ShowHud1(); gViewPort->HideHud();}
if ( !CL_IsThirdPerson ()) { gViewPort->ShowHud(); gViewPort->HideHud1();}
PlaySound("player/hudon.wav", 1);//(c)Admer
}
if ( g_bHideHudToggle )
{
gHUD.m_iHideHUDDisplay |= HIDEHUD_WEAPONS;
gHUD.m_iHideHUDDisplay |= HIDEHUD_HEALTH;
gHUD.m_iHideHUDDisplay |= HIDEHUD_FLASHLIGHT;
gViewPort->HideHud();//HUD reticle Firstperson
gViewPort->HideHud1();//HUD reticle Thirdperson
PlaySound("player/hudoff.wav", 1);//(c)Admer
}
//=============================
It compiled fine this way!!EMIT_SOUND(ENT(pev), CHAN_VOICE, "player/hudon.wav", 1, ATTN_NORM);
I obtain:
E:\DevZWC20\Elementos Basicos MAYO 2017\Single-Player Source\cl_dll\input.cpp(902) : error C2065: 'EMIT_SOUND' : undeclared identifier
BTW: i need spoonfeeding with the gunners following the trolleys. I have added the Nebuchadnezzar ship to the map, the Ganesha and Caduceus are ready too, I´m rewriting the manual, the mod is finished except for that part. I really can left that undone, I did it with the trolley code ages ago in 2008, but it could be cool if that part could be added before I can consider dinished the mod finally. #include "vgui_scorepanel.h"
Put
bool g_bShowHudToggle;// Or whatever key you want
Inside
//DECLARE_MESSAGE(m_Logo, Logo)
int __MsgFunc_ResetHUD(const char *pszName, int iSize, void *pbuf)
{
return gHUD.MsgFunc_ResetHUD(pszName, iSize, pbuf );
Put
g_bShowHudToggle = false;
Inside
// This is called every time the DLL is loaded
void CHud :: Init( void )
{
Put
g_bShowHudToggle = false;
Now in input.cppextern int g_iAlive;
Put
extern bool g_bShowHudToggle;
Under
kbutton_t in_graph; // Display the netgraph
Put
kbutton_t in_showhud;
Under
void IN_DuckUp(void) {KeyUp(&in_duck);}
Put
void IN_ShowHudToggle( void ) {g_bShowHudToggle = !g_bShowHudToggle;}
Now into
int CL_ButtonBits( int bResetState )
{
Put
//=============================
if ( g_bShowHudToggle )
{
Yourstuff here...
}
//==============================
And into
void InitInput (void)
{
Put
gEngfuncs.pfnAddCommand ( "showhud", IN_ShowHudToggle);
Probably into both input.cpp and hud.cpp you must put...
#include "vgui_TeamFortressViewport.h"
...because I cannot remember if, because I add the "showhud" stuff there (the function that shows and hides the Combat HUD), the compiler needs it to build the client.dll."showhud" "Combat Screen Reticle CSR ON"
I hope that it works for you too. case 102:
CLIENT_PRINTF( ENT(pev), print_console, "Radar System OFF \n" );
EMIT_SOUND(ENT(pev), CHAN_VOICE, "player/radaroff.wav", 1, ATTN_NORM);
radar_on = 0;
MESSAGE_BEGIN( MSG_ONE, gmsgRadar, NULL, pev );
WRITE_BYTE(0);
MESSAGE_END();
break;
Any material you´ll need just ask. Thank you so much Admer. Also, someone might ask me "Why are you doing everything, even the stuff you're not good at?"Amen
code
, and it look awful (sorry), but did not look into the Formatting Help link, moron me. //=================================================
if ( HasConditions (bits_COND_SEE_HATE ) )
{
return GetScheduleOfType( SCHED_TARGET_CHASE );
}
//=================================================
...the game runs perfect. The gunners attack the Trolley guy, yes, but the game does not crash at all. //=========================================================
// Classify - indicates this monster's place in the
// relationship table.
//=========================================================
int CISlave :: Classify ( void )
{
return CLASS_PLAYER_ALLY;
}
int CISlave::IRelationship( CBaseEntity *pTarget )
{
if ( FClassnameIs( pTarget->pev, "monster_sentinel" ) )
{
return R_NM;
}
if ( FClassnameIs( pTarget->pev, "player" ) )
{
return R_AL;
}
if ( FClassnameIs( pTarget->pev, "monster_trolley" ) )
{
return R_HT;
}
return CBaseMonster::IRelationship( pTarget );
}
wrote the new code:
//=========================================================
// Codigo para seguir a los Trolley
//=========================================================
Task_t tlFollow[] =
{
// { TASK_SET_FAIL_SCHEDULE, (float)SCHED_CANT_FOLLOW }, // If you fail
{ TASK_MOVE_TO_TARGET_RANGE,(float)640 }, // Move within 640 of target ent (monster_trolley)
// { TASK_SET_SCHEDULE, (float)SCHED_TARGET_FACE },
};
Schedule_t slFollow[] =
{
{
tlFollow,
ARRAYSIZE ( tlFollow ),
bits_COND_NEW_ENEMY |
bits_COND_LIGHT_DAMAGE |
bits_COND_HEAVY_DAMAGE |
bits_COND_HEAR_SOUND,
bits_SOUND_COMBAT |
bits_SOUND_DANGER,
"Follow"
},
};
Of course I have definded all...
DEFINE_CUSTOM_SCHEDULES( CISlave )
{
slSlaveAttack1,
slSlaveEstablishLineOfFire,
slFollow,
};
And in:
Schedule_t *CISlave :: GetSchedule( void )
I placed:
//=================================================
// He follows who he hates...
//=================================================
if ( HasConditions (bits_COND_SEE_HATE ) )
{
return slFollow;
}
//=================================================
Also I put the "follow" thing in:
Schedule_t *CISlave :: GetScheduleOfType ( int Type )
{
switch ( Type )
{
case SCHED_FAIL:
slSlaveEstablishLineOfFire;//ZWC
case SCHED_RANGE_ATTACK1:
return slSlaveAttack1;
case SCHED_TARGET_CHASE:
return slFollow;
}
return CSquadMonster :: GetScheduleOfType( Type );
}
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* This source code contains proprietary and confidential information of
* Valve LLC and its suppliers. Access to this code is restricted to
* persons who have executed a written SDK license with Valve. Any access,
* use or distribution of this code by or to any unlicensed person is illegal.
*
****/
//=========================================================
// HandOfGod Monster (10-7-2015) First Attempt.
// Modificado 19/11/2019
//=========================================================
// UNDONE: Don't flinch every time you get hit
#include "extdll.h"
#include "util.h"
#include "cbase.h"
#include "monsters.h"
#include "schedule.h"
// New Includes
#include "weapons.h"
#include "effects.h"
//=========================================================
// Monster's Anim Events Go Here
//=========================================================
#define HOG_AE_ATTACK_RIGHT 0x01
class CHog : public CBaseMonster
{
public:
void Spawn( void );
void Precache( void );
void SetYawSpeed( void );
int Classify ( void );
void HandleAnimEvent( MonsterEvent_t *pEvent );
int IgnoreConditions ( void );
int IRelationship( CBaseEntity *pTarget );
void IdleSound( void );
void AttackSound( void );
static const char *pAttackSounds[];
static const char *pIdleSounds[];
static const char *pAttackHitSounds[];
static const char *pAttackMissSounds[];
int TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType );
void TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType );
void PrescheduleThink( void );
};
LINK_ENTITY_TO_CLASS( monster_hog, CHog );
const char *CHog::pAttackHitSounds[] =
{
"sentinel/slash1.wav",
"sentinel/slash2.wav",
};
const char *CHog::pAttackMissSounds[] =
{
"drone/claw_miss1.wav",
"drone/claw_miss2.wav",
};
const char *CHog::pAttackSounds[] =
{
"drone/attack1.wav",
"drone/attack2.wav",
};
const char *CHog::pIdleSounds[] =
{
"drone/idle1.wav",
"drone/idle2.wav",
"drone/idle3.wav",
"drone/idle4.wav",
};
//=========================================================
// Classify - indicates this monster's place in the
// relationship table.
//=========================================================
int CHog :: Classify ( void )
{
return CLASS_ALIEN_MILITARY;
}
//=========================================================
// Relationship - El bichito tiene ahora muchas cosas
// a las que atacar.
//=========================================================
int CHog::IRelationship( CBaseEntity *pTarget )
{
if ( FClassnameIs( pTarget->pev, "player" ) )
{
return R_HT; // Probar R_NM;
}
if ( FClassnameIs( pTarget->pev, "monster_crane" ) )
{
return R_NO;
}
return CBaseMonster::IRelationship( pTarget );
}
//=========================================================
// SetYawSpeed - allows each sequence to have a different
// turn rate associated with it.
//=========================================================
void CHog :: SetYawSpeed ( void )
{
int ys;
ys = 180;
#if 0
switch ( m_Activity )
{
}
#endif
pev->yaw_speed = ys;
}
int CHog :: TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType )
{
// Take 10% damage from bullets
if ( bitsDamageType == DMG_BULLET )
{
Vector vecDir = pev->origin - (pevInflictor->absmin + pevInflictor->absmax) * 0.5;
vecDir = vecDir.Normalize();
float flForce = DamageForce( flDamage );
pev->velocity = pev->velocity + vecDir * flForce;
flDamage *= 0.1;
}
return CBaseMonster::TakeDamage( pevInflictor, pevAttacker, flDamage, bitsDamageType );
}
void CHog :: IdleSound( void )
{
int pitch = 95 + RANDOM_LONG(0,9);
// Play a random idle sound
EMIT_SOUND_DYN ( ENT(pev), CHAN_VOICE, pIdleSounds[ RANDOM_LONG(0,ARRAYSIZE(pIdleSounds)-1) ], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG(-5,5) );
}
void CHog :: AttackSound( void )
{
// Play a random attack sound
EMIT_SOUND_DYN ( ENT(pev), CHAN_VOICE, pAttackSounds[ RANDOM_LONG(0,ARRAYSIZE(pAttackSounds)-1) ], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG(-5,5) );
}
//=========================================================
// HandleAnimEvent - catches the monster-specific messages
// that occur when tagged animation frames are played.
//=========================================================
void CHog :: HandleAnimEvent( MonsterEvent_t *pEvent )
{
switch( pEvent->event )
{
case HOG_AE_ATTACK_RIGHT:
{
CBaseEntity *pHurt = CheckTraceHullAttack( 70, RANDOM_LONG (2,10), DMG_SLASH );
if ( pHurt )
{
if ( pHurt->pev->flags & (FL_FAKECLIENT|FL_CLIENT) )
{
pHurt->pev->punchangle.z = -300;
pHurt->pev->punchangle.x = 300;
pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_right * 550;
}
// Play a random attack hit sound
EMIT_SOUND_DYN ( ENT(pev), CHAN_WEAPON, pAttackHitSounds[ RANDOM_LONG(0,ARRAYSIZE(pAttackHitSounds)-1) ], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG(-5,5) );
}
else // Play a random attack miss sound
EMIT_SOUND_DYN ( ENT(pev), CHAN_WEAPON, pAttackMissSounds[ RANDOM_LONG(0,ARRAYSIZE(pAttackMissSounds)-1) ], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG(-5,5) );
if (RANDOM_LONG(0,1))
AttackSound();
pev->nextthink = gpGlobals->time + 10;//Tiempo de espera entre éste ataque y el siguiente
}
break;
default:
CBaseMonster::HandleAnimEvent( pEvent );
break;
}
}
//=========================================================
// Spawn
//=========================================================
void CHog :: Spawn()
{
Precache( );
SET_MODEL(ENT(pev), "models/monster_hog.mdl");
//UTIL_SetSize( pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX );//Buscar tamaño del tentacle
UTIL_SetSize( pev, Vector( -32, -32, 0 ), Vector( 32, 32, 64 ) );
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_FLY;
m_bloodColor = DONT_BLEED;
pev->health = 10000;
pev->view_ofs = VEC_VIEW;// position of the eyes relative to monster's origin.
m_flFieldOfView = VIEW_FIELD_FULL;
m_MonsterState = MONSTERSTATE_COMBAT;
//m_afCapability = bits_CAP_DOORS_GROUP;
MonsterInit();
}
//=========================================================
// Precache - precaches all resources this monster needs
//=========================================================
void CHog :: Precache()
{
int i;
PRECACHE_MODEL("models/monster_hog.mdl");
for ( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ )
PRECACHE_SOUND((char *)pAttackHitSounds[i]);
for ( i = 0; i < ARRAYSIZE( pAttackMissSounds ); i++ )
PRECACHE_SOUND((char *)pAttackMissSounds[i]);
for ( i = 0; i < ARRAYSIZE( pAttackSounds ); i++ )
PRECACHE_SOUND((char *)pAttackSounds[i]);
for ( i = 0; i < ARRAYSIZE( pIdleSounds ); i++ )
PRECACHE_SOUND((char *)pIdleSounds[i]);
}
//=========================================================
// AI Schedules Specific to this monster
//=========================================================
int CHog::IgnoreConditions ( void )
{
int iIgnore = CBaseMonster::IgnoreConditions();
if ((m_Activity == ACT_MELEE_ATTACK1))
{
#if 0
if (pev->health < 20)
iIgnore |= (bits_COND_LIGHT_DAMAGE|bits_COND_HEAVY_DAMAGE);
else
#endif
}
return iIgnore;
}
//====================================================
// Hog TraceAttack Definitions
//====================================================
void CHog::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType )
{
bitsDamageType &= DMG_GENERIC;
if ( bitsDamageType == 0)
{
if ( pev->dmgtime != gpGlobals->time || (RANDOM_LONG(0,100) < 20) )
{
UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT(0.5,1.5) );
pev->dmgtime = gpGlobals->time;
}
flDamage *= 0.1;
}
CBaseMonster::TraceAttack( pevAttacker, flDamage, vecDir, ptr, bitsDamageType );
}
void CHog :: PrescheduleThink( void )
{
}
Any ideas?.BG maps is a full fledged feature only a dozen mods would really take advantage ofI love how they look on my mod
-Support for background menu maps.That´s no reinventing at all!!
-ed_alloc crash fix increasing number of entities.
-Full GPU rendering posibilities.