HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- Half-Life SDK (https://hlfx.ru/forum/forumdisplay.php?forumid=8)
-- Sprite on attachment (https://hlfx.ru/forum/showthread.php?threadid=4086)
Отправлено MisterDeath 09-09-2013 в 22:16:
Sprite on attachment
The sprite creation
C++ Source Code:
2 | pClient = gEngfuncs.GetViewModel(); |
4 | TEMPENTITY *pSprite = gEngfuncs.pEfxAPI->R_TempSprite( pClient- |
5 | >attachment[0], Vector( 0,0,0 ), 0.5, gEngfuncs.pEventAPI- |
6 | >EV_FindModelIndex( "sprites/hotglow.spr" ), kRenderTransAdd, |
7 | kRenderFxNone, 255.0, 1.0, 0 ); |
9 | pSprite->flags |= ( FTENT_CLIENTCUSTOM ); |
10 | pSprite->callback = EV_MuzzleflashCallback; |
The sprite callback:
C++ Source Code:
1 | void EV_MuzzleflashCallback ( struct tempent_s *ent, float frametime, float currenttime ) |
4 | pClient = gEngfuncs.GetViewModel(); |
6 | ent->entity.origin = pClient->attachment[0]; |
Not moving:
http://img818.imageshack.us/img818/2561/shz.png
Moving ( THE BUG !!! ):
http://img194.imageshack.us/img194/9938/ov1h.png
If shoot moving, the sprite on the attachment create in the opposite position of movement...
( SORRY BAD ENGLISH )__________________
hl 4 ever
Отправлено Дядя Миша 10-09-2013 в 08:11:
Make sure what sprite creation calling from HUD_StudioEvent. It's very important.
__________________
My Projects: download page
F.A.Q по XashNT
Блог разработчика в телеграме
Цитата:
C:\DOCUME~1\C4C5~1\LOCALS~1\Temp\a33328if(72) : see declaration of 'size_t'
Отправлено MisterDeath 10-09-2013 в 13:59:
Цитата:
Дядя Миша писал:
Make sure what sprite creation calling from HUD_StudioEvent. It's very important.
The problem persists... !__________________
hl 4 ever