Menu

Wiki usage

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
Edit Sidebar
Main > ErrorDetection

How to find errors in your map

On this page...

Sooner or later you will run into problems. You will know that it does not work, but you don't know WHY it does not work. It is time to take a look at the magic of the MOH:AA console.

Activating the console

There is a nice checkbox in the MOH:AA settings ( go to "Advanced settings" in the game ), make sure it is selected and press "Apply".

Bringing down the console

After activating it ( as described above ) you can bring down the console window by pressing the § button ( located directly beneth the F1 button, on my Swedish keyboard at least ).

Description of the console

At the bottom you can write console commands, and the log above that line displays what MOH:AA has to say.

Useful commands for finding errors

The most useful thing about the console is not a command at all, it is simply to read what the MOH:AA game is saying. But there can be problematic to do this sometimes because MOH:AA writes a lot here, so there is a good chance that MOH:AA has written so many lines that you cant read the error anymore... this is because only a limited amount of rows are displayed in the console. So lets write something in the console:


 logfile 1

...and press enter to execute it. From now on, everything that is written to the console is also written to the file qconsole.log in your MOH:AA main directory. And nothing will be lost or overwritten. (See ScoresAndStatistics for more information on the log file variable)

Now load your map. If needed, enter the map and produce the error.

You will get a nice little qconsole.log waiting for you in the main directory now.

Get out there and look for errors, and when you find them: fix them. There are a lot of strange things in that file, so it will probably take you a while to identify what is an error, and what is not.

Error examples

(Look at the TODO: compile error FAQ for more errors and their solutions.)

This is NOT an error:


 Localization error: XXXXX does not have a localization entry.

This is NOT an error ( but it WOULD be a good idea to add the line cache models/weapons/colt45.tik to your maps *_precache.scr script as it said ):


 Add the following line to the *_precache.scr map script:
 cache models/weapons/colt45.tik

This IS an error (caused by calling a non exising label. The Label is called start_lib, so MOH:AA cant find it ):


 thread star_lib (maps/obj/lib_tut.scr, 36)
 Script Error: ScriptMaster::CreateScriptThread: label 'star_lib' does not exist in 'maps/obj/lib_tut.scr'.

Most errors caused by scripting errors will be containing the text ^~^~^Script Error, so try to search for that string first... or just search for ^~^~^. But if you don't find it that way search for the first occurrence of your bsp's name and you will find the line:


 CM_LoadMap( maps/obj/<YOUR_MAPS_NAME_HERE>.bsp, 0 )

Start looking downwards from there.

Some scripting tips

Tired of shutting down MOH:AA, editing the cript and then restarting MOH:AA each time to make a tiny script edit? Use the "editscript" and "restart" commands in the console.

  1. use editscript in the console to get a window ( in the game ) where you can edit the level script of the currenlly loaded map.
  2. Edit the script.
  3. Save ( CTRL+s ) the script.
  4. use restart in the console to restart the map using the new version of the script.

You can also use the Alt-Tab key (under Windows, or similar on other operating systems) to an editor like Notepad to modify your map script.

Check out this tutorial as well: ParametersWhenDeveloping.

- Bjarne Grönnevik?

Recent Changes Printable View Page History Edit Page [Attributes] [Printable View] [WikiHelp]
Page last modified on January 27, 2005, at 11:43 PM