Using the templates

Top  Previous  Next

By the time you read this article, Doug has finished creating the new template set for the free, major engine update: A6.405. Before we begin, please make sure that you have updated the engine, as well as the templates to the latest version. How do you do that? Well, the engine can be updated by running the update6405.exe file and the templates are updated by unzipping the template_640.zip file and copying its content inside your 3DGS folder, overwriting the existing files.

 

Get and use those files from Conitec's download page; otherwise, you won't be able to play with our toys. Wed's Help -> About Wed window should show something like this after a successful update:

 

aum57_template1

 

Since this series of template-based articles intends to provide a step-by-step approach to the wonderful world of Doug's templates (WWDT) we will have to create a new project from scratch. Start Wed, and then choose File -> New to create a new level file. This is a crucial step; you can't access the project manager unless you have created a new level. Create a new folder inside your 3DGS folder, name it (let's say) experiment1 and save then save the empty level inside that folder as exp1.wmp.

 

Click File -> Project Manager.

 

aum57_template2

 

You can now see the following window.

 

aum57_template3

 

I guess that we will get to discuss most of these project templates, but let's concentrate our attention on the _A6_template_project for now; this is, in fact, the default template project, so let's just press the OK button.

 

aum57_template4

 

This is the real Project Manager window; you can see several tabs that can be explored.

 

- "Notes" gives us information about the project manager version, the needed engine version and (most important for us now) the name of the main script file that was created for us automatically: exp1.wdl. As a general rule, if you have named your level "littlepig.wmp" you can expect to see a "littlepig.wdl" main script file being created for you.

 

What is it with this main script file? It's a... script file, of course, and it allows you to run and explore your level. Let's examine its content; locate it inside the \experiment1 folder and then double click it to open it in the script editor (Sed). My exp1.wdl script has 151 lines, but most of them are comments; after butchering the file for a while I have managed to display all the relevant code in the following picture:

 

aum57_template5

 

The Project Manager has created for us the code that loads the level, includes the needed files and starts the project. Don't be worried if you can't understand all the lines of code; we won't touch them at all. Let's run our level!

 

What are you saying? We don't have a level yet? Dismiss Project Manager's window, and then add a large hollowed cube to the level.

 

aum57_template6

 

I'm not so sure about your cube, but mine was placed away from the origin.

 

aum57_template7

 

Let's center the cube in the origin; move it in Wed's top view until you are happy with the result. Don't forget to align it on the z axis as well; use the back or side view for that. The result should look like this:

 

aum57_template8

 

We need to texture our block, so let's fire up the Texture Manager:

 

aum57_template9

 

Press the "Add WAD" button:

 

aum57_template10

 

Double click the "standard.wad" file to add it to the project.

 

aum57_template11

 

Press OK, and then click Wed's "Textures" tab; you will see the new "standard.wad" file being added to it.

 

aum57_template12

 

Let's make more room for our new textures; click the "Object" and "Texture" buttons (not Wed's menu buttons!) to hide their associated windows, and then click "standard.wad" to expand it. Click and draw the lower border of the standard.wad window to increase its size until you can see several textures at once.

 

aum57_template13

 

Click and drag the vertical bar until you find a texture that you like. Stay away from the moving (water, sky) textures for now; they are nothing but trouble at this stage, as I am sure that your mama has told you already.

 

aum57_template14

 

I have chosen that metal plate texture because, if I am not mistaking the things, was included in one of the A3 games, so it must be a good texture, right? Feel free to use (almost) any other texture. Make sure that the hollowed cube is still selected (click it if it isn't) and then double click your dream texture. Nothing appears to have changed in Wed's windows, so let's do something about it: click View -> Textured, and then click one of Wed's windows to deselect the cube.

 

aum57_template15

 

You should now see the textured, hollowed cube in its full splendor.

 

aum57_template16

 

Save and then build the level. Press the "Run" button to bring on the "Run level" window:

 

aum57_template17

 

I have always wondered what those cryptic characters means... haven't you? Let's discuss them one by one:

 

1) exp1.wdl is the name of our main script file. It must be here; otherwise, the script can't run.

 

2) nx 30 sets the NeXus to 30. What's with this nexus, you ask? It's the amount of memory that is needed by our level in order to run properly; the engine uses a default value of 30 MB, which is ok for small or medium sized levels. For bigger levels use values up to 200 MB (smaller the better, of course). The nexus can be set with one of these two methods:

a) Using the command line, like in the picture above;

b) Using Wed's File -> Map Properties (my favorite).

 

aum57_template18

 

As a general rule, use small nexus values and increase them little by little until you get rid of the "Nexus too small" error message.

 

3) -wnd tells the engine to run in a window, and not in full screen mode. This window mode is useful when we are writing or editing some code because the engine will display the error messages only in window mode. Since this is the default running mode, we can safely remove -wnd from the command line. Let's not forget that we can switch between window mode and full screen mode by pressing the "Alt" and "Enter" keys at the same time while the engine is running.

 

4) -d hires determines the engine to use dynamic lights with a higher resolution (using more video memory, of course).

 

Ok, with all the things that we have just learned about, we can safely remove the extraneous stuff; edit the command line for the engine until it looks like this:

 

aum57_template19

 

Is this simple or what? Press the "OK" button to run the level; you should find yourself in a small room. I'm not a claustrophobic guy, but I know for sure that I would feel a bit more comfortable in a bigger room... Select the entire hollowed cube, right click it, and then choose "Properties". Click the "position" tab.

 

aum57_template20

 

Change the 3 scale values from 1 to 5; type in "5" and then press the enter key for the x, y and z axis. Don't be fooled by the fact that the scale values are set back to 1; the cube has changed its size indeed.

 

Close the "Object Properties" window, save the level and then build it again and run it. See? It's all much better now! Press the "zero" key once and then move around in the room using the arrow keys and the mouse. There aren't too many interesting things to look at for now, but this will change for sure within the following template tutorials. I'll see you then!