Raised This Month: $ Target: $400
 0% 

Sprite animations


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bogdyuttzu
Senior Member
Join Date: Dec 2009
Location: Romania
Old 07-15-2011 , 03:18   Sprite animations
Reply With Quote #1

I try to attach to player an animatesprite with this code but don't work

Code:
	engfunc(EngFunc_SetModel, ent, "sprites/zombihealer.spr");
	set_pev(ent, pev_aiment, id);
	set_pev(ent, pev_movetype, MOVETYPE_FOLLOW);
	set_pev(ent, pev_owner, id);
	
	set_pev(ent, pev_scale, 1.0);
	
	set_pev(ent, pev_rendermode, kRenderTransAlpha);
	set_pev(ent, pev_renderamt, 255.0);	
	
	set_pev(ent, pev_animtime, get_gametime())
	set_pev(ent, pev_framerate, 1.0)
	set_pev(ent, pev_spawnflags, SF_SPRITE_STARTON)
	
	dllfunc(DLLFunc_Spawn, ent)
The sprite don't spawn
bogdyuttzu is offline
Send a message via Yahoo to bogdyuttzu
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 07-15-2011 , 03:39   Re: Sprite animations
Reply With Quote #2

Can you post the whole code behind the scene?
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
bogdyuttzu
Senior Member
Join Date: Dec 2009
Location: Romania
Old 07-15-2011 , 03:45   Re: Sprite animations
Reply With Quote #3

PHP Code:
    g_playerenth[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_sprite"));        
    
    if(
pev_valid(ent))
        return
    
    
engfunc(EngFunc_SetModelg_playerenth[id], "sprites/zombihealer.spr");
    
set_pev(g_playerenth[id], pev_aimentid);
    
set_pev(g_playerenth[id], pev_movetypeMOVETYPE_FOLLOW);
    
set_pev(g_playerenth[id], pev_ownerid);
    
    
set_pev(g_playerenth[id], pev_scale1.0);
    
    
set_pev(g_playerenth[id], pev_rendermodekRenderTransAlpha);
    
set_pev(g_playerenth[id], pev_renderamt255.0);    
    
    
set_pev(g_playerenth[id], pev_animtimeget_gametime())
    
set_pev(g_playerenth[id], pev_framerate1.0)
    
set_pev(g_playerenth[id], pev_spawnflagsSF_SPRITE_STARTON)
    
    
dllfunc(DLLFunc_Spawng_playerenth[id]) 
bogdyuttzu is offline
Send a message via Yahoo to bogdyuttzu
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-15-2011 , 03:50   Re: Sprite animations
Reply With Quote #4

Quote:
Originally Posted by bogdyuttzu View Post
PHP Code:
    if(pev_valid(ent))
        return 
So if entity is valid, just cancel the whole thing =) ... add a NOT logic operator ( ! ) before pev_valid().
__________________
Hunter-Digital is offline
bogdyuttzu
Senior Member
Join Date: Dec 2009
Location: Romania
Old 07-15-2011 , 03:52   Re: Sprite animations
Reply With Quote #5

LOL I forgot this my fail
bogdyuttzu is offline
Send a message via Yahoo to bogdyuttzu
bogdyuttzu
Senior Member
Join Date: Dec 2009
Location: Romania
Old 07-15-2011 , 03:57   Re: Sprite animations
Reply With Quote #6

Now is work but have black background
bogdyuttzu is offline
Send a message via Yahoo to bogdyuttzu
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-15-2011 , 04:01   Re: Sprite animations
Reply With Quote #7

See what type of transparency the sprite has and use that in your pev_rendermode... you can view sprites with "SprView" program and use View -> Sprite Information to see transparency mode.

EDIT: actually, if it's not alphatest, it should be additive, so try that rendermode.
__________________
Hunter-Digital is offline
bogdyuttzu
Senior Member
Join Date: Dec 2009
Location: Romania
Old 07-15-2011 , 04:08   Re: Sprite animations
Reply With Quote #8

Done it's work now

Ms Hunter pt ajutor
bogdyuttzu is offline
Send a message via Yahoo to bogdyuttzu
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 07-15-2011 , 05:41   Re: Sprite animations
Reply With Quote #9

I tested with alphatest and it worked for me however additive sprite doesnt work from some reason.
What alterations did you do to make it work ?
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-15-2011 , 06:07   Re: Sprite animations
Reply With Quote #10

Quote:
Originally Posted by abdul-rehman View Post
I tested with alphatest and it worked for me however additive sprite doesnt work from some reason.
What alterations did you do to make it work ?
It's sprite related, you can't just test with any sprite, you must have the exact sprite he's using... do you ?
__________________
Hunter-Digital is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode