INSERTING COMMANDS
To add a Command and make it work, it must be imported on a sector of the track or the pitlane where it is thought to act. Importing a command usually it makes its ’work’ 
at the beginning of the sector better said at offset = 0. In many of them we can even set the offset to the point where it should act. To import commands into the track 
or pitlane, we need to right click on the sector in the track tree and select “insert track command”:



It will open the following dialog box:



In the left side there is the list of codes to click to select the command and in the right there is the description of the command. Once selected the command and confirmed, 
it will open automatically the dialog box of the selected command. In this window we can change the values of the arguments according to our needs. In example:



In this case we are adding a ‘track width change’. This command has 3 active arguments and we can read their description below the slots. 
Of course the number of arguments changes from command to command. They can have 8 arguments or only 1 argument. Some commands will open directly their own dialog box, 
like scenary structure commands, kerb profile and anchor object.


USEFUL COMMANDS

There are some useful commands that we can import into the track to affect the track itself or the gameplay.
 
0xb5    track width change right
0xb4    track width change left
0x85    track width change
We can add all of them in one sector simultaneously but adding two of the same kind in the same sector, only the last one will work.
		a1= offset into sector
		a2= length of the transition from the old width to the new one
		a3= new length 
 
0xa8    trigger flag man waving flag end
Added somewhere before the finish line is the point since we’ll start to see the man with the black/white flag.
		a1= offset into sector
 
0x94    cc cars coaching left  
0x95    cc cars coaching right 
It seems a way to make the cc-cars approach a turn in a more intelligent way to avoid abnormal accidents.
with a2 = 1 cars will make more attention than a2 = 8. The usage is related to the kind of turn/hairpin we want to affect. If the turn goes in the right we can place a 
0x94 before the entrance, so the cc-cars will stay on the left aproaching the turn. If the turn is to the left we can add a 0x95 command before it.
		a1= offset into sector
		a2= values from 0 to 8
 
0xad    track banking
With positive values we’ll have a left banking, with negative values we’ll have a right banking
		a1= not used
		a2= transition length
		a3= height of banking    
 
0xe8    map jip on to surface (.JIP files)
It is used to place road signals on the surface.
 
0xe2    fence extention on
0xe1    fence extention off
This commands will turn on/off the extentions above the fences. Adding 21 we’ll involve the right extention, adding 22 we’ll involve the left extention. Once activated, the 
extention will stay on for the rest of the track, so we'll need to play with these commands to alternates them.
		unk(1)= ?         
		Unk(2)= value
 
0xa5    set fence extenstion height left
0xa6    set fence extenstion height right
After turning on an extention we can decide to set the height of it. The transition will take 1 sector, so it’s better use it on sector with a short length.
Adding this command in sector t0, it will set the height for the entire track.
		a1= offset into sector
		a2= height
 
0x98    left fence height change
0x99    right fence height change
These command allow to modify the height of the fences. The values are intended as height codes, so we can add 1, 2, 3, 4….
		a1= unk                       
		a2= new height
 
0x9a    Define custom fence height
This command used in accordance with the previous ones allow to define exactly the heights of the fences. In a2 we must insert the height code we used in the 
0x98 or 0x99 commands and in a3 the desired new height. Since this command both right and left walls will be affected by its value.
	a1= not used
	a2= height code affected
	a3= new height
 
0xe0    Place shodow zone
This command allows to add a shadow zone to the part of the track we want and for the length we want. In example it can be used to place the shadow under a 
bridge or inside a tunnel.
	a1= offset into sector               
	a2= part of the track                
	a3= length 
	a4= always 1
 
0x80    object anchor
This command allows to add new objects opening the object dialog box. It can be used to add objects into the pitlane. See the object editing chapter.


SANITY CHECK
The sanity check is a tool that allow to locate many possible errors into our project and give us the chance to solve them. So it is good to have a look there if the track doesn’t work in the beginning:



The tests that we need to care are:



Venetian effect existance – distance of the pit entrance/exit from the S/F line.
Track+pit too long – length of the track. The max length is 1597 units (track + pits).
Track too short – This one is not important using the magicdata. 
Too many scenary commands – We can add til 128 couples of scenary commands.
Total commands – max number of objects. It tells 1048 but we have to care only the file size.
Performing overlap tests – object overlapping and objects placed after the end of the track.

With the latest version of GpXPatch some of these tests will become irrilevant being the patch able to overcome come original game limits.