Experimental oncoming traffic for RACER tracks
============================================================
Script created by Oliver Pieper, pieper@viaregio.de 2005-05-13
This add-on uses:
- a reversed spline.ini (to allow the ai cars to drive in the opposite direction of the player's car)
- a special.ini with 14 additional grid positions (fake, since the grid positions are all in the same place, you need to use the option random_scenario=1 
in racer.ini!)
- a template ai file (duplicate this ai file and rename it to the folder name of the car(s) you want to use as ai cars).

The reverse_splines.py Python script reads the file 'spline.ini' in the current track directory and writes the reversed splines as 'spline.rev.ini'. 
The script expects a "well-formed" spline.ini, like the ones written by Racer's tracked.
The script was written and tested under Python 2.4 and 2.2.3 on Windows. Minor changes might be necessary to get it to run on a different OS or Python version.



Instructions by Bob Hojaboom, hojaboom@oregontrail.net  -  May 20, 2005 updated Jan 2011

Get Python ver. 2.5.1 from www.python.org and install it in a folder named "PYTON25".  Version 2.5.1 requires MS msi installer.
Put a path statement in your autoexec.bat file as shown below:
set PYTHONPATH=C:\PYTHON25;C:\PYTHON25\DLLs;C:\PYTHON25\Lib;C:\PYTHON25\Lib\\lib-tk

Duplicate (copy) the desired track folder in the "tracks" folder and rename it "trackname_traffic" and change name in track.ini to indicate the 
track has traffic so you can find it on the menu.

Copy "_traffic" folder to the desired track folder.

Files/folder you will make in the "_traffic" folder after copying it:
a folder named ai
original special.ini (copied from track folder)
original spline.ini (copied from track folder)
reverse_splines.py (should be there)
special.ini (make like shown below)
spline.ini (made from spline.rev.ini taken from the track folder after making it with the pyton script)
traffic_instructions.txt (this file)

Steps:
Make an "ai" folder in  the "_traffic" folder

Make a copy of spline.ini and special.ini and put in _traffic folder, rename to "original special.ini" and "original spline.ini" to keep for backup.

Make a special.ini file with up to 14 additional grid positions, (these are fake positions, since the position numbers are all in the same place), 
by copying the original special.ini to this folder and duplicating the last grid position up to 14 times, renumbering each and don't forget to 
change the count to number of last position plus 1 (count=n+1).  Add "; fake" to each added grid position.

Copy the python script, "reverse_splines.py", to the trackname_traffic folder and double click it .  
It generates the "spline.rev.ini" file in the trackname_traffic folder.
Move spline.rev.ini file into the "_traffic folder" and rename to spline.ini.

Make template.ini with wordpad by copying a reasonable ai.ini file from the track ai folder to this folder and replacing all the "u_racingline=" 
with "u_racingline=0.75   ;" using find/replace, rename it template.ini. OR Make an ai run with a car staying on the right side of the road at 
reasonable speed and name it template.ini. OR you can just use an ai file as is but it can cause chaos with cars crashing everywhere.

Copy special.ini and spline.ini to the trackname_traffic folder replacing the ones there.

Copy template.ini to your track ai folder and rename as the car you want to go in reverse direction. You can have more than one

Set random_scenario=1 in racer.ini file, it's in the race section. Add each car you want to be traffic to the line "ai_car_multiple=", example:
ai_car_multiple=bmw ford_fusion jaguar lotus_elite

Run RACER setting ai cars to the number of cars in the "ai_car_multiple=" line and watch out for traffic! It takes a while to load so be patient.

don't hit shift-A unless you want the car you are driving to try to go in reverse direction.

comment out the lines changed in racer.ini when done racing or normal tracks will have multiple ai cars running.

NOTE:  Files in original _traffic folder:
reverse_splines.py
traffic_instructions.txt (this file)