Torque Tutorials - How to Create a Torque Mission File - The Terrain
How to Create a Torque Mission File - The Terrain
1. Create your terrain. Make sure to save it as a .png file with the dimensions 256×256 pixels height and width. Remember that the white areas will be your mountains or your highest points. The dark areas are your lowest points. The file will be grayscale.
2. Here’s the biggest trick. You need to make sure that you save your terrain map in a directory named “heightscripts”. The location is very important. You need to save it in GameRoot/common/editor/heightscripts/. You need to save it in the prescribe location because that is the only way that the program will be able to locate your file. You’ll see more in the next few paragraphs.
3. In this example, I used the file that came with the starter kit. The found in the starter.fps directory. The clouds, sun, lighting and water was just fine, so I left is as is and just imported my map. It wasn’t perfect mind you, there were some instances where the huts, spawn points, and other clutter could be found underneath my map. That wasn’t good, but we will deal with that. Our priority at this time is to just get the map working!
For example, below is where I would keep my map (in the heightscripts directory):

This tells us that “jtmap.png” is located in:
C:\JamesFPSTest_original\common\editor\heightscripts
3. Once you have your map ready to go and in the right place, launch your game. Go into one of the missions and hit F11 on your keyboard. You will enter the world editor.
When you are in the world editor, go to the File menu and select new mission. A default mission scene will be created for you. It looks like something below:

Then go to the Window menu and selec Terrain Terraform Editor. You will see a screen similar to below:

Then click on the Operation button and select bitmap in the pulldown menu. This will bring up the Load File… dialog box. You should see the map. Select the map you want to use and click the Load button located in the lower right corner of the dialog box. You will then notice that the location of your file shows up in the right hand area of the editor. It is just above the Choose… button. Click the apply button. You should then see the terrain as per your bitmap file.

You will also see your map file in the lower left side of the screen. Instead of white and black, it is flourescent green and black.
Before we forget, let’s save this. Go to the File menu and select Save mission. A dialog box will appear asking for a name. The default name is newMission.mis. Ofcourse save the new file with a relevant name. Then save it.
Now that you have your terrain in the program, it’s time to adjust some of the environmental settings such as the cloud, sky and water. We’ll do that in the next tutorial. Otherwise we can leave it as is. The sample came with starter kit works just fine for most applications. But you can fiddle with the settings to get different water effects, settings, and moods.
To exit, you need to hit F11 and press the escape key. That will take you to the main menu where you can quit the file.
How to Create a Mission File - Spawn Points and Other Clutter
Using the starter.fps files is a great way to tinker and find out the inner workings of the program. Truth be told that I believe it is one of the best ways to get deep into any program or skill. Get you’re hands dirty and try things out. Just make sure you have a back up copy in case you’re anything like me, constantly messing up files. Using the starter kit files may also save you time in the beginning as a lot of the foundational framework is already done for you. You merely have to get over you personal ego and extend it or modify it. Now, if you really want to start from scratch, then come back in about 8 months and we’ll see how you did. So learn from the masters who put this sample file together. In time, after working with it long enough and continuing to read a learn, you will be able to start coding using basic patterns as starting points.
Let’s start with the easiest part. You will notice that some of the assets or clutter are buried or submerged within other files. This makes sense as you basically replaced an entire terrain with a completely new one. So you can expect homes and things sinking. Some things that we will tackle are:
1. Take out the assets or clutter we don’t want. We also will work with the accompanying scripts that call those parts.
2. Move spawn points so that they don’t appear under the terrain where it will not be seen when the game is running.
3. Modify sky, sun, water, and other settings to get a sense of how the terrain editor works.
4. Move assets other assets around so they are not buried in the new terrain.
There’s a few more notes I wanted to make, but this one just took waaay to long to do. I am gonna take a break. It took me 3 weekends to tinker and figure out what I just wrote.
Anyway, it’s summer and holidays are starting, I hope to write a few more tutorials in the next few months.
Have a safe and happy summer everyone
*Note: Thanks to fluff for reminding me to let peeps know the tutorial is using the Torque Game Engine.