Custom Command

CiceronMT

Member
Hello!
I have this class:
class AiHornMsg isclass CustomCommand {
bool Execute(Train train, int px, int py, int pz) {
train.SoundHorn(); return true;
}
};

How can I call the "Execute" from the schedule list: Schedule Sched2=new Schedule(); Sched2.ReverseTrain(); ..... ?
:eek:
 
This is better suited for the Scripting forum. It depends on when and where you want the function executed. Look for examples of Rules and Driver Commands.
 
Unfortunately there are no examples of how to call the function CustomCommand.Execute () and explanations about CustomCommand Class Reference besides schedule.gs.
 
Custom Commands are, in my experience, bundled in a Driver Command. The system will call a member function, eg Execute() or BeginExecute(), when the driver command needs to be executed. Look at the code for some of my driver commands, or those of many others.

If you are trying to execute outside of a driver command, I suggest you examine the member functions to be overridded for a customcommand.
 
Last edited:
Back
Top