Continuing weapon animations

Locked
torhu
Posts: 76
Joined: Thu Jun 16, 2005 7:57 pm

Continuing weapon animations

Post by torhu »

I'm trying to make it possible to pick up a dynamite with a lit fuse (wq3 mod). Picking it up seems to be doable, guess I can do a custom weapon change in bg_pmove.c, and then use an event if I need any other info transmitted to the client. It sort of works already.

But how can I get the animation to start from the correct frame? PM_StartWeaponAnim() just starts it from the beginning. When the fuse is lit, there's a spark moving down along the fuse. The position of the spark seems to be calculated based on the frame number of the weapon animation. But I'm not quite sure about that last bit.

When lighting the dynamite, the timer is kept in ps.stats[STAT_WP_MODE]. When the dynamite is thrown, it's copied to dynamite->s.apos.trDelta[0] and dynamite->nextthink. dynamite->think is G_ExplodeMissile. So I basically need to reverse this process, and get the dynamite back into the hand of a player, with the spark position and the timer set correctly.
[url=http://www.smokin-guns.org]Smokin' Guns[/url]
[url=https://sites.google.com/site/monsterbrowser//]Monster Browser[/url]
Caffeine
Posts: 115
Joined: Fri Feb 24, 2006 8:00 pm

Post by Caffeine »

You could try asking about this over at QuakeSrc.
Locked