Making Custom Weapons This is a tutorial I've made to attempt to explain the process of making custom components. It explains how to prepare a mesh you have created, how to export it using my GMF tools, and how to compile it and put it in the game using my GMF compiler. I can only recommend it to people with experience in 3D Studio Max r5, and decent computer knowledge. It's pretty bad at the moment as I have not had much time to work on it. If you can think of any improvements, or want to submit tutorials yourself email me ![]() The easiest way for you to go about this is to load the reference .max file I prepared. This means you don't have to worry axis or scales. Download this file and uncompress it. Load the .max file into 3D Studio Max r5. Note that your weapons do not need to align to the reference robot, it is simply there to allow scale determination. ![]() To bring your mesh into the scene use the Merge command from the File menu. Find your saved .max file and merge it into the scene. Follow any steps neccessary to merge it. You may find that your mesh is too big/small compared to the reference robot. This is the time to scale, move and rotate your mesh so that is in a perfect position. ![]() ![]() I'm importing a mesh I was sent in an email. As you can see it's way too big to use in the game. Remember that you must only rotate, scale or move your merged mesh. Do not scale or rotate any of the existing reference meshes. ![]() ![]() Select the reference mesh "reference_display". This is the mesh that will be displayed as your component. First we have to get rid of the existing faces and vertexes (otherwise your component will have a huge cylinder in it.). Open up Editable Mesh and select Element editing mode and select all the faces using Select All. ![]() Press Delete on the keyboard and choose Yes to Deleting Isolated Vertices. ![]() Now select Attach from the Edit Geometry rollout and click your mesh. It will become black showing that it is now joined to the mesh. ![]() Now you have the chance to position textures on your object. Make sure that your mesh is totally finished because if you edit it any more you will lose these texture settings. You can skip this process if your mesh does not require a custom texture ![]() Rename the model your mesh is in to mycomponent_display (or a name of your choice. Things such as axe_display, reaper_display, etc). ![]() Load the GMF export maxscript (see its readme for info how to do that) and make sure the model is selected. Ensure main_display is not checked and hit Export. ![]() In the Robot Arena component folder, create a directory for your component (I recommend something useful. I used d1_ followed by a short name: d1_reaper, d1_axe, etc). Copy reference.gmf into this folder and rename it to mycomponent_txt.gmf (or whatever you wish to call it). Open it in notepad, and also open the file you just exported (c:\test.txt) in another instance of notepad. ![]() The left picture shows your new GMF file. It contains a 'template' GMF file ready to insert your mesh data into. ![]() Copy all the lines of data from c:\test.txt and paste it right below *OBJECT_COUNT 5 in your .GMF file. Make sure there is no gap between the *GEOMETRY line from your mesh data and the *OBJECT_COUNT 5 line. ![]() Use the Clone command in the Edit menu to create a copy of your _display mesh. Make sure that _display on the end is replaced with _collision ![]() ![]() You can select this new cloned _collision model and remove any texturing. This cuts down on the size of your GMF file and removes unneeded data. ![]() You can now select and export this new _collision mesh. Make sure main_display is not checked this time, and click Export. ![]() Open the newly created c:\test.txt into notepad and copy all the data in it. ![]() Return to your GMF file and paste this new collision mesh data straight underneath the previously pasted _display mesh data. Make sure there are no gaps between the last mesh's } line and the new mesh's *GEOMETRY line. ![]() You may now want to edit the actual havok data. Ensure that *NODE_NAME matches your exported _dispay mesh's name, and *GEOMETRY_PROXY_NAME matches your _collision mesh's name. It's also wise to check all the *MATERIAL_REF's on the end of *GEOMETRY objects to ensure they're set to 0 (as we only have one material). ![]() Finally we create an attachment point. Create a Point type object in 3D Studio Max. IMPORTANT : Depending on what view you create this object in depends on which direction it attaches in: Top: The attachment point faces north of the top view Front: The attachment point faces south of the front view Left: the attachment point faces west of the front view ![]() Here I want it to face downwards to allow the component to spin, so I create it in the Front view. ![]() With the point object selected, export it using the maxscript. It will update c:\test.txt with the attachment point data. ![]() Open the test.txt file. We are going to have to add some info to it before copy pasting it to our GMF file. Use the picture on the left as a guide to how it should look. Attach = specifies what this object can connect to/can have connected to it. Possible values are base_f, base_n, axle_f, axle_m, generic_f, generic_m. Play around with them till you find the right one. Also ensure ID = is different for each point. ![]() Finally we select all the attachment point data, copy it, and paste it into our GMF file. Again, ensure no spaces are left between lines as this could confuse the compiler. ![]() Before you can compile you need to ensure the texture filename is correct. It's at the top of the file in the *MATERIALS section (search for .bmp in the file). Save the completed GMF file and run the compiler. Select it as the source file and set the destination file as the .GMF file minus the _txt (so if it was blah_txt.gmf set destination as blah.gmf). Hit compile and cross your fingers. ![]() If you receive an error message "Input Past End of File" you have probably put a blank line somewhere in the GMF file. Check it over and try again. ![]() After that: All that remains is to create a component .txt file that describes how the component should be used in the game and move all textures to the components folder. I included a reference one (reference.txt) that shows an example of one, so simply make a copy of it and rename it mycomponent.txt (or again, whatever you wish it to be called). Play about with the settings and learn what they all do. Your component's texture must be placed inside a folder called Maps inside the components own folder. If you are stuck on this last stage I recommend downloading this file and uncompressing it. It shows the files that need to be inside a component's folder. If you have any questions check out the RobotArena.com forums as I usually post there and can answer small questions. If you can't get a GMF to compile, post it on the forums and I'll try to correct it and note what the compiler was picky about. Learning more: In future I'll post some more tutorials on advanced components such as custom collision meshes, texture UVW unwrapping, etc. Until then I recommend you experiment as much as you can with the methods I've shown. You can't break your computer (or the game) by creating and editing new components so theres no harm in experimenting. |
DUmmy Tutorials Made Downloadable by: HackerX