HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- Half-Life SDK (https://hlfx.ru/forum/forumdisplay.php?forumid=8)
-- UTIL_SetSize Problem (https://hlfx.ru/forum/showthread.php?threadid=2535)
Отправлено XaeroX 08-01-2011 в 17:53:
 
S34Qu4K3 
Running speed is not the same as yaw speed. It is extracted directly from monster's animation (LX flag). Therefore you need to create a different animation where monster has less linear movement.
__________________
Отправлено S34Qu4K3 08-01-2011 в 17:59:
 
:O, thank you  XaeroX for help me ^^
Отправлено XaeroX 08-01-2011 в 18:01:
 
Цитата:
S34Qu4K3 писал:
And I can´t hit with the rpg in the head 
You seem not to read everything we write. This is VERY bad.
Цитата:
Дядя Миша писал:
Look for SetObjectCollisionBox.
Did you look for it? Did you change it? It must look like something
C++ Source Code:
| void SetObjectCollisionBox( void ) | 
|   pev->absmin = pev->origin + Vector(-400, -400, 0); | 
|   pev->absmax = pev->origin + Vector(400, 400, 1800); | 
 __________________
Отправлено S34Qu4K3 08-01-2011 в 18:24:
 
Цитата:
XaeroX писал:
You seem not to read everything we write. This is VERY bad.
I readed everything  `
`
Цитата:
XaeroX писал:
Did you look for it? Did you change it? It must look like something
C++ Source Code:
void SetObjectCollisionBox( void )
{
____pev->absmin = pev->origin + Vector(-400, -400, 0);
____pev->absmax = pev->origin + Vector(400, 400, 1800);
}
Yeah, my SetObjectCollisionBox is exact to this 
Отправлено XaeroX 08-01-2011 в 18:45:
 
S34Qu4K3 
Then RPG must hit monster's head. I've just checked it.
__________________
Отправлено S34Qu4K3 09-01-2011 в 02:01:
 
mmm, the hand grenades, AR Grenades and the RPG trasspas the monster head, but hits in the stomach, leggs, etc.  Oh, and the monster don´t trigger the tripmines, i don´t know why
Добавлено сегодня в 08:01:
Soeey, i have to mae double post beacause I can´t edit my latest post 
I want to make that when the monster walk, a little screenshake ocurss
C++ Source Code:
| UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 ); | 
 
But i don´t know where i should place it, i´ve done this
C++ Source Code:
| 1 | void CDragon :: SetYawSpeed ( void ) | 
| 10 |       UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 ); | 
| 16 |       UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 ); | 
| 22 |       UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 ); | 
| 28 |       UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 ); | 
| 34 |       UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 ); | 
| 41 |       UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 ); | 
| 47 |   UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 ); | 
 
But only work when turn right/left
Thanks in advance
Отправлено Ku2zoff 09-01-2011 в 04:37:
 
S34Qu4K3 call UTIL_Screen shake from HandleAnimEvent. You need to add events for your monster's animations in the *.qc file. Watch alien grunt's source code and model (ladder step sounds when agrunt moves).
Отправлено S34Qu4K3 10-01-2011 в 23:32:
 
Thanks Ku2zoff
Now, i´m having problem, i´ve added this to the stomp attack from gargantua
C++ Source Code:
| 1 | if (UTIL_FindEntityInSphere( pStomp, pPlayer->pev->origin, 14096 ) != NULL) | 
| 3 |   pPlayer->TakeDamage( pev, pevOwner, 100, DMG_SONIC ); | 
| 5 |   UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 150 ); | 
 
I wan to check if the player is in the radius and if the player is in radius, do damage and make a little shake, but when the monster attack and i´m in the radius, hl.exe crashes 
Full function:
C++ Source Code:
| 1 | void CDragonStomp::Think( void ) | 
| 5 |   pev->nextthink = gpGlobals->time + 0.1; | 
| 9 |   //Required for UTIL_FindEntityInSphere | 
| 10 |   CDragonStomp *pStomp = GetClassPtr( (CDragonStomp *)NULL ); //Origin | 
| 14 |   pPlayer = (CBasePlayer *)GET_PRIVATE(pev->owner); | 
| 17 |   entvars_t *pevOwner = pev; | 
| 19 |   //For origin use vecStart | 
| 22 |   // Do damage for this frame | 
| 23 |   Vector vecStart = pev->origin; | 
| 25 |   Vector vecEnd = vecStart + (pev->movedir * pev->speed * gpGlobals->frametime); | 
| 27 |   UTIL_TraceHull( vecStart, vecEnd, dont_ignore_monsters, head_hull, ENT(pev), &tr ); | 
| 29 |   if ( tr.pHit && tr.pHit != pev->owner ) | 
| 31 |     CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); | 
| 32 |     entvars_t *pevOwner = pev; | 
| 34 |       pevOwner = VARS(pev->owner); | 
| 37 |       pEntity->TakeDamage( pev, pevOwner, 0, DMG_SONIC ); | 
| 40 |   // Accelerate the effect | 
| 41 |   pev->speed = pev->speed + (gpGlobals->frametime) * pev->framerate; | 
| 42 |   pev->framerate = pev->framerate + (gpGlobals->frametime) * 1500; | 
| 44 |   // Move and spawn trails | 
| 45 |   while ( gpGlobals->time - pev->dmgtime > STOMP_INTERVAL ) | 
| 47 |     pev->origin = pev->origin + pev->movedir * pev->speed * STOMP_INTERVAL; | 
| 48 |     for ( int i = 0; i < 2; i++ ) | 
| 50 |       CSprite *pSprite = CSprite::SpriteCreate( DRAGON_STOMP_SPRITE_NAME, pev->origin, TRUE ); | 
| 53 |         UTIL_TraceLine( pev->origin, pev->origin - Vector(0,0,500), ignore_monsters, edict(), &tr ); | 
| 54 |         pSprite->pev->origin = tr.vecEndPos; | 
| 55 |         pSprite->pev->velocity = Vector(RANDOM_FLOAT(-200,200),RANDOM_FLOAT(-200,200),175); | 
| 56 |         // pSprite->AnimateAndDie( RANDOM_FLOAT( 8.0, 12.0 ) ); | 
| 57 |         pSprite->pev->nextthink = gpGlobals->time + 0.3; | 
| 58 |         pSprite->SetThink( SUB_Remove ); | 
| 59 |         pSprite->SetTransparency( kRenderTransAdd, 255, 255, 255, 255, kRenderFxFadeFast ); | 
| 61 |         UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 150 ); | 
| 64 |     pev->dmgtime += STOMP_INTERVAL; | 
| 65 |     // Scale has the "life" of this effect | 
| 66 |     pev->scale -= STOMP_INTERVAL * pev->speed; | 
| 67 |     if ( pev->scale <= 0 ) | 
| 71 |       STOP_SOUND( edict(), CHAN_BODY, DRAGON_STOMP_BUZZ_SOUND ); | 
| 77 |   if (UTIL_FindEntityInSphere( pStomp, pPlayer->pev->origin, 14096 ) != NULL) | 
| 79 |     pPlayer->TakeDamage( pev, pevOwner, 100, DMG_SONIC );  // I think that this line is bad | 
| 81 |     UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 150 ); | 
 
Отправлено S34Qu4K3 11-01-2011 в 22:32:
 
I´ve solved the crash error  , but know, I don´t recieve any damage
, but know, I don´t recieve any damage 
C++ Source Code:
| 2 | pPlayer = (CBasePlayer *)GET_PRIVATE(pev->owner); | 
| 5 | if (UTIL_FindEntityInSphere( pStomp, pev->origin, 14096 ) != NULL) | 
| 9 |   ALERT( at_console, "pPlayer = %d\n pev = %d\n", pPlayer, pev ); | 
| 12 |     pPlayer->TakeDamage( pev, pevOwner, 100, DMG_SONIC ); | 
| 15 |   UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 150 ); | 
 
I think that:
C++ Source Code:
| 2 | pPlayer = (CBasePlayer *)GET_PRIVATE(pev->owner); | 
 
Is bad beacause pPlayer is 0