Game Development Community

How would you implement a bow?

by Afrim Kacaj · in Torque Game Engine · 08/21/2006 (3:34 pm) · 6 replies

So the crossbow is easy because it is a one handed weapon. But how would you implement a bow and make the animation of the crossbow sync with the player while he is pulling the string?

#1
08/21/2006 (5:15 pm)
Play a blend animation on the player when you fire the bow.
#2
08/24/2006 (6:44 pm)
I was thinking more along the line of mounting the same weapon to both hands. The bow to his right hand and the string to his left hand, but i guess that would be too difficult.

Sounds like blend is the way to go, but now I run into new problems.

I have my weapon script set up so that it does not shoot until the mouse button is up.

stateTransitionOnTriggerDown[2] = "Pull";
When this happens I want to play a pullBow animation, and hold the animation at the end.

stateTransitionOnTriggerUp[4] = "Fire";
When this happens I want to play the fireBow animation and return the player to root pos.

playActionthread allows me to hold the animation in the end but the problem is that if the player shoots and starts running the animation stops playing. (Which I understand why and that it is by design)

playthread does the same as above. I tried specifying all 4 slots 0, 1, 2, 3

setArmThread is not meant for this kind of a thing although it almost works. Problem is that the arm thread is adjusted as the player looks up and down. So it works as long as I am looking straight, but if I look down the animation goes to the beginning.

Ideally I would love to have just one animation and a way to play it half way on the pull script and then play the rest on the release script.

So I guess my question is has anyone ever done anything like this before, if so how?

I don't need specifics (unless you've got them) just general ideas so that I don't look in the wrong place.

Thanks
#3
08/24/2006 (8:35 pm)
Try this resource its for guns but wood work for bows "Here"
#4
08/24/2006 (9:03 pm)
Thanks Dave but thats not it. I dont want to have two different models for the weapon. I just want to be able to pull back the bow and let it go when i release the trigger.
#5
08/25/2006 (5:19 pm)
I think it would be much easier to have the bow be a single model and do the following:

- Make a arms-only pose that holds the bow correctly.

- Make an animation for the bow model (in the bow model) where you pull the string back. Remember the distance you pulled it back.

- Make a blend sequence from the hold pose where the hand moves back that far.

optionally, you could make a upper body sequence for "release" that you would load as the action thread or something.
#6
08/25/2006 (7:14 pm)
Which of the available functions would I use to activate those animations? The problem with the current set of functions is that the only one that has a hold paramater is the setActionThread. But set action thread gets overriden as soon as the player starts moving.