Game Development Reference
The harness code that uses the scripting engine is not overly complex, but is large
enough that it would be a waste of space and reading time to place it all in this
chapter. Rather, I will just show you a couple of screenshots of the command win-
dow, error listing, and script output window.
Figure 43.6 shows our new command window. Clicking Run passes the code with-
in the textbox into the scripting engine and executes it. If no errors are encoun-
tered, the tab control switches to the Output page, otherwise the tab control
switches to the Errors and Warnings page.
Figure 43.6 Integrated C# command window for automation.
As you can see from the code in Figure 43.6, we are trying to initialize an integer
value to a string. Obviously, this will generate a compilation error and inform us
that we are too tired to write any worthwhile code. When attempting to run this
code, you will end up with an error like the one shown in Figure 43.7.
If a script executes successfully, you will be redirected to the Output page of the tab
control, which displays any script output that was printed during execution.
Figure 43.8 shows some output that is printed when executing the example pro-
vided with this chapter.