Raised This Month: $51 Target: $400
 12% 

Can I catch when a sprite is displayed?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stupok
Veteran Member
Join Date: Feb 2006
Old 09-21-2008 , 00:15   Can I catch when a sprite is displayed?
Reply With Quote #1

I was reading this thread:
http://forums.alliedmods.net/showthread.php?t=66081

It got me thinking about how to consolidate all of the sprites in CS into one massive sprite. I've considered it before, but his success with the models has motivated me to go further.

Anyways, is there a way to "catch" when a sprite is spawned?

I'd like to:
1. Catch when spawned/displayed.
2. Determine which sprite is supposed to be shown.
3. Show my own sprite (with the correct frame(s), since there will be many of them inside).

I'm almost certain that this is not possible, but I'd like to hear from you guys.




When I look at something like this, for example:
Code:
#define	TE_EXPLOSION                3        // Additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps
// write_byte(TE_EXPLOSION)
// write_coord(position.x)
// write_coord(position.y)
// write_coord(position.z)
// write_short(sprite index)
// write_byte(scale in 0.1's)
// write_byte(framerate)
// write_byte(flags)
It'd be entirely possible to show my sprite instead of the regular sprite that's shown, but I can't specify which frames to show. So, I don't think my idea will work.
stupok is offline
Prajch
Senior Member
Join Date: Dec 2007
Location: anger++
Old 09-21-2008 , 01:25   Re: Can I catch when a sprite is displayed?
Reply With Quote #2

What kind of sprites are you trying to catch? Muzzle flash? Map sprites?
Prajch is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 09-21-2008 , 01:46   Re: Can I catch when a sprite is displayed?
Reply With Quote #3

Ideally, ALL of them. Again, I think it's impossible, but I'm hoping someone can prove me wrong.
stupok is offline
Prajch
Senior Member
Join Date: Dec 2007
Location: anger++
Old 09-21-2008 , 17:49   Re: Can I catch when a sprite is displayed?
Reply With Quote #4

Well, you can catch when the sprite is being applied to an entity by registering FM_SetModel. You might also be able to use key value forwards. If you want to replace them with a specific subset of your sprite's frames, I don't think it's going to be possible without some ugly methods. The only one I can think of right now is that you'll have to use something like TE_BEAMPOINTS, set the start frame, set the framerate, and set the lifetime such that it dies before it goes beyond the last frame you want.
Prajch is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 09-21-2008 , 20:21   Re: Can I catch when a sprite is displayed?
Reply With Quote #5

sprite is Temp entity.i think you should try to do:
PHP Code:
    register_event(23,"eTempEntity","a")
    
register_message(23,"mTempEntity"
zwfgdlc is offline
Reply



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 06:55.


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