Welcome, Please Register or Login

Tutorials \ Street Legal Modding Tutorials \ Animated Shocks & Springs

Author / Submitted by: MisterSir

Animated Shocks & Springs

How to set up animation for the shocks and springs

Animated Shocks/Springs Tutorial:
This tutorial will show you how to create the bones and set them up on the meshes of the suspension so that the game engine can modify the models in real time.

Things Needed:
-3D model of a shock absorber and its coresponding spring ready for exporting
-3D Studio Max 5.1 (5.0 will not do it, there is a bug with the bones)
-Invictus v4 SCX Exporter (v3 i havent been able to export working modifyable meshes with)

Step 1: Bone Creation and positioning
Open your model and position it at the center (0,0,0). Then click on the Character menu on top and select Bone Tools.

Then click the Create Bones button and draw the bone, and draw them in the FRONT VIEW.
To draw the bone just click ones for the starting point of the bone and click again for the ending point. Then you must RIGHT click to stop the bone creation and it will form a bone stub at the end of the first bone. Use the move tool to position the first bone at x=0 y=0 and then its stub to the same x,y cordinates. The starting position of the bone should be roughly at the top of the spring, and the end part at the bottom of the spring, to ensure that only that part will get deformed not the whole shock body. This concludes Step 1:


Step 2: Skin Modifier and Editing Envelopes
Now select both parts of the bone (the longer part and teh stub), right click them and go to properties and make them See-Through (this is just so you can see better it has no functional dependancy). Then select the shock and add a SKIN modifier to it.

After that click the add button in the Parameters section of the skin modifier on the right and select the Bones you created(if its the first bones in the scene it should be Bone01 and Bone02) You will see them added to the list in the parameters of the skin modifier.

Select one of the bones in the list and click teh Edit Envelopes button abit further up. An unusual eliptical thing will show up with editable points on it. Takes a while to figure out which ones you can move which way and what actualy they move. So as you can see they are built of 2 eliptical shapes one inside the other. The way i explain it to myself is the inner one is like the bone itself, adn the outer is all the meat that will be modified. When you move them around you will notice the vertecies that are enveloped by them change color. The more Red they are the more weight they have to them. Now you have to edit the envelopes such that the top ones center will covert the uper part of the shock and the bottom one the botom part, and their bigger elyptical things will overlap in the middle where the shock will be folding(same idea for the spring). Make sure all vertices are covered or you will get fucked up buggy shit. This is how i set them up:


Ones you have that select the bone in the skin modifier and scroll down untill you find the Weight Table buton. What your goign to do might or might not make any difference for the shock, but it will make the spring compress and stretch more realisticly. So when you open the weight table go to Edit and SElect All. Then click inside the N column ( so all the X will disapear), and then click inside the M column(so the new X will disapear from there too). There shouldnt be any X in that table. Close it and do the same for the other bone.


Step 3: Exporting and Scripting
Once you have your envelopes set up properly, you are done with teh 3dmax work now just need to export. Elect the shock or the spring and hit File/Export Selected. Enter a name and choose a directory( my advice dont do it directly in the game folder there is files you dont need). Select Invictus Export plugin v4(*.SCX) and hit Save. Then on the exporter pop up select the Animation check box.


If you go to the folder where you exported the file you will notice 5 files:
*.animdata(this you dont need)
*.hierarchy.txt(this you dont need)
*.matrixdata(this you dont need)
*.SCX
*.tex (this you dont need after you are done loading order in rpk)
Delete the uneeded files and then move teh SCX file to the game directory where you have scripted it. Now you need the bone script. For both the shocks and springs the bone script has teh same name as the .scx file except its extension is .bon. It also stays in the same location as the .scx. The bon file contains something like this (this is for my Ksport_GT_pro_R_shock):

bone00
-1
1.000000, 0.000000, 0.000000
0.000000, 1.000000, 0.000000
0.000000, 0.000000, 1.000000
0, -13.0, 0
-3.141593, 3.141593
-3.141593, 3.141593
-3.141593, 3.141593
bone01
-1
1.000000, 0.000000, 0.000000
0.000000, 1.000000, 0.000000
0.000000, 0.000000, 1.000000
0, 10.5, 0
-3.141593, 3.141593
-3.141593, 3.141593
-3.141593, 3.141593

The only two parts you need to edit is the red and the green. The red is where the top part of the bone sits at rest, and the green is where the bottom part of the bone sits at rest. Play around with them and set it up as you need. Things to keep inmind the game treates the back shock bones upside down so the bone00 is actualy the bottom took my a couple of tries to figure this one out. Ones you have that set up you will have properly animated shocks and springs. And that concludes the tutorial. Make sure you read it and comprehand it thoroughly before askign further questions.

Enjoy MisterSir Tags: No tags

Avatar

5. PunkGuy

2010-01-23 05:27

MisterSir great work.
sometimes its very helpfull to open slrr file by a notepad :D


4. JAG

2010-01-22 16:51

I bet it would take longer for me, lmao! Excellent tutorial, tho, MisterSir! Thank you! Altho now you will probably have kids who don't even know how use Max bugging you for help. :lol


3. MisterSir

2010-01-22 15:44

once you do it 2 or 3 times it gets routine and very easy. This part of the whole process of making a shock and a spring takes about 15 min.


2. Davidov

2010-01-22 13:59

Thanks, but...f**king hell, it's complicated...


1. Rolts

2010-01-22 12:02

Yeah! Thanks for this:D


Only registered users can post new comments

Administration panel

Contact Info

Put your e-mail, skype, phone numbers or any other contact information here so that your visitors could easily get in touch with you.