Game Development Community

Torque 101: Day One

by Infinitum3D · 10/15/2006 (1:54 pm) · 1 comments

First Rule, save your work often!!!

OK, so I'm trying to add a lake to my map. I'm using the GameOne mission from the tutorial.

1. First I used the World Editor (hotKey F2) to raise the ground in a circle, like a volcano. I keep my brush small, 3x3.

2. Next, use the World Editor Creator (F4) and go to Mission Objects>Environment>Water

This opens a pop-up window called Building Object: WaterBlock. In Object Name, I named it Lake (real original). Anyways, click OK to accept the defaults, since I don't know what the wave parameters do yet. We'll change a couple settings in a minute.

OK, so this opened a flat plane of water which I couldn't find in the camera view, (NOTE: I do all world editing in Camera View. Hit Ctrl+TAB to toggle back and forth from player view to camera view) so I went to the upper right window (tree view) and found 4900: Lake - WaterBlock. I think the 4900 is randomly generated, so just look for the WaterBlock.

3. Then I opened the World Editor Inspector (hotKey F3). In the TRANSFORM section, I changed position to 0 0 0, but still could find the water, so I highlighted the 4900: WaterBlock in the tree view and clicked World>Camera to Selection.

Whoa. What happened. OK, I moved around a little and saw I was near a big opaque square. I found my lake, but it doesn't really look like a lake floating here in the middle of nothing. I'm not sure how to move the water other than using the TRANSFORM>POSITION section.

4. I gave up on my original volcano/lake, and used the Terrain Editor to create a rim of hills around the lake. I know it's better to bring the lake to the mountains, but we'll learn that later.

So now I have a lake in a mountain, but it doesn't quite seem right.

5. Let's go to the Inspector (F3). In the TRANSFORM section I see SCALE, so I changed the 32,32,1 to 32,32,32. Aha, I learned that the last digit (the 1) is the height of the object (water). Not how thick the water is, but how high off the ground it is. The water itself is just a flat plane (surface) with no thickness.

OK, so I mess with the numbers until I get it to fit my mountain. My end result is 40,40,3. Yours will probably be different.

6. OK, next I File>Save the mission, and File>Exit.

7. I restarted the mission, by clicking Start (from the tutorial). My world loads, and I'm back in player view. So I run around looking for my lake. Boy, it's like a million miles from the PlayerSpawn. We'll have to fix that later.

Finally I find it. (I had to cheat by switching to Mission Editor/Camera View to see where it was, then I went back tp player view).

8. The water is hard to walk through. Is is supossed to be? I don't think so, but how do I fix it. I remember something about viscosity in the Inspector. Go back to Mission Editor (F11), World Editor Inspector (F3).

Highlight Lake - WaterBlock in the tree view. In the Inspector, set FLUID> LiquidType> Water, Fluid>density>1, Fluid>Viscosity>5.

Then SURFACE>waveMagnitude>0.1

What this does is affect the physics of the water. The surface moves a little, and walking is like being in a real lake. You float a little when it gets deep. It's harder to start moving and stop moving. You aren't really swimming, as much as running/floating through deep (sometimes over your head) water. Breathing hasn't been programmed in yet, so you can't drown yet.

9. Last thing. Since we worked so hard creating the lake, highlight the Lake - WaterBlock in the tree view. Then World>Lock Selection (hotkey Ctrl L). This locks the WaterBlock so you can't accidentally delete it.

10. Finally, File>Save Mission As... gameonemission.mis

I'd like to put in some kind of compass/direction monitor. I think my lake is a long way South of the playerSpawn, but I can't be sure. Maybe I'll just move the Spawn closer to the lake. Or even add a Teleport Platform to zap me back and forth between the lake and the spawn. Also, we need to program in a "breathing/holding your breath underwater" system of some kind.

OK, in the treeview in the folder PlayerdropPoints - SimGroup highlight the SpawnShere. Go to camera view (ALT+C), find the spawn shere and drag it closer to the lake. Make sure the box at the center of the sphere is on the ground. If it's too high, the player will fall to the ground when spawned. If it's too low, the player will fall through the ground into the void.

#1
11/09/2008 (7:59 am)
Just some tips ;-)

When you are about to create the water block, move the camera above and to the side of where you want to add it so you have a good view of the spot. Go to the World menu, and make sure that Drop Object at Screen Center (it's something like that) is checked. Then add the water block.

From there, you can use the little X-Y-Z arrows that point out of it (You may need to move the camera around to get a good view of the arrow you want. Hold the right mouse button in the editor and you can move the cam around as you please.). Click and drag the mouse button over an arrow when it's highlighted to move the object on that axis. As for making it the right size, hold Ctrl and Alt while dragging the arrows to increase the size on that axis.

Once you get a hang of it, Torque isn't too bad. I wish you luck with everything, happy Torque-ing!