Skip to main content

Testing your world

In SCS, you can test your world to see how it will behave and feel when one or more players join it. In this mode, you can identify errors in your code and debug it until it works as intended. Enter "test mode" by tapping on the test button in the bottom right of your screen while in build view.

Test Mode Button

In "test mode" the following options are available:

Test Mode Options

  1. BACK returns to build view.
  2. ADD PLAYER adds a player to enable you to test how your world will behave with more than one player. You can add up to 16 players.
  3. DESTROY PLAYER destroys the selected player. This is to simulate what happens if a player is destroyed (i.e. shot by another player, due to a hazard, or for some other reason) and respawns in the world.
  4. LOG CONSOLE displays error messages and other messages related to your lua code. If there a message, a red dot will appear on the log console button, as in the example above.
  5. SNAPSHOT BUTTON allows you to take and save a snapshot of your world while in build view.

Debugging using the Log Console

To see any error messages, tap on the log console button (see above.) In this case, there are two identical error messages because there are two arrows in the world which are running the same code.

Log Console

The key parts of the error message are:

  1. SCRIPT NAME the name of the script which contains the error.
  2. ERROR LOCATION the first number inside the "()" is the line number in the script where the error is located. In this case, the error is on line 3 of the script.
  3. ERROR MESSAGE explanation of what the error is.

With an understanding of what the error is, open your code so that you can identify and fix any specific issues that have caused the error. In this case, the issue is that line 2 contains Speech,setText("Level 1") with a comma that is an "unexpected symbol" instead of Speech.setText("Level 1"), which correctly contains a dot after "Speech". Change the comma to a dot and test your code again!

Incorrect Script

Multiplayer testing

To see how your world will behave when 2 or more players are in it, tap on the "Add Player" button to add up to 16 players. Each player that is added will have a unique number index after the username. Once 2 or more players have been added to the world in "test mode", the following options are available:

Multiplayer Testing

  1. BACK returns to build view.
  2. ADD PLAYER adds a player to enable you to test how your world will behave with more than one player. You can add up to 16 players in total.
  3. REMOVE PLAYER removes the selected player from the world. This simulates what would happen if a real player were to leave your world and go to do something else on SCS, or leave the app entirely.
  4. TOGGLE PLAYER toggles between the different players you have added to the world. Each time you toggle, you will take control of one of the players that you have added.
  5. DESTROY PLAYER destroys the selected player. This is to simulate what happens if a player is destroyed and respawns in the world.