Menu Close

Command Prompt

The command prompt is a powerful tool which allows you to "talk" to Platform Builder and tell it what to do.

One could say that the command prompt is like something “in-between” a spoken language and a programming language. The experience with the command prompt is comparable to the experience of telling your smartphone what you want it to do. Most of the commands are intuitive, the same thing can be said multiple different ways, and you only need to learn some basic concepts and vocabulary. Furthermore, nothing is case-sensitive or spacebar-sensitive (with a few exceptions), and you don’t need to worry about getting an error if something is entered wrong. After you have mastered using the command prompt, you may find that learning an actual coding language will come a little easier for you.

The process is quite simple. Each command must be placed on a single line. Most commands are split into three parts: The command, the operator, and the value.*

  • The command is what you want to change (For example, health, maximum ammo, the ability to perform a “super jump.”)
  • The operator is how you want to change it. “=” will make your command equal to something. “+” or “-” will add or subtract. “*” or “/” will multiply or divide**. (Do not use “x” or “X” to multiply. You must use the star). The operator you can use varies on the command. Sometimes you can use any of these operators, but sometimes you can only use =.
  • The value is what you want to change it to. (For example, 100, true, 50, action 3, etc.) This varies on the command. For instance, if you are turning a setting on or off, your command would be the name of the setting and your value would be true or false.*** If you are changing the music for your area, your value would be the name of the music track. If the value is a number, you will usually need to use whole numbers. But some things work with decimals and negative numbers as well. It all depends what command you are working with.

When you finish writing out your commands, right-click on your command input and Platform Builder will check to see if you used any commands which are not recognized.

Select from a list of categories below to learn about the different commands you can use with Platform Builder's Command Prompt:

You will need a larger screen to view a grid of all the different commands. Come back here on a tablet or computer browser.

The following are command setting for character physics. There are a couple things to keep in mind when using these settings. Every numerical value ranges from 0-100 where 0 is the minimum, and 100 is the maximum. 0 would be like placing the slider all the way to the left in the character physics editor, and 100 would be like placing the slider all the way to the right. This is true even when the final result is a different range. For instance, Jump Delay can be from 0 to 2 seconds in length. To make the jump delay 2 seconds, you would set it to 100. For 1.5 seconds, you would set it to 75. For 0 seconds, you set it to 0.  Many of these commands actually let you go as high as 500, but we do not recommend you exceed 100 or else you may encounter problems.  The physics can be changed even if the character movement style is not set to custom. However, the character movement style will need to be permanently custom if you wish to permanently change the physics from a permanent custom item.
When using the command prompt in timelines, you may wish to take control of how the character moves so that you can design interesting cut-scenes. That is what the following commands are for. They allow you to control the character in the sense that you “take over the keyboard,” telling the character to behave as if certain keys are being pressed and/or released. (Note: Although technically NPCs are also characters, these commands do not apply to NPCs. To control NPC characters, keep scrolling down!)
The following are various commands for controlling the view of Platform Builder. They can be useful for gameplay, but also handy when you are doing cut-scenes for your game. For instance, you can cause the view to travel in certain direction to keep up with whatever it happening in your cut-scene. You could also use a timeline to cause the view to travel in a special path for an exciting gameplay .
The following are a couple commands which you can use when handling timelines and menus. If you are looking for commands which would be useful to use within timelines, look to view movements, controls for character/enemy/NPC movements, and displaying text.
In video games, HUD stands for “Heads-Up Display” and it is everything displayed on the screen that gives information about the state of the game (such as score, level name, or health.)
When you are using your own sprite for a HUD, you have other controls which can be used to change the display of your HUD. The following commands work only with custom HUD sprites.
When you start playing a game made with Platform Builder, you typically have buttons have buttons in the Title Screen which can save and load from five different game files of your game. However, you can use these commands to work with game files yourself, and you can use as many game slots as you would like. Keep in mind that many of these commands will not work unless you are doing a test run or playing the game. They are also not available to use in Sandbox levels. If you plan to use these commands to save and load manually, you may wish to disable any kind of automatic saving in “Other Settings” of Game Settings.
Platform Builder lets you use your own variables. Variables are used for storing numbers that can later be checked with conditionals. There are already a bunch of built-in variables like health and ammo, but you can also create your own variables and have them store your own numbers. The first time you use a variable, it must be initialized. This means typing “area var” or “course var” etc. followed by the variable name you wish to use, and then the operator and finally the number you wish to store inside the variable. After that, you can use just the variable name to check its value using a conditional, or change its value to something else. For several practical examples of how variables could be used in Platform Builder, go here. Make sure that your variable names are distinct from all other commands and conditionals in Platform Builder. For example, don’t say “var health = 4” because “health” is already a command of Platform Builder. Also, avoid using special characters in your variable names, and do not start a variable name with a number. Since you are creating your own variable names, Platform Builder may not recognize your command when you right-click on the command prompt. However, whenever you right-click on a command prompt which initializes the variable with “area var,” “course var,” etc., the variable name will be stored in memory, and Platform Builder will recognize that variable when you right-click on other command prompts which only use the variable name. You can access this memory bank from “Other Settings” in Game Setup.
By default, a command will apply to whatever is calling the command. So if player 2 has a command prompt that adds 1 health point, that health point will be added to player 2. Likewise, suppose an enemy-related command with a missing enemy ID (e.g., “enemy alpha = 1”) is run from the enemy command prompt. In that case, Platform Builder will know to apply that command to the enemy calling the command. The commands below allow you to change where any subsequent commands are applied.
A conditional is something which has to be true in order for your command(s) to execute. Conditionals are powerful tools to use with your commands to make Platform Builder behave in special ways. To learn more about conditionals and how to use them, visit the Conditionals Page. On that page you will discover that many of the commands we have already seen can be converted into conditionals. Below is a list of conditionals which do not come from any other commands.

Full List of Commands and Conditionals

Below is a full list of all the commands listed above, collected in a single place with a search feature.

Other Syntax

There are three other forms of syntax (that is, special things you can do) in the command prompt.

First, A double forward slash ( // )  will mark the beginning of a comment. In other words, anything after // will be ignored, and it won’t show up as an error when you right-click on the command prompt.

Second, many things which you are able to change (such as health, ammo, x/y positions, and custom variables) can also be used in replace of the required number for certain commands. For instance, instead of saying “score += 3” to add 3 to the score, you can say “score += health” to add however much health the character has to the score.

Third, whenever you are working with displaying text (e.g., popup messages, overhead messages, NPC messages, or even signs or area names, etc.) you can place many things in brackets to make it display the number value of that thing. Again, this works for health, ammo, x/y positions, custom variables, etc. You can also use [view x] and [view y] to get the x and y positions of the view of your game.

See the screenshots below for examples of how this all works.

In addition to things you should already know about like health and ammo, there are a couple other things which can be used to generate numbers in your commands.

  • “random X” or “irandom X” where “X” is a number of your choice. This will return an integer (a whole number) between 0 and whatever you put for “X.” See the example image.
  • “mouse x” and “mouse y” will give the x and y positions of your mouse cursor in the area.
  • “game” will give the current game file number of the game being played.

Finding the ID of your Item, Enemy, Etc.

Many commands that work with characters, enemies, items, etc., ask you to provide the ID. Each custom character, enemy, etc. has a number assigned to it called an ID, and the ID is used in the command prompt in order to work that that particular character, enemy, etc. Look through these four images to learn how to insert the correct ID in the command prompt.

Many commands that work with characters, enemies, items, etc., ask you to provide the ID. Each custom character, enemy, etc. has a number assigned to it called an ID, and the ID is used in the command prompt in order to work that that particular character, enemy, etc. Look through these four images to learn how to insert the correct ID in the command prompt.

Commands which call for an ID require that a custom enemy, item, etc. is used and not a pre-built enemy, item, etc. from your workstation. This shouldn’t be a big problem since most of the pre-built items and enemies can be re-created as custom ones.