HLFX.Ru Forum
Показать все 24 сообщений этой темы на одной странице

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)


Отправлено S34Qu4K3 08-01-2011 в 01:58:

UTIL_SetSize Problem

Hi, when i put in my monster spawn function:

C++ Source Code:
UTIL_SetSize( pev, Vector( -893, -893, 0 ), Vector( 893, 893, 1786 ) );


My monster is in floating and don´t walk, but if I put:

C++ Source Code:
UTIL_SetSize( pev, Vector( -892, -892, 0 ), Vector( 892, 892, 1784 ) );


My monster in into the ground and walk

How can I know what vectors are good for my monster?



pD : For curiosity, Can I use floats in SetSize?


Отправлено Wealth 08-01-2011 в 06:45:

You make mmmrpg ?


Отправлено Дядя Миша 08-01-2011 в 12:19:

S34Qu4K3 see tentacle.cpp for details.
Look for SetObjectCollisionBox.
And too big monsters must set $flags 512 in qc-script for studiomdl then compile model.

__________________
My Projects: download page

F.A.Q по XashNT
Блог разработчика в телеграме

Цитата:

C:\DOCUME~1\C4C5~1\LOCALS~1\Temp\a33328if(72) : see declaration of 'size_t'


Отправлено S34Qu4K3 08-01-2011 в 14:21:

Ill try it

Can you explain me why: $flags 512 ?


Отправлено XaeroX 08-01-2011 в 14:29:

Цитата:
S34Qu4K3 писал:
$flags 512

Don't ask, just do it.
This is undocumented Half-Life magic.

__________________

xaerox on Vivino


Отправлено S34Qu4K3 08-01-2011 в 14:38:

It´s the same, i put the SetObjectColisionBox from tentacle, recompiled my model with $flag but it´s the same


Отправлено XaeroX 08-01-2011 в 14:47:

Ok then give us your model and monster's source code.

__________________

xaerox on Vivino


Отправлено S34Qu4K3 08-01-2011 в 14:52:

Here you are

For mode, i´ve put:

$scale 10.0
$flags 512

and multiplied all hitboxes by 10



Отправлено Дядя Миша 08-01-2011 в 16:05:

S34Qu4K3 try to remove all $hbox definition instead of multiple

__________________
My Projects: download page

F.A.Q по XashNT
Блог разработчика в телеграме

Цитата:

C:\DOCUME~1\C4C5~1\LOCALS~1\Temp\a33328if(72) : see declaration of 'size_t'


Отправлено XaeroX 08-01-2011 в 16:07:

There is a lot of problems.
First of all your model does not have legs on ground. I suggest to put "$origin 0 0 -530" into QC. I uncommended your UTIL_SetSize and replaced your model with fixed one and it works.
Next, model is really HUGE. How do you manage to create maps for this monster? It is way too easy to catch "Exceeded max_leaf_faces" error.
Then your model has no animation events specific to garg or any other monster. This means it will never attack its enemy and perform any other monster-specific actions.
And finally it does not have an attachment for eye sprite, so it is located at monster's origin.
To sum things up you need to work a lot on your monster's model.

__________________

xaerox on Vivino


Отправлено S34Qu4K3 08-01-2011 в 16:31:

Цитата:
XaeroX писал:
There is a lot of problems.
First of all your model does not have legs on ground. I suggest to put "$origin 0 0 -530" into QC. I uncommended your UTIL_SetSize and replaced your model with fixed one and it works.
Next, model is really HUGE. How do you manage to create maps for this monster? It is way too easy to catch "Exceeded max_leaf_faces" error.
Then your model has no animation events specific to garg or any other monster. This means it will never attack its enemy and perform any other monster-specific actions.
And finally it does not have an attachment for eye sprite, so it is located at monster's origin.
To sum things up you need to work a lot on your monster's model.


Why $origin 0 0 -530??

I know it, but I only want a bix box with the huge monster
And animations will be changed and eye sprite will be removed, first of all, I wanted to create well the monster and later fix it

Thanks for your help

EDIT: I´ve put $origin 0 0 -530 but the monster not appears


Отправлено XaeroX 08-01-2011 в 16:59:

Цитата:
S34Qu4K3 писал:
I´ve put $origin 0 0 -530 but the monster not appears

I've put $origin 0 0 -530 and monster walks.
So thats your business.
Maybe you sent me some another mdl and source code..

Добавлено 08-01-2011 в 22:59:

Here is the monster that walks

__________________

xaerox on Vivino


Отправлено S34Qu4K3 08-01-2011 в 17:04:

Yeah, it´s the model

It´s bad my .qc file???:

PHP:

$modelname 
"dragon.mdl"
$cd ".\"
$cdtexture ".\"
$scale 10.0
$flags 512
$origin 0 0 
-530
$cliptotextures


And why did you put -530? How I know these number for other models?

And how can I reduce the movement speed? (YAW_Speed???)


Отправлено XaeroX 08-01-2011 в 17:10:

Цитата:
S34Qu4K3 писал:
$scale_10.0

Put "$origin 0 0 -53", since it is subsequently scaled by 10.
Цитата:
S34Qu4K3 писал:
And why did you put -530? How I know these number for other models?

Just by eye. To make ground be at monster's legs.
Цитата:
S34Qu4K3 писал:
And how can I reduce the movement speed? (YAW_Speed???)

Look for SetYawSpeed function.

__________________

xaerox on Vivino


Отправлено S34Qu4K3 08-01-2011 в 17:47:

Thanks

I´ve changed al ys= from SetYawSpeed but the monster continues running at the same speed

C++ Source Code:
1
void CDragon :: SetYawSpeed ( void )
2
{
3
  int ys;
4
 
5
  switch ( m_Activity )
6
  {
7
  case ACT_IDLE:
8
      //	ys = 60;
9
    ys = 30;
10
    break;
11
  case ACT_TURN_LEFT:
12
    case ACT_TURN_RIGHT:
13
        //ys = 180;
14
      ys = 30;
15
      break;
16
    case ACT_WALK:
17
      case ACT_RUN:
18
          //	ys = 60;
19
        ys = 5;
20
        break;
21
 
22
  default:
23
      //	ys = 60;
24
    ys = 5;
25
    break;
26
  }
27
 
28
  pev->yaw_speed = ys;
29
}


pD : And I can´t hit with the rpg in the head


Отправлено 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.

__________________

xaerox on Vivino


Отправлено 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);
}

__________________

xaerox on Vivino


Отправлено 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.

__________________

xaerox on Vivino


Отправлено 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 )
2
{
3
  int ys;
4
 
5
  switch ( m_Activity )
6
  {
7
  case ACT_IDLE:
8
    {
9
      ys = 60;
10
      UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 );
11
      break;
12
    }
13
 
14
  case ACT_TURN_LEFT:
15
    {
16
      UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 );
17
    }
18
 
19
  case ACT_TURN_RIGHT:
20
    {
21
      ys = 180;
22
      UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 );
23
      break;
24
    }
25
 
26
  case ACT_WALK:
27
    {
28
      UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 );
29
    }
30
 
31
  case ACT_RUN:
32
    {
33
      ys = 60;
34
      UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 );
35
      break;
36
    }
37
 
38
  default:
39
    {
40
      ys = 60;
41
      UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 );
42
      break;
43
    }
44
  }
45
 
46
  pev->yaw_speed = ys;
47
  UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 );
48
}


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)
2
{
3
  pPlayer->TakeDamage( pev, pevOwner, 100, DMG_SONIC );
4
 
5
  UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 150 );
6
}



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 )
2
{
3
  TraceResult tr;
4
 
5
  pev->nextthink = gpGlobals->time + 0.1;
6
 
7
 
8
 
9
  //Required for UTIL_FindEntityInSphere
10
  CDragonStomp *pStomp = GetClassPtr( (CDragonStomp *)NULL ); //Origin
11
 
12
  //Player var
13
  CBasePlayer *pPlayer;
14
  pPlayer = (CBasePlayer *)GET_PRIVATE(pev->owner);
15
 
16
  //Owner
17
  entvars_t *pevOwner = pev;
18
 
19
  //For origin use vecStart
20
 
21
 
22
  // Do damage for this frame
23
  Vector vecStart = pev->origin;
24
  vecStart.z += 30;
25
  Vector vecEnd = vecStart + (pev->movedir * pev->speed * gpGlobals->frametime);
26
 
27
  UTIL_TraceHull( vecStart, vecEnd, dont_ignore_monsters, head_hull, ENT(pev), &tr );
28
 
29
  if ( tr.pHit && tr.pHit != pev->owner )
30
  {
31
    CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit );
32
    entvars_t *pevOwner = pev;
33
    if ( pev->owner )
34
      pevOwner = VARS(pev->owner);
35
 
36
    if ( pEntity )
37
      pEntity->TakeDamage( pev, pevOwner, 0, DMG_SONIC );
38
  }
39
 
40
  // Accelerate the effect
41
  pev->speed = pev->speed + (gpGlobals->frametime) * pev->framerate;
42
  pev->framerate = pev->framerate + (gpGlobals->frametime) * 1500;
43
 
44
  // Move and spawn trails
45
  while ( gpGlobals->time - pev->dmgtime > STOMP_INTERVAL )
46
  {
47
    pev->origin = pev->origin + pev->movedir * pev->speed * STOMP_INTERVAL;
48
    for ( int i = 0; i < 2; i++ )
49
    {
50
      CSprite *pSprite = CSprite::SpriteCreate( DRAGON_STOMP_SPRITE_NAME, pev->origin, TRUE );
51
      if ( pSprite )
52
      {
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 );
60
 
61
        UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 150 );
62
      }
63
    }
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 )
68
    {
69
      // Life has run out
70
      UTIL_Remove(this);
71
      STOP_SOUND( edict(), CHAN_BODY, DRAGON_STOMP_BUZZ_SOUND );
72
    }
73
 
74
  }
75
 
76
 
77
  if (UTIL_FindEntityInSphere( pStomp, pPlayer->pev->origin, 14096 ) != NULL)
78
  {
79
    pPlayer->TakeDamage( pev, pevOwner, 100, DMG_SONIC );  // I think that this line is bad
80
 
81
    UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 150 );
82
 
83
  }
84
 
85
}


Отправлено S34Qu4K3 11-01-2011 в 22:32:

I´ve solved the crash error , but know, I don´t recieve any damage

C++ Source Code:
1
CBasePlayer *pPlayer;
2
pPlayer = (CBasePlayer *)GET_PRIVATE(pev->owner);
3
 
4
 
5
if (UTIL_FindEntityInSphere( pStomp, pev->origin, 14096 ) != NULL)
6
{
7
 
8
 
9
  ALERT( at_console, "pPlayer = %d\n pev = %d\n", pPlayer, pev );
10
 
11
  if ( pPlayer )
12
    pPlayer->TakeDamage( pev, pevOwner, 100, DMG_SONIC );
13
 
14
 
15
  UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 150 );
16
}


I think that:

C++ Source Code:
1
CBasePlayer *pPlayer;
2
pPlayer = (CBasePlayer *)GET_PRIVATE(pev->owner);
3
 


Is bad beacause pPlayer is 0


Временная зона GMT. Текущее время 19:31.
Показать все 24 сообщений этой темы на одной странице

На основе vBulletin версии 2.3.0
Авторское право © Jelsoft Enterprises Limited 2000 - 2002.
Дизайн и программирование: Crystice Softworks © 2005 - 2024