AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ham_Killed superceded - force death animation (https://forums.alliedmods.net/showthread.php?t=132692)

Hunter-Digital 07-17-2010 21:41

Ham_Killed superceded - force death animation
 
I'm hooking Ham_Killed and returning HAM_SUPERCEDE and I noticed that the animation is frozen.

If I force EV_INT_sequence on the player, sometimes it's just fast-forwarded to the final frame, sometimes it's fast forwarded to half-frames and freezes in mid-air.

I tried EV_FL_framerate, then EV_FL_frame, later on I tried EV_FL_animtime, and they just weirded things more...

So, how should I "play" a death animation cancelling all other influences ?

fysiks 07-17-2010 23:30

Re: Ham_Killed superceded - force death animation
 
You are trying to block a death yet the player has zero health and therefore puts him in limbo.

Hunter-Digital 07-17-2010 23:57

Re: Ham_Killed superceded - force death animation
 
Yes I know that, I said I forced a death sequence on him, but how do I properly play it ?

Arkshine 07-18-2010 02:22

Re: Ham_Killed superceded - force death animation
 
I guess you need to block CBasePlayer::SetAnimation(), then playing your wanted animation.

grimvh2 07-18-2010 14:01

Re: Ham_Killed superceded - force death animation
 
Can't u hook damage event, check if hes health goes to 0 or below, if so u supercede the damage.

Arkshine 07-18-2010 14:04

Re: Ham_Killed superceded - force death animation
 
You aim something complicated when you could easily with orpheu.

Hunter-Digital 07-18-2010 19:18

Re: Ham_Killed superceded - force death animation
 
I have absolutely no experience with orpheu and I kinda refuse to understand it at the moment :} so no thanks :P This happened when ham was first released too :P I didn't want to hear about it :lol: but now, I'ved slowly learned it and it's ok ... so, when orpheu's time comes, I'll use it, until then...


And no, grimvh2, I don't need to hook damage event and supercede damage because I need the player to actually die... if I supercede death, it does what I want... death but not really death :} I just need to fake the rest, scores, money and deathmessage already done, all it's left is the player's death animation... wich I can't figure out how to use.

The player in dying mode is like any entity with some pre-set animation (wrong one) on it... how would you completly overwrite that sequence ?

Oh, did I mention I really have no ideea how are frame, animtime and framerate used ? I don't :} framerate I thought it was the actual framerate, then I found out it was a percentage of the actual model's framerate (1.0 == normal model FPS), frame... it's the model's current (or starting ?) frame number... I don't know any other use of that... and animtime I don't know, it's it just a float, or gametime + time.. or wth :-?

fysiks 07-18-2010 20:33

Re: Ham_Killed superceded - force death animation
 
I'm still confused why anyone would want to supercede on ham_killed. It means you have 0 health but are still alive aka limbo. Can someone give a good example where you would actually supercede a death?

Hunter-Digital 07-18-2010 22:19

Re: Ham_Killed superceded - force death animation
 
Yes, you have 0 health and appear as dead... supercede blocks death cammera, death message, scores, money and round-end, wich is why I'm using it.

I faked the rest, even death cammera, looks normal... I'm just stuck at this animation thing... :|

Or maybe you need a code to visualize things:

PHP Code:

// ...
public plugin_init()
{
    
RegisterHam(Ham_killed"player""player_killed")
    
//...
}

public 
player_killed(idkiller)
{
    
// ... checks, defines, ETC !

    
if(bFakeDeath/* is true if id was the last player alive on his team */
    
{
        
entity_set_int(idEV_INT_deadflagDEAD_DYING)
        
entity_set_int(idEV_INT_solidSOLID_NOT)
        
entity_set_int(idEV_INT_iuser12/* spectator mode: chase locked */
        
entity_set_int(idEV_INT_iuser2id/* spectating: yourself */
        
entity_set_int(idEV_INT_iuser3killer/* view targeting: killer ; and voilla, the normal CS deathcam */
        
entity_set_int(idEV_INT_sequence104/* headshot sequence */
        
entity_set_float(idEV_FL_framerate1.0)

        
/* I don't know WHAT ELSE to place here so that animation plays NORMALLY */

        // other irelevant stuff...
    
}

    
// other irelevant stuff...

    
return bFakeDeath HAM_SUPERCEDE HAM_IGNORED


I don't think 8 replies were needed in order to understand one simple question.

jim_yang 07-18-2010 23:03

Re: Ham_Killed superceded - force death animation
 
you did all stuff above just for blocking round end? If so, please use a plugin made by arkshine which using orpheu, it's more efficient and logical. If not, never mind.


All times are GMT -4. The time now is 07:05.

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