Chapter IV
Building a Simple Level
WED icons to be familiar with for this chapter:
New:
Open:
Save:
Build:
Run:
Move:
Rotate:
Scale:
Note: When working in WED, MED, SED, or any other programing tool for that matter, make sure you save often. Nothing is more frustrating then working for 2 or 3 hours on something only to see it disappear in blink of the eye.
Note: I am assuming you have at least a basic knowledge of WED & SED and how they work.
I guess it's time to build a simple level in WED (or you can just use the provided level and script and follow along).
Open WED and hit the New Icon, then File-Save As-multiplayer.wmp into the Multiplayer folder. Now go File-Map Properties-New Script-Empty Script. Now Save again.
Now let's create a fighting area, go Object-Add Cube-Large. Now click on the Scale Icon, resize the cube so it its pretty large (x & y -1000 to 1000 quants or so, z from around 0 to 50 quants). Now l-click on Move Icon, and drag the cube down so it is just below position 0 on the z-axis.
The level should now look something like this.
Lets go ahead and give it a basic texture of some kind. Go to Texture-Texture Manager-Add Wad- (Gstudio Folder-Multiplayer Folder (work folder)-Wads Folder-multiplayer.wad)-Open-Ok. We have now added the multiplayer.wad to are textures. Now, make sure the cube is selected by l-clicking on it (it should show up as red). Now l-click on texture tab, l-click multiplayer.wad tab, double l-click on the earthtile texture, it will now appear under texture, now r-click on the texture, l-click on Apply. Now Save.
The level should now look something like this.
Now go Object-Add Primitive - Spheres - 26 Sided A. Click on Scale Icon and re-size it until the edges are touching the edges of the cube and then re-size it vertically too. Now click on Move Icon and position it so the bottom of the sides of the sphere are slightly outside the cube we made earlier. Now l-click on texture tab, l-click multiplayer.wad tab, double l-click on the stars texture, it will now appear under texture, now r-click on the texture, l-click on Apply. Now Save.
The level should now look something like this.
We are using the biosphere for a visual effect, similar a sky sphere, so we don't really want it to have any collision detection, so go ahead and r-click on the sphere, select properties, and the set the passable flag to on using the check box as this picture shows.
This allows us not to have to worry about our gravity code or placing player on floor code to accidentally place the player on top of the sphere.
Now hit Build Level Icon, the Map Compiler Window should pop-up. Make sure Build Level Button is selected, then hit OK Button. After the level is done compiling, hit OK Button again. Now Save the level.
Ok lets add enough script to make sure the level is working properly so far. L-Click on Resources Tab , then open Script Files Folder, r-click on multiplayer.wdl, then l-click on open. This should open SED, the script editor.
Now add the following lines of code.
// multiplayer.wdl
//*******************************************************************
//
// Locoweed's Multiplayer Tutorial I
//
// Name: Bioshere IV: Lunar Mania
//
// Date Created: 09/15/04
// Last Update: 10/25/04
//
// Author: Frederick "Locoweed" Sims and You
//
// Description: Multiplayer Deathmatch Shooter made for Conitec's
// 2004 Tutorial Contest
//
// Rules of Use: Freeware. Credits appreciated.
//
// Contibutions:
//
// Models:
// lightgun model: Kai Kieschnick
// rifle model: created by logaan (Daniel van Westen)
// webmaster@lunatic-software.de
// www.lunatic-software.de
//
// Textures:
//basewalls: Gay "Bopete" Crawford
//basewalls: Gay "Bopete" Crawford
//stars: Gay "Bopete" Crawford
//crators: Gay "Bopete" Crawford
//planet: Gay "Bopete" Crawford
//
// Scripts:
// Server Disconnection Check on Client written by SchokoKeks
// Skip Old Local Procedures (A6.31 Bug) written by Giorgi3
//
// Executive Beta Tester: imagineer - thanks for doing tutorial test :)
//
// Beta Testers Online: giorgi3, ZombieWoof, Juppp, Grimber, danthaman015
// and Rhuarc.
//
//********************************************************************
//--------------------------------------------------------------------
// PATHS
//--------------------------------------------------------------------
// resources
path ".\\Wads";
path ".\\Sounds";
path ".\\Models";
path ".\\Entities";
path ".\\Bitmaps";
//--------------------------------------------------------------------
// RESOURCES
//--------------------------------------------------------------------
// Levels
string world_str = <multiplayer.wmb>; // level string
//--------------------------------------------------------------------
// MAIN
//--------------------------------------------------------------------
function main()
{
level_load(world_str); // load level
sleep(.5); // make sure level is loaded
}
Now save the mutiplayer.wdl. Minimize SED for now and get back into WED. Now hit the Run Icon. Make sure the Engine Options Entry Line is empty and l-click on OK. The game should now run and the level will load. You should be able to see the level now. Hit ESC to exit from game.
Here's what you should see.
Notice how the camera is close to the floor (or maybe even in the floor depending on what z position you have it at)? We have not set up a camera yet, so the view is automatically set at position (0,0,0), which is about at our floor level. We will add a camera position here shortly.
We are some scripting fools now! We have now created a zero player game.
Well, maybe we shouldn't quit just yet. Let's add some obstacles into the level for players hide behind. I am not going to go step by step on scaling, etc since we should have a basic idea how to do that now.
Ok, add a small cube, scale it so it is about 80 quants high. Make it about 500 quants long, and about 50 quants wide. Then give it the metalgrill texture. Move it so it is positioned like so.
Create another one just like that except going from south to north. You could also just copy and rotate the one that exist. You want to position it so it now looks like this.
Now, lets create or copy 4 more cubes like that. Give these 4 cubes metalrivet texture. Position them diagonally about half way from the center of level to the corners of level. Now level should look like this.
Let's add a camera so we can build and test run level again and see what it looks like. We can always remove this camera later if we want, but this will be the actual camera position a player who waiting to choose profession will be viewing from. Go Object-Add Position. Now move and rotate the camera so it is close to this.
Ok, go ahead and save, then build level.
Note: When a small level is building and it spends a lot of time on generating lightmaps, this is usually an indication that your blocks are not making good contact with the ground or walls. Small spaces in between objects can make generation of lightmaps very slow.
Run the game, it now will look like this. Hit ESC to exit.
Ok, now lets add four lights. Place them halfway between ends of the center walls and the biosphere walls and about 200 quants above floor. Go Object-Add Light, then r-click on the light, set Range to 700. They should be placed close to what this picture shows.
Now Save level and then Build it. Now Run the game again and the level should look like this.
Now, let's add some retaining walls just inside the biosphere. These wall will keep our entities within the biosphere.
Ok create a rectangle block about 100 quants high, make it long enough to cover one of the edges of the biosphere, making sure that it overlaps inside of the biosphere some. Give it a tilesand texture. R-click on it, then click properties-position tab, then set the last position value to 35 (z position). Now copy and paste 7 more of them placing them along each edge of the biosphere, making sure all the z positions = 35. I went ahead and made every other retaining wall a bit shorter (by resizing it vertically) than the rest, just to make it not look so linear. You don't have to do that if you don't want to.
Note: If you are not sure of something that I have explained, like when I made every other retaining wall a bit shorter, you can always refer to the LocoweedsMPTutSource folder's multiplayer.wmp file and look at it to see what I actually did.
When you are done in WED is should look close to this.
Ok, Save in WED, then Build the level. Next Run it. It should now look like this.
Now, to give our level a level a more lunar look, lets's add some crators that were contributed by Bopete onto the moon surface. To do this go Object - Add Sprite - (find the crator.pcx , which is in the bitmaps folder within our work folder) - select the crator.pcx - l-click OK. The sprite will be verticle to start with. Go ahead and rotate it so it is horizontal and move it somewhere within the retaining walls so it shows up just above the lunar surface (floor). Since the crators are just for visual effects, lets go ahead and make them passable by r-clicking on the crator sprite, selecting properties, and setting the passable flag.
After that, r-click the sprite again, select Copy. Scale the copy and move it somewhere else in level. Repeat this until the floor has a lunar look to it. The level in WED should be similar to this picture now.
Let's go ahead and Save now and then Build. Now Run the level and it should look close to this.
We are now going to add a few planet tga's and place them just inside the sky dome to make it look more like space. To do this go Object - Add Sprite - (find the planet.pcx , which is in the bitmaps folder within our work folder) - select the planet.pcx - l-click OK. Now rotate the planet and place it inside the sky dome while keeping it outside and above the retaining wall. You want to have the planet parallel to sky dome face you are placing it close to. Now copy the planet, scale the copy (larger or smaller), move it and rotate it and place it by another face of the skydome. Keep adding planets until you are satisfied with the results.
Now save, build, and run. The level should look something like this. There is actually a small planet in the view if you close enough.
I think that should be good enough for now. The players at least have some objects to use as cover. If we want to add more objects, we can always do so later. Also, it now has a lunar feel to it.
Note: I would recommend always opening you files from within WED or SED. If you find the file in you Desktop and you double-click to open from there you will sometimes end up with a pathname that has this "~" symbol in it. What happens then is if you try to test run the program from SED, it won't be able to find the .wmb if it has a "~" in path name.
So are you ready for some scripting?
Previous Page Contents Next Page