Rail3D*

   

 

Sample Train Script



// Test script for train

Init()
{
	debug.printL("train Initialising");
}

OnSignal()
{

	debug.printL("Train.OnSignal()");

	debug.print("   ");
	debug.print(Train.GetType());
	debug.print("   ");
	debug.print(Train.GetNumber());
	debug.print("   ");
	debug.printL(Train.GetRoute());



	debug.print("   Power:  ");
	debug.print(Train.GetControl(0));
	debug.print("   Brake:  ");
	debug.print(Train.GetControl(1));
	debug.print("   ");
	debug.printL(Train.GetSpeed());


	float x=Signal.GetX();
	float y=Signal.GetY();
	debug.print("   Signal at: ");
	debug.print(x);
	debug.print(", ");
	debug.print(y);
	debug.print("  ");
	debug.printL(Signal.GetType());


	debug.printL("");

}


import