Game Development Community

Canceling attack animations?

by Michael Layfield · in Torque Game Engine · 12/02/2005 (9:16 pm) · 5 replies

We're planning on making a simple beat-em-up arcade game using TGE although from what we've seen in TGE so far, only one comman can be assigned per 'attack'.

Is it possible in TGE to implement a series of attacks by pressing only one button consecutively?

Example:

Pressing Left Click executes a punch and then pressing Left Click again while the first punch animation is still running exectutes another punch but with a different animation/property

We've tried searching the forums and resources but couldn't find any info regarding this.

#1
12/02/2005 (9:25 pm)
It can almost definately be done, not sure how though.
Maybe

function Attack
{
if thing.animation(Attack)
$AttckCode1Stuff;
else
$AttckCode2Stuff;
}

something along those lines...
#2
12/02/2005 (9:43 pm)
This can be done through weapon states. I don't have any exact code handy, but a simple 3-hit combo would work something like this:

Ready
   Transition to Attack1 on trigger

Attack1
   Execute attack1 animation and damage script
   Transition to Attack2 on trigger
   Transition to Ready on timeout

Attack2
   Execute attack2 animation and damage script
   Transition to Attack3 on trigger
   Transition to Ready on timeout

Attack3
   Execute attack3 animation and damage script
   Transition to Ready on timeout
#3
12/03/2005 (2:17 am)
I see, we'll go check it out. Thanks so much for the info, you see me and my programmer really need all the resources we can get.

Anymore info will be much appreciated.
#4
12/03/2005 (12:24 pm)
@Walter: I see that the method you outline is set to move between the states of the 'weapon', I understand. How do you get the playerClass to play the animation? By the weapon recoil state sequence?? by default a blend sequence Thread plays. The existing State Machine for weaponImage only has about 3 separate recoils to refer to. Is each 'punch' a blend sequence then? And for the weaponImage mounting, an invisible[or hand held weapon] DTS shape is mounted to the player's mount0 Node?? It would be great to see a scriptable solution around the default number of recoils for weaponClass without any Source code changes...:).
#5
12/04/2005 (1:22 pm)
@Rex: Using the default recoil framework should work fine if you're just using a few hand attacks that do not affect the player's movement. In that case, the punches would indeed be blend sequences.

Anything more complicated than that (ie: kicking, full-body charge attacks, etc) will probably require hacking up the C++ code, because the player's basic movement animations have a tendancy to override almost everything.

As for weaponImages, yes, mounting an invisible DTS shape works well enough.