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