Skip to content

Variables

One of the main features of GMPulse is that it lets you edit variables while your game is running. These can be global variables or instance variables, but the GMPulse GUI displays both of these in a similar way.

Variable tables

The first way you'll see a variable is inside a variable table like this:

Variable table

The name, type, and value are listed for each variable. All variables are sorted alphabetically.

Some variables (reals, strings, and Booleans) can be edited directly in this view. When you click on a text box to edit strings and reals, that row will be focused. While a row is focused, that variable will no longer automatically update its variable even if you have auto-updating enabled. This is to prevent the value from changing while you're still editing it. If you want to see changes after making your edits, click anywhere else on the page to unfocus that variable row.

If you want to edit other variable types, you can click on the name to go to a more detailed page.

Variable edit page

The variable edit page has a more detailed view suitable for editing some variable types:

Variable page

The top of the page shows the current in-game value, and below that is a section where you can make changes. Each variable will have a drop-down to select what type the variable should be, and below that will be controls for editing that variable type.

Strings

Strings will always be assigned as basic string types, and not string literals or template strings. If you have a lot of text to enter, it may be better to paste in your text from an external editor.

Reals

When editing reals, you can use the up and down arrow keys to change the value by one in either direction. By holding down the shift key, you can use the up and down arrow keys to change the value by ten in either direction. You can also add a minus (-) sign to the front of any positive number to change it to a negative.

Handles

For handle variables, you'll have an extra drop-down that let you select what kind of resource you want to edit it as. You will also see a box containing all of the resources of that type in your project, allowing you to select one from the list. At this time, only the following types are able to be edited this way:

  • Objects
  • Sprites
  • Sounds
  • Fonts
  • Rooms

Something worth noting about handles, is that they are (basically) just numbers. If you know the ID or index of the handle you want to reference, you can edit the variable as a real and simply enter that number.

Unsupported variable types

Some data structures and buffers are not supported. Structs, arrays, ds maps, and ds lists can not be edited, but they can be viewed as JSON. Other complex resources like shaders, animation curves, and particle systems are also not currently supported. Future updates may bring support to these types, see Upcoming Features.

A note on Booleans

Sometimes, GameMaker will report a Boolean variable as a real instead. GMPulse doesn't have a way to know if a particular real is being used as a Boolean, but you can still edit its value anyway. Setting it to 0 will make it false, and 1 true. For more information on how GameMaker handles Boolean values, see this page on data types.