jam1garner

MTA Editing tutorial

Sep 8th, 2016
813
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.54 KB | None | 0 0
  1. Ok so first off, you should have MTA_Dump.py, MTA_Dump.bat, MTA_Create.py, and MTA_Create.bat. If you were linked to this you should be able to find it.
  2.  
  3. So first off, have an idea of what you want to do with MTA. It's probably stage texture/material/UV/VIS0 animation because that is what this does best. Other stuff is possible like custom eye expressions for characters and other things if you're into that. Also if you add a model.mta to the cXX folder I believe it will loop whatever animation you give it so that's neat.
  4.  
  5. Try and find an MTA that is similar to what you are looking for to use as a base. If you are somehow amazing enough to replicate the CSV dump of an MTA than you can also make it from scratch, but that's a little harder.
  6.  
  7. Once you have an MTA you want to either inspect or edit, drag an drop it over MTA_Dump.bat (Or for cross platform support/command prompt usage use the command "MTA_Dump.py model.mta", same goes with MTA_Create) This will create Output.csv, a dump of your MTA (as the name implies)
  8.  
  9. Open the csv in notepad or any other text editor and you are ready to edit. Most values should be self explanatory, so I'll let you figure those out.
  10.  
  11. When you are done editing you want to drag your CSV over MTA_Create.bat and it will create an MTA out of your CSV (if the syntax is correct)
  12.  
  13. One thing to always remember is that you want your material hash to match in the NUD and the MTA so that your material change applies! To fix this use a NUD material editor that supports Material hash and change either the MTA or NUD to match.
  14.  
  15. More advanced usage:
  16. One thing you can do with MTA_Create that isn't very intuitive is keyframe material/UV animations. Normally these are "baked" animations, which means if you want to make a 600 frame animation... you have to type in values for every single frame. However I also support keyed animation -> baked animation compiling!
  17.  
  18. How to use this...
  19. Take a material animation as such, this is straight from a dump. It is affecting NU_finalColorGain and is animated (Note: I cut off a lot of the frames... there are usually way more)
  20.  
  21. Material
  22. phong6__S_CUS_0xa3c01901__A_AB__1__NORMEXP16___VTC_
  23. Material Hash,0xa33f112d
  24. Has PAT0,0
  25. ###
  26. Material Property
  27. NU_finalColorGain
  28. MatProp_Unk1,1
  29. MatProp_Unk2,1
  30. Compile Type (Baked or Keyed),Baked
  31. 1.0,1.0,1.0,1.0
  32. 1.0,1.0,1.0,1.0
  33. 1.0,1.0,1.0,1.0
  34. 1.0,1.0,1.0,1.0
  35.  
  36.  
  37. Now if we want to turn this into a custom Keyed animation we first need to set the compile type to Keyed. Just replace where it says "Baked" with "Keyed."
  38.  
  39. Next we are going to want to make the actual animation. To do so we are going to have to remove the existing baked frames. To do this, just delete everything between the compile type line and the next "###" (The divider between material properties). In the above example it would look more like this now:
  40.  
  41. Material
  42. phong6__S_CUS_0xa3c01901__A_AB__1__NORMEXP16___VTC_
  43. Material Hash,0xa33f112d
  44. Has PAT0,0
  45. ###
  46. Material Property
  47. NU_finalColorGain
  48. MatProp_Unk1,1
  49. MatProp_Unk2,1
  50. Compile Type (Baked or Keyed),Keyed
  51.  
  52. Now we are ready to actually make the animation. The format use will be
  53. "frame number,property values"
  54. In the example, there were 4 values per frame, so in the keyed version we will have 5 values separated by commas. An example frame would be:
  55.  
  56. 50,1.0,0.75,0.5,0.0
  57.  
  58. This means on frame 50 the values will be 1.0, 0.75, 0.5, and 0.0.
  59.  
  60. Now for those that don't understand how keyframing works, lets go over it real quick. Think of it like a graph. From frame 0 to the first keyframe you write it will be whatever value the first keyframe you write has. Then between the first and second keyframe it will have a steadily increasing/decreasing value. Same thing with keyframe two to three. Let's look at an example real quick to see how this works in practice. In the following example I'm just going to make the material only have 1 value involved just to make it simple, but this should scale up fine.
  61.  
  62. Material
  63. phong6__S_CUS_0xa3c01901__A_AB__1__NORMEXP16___VTC_
  64. Material Hash,0xa33f112d
  65. Has PAT0,0
  66. ###
  67. Material Property
  68. NU_finalColorGain
  69. MatProp_Unk1,1
  70. MatProp_Unk2,1
  71. Compile Type (Baked or Keyed),Keyed
  72. 0,1.0
  73. 50,0.5
  74. 60,0.5
  75. 100,1.0
  76.  
  77. Here is an illustration to help understand: http://i.imgur.com/Nf6gCF2.png
  78.  
  79. The graph above shows the Y being value, X being frame. Enjoy, and mess around with it some! If you need help this game has plenty of MTAs, just dump em and look at the CSV. The MTA created by MTA_Create uses only data from the CSV, so as long as it is formatted like a normal MTA dump it will compile/build your MTA!
Add Comment
Please, Sign In to add comment