If you can read this document you have
managed to install 3DGS on your computer; the program should have an entry
in Windows’ start menu, just like in the picture below:
You can see shortcuts to the "Level editor",
"Model editor", "Manual" (this manual) and "Script editor". Let's see what
they do:
- The level editor (WED) is used to create
the levels for our games, the 3D worlds that will be populated with humans,
monsters, etc;
- The model editor (MED) is useful if
you want to create 3D objects (models). Need a torch for your level? Create
it in MED. Need a player model? Create it in MED.
- The manual (this manual) will teach
you C-Script, the programming language used by the Acknex engine. If you
take a look at some of the workshops you will notice that C-Script is a
powerful scripting language: you can create interesting things with only
a few lines of code;
- The script editor (SED) is the program
that helps us to write C-Script lines of code. SED is a great script editor,
with many features.
Let's start the level editor (WED):
This is WED’s main window; it doesn’t
look too interesting at the moment but this will change in a moment. Press
the open button and it will
show the Open window, like in the picture below:
These are the folders inside your GStudio6 program; let's double click the folder named workshops:
There are quite a few workshops! Don't worry, most of them can be completed in less than 30 minutes; more than that, all the new things inside them are explained step by step. Double click workshop01 to open it:
Now double click the level named work01 to load it:
You can see a house and a few more things inside this test level. Note that I've activated the 'Textured' mode in the View menu, otherwise you'd see the house in wireframe mode.
At this point I feel that I have to give you some useful Windows related information. I don’t blame you if you want to read this manual and run the engine at the same time. Windows allows us to switch from one task (program) to another by pressing Alt + Tab; this is what I am going to do from now on while I am writing this manual. I encourage you to do the same thing while you are working with these workshops.
Let's get back to work: press the Build button
in WED's button bar and you will see a window similar to the following one
(the lower part appears when clicking the [>>>] button):
Make sure that the first button (Build Level or BSP Map, depending on the version) is selected, then press [OK] to build the level:
Now take a deep breath and and then run the level by selecting File / Preview Level ! You will see the following image:
This is our level in the "real" 3D world; you can see the house and a tiny creature that moves continuously... is it a monk, a warrior or what?
I'm not so sure about you, but I'm really curious to see what that moving thing is. We will type in our first C-Script program so follow these steps:
1. Press Tab on your keyboard. You will
see a blinking cursor near the lower left corner of the screen;
2. Type camera.arc = 5; and press
Enter.
Did you see what just happened? With a single line of code (and a short one) we wrote a sniper effect! Now we can see the wizard model in its full splendor!
Let’s restore the original zoom factor:
1. Press Tab on your keyboard. You will
see the same blinking cursor near the lower left corner of the screen;
2. Delete "5" using the Backspace
key and then replace it with "60". The line of code should look
like this: camera.arc = 60;
3. Press Enter and everything will go
back to normal.
Let’s explore the level; use the arrow keys and the mouse to move. If you get too far away from the house you might get out of the level. If this happens, try to move back where you came from or exit the engine using the Esc key and then run the level again. Now let’s move towards the house; take a close look at the wizard standing in front of it. It looks pretty cool but why is it passing through all its animations?
The reason is simple: it hasn’t got any
piece of code attached to it. The engine uses C-Script code for all the
objects that need to do something "intelligent" in the level. I have created
a script file for this project; its name is script01.wdl. So shut down
the engine (press Esc) and then press the Run button in
the button bar. Make sure that the name in the Engine Options window
is as shown below:
A lot of things have changed in the level! I can see some nice fire effects, the old man stands still for a while and then it fires some energy balls that cast blue light on the floor! My poor level looks nicer now, doesn’t it?
Press the 0 (zero) key on your keyboard and you will be able to move inside the level using the arrow keys, PgUp/PgDn and the mouse.
The code that was used for this example is placed inside the script01.wdl file. You can open the script file (using SED) if you are curious to see the code but we won’t talk about it now. Just remember that I have coded all this stuff using about 70 short lines of C-Script code.
Every level should have a script file associated to it. Make sure that WED is running, open the same level (work01) and then choose File / Map Properties.
You can see that I have associated the
script file named script01.wdl with the level used in this workshop.
Press the Choose Script button
and you will be able to associate any C-Script file to this level. I know
that you don’t have any C-Script file written by you at the moment but
you will have quite a few soon, trust me!