Debug Window Explained

I have added back a pretty big feature that should make creating table a lot easier: the Visual Player Debugger. Here is a description:

Debug window -

To open the window, hit 'esc' while the game is playing and select the debug window option.
The window has 3 buttons. When the debug window is active, the game is paused. The status of the three buttons indicates how the game will play when the game window is active.
When the play button is on, the game will play normally.
When the pause button is on, the game will be paused.
When the step button in on, the game will play for the number of milliseconds specified in the step window, and then return to the paused state.

In the game window, while the debug window is showing, you can directly manipulate the table. You can right-click on any object and bring up a menu of all the events that object has. Then you can select an event and it will fire. This simulates the ball hitting that object so you can try things out in the table much faster. In some cases script might differentiate between which ball is doing the action. The 'active' ball has a red target drawn on it. You can right click a ball to make it the active ball. When script checks what ball preformed the action in question, it will be the active ball.

Note that this can be used to get the game into a state it was not expecting, like hitting the ball drain before the game is started.

You can disable the debugger when you 'save as protected' to keep other people from cheating. Table which were saved with 'disable everything' will already have the debugger locked out.

- Randy


New in this version:

There is a new option in Video Options to antialias the ball. Default is on.

There is a new option in Security Options to detect hanging script (it's not really a security thing; I will probably rename this dialog 'script options' or something.) Table authors will probably want to have this on to help debug script while table players can turn it off under the assumption that the script works. This will hopefully alleviate the problem of older tables bringing up dialogs and whatnot that make the detector fire.

The problem with random pixels appear at the edge of tables is fixed.

The problems with table/background stretching should be fixed.

I have enabled another debug feature that I had been working on. In the debug window there is now a button to expand the immediate window. The immediate window works much like the window of the same name in VB (except you can't use ? as shorthand for print.) There is a ton of stuff you can do with this window so I will attempt to point out the highlights.

If you have a global variable called 'score' you can display its value like this:

print score

You can set the value like this:

score = 10000000

If you have a subroutine in your script called DoSomeStuff, you can call it directly by just typing:

DoSomeStuff

If you have an element on the table, say a light named Light1, you can edit it directly:

Light1.State = LightStateBlinking

Or you can get the value of course:

Print Light1.State

If you want your script to notify you of things, like when a timer fires, you can do this in the table script:

Sub Thing_Timer()
Debug.Print "Timer Fired"
End Sub

Debug.Print will only do anything if the debug window is up, so if you are expecting messages then open it right away. The immediate window does not have to be expanded.

- Randy

Updated Jun 22, 2005 Written by Randy Davis
 
Forum activity
Help Users
You can interact with the ChatGPT Bot in any Chat Room and there is a dedicated room. The command is /ai followed by a space and then your ? or inquiry.
ie: /ai What is a EM Pinball Machine?
  • No one is chatting at the moment.
      Mibs Mibs: Popotte has posted a new reply in the thread "How Do I Move a DMD on the Backbox Using Script...
      Back
      Top