Creating Courses:(for version 1.1)A number of things have changed in the course format between version 0.61 and version 1.1. A lot of this was required for all the great new features in the full version. Here's a quick run down of whats changed that affects us course builder:
It is this last point that really causes the biggest headache. Come on Tux, play my course...If you have a look around the data directories you'll soon notice that the file courses/course_idx.tcl lists all the courses in the game and what cups they belong too. It is possible to add you own course explicitly to these lists, but it soon turns into a nightmare. To overcome this I've written a small tcl script that can be called from this file, to go off and search for new courses added: Place this in your 'tuxracer/courses' directory. It does however rely on a particular directory structure where it will find new courses:tuxracer/courses/contrib/your_name/your_coursename It also needs an extra tcl file be added to your course, containing all the information about the course. I've called this 'text.tcl' and it will live alongside the 'course.tcl' file we're used to. This file contains the above 'contrib' directory structure along with a basic template course that can be used as a starting point, extract it from within the tuxracer/courses directory: The last thing todo is edit the course_idx.tcl file so that it calls this new script. Open up the file in your favourite text editor, and look for the following chunk of code (about 150 lines in), then add the lines in yellow:
Here is a copy of the file already edited. Back up your version, then replace it with this copy: Text.tcl ExplanationNow this new text.tcl file thats a complete invention of my own works a bit like this:- The first thing is does is define the Title and Description of the course for various languages. I cheated and used Babelfish to do the translation.
The variable names in yellow are the ones you want to change. They should be unique across the whole game, which is why I preappended my name to them. Also changes the ones for the other languages. This information for the built in courses lives in 'languages.tcl', however we don't want to keep editing that everytime we add a course, hence why I've moved it here. The next bit adds the course to an array called 'contrib_course_list', which seems to be one two internal arrays the games uses to stores courses in.
This next part creates the courses entry in a cup. I've created a default 'contrib cup' (look in the 'contrib_course_idx.tcl'), which I add all contributed courses too. If this isn't done, you'll see your course on the menu, but won't be able to play it.
As you can see, it needs very similar information to the above bit. There's also loads of other details there crying out to be edited. The 3 numbers for -herring and -time, I'm guessing are completion criteria for different difficulty settings. Course.tcl ExplanationThis has pretty much the same role as before; detailing the size of the course (in pixels), the angle and scale of the map and the start position. There's still an option to put the course name, however it doesn't appear to be used. Refer back the to text.tcl file explained above for giving your course a title and description. Terrain.pngThis file is still used in exactly the same way as before, hwoever there are many more colours that can be used for different terrain types. Here's a list I put together by going through the file courses/common/terrain.tcl:-
Sunny, Foggy, Sunset LightsIt is possible to edit the environment of your courses using the sunny_light.tcl, sunset_light.tcl and foggy_light.tcl files. These live in the directory above your course, with the intention that they may be shared between many courses. Using the template course you downloaded from above, these will be in the courses/your_name/ directory. In the template I've put together, they simple source the files from the 'Beginner' cup, thus reusing the environments from them. If you want to overide them, I suggest you copy the ones from the other courses, then edit them. Six textures are needed to build the environment, these will form the sides of cube around Tux, i.e. what you see one the horizon. Check out those that come with the other courses for a better idea. In each of the *_light.tcl files, you can also specify the light source, its colour, strength and position. Also the fog properties and particle colour can be tweaked too. Again take a look at those from other courses. |
Tuxracer Belly Rub © 2002-2003 Arthur J. Yarwood.
|