TWiki
> Main
>
HowToDebugYourMediascape
How to: Debug Your Mediascape
When testing out your mediascape using mscape tester or mscape player, you may find out that certain parts are not working as you expected. This is particularly common in games as these often contain fairly complex pieces of script to define the rules of the game.
There are two different classes of error:
- Script Syntax Errors - this is when there are mistakes in the text of your script, for example missing out closing brackets, or forgetting to put a semicolon ; at the end of each line. This class of error can be fixed by ensuring you follow the correct syntax rules - see the document Event scripts: an introduction for more information.
- Logic Errors - Logic errors are when your script follows the syntax rules correctly, but does not perform the intended function. This document demonstrates some of the tools that can be used to help you fix this type of error.
Note that the debug tools do not automatically fix problems for you, I'm afraid this is still up to you as the designer! What they do allow, however, is for you to throughly test your mediascape to find out what the problem is.
Using debug tools in mscape tester
mscape tester has the richest set of debug tools. If you are in front of your desktop machine rather than out in the world, it's recommended to use mscape tester to debug logic errors in your mediascape. Of course, it is essential to also test on the mobile device as well!
In this example, we're going to use the
'Stamp the Mole' Mediascape. If you want to folllow along, download the mediascape and open it in mscape maker.
- Click Tester to open the mediascape in mscape tester.
Some of the features you can use for debugging your mediascape are:
- Simulate GPS positions
- You can also simulate the OnGotFix? event on the GPS object
- Checking the Value of Variables
- You can also view the value of any property on any object
- Play Audio, Show Images
- You can run any action on any object in your mediascape
- Seeing what's playing on the playlist
- You can also skip the currently-playing audio
Simulating GPS Positions
This is one of the most basic functions that mscape tester provides.
- Ensure that the Place tab is visible, and that GPS mode is selected.
- You can then simulate GPS positions by clicking on the map - A small person icon represents the current location of the user.
- Some mediascapes may not begin until the GPS has a fix. You can simulate a GPS getting a fix by checking the Has Fix checkbox in the GPS control on the right-hand side of mscape tester.
Checking the Value of Variables
Seeing the values of your variables is a very useful tool to help you debug your mediascape.
- Click the Debug tab
- Scroll the left panel down until you get to the secion called State
- Click on the molesStomped variable
The right part of the window will show the properties of the selected item - the important one is the
Value property.
If you find at any point that the variable does not have the value you expected, you can change the value by typing a new value into the box.
Playing Audio, Showing Images
Using the Debug tab (see above) you can run any action on any object in mscape tester. For example, you can play, pause, and stop any audio in your mediascape.
To do this, scroll to the
Audios item, and right-click on an audio item. This will bring up a list of all the events and actions available for that object; select one from the list and mscape tester will run it for you.
This same idea works for all objects including images, flash movies, videos, slideshows.
Using debug tools in mscape player
It is possible to access many of the same debugging tools that are available in mscape tester in mscape tester.
However, you must first enable debugging tools in the mediascape that you wish to debug.
Once in Designer Tools, there are many different tasks you can perform
- Checking the Value of Variables
- You can also view the value of any property on any object
- Play Audio, Show Images
- You can run any action on any object in your mediascape
- Simulate GPS positions without a GPS Fix
- You can also simulate the OnGotFix? event on the GPS object
Checking the values of Variables
It's possible to view the value of any of the variables you have defined in the State section of your mediascape. This is very useful for checking that variables have the values you expect.
From the Designer Tools screen, tap the 'Tools' menu and select 'Debug'.
This will bring up the debug screen. The bottom half of the screen shows messages that are output from the mediascape, while the top half is the same list of mediascape objects that appears on the left of the mscape maker.
In this example, we're going to look at the value of the 'molesStamped' variable in the
'Stamp the Mole' Mediascape. If you want to folllow along, download the mediascape, open it in mscape maker and make sure you enable the 'Allow Debugging' option as shown above before running the mediascape on your mobile device.
Scroll the upper window down until you pass the 'State' item. Select 'molesStamped' and press 'Properties'.
The screen will show the value of the variable. This technique works for any properties on any of the objects in the mediascape (e.g. an audio's Played, Volume etc properties).
Playing Audio, Showing Images, and running other Actions
Follow the instructions above to display the Debug screen. To play an audio, scroll the upper window to the 'audios' section, tap on an audio, and click 'Actions'. You will see a list of actions that can be performed on the audio. Click 'Play', then click 'Run', and the audio will play.
To display an image, use the technique above to select an image file, and choose 'Show' from the list of actions. To see the image you'll need to exit Designer Tools mode by pressing the Back button.
This method can be used to run any action on any object in the mediascape.
Simulate GPS Positions without a GPS Fix
Sometimes you may want to simulate GPS on your mobile device when a GPS fix is not available, for example when you are inside, or when you don't have a GPS device.
See the document
HowToSimulateGPSOnMscapePlayer for details on how to perform this function.