ec2-54-162-111-247.compute-1.amazonaws.com | ToothyWiki | ToothyGDL | RecentChanges | Login | Webcomic
There are two main ways to write your own ToothyGDL game: Directly on the Wiki or locally, on your own computer.
Chances are, for anything but the simplest games, you are probably going to want to do some development on your own machine, simply because it allows you to compile and test slightly faster than you would be able to on the Wiki. There is nothing, however, stopping you from doing all your development on the wiki if you want to.
Either way, you will eventually want to display your master-piece on the ToothyWiki. To do so, you should make a page (usually a subpage of your personal page) which follows the following template:
[http://www.toothycat.net/wiki/compiled_code/MyHomePage-GameName.txt View compiler errors]
// Game logic goes here
// Display information goes here
Then just enter your game and display logic into the appropriate places, change the recompile link so it refers to your new page and save the page. Selecting the recompile link will compile the page and also tell you the locations of the produced game and error log files (but these are quite simply guessed by replacing the / with a - in your page name).
If you are working solely on the Wiki, the above is all you need to get started. Move on to the /Language page for details of writing the logic itself.
To run the compiler locally on your own machine, you need to set up a few more things. First, you need Perl. On Linux, this is almost certainly already on your machine. On Windows, you need something like [ActivePerl].
Next, you need to add the Perl modules, URI::Escape and Parse::RecDescent.
perl -MCPAN -e shell
..and follow the prompts. It'll want unix-like tools including tar, gzip, lynx... around, so under Windows you probably want to install something like Cygwin, MinGW? or "Microsoft Windows Extensions for Unix".
Now grab the latest compiler and script files for ToothyGDL itself:
The last setup stage is to compile the grammar file. The command is on the first line of slang.grammar.txt: perl -MParse::RecDescent? - slang.grammar.txt Slang
Now you can write your own GDL files and compile them by running, for example, "perl slang.txt < mygame.txt > mygame.html" to compile mygame.txt into mygame.html. Any compiler errors are output to stderr.
You're all set up, so now you need to go off to the /Language page to get details of the GDL itself.