You must be logged in to post messages.
Please login or register

Modding and Scripting
Moderated by Yeebaagooon, nottud

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Debugging an RMS
posted 09 March 2004 00:47 AM EDT (US)   
Seems quite a few of our new scriptors are unaware of how to debug an rms. Finding syntax mistakes by hand can take hours, especially when you are just missing a comma or you capitalized a letter when it should be lower case (cNUmberNonGaiaPlayers anyone?). You can also use the debugger to find out if objects/areas are placing instead of scanning a map in the editor and counting objects.

To enable the debugger you need to create a new file in notepad and add the line debugRandomMaps to it, then save it as 'user.cfg', without the quotes in your AOM\startup directory.

Put the xs and xml file of the map you wish to work on in the AOM\RM directory.
The TT debugger does not work, so you must use the AOM debugger. If you want to use TT specific objects or terrains (or talk about something to do with the player being Atlantean) just replace it with an AOM terrain or object for now (or comment those lines out) and work in the AOM editor. Once your map is working the way you want you can just move the files and finish it using TT

You now have 2 options that you can use:
1)You can try and load the map in single player
2)You can select to create a map using your script in the editor.

My advice is to use single player when you are trying to work out the syntax bugs (misplaced comma, spelling and so on) since it is quicker to reload after fixing each error.
You should use the editor when you want to check for other things like objects placing and so on; since, you have the option to start the debugger before you load the map and you can set breakpoints and step through the map line by line.

There are 4 very important tools when debugging a rms.

1)rmSetAreaWarnFailure(int areaID, bool warn);

Quoted from "RMS help doc":

Sets whether the area build process will warn if it fails.
It is very easy to over-constrain areas to the point where there is no room for them. This can cause two problems: the map may take a long time to generate, or if you are in debug mode (see above), the debugger will pop up and generation will stop. Sometimes you want to catch these errors, but when you are done with your map it is a good idea to set SetAreaWarnFailure to false.


2) rmEchoInfo( string echoString, int level );

Quoted from "RMS help doc":

Random map echo.
Use this to spit out information while debugging a script. It is not shown to the player.


You can use this to chat variable values like map size, area size and so on. To chat a variable value I tend to do rmEchoInfo("<var name> = "+<var name> ); where <var name> is just the name I used for the variable.
3)TextPad which is a shareware program that is very useful in scripting (it has an option to number lines). You can download it here : http://download.com.com/3120-20-0.html?qt=textpad&tg=dl-2001

4)Patience

I hope this is helps some peeps and I look forward to seeing what you can create.


Guide to Debugging RMS
Download my RMS here
Help improve RMS reviewing here
A monk I need a monk.
I thought therefore I was.

[This message has been edited by Pascal9872 (edited 03-09-2004 @ 00:49 AM).]

Replies:
posted 09 March 2004 12:17 PM EDT (US)     1 / 1  
Alas let me not forget,

5) A lising of all(or most)mof the rms functions : You can refer to the mrms help file in your aom\docs folder or go here: http://www.geocities.com/hyenastudios/aomrmstutorial.htmto Monty Python's rms tutorial.

The second option is the best imo since it color codes a lot of things.


Guide to Debugging RMS
Download my RMS here
Help improve RMS reviewing here
A monk I need a monk.
I thought therefore I was.
Age of Mythology Heaven » Forums » Modding and Scripting » Debugging an RMS
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Mythology Heaven | HeavenGames