Unreal Development Kit 17c - Custom Weapons Part 3 - Animated Weapons

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

UNREAL DEVELOPMENT KIT 17c - Custom Weapons Part 3 - Animated Weapons

WHERE YOU NOW ARE Theoretically, at this point you have been able to import a custom weapon into your Level, place a Weapons Pickup, choose your weapon from the drop down menu and then play with that weapon. Next step is to add basic animations to our weapon such as Idle, Equip, Put Away, Fire and Reload so your custom weapon workd more like the basic weapons that come with UDK. Follow these instructions carefully and you will have added another layer of complexity to your skills. SETTING UP BONE OBJECTS 1. Open up the Thompson weapon I provided for you on the web in Max. First thing to do with this is change the timeline so we can add more animations. Click the Time Configuration button in the lower right part of the Max window. Change the Length setting to 300 and click OK to close the window. Check your time scrubber to make sure it now registers 300 frames in length.

2. In the Front view, rotate the weapon around so that the barrel faces to the right. This orientation to the x-axis is important with animated weapons. Up to now that has not been too important with a static model but becomes critical now. 3. Still in the Front view, go to the Create Panel / Helpers (right) and select the first button called Dummy. We are going to use dummies rather than bones for these animations. Create a dummy object right on the 0,0,0, crosshairs in your screen (below). Name this dummy b_gun_right_hand. Clone a copy of this dummy and position it on the clip and name it b_Ammo.

Create another clone copy and position it i where the left hand would go under the barrel about halfway out to the end. Name this dummy b_gun_left_hand. Create another clone copy and position it at the end of the barrel. Name this one b_muzzleFlash. For the last one, clone copy one of the other dummies and position it right over the trigger. Name this one b_Root.

b_Root b_muzzleFlash

b_gun_right_hand b_Ammo

b_gun_left_hand

Make sure that all these dummies are centeered on your weapon in the Top view. 4. Select the right hand, left hand, muzzle flash and Ammo dummies and use the Select and Link tool to link them to the b_Root dummy. Test whether or not you linked correctly by moving the b_Root dummy and the other 4 should move with it. Ctrl-Z to undo the move (dont try to reposition, just undo the move). If they are not linked correctly, do it again until you have them done right. 5. Select the Thompson gun, switch to Element subobject, select the ammo clip and then detach it from the model. We will animate that separately for the Reload animation. 6. With the gun selected, add a Skin modifier. Add all of the dummies to the bone list EXCEPT b_Ammo. 7. Select the b_Root dummy in the bone list and click the checkmark box for Vertices. Select all of the vertices on the model and set the Weight Properties / Abs. Effect to 1.0 so the entire gun turns red.

8. Now do the same thing to the Ammo clip. Add a Skin modifier, add only the b_Ammo dummy as a bone and make sure that every vertex is assigned red. BASIC IDLE ANIMATION FOR OUR GUN All gun movement animations (except reload) involve animating JUST the r_Root dummy since all of the other dummies are linked to it. 9. Reposition your perspective window to kind of reflect the way youll view the first-person gun in UDK (right). 10. Select the b_Root dummy and then click N to toggle on the Auto Key animation mode. 11. Make sure your timeline is set to frame 0 and click the Key button to place a keyframe at 0. 12. Move the time slider to frame 100 and click the Key button again. This establishes beginning and ending points for your animation and are both located in exactly the same place. 13. Move the timeline to frame 50. Switch to the rotation tool and rotate your gun upwards about half a degree (idle movements are very subtle). Your best bet is to set your Angle Snap tool to .25 which will make small movements that much easier. 14. Move the time slider to frame 33. Rotate the gun .25 degrees to the left. Then move to frame 66 and move the gun to -.25 degrees. Run the animation...you should see slight movement up, down, left and right. If necessary, right-click on any of the keyframes and change the settings as shown in the demonstration. BASIC PUTAWAY ANIMATION FOR OUR GUN 15. Move the time slider to frame 110. Click the Set Key button again to establish a start point. Frame 100 and 110 should be IDENTICAL. 16. Move the time slider to frame 140 and click Set Key again. While still at frame 140, use the Select and Move tool to pull the gun down and out of the line of view. Now use the Rotate tool to rotate the nose of the gun downwards about 20 degrees, then rotate sideways about 20 degrees so the muzzle goes left. Switch the Reference Coordinate System from View to Local and rotate the top of the gun about 45 degrees to the left. Go back and watch the animated segment. You should see the gun swing down to the left and away from the action.

BASIC EQUIP ANIMATION FOR OUR GUN 17. This is a reverse animation of our Put Away, so well just use the keys we already have to quickly make this animation. Select the keyframe at 140. Hold down the Shift key and drag a copy to frame 150. Then, select the key at frame 110 and Shift-Drag a copy to frame 180. Boom...done! BASIC Fire ANIMATION FOR OUR GUN 18. Shift-Drag the keyframe at frame 180 to frame 190 and repeat that to copy one at frame 200. 19. At frame 196 slide the gun back about 1 unit. Rotate the nose of the gun up about .25 degrees. RELOAD ANIMATION FOR OUR GUN This one is a bit more complicated because it involves manipulating both the gun and the Ammo clip together and separately. Everyone will have a slightly different look to their Reload animation because of the way it is constructed -- you can do it exactly as I do or you can do it visually yourself. Either way works, but all were really trying to do is pull the gun nose up to the right, roll it slightly to the right, remove the clip and then replace it. 20. To establish the beginning and end keys for this animation, select the b_Root and Shift-Drag a copy of keyframe 200 to frame 210. Then repeat to add an identical keyframe at frame 300. 21. With b_Root still selected, make sure your Reference Coordinate System is set to Local. 22. Move the Time Slider to frame 230. Rotate the nose up about 20 degrees. Raise the weapon up about 10 units on the Y axis. Then rotate the top to the right about 10 degrees. 23. Shift-Drag a copy of this keyframe to frame 250. This holds the gun in position for those 20 frames. Heres what you should see when you scrub through this animation so far: a. 200-230 Weapon and revolves raises up to the right b. 230-250 Weapon remains raised c. 250-300 Weapon lowers to starting position 24. With Auto Key still turned on, select the b_Ammo dummy. Move the Time Slider to frame 210 and then click the Key button to add in a Keyframe here. Move the Slider to 300 and repeat to add a Keyframe there. 25. Move the Time Slider to frame 230, click the Key button to add a key here. Move the Time Slider to frame 250, and making extra sure that the Reference Coordinate System is set to Local, slide the Ammo clip about 30 units down so it goes out of your view. Turn off your Auto Key animation. Scrub through your animations to see the whole set.

EXPORTING YOUR GUN AND ANIMATIONS 26. Well be using the ActorX plugin to export both the model and animations, so open it up so you see what well be using. Also, make sure you have your entire model and all dummies selected because ActorX only exports what you have selected. 27. Just like exporting your previous model, select the Output folder and name your mesh to something like WP_1P_Thompson. Note: if youve already exported this model out with no animations, re-export it because you now have bone dummies which have to be a part of the file. Click the Save mesh/refpose button. You should get several popups: first says the number of vertices added. Click OK. Second one should tell you the file was written. If you get others, then you have problems you need to address -- most have to do with missing Skin modifiers, dummies not attached, etc. Go back and repair anything it says to do.

28. To save the animations type the name of the animation in the box below the export button. Use WP_1P_Thompson_Anim as the Animation File Name. 29. Each individual animation you created must be typed in and digested so we can apply it in UDK. You have to do each separately. Type WeaponIdle in Animation Sequence Name. Type 0-100 in Animation Range. Click Digest Animation. A window pops up telling you it has been digested. Click OK. 30. Repeat this exact same sequence for the next animations: WeaponPutaway 110-140 WeaponEquip 150-180 WeaponFire 190-200 WeaponReload 210-300 31. When all are done, click Animation Manager button. At the top of the next page is a picture of the Manager. Notice that all of the animations you just digested are listed on the left side of the windows. Select all 5 and click the Copy arrow in the middle aiming to the right to add them into the final animation set. The filename should be what you typed in earlier, so just click the OK window. Save up your file, and quickly check the folder that you designated the place where your model and animations were exported -you should see two files: WP_1P_Thompson.PSK and WP_1P_Thompson_Anim.PSA.

If you do, youre good to move on to UDK. Quit Max and lets do some importing and scripting.

You might also like