This website views at its very best in Firefox web browser, and is not available in a mobile version.

      Copyright © All Rights Reserved | Built by Serif Templates

Parchment Background Image for How To's: The Ultimate CTR Creator, Page 12, on FlightToAtlantis.net Please turn to Page 13

   Opening






We've launched the Opening animation in Notepad++ which is an application that counts lines. If there is an error with our XML when Importing, the error message is usually helpful in telling what line it's not happy with. All lines are counted, including the lines with only a space. See our webpage here to download Notepad++.






The first thing we're going to do is to change line 8 to reflect the bone we're actually using. Change






<bone name=bone_[INSERT BONE NAME HERE]>






to






<bone name=bone_doorleft>






As a memory refresher we'll mention again that we're going for a simple animation where each door







pushes sideways from the car for 10cm and then


moves towards the back of the car by 1.5m.






These are two different translate movements so we only need two lines of translate code. Delete line 11 and 12 because we don't need rotate transitions for this animation. For these introductory animations we'll also delete line 11 and 12 from Opening, OpenIdle, Closing, and ClosedIdle before working with them.






Our XML should look like this now.






Image 101, HowTo's: The Ultimate CTR Creator, Page12

We'll aim for the door taking 2 seconds to push sideways away from the car and 4 seconds to travel 1.5m along the length of the car so now we'll enter our times. Now our XML looks like this:






Image 102, HowTo's: The Ultimate CTR Creator, Page12

Transitions need to be written in the order that they're expected to occur. We've entered 2 seconds on line 9. Note that the second transition on line 10 has been entered as 6 seconds although we want it to span 4 seconds. This is because the door is going to spend the first 2 seconds transitioning as per line 9 before it gets to line 10 at which time the door will be in position for the second transition and because we want the second transition to take a total of 4 seconds we need to add the 4 seconds to the 2 seconds and write 6 seconds here.






It is also an excellent idea to begin all animations by starting the Opening XML with a zero translation lasting for 0 seconds as confirmation that our bones and set points are all at X+Y+Z . This ensures that the game engine begins the animation accurately coordinated. Having added that, this is what our XML should now look like.






Image 103, HowTo's: The Ultimate CTR Creator, Page12

As you read earlier, cars need to be created at X+Y+Z=0 as if they're traveling along the X axis/main axis with their sides along the Y axis/across axis.






Image 104, HowTo's: The Ultimate CTR Creator, Page12

Before we type anything else into our XML we need to know the axis plus and the axis minus directions. Let's again refer to our illustration.






Image 105, HowTo's: The Ultimate CTR Creator, Page12

Because we're working with the left door and we want it to move away from the side of the car the translation will be a -Y transition so we'll adjust line 10 so it reads like this:

<translate time= 2.00000000 x= 0.00000000 y= -0.10000000 z= 0.00000000 />






Remember this value is a minus value so we've added a minus sign before the value. Although we added a - to represent a minus value we don't need to add a + sign to indicate plus values. Zero values don't need a decimal nor do they need a plus sign or a minus sign.






Now we need to add the door's translation 1.5m towards the back of the car. The illustration shows us that's a +X transition so we'll make our first adjustment to line 11:

<translate time= 6.00000000 x= 1.50000000 y= 0.00000000 z= 0.00000000 />






Line 11's second adjustment will be a code to ensure the door remains 10cm away from the side of the car as it moves the 1.5m towards the back of the car so we'll add a Y value:

<translate time= 6.00000000 x= 1.50000000 y= -0.10000000 z= 0.00000000 />






And just like that the most difficult part of our animation is done.






Image 106, HowTo's: The Ultimate CTR Creator, Page12

Save your Opening XML.






If we wanted our door to take 2 seconds to push sideways away from the car, add a pause there for 1 second, and then take 4 seconds to travel 1.5m along the length of the car we'd have written our code like this:

<translate time= 0.00000000 x= 0.00000000 y= 0.00000000 z= 0.00000000 />

<translate time= 2.00000000 x= 0.00000000 y= -0.10000000 z= 0.00000000 />

<translate time= 1.00000000 x= 0.00000000 y= -0.10000000 z= 0.00000000 />

<translate time= 7.00000000 x= 1.50000000 y= -0.10000000 z= 0.00000000 />






Note that the XYZ transition values representing the pause are all 0's. These 0's ensure the door remains stationary at this time.






   OpenIdle






We can consider this animation as the Open position being held in place, therefore for this animation we need only a single line of code. To get that code we'll simply copy line 11 of the Opening XML (the final transition location of the door) and then paste it into OpenIdle so it becomes the only line of code there. All we'd need to do after that is change the translation time in OpenIdle to 0 seconds.






Image 107, HowTo's: The Ultimate CTR Creator, Page12

And there's our OpenIdle XML done. Save your work.






   Closing






While Opening can be the most difficult animation to create, Closing is the easiest one to get wrong. For our purposes Closing will have three lines of code. The first line needs to reflect where our mesh was located while it's been on hold in OpenIdle so we'll copy the only line of code from OpenIdle (line 9) and paste it into Closing where it will become line 9 in Closing. It will serve exactly as we pasted it there for the first line of code in Closing.






Next, our door mesh that's been slid 1.5m along the side of the car towards its rear needs to return to the place where it was when, in Opening, it initially moved 10cm sideways from the left of the car. To do this copy line 10 from Opening and paste it into Closing so that it becomes line 10 there in Closing. Because this sidelong slide initially took 4 seconds to open we want to be consistent and see that it takes 4 seconds to close so change the translate time here on line 10 to 4 seconds.






For the final line of code we only need enter a time along with zeros for each of the X, Y, and Z fields. Our total Opening transition was 6 seconds so for consistency we want our Closing transition to also be 6 seconds. We've already put 4 of those seconds on line 10 so that leaves 2 seconds.






Remember in Opening we entered 6 seconds as the translation time on line 10 although that specific translation was 4 seconds? We need to do the same sort of thing here but in reverse. The total transition time for Closing is also 6 seconds, After the door has taken 4 seconds in this animation to slide along the side of the car towards its front we want it to take an additional 2 seconds to snug into the side of the car and the way to achieve this is to add the 4 seconds to the 2 additional seconds that we need in order to total the 6 seconds as the translate time on line 11.






Image 108, HowTo's: The Ultimate CTR Creator, Page12

You may save Closing now that it's completed.






   ClosedIdle






Because the animation for our door starts and ends at X+Y+Z=0 without any transition, simply copy line 9 from Opening and paste it as line 9 into ClosedIdle.






Image 109, HowTo's: The Ultimate CTR Creator, Page12

Save your ClosedIdle XML.












 The <!-- Header And The --> Footer







Drag the above toggle to a

convenient place on your screen.




The Ultimate CTR Creator

Table Of Contents: