AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Replacing player model (death animations only) (https://forums.alliedmods.net/showthread.php?t=108453)

reficooL 11-05-2009 12:45

Replacing player model (death animations only)
 
2 Attachment(s)
Hi masters!

I want to make a little plugin to add some gore stuff on my serv.

I saw this plugin:

http://forums.alliedmods.net/showthread.php?p=475029

I like the idea, but I want to go beyond.

I want to add the complete death animation with a skeleton model I've done (not mine, only recompiled with death animations).
And I want the player to disintegrate (to see later) and replace with the skeleton model (death animations), only if is killed with AWP, but I want it working first.

How can I "known" why animation may be used?

Ex: if player is crouch, crouch_dead anim, if was haedshot, headshot animation.

And how can I "select" the animation from a model? (to use one model only).

Errors I've got trying (if the entity is created using a model):

* The animation is reproduced, but only default animation (no change if crouch, etc), played once and no corpse remainig on ground. Just disapears immediately ???
* Default animation looping for a while.
* No animation, just appears a freeze model and stay immobile (standing) for a while.

I'm wondering it's due creating entity instead of replacing it.
But... How can I replace the player model in realtime (taking care at the current animation)? I think it's the way, but I dunno if it's possible.

Any suggestion?

Attached the skeleton model (see with HLMV) and a screenshot, greetings.

PD. I found this, maybe useful stuff:

Code:

public client_PreThink( id )
{
  // check some vars first and whatnot..
  set_animation(id, 2); // 2 = grenade throwing, what is death?
}

public set_animation( id, seq )
{
  entity_set_int(id, EV_INT_weaponanim, seq);
  message_begin(MSG_ONE, SVC_WEAPONANIM, {0,0,0}, id);
  write_byte(seq);
  write_byte(entity_get_int(id, EV_INT_body));
  message_end();
}


Arkshine 11-05-2009 12:49

Re: Replacing player model (death animations only)
 
If you have a linux server, you should try to play with Orpheu and the CS functions provided.

reficooL 11-05-2009 22:59

Re: Replacing player model (death animations only)
 
Quote:

Originally Posted by Arkshine (Post 981608)
If you have a linux server, you should try to play with Orpheu and the CS functions provided.

Hi, thanks for answer.
I've seen this post and the module seems AWESOME, but unfortunately my server is running on windows.

There's any way to do somehitng similar in windows? or are you considering add windows support for this module in the future?

Thanks, and good job awesome module.

drumzplaya13 11-05-2009 23:41

Re: Replacing player model (death animations only)
 
Quote:

Originally Posted by reficooL (Post 982106)
Hi, thanks for answer.
I've seen this post and the module seems AWESOME, but unfortunately my server is running on windows.

There's any way to do somehitng similar in windows? or are you considering add windows support for this module in the future?

Thanks, and good job awesome module.

The module was said to be very hard to code for windows.

reficooL 11-08-2009 00:57

Re: Replacing player model (death animations only)
 
Ok, it seems to be impossible to replace player models in real time, so:

1. On event death, get player direction and player model sequence (animation, crouch, hs, etc).

2. Remove original player model.

3. Create new entity with custom skeleton player model (with death animations/sequences only), taking care about original direction and sequence.

4. After reproduced player death animation (with custom skeleton model), replace it with static dead sekeleton, on ground, with the same direction.

I'll compile the necesary sequences/animations for the skeleton player model.

PD: Another way:

1. On event death, get player direction and player model sequence (animation, crouch, hs, etc).

2. Remove player original model.

3. Create new entity with custom skeleton player model (with death animations/sequences and static death skeleton), taking care about original direction and sequence.

4. After reproduced death animation, change the sequence to one static dead skeleton (included in the same model), on ground, with the same direction.

I think this second way it's more efficient and can be done.
Any sugestion?

Thanks, I've no skill coding/scripting.

PD: I dunno if this has to be in requests. ??


All times are GMT -4. The time now is 17:42.

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