PowerQuest 0.19.4
Loading...
Searching...
No Matches
Testing Your Game

Testing Tips

To test your game, you just have to hit Play button, the game will jump right into the room you're currently editing.

Here's a bunch of tips for testing your game-

Editing scripts while testing

You can edit scripts when the game is running! A lot faster than stopping and starting each time when you're making little tweaks. This is one of the really powerful things about PowerQuest. Make the most of it!

  • This happens automatically, when you've saved a script, click back in the game, it'll compile in a couple of seconds.
  • Tick the Auto-Load tickbox in the script editor and it will show the last script to be run in game. Handy for tweaks on the go.
  • QuickSave (F5) and QuickLoad (F7) are very useful when doing this so you can try a sequence over and over while tweaking the code.
  • And the debug key ~+F9 will restart the current room, also very useful!

EnteredFromEditor flag

Sometimes you have a bunch of stuff happen when you first enter a room, you don't want to have to see it every time you test the room.

  • To skip it, use if ( R.EnteredFromEditor == false ) in your OnEnter scripts. Eg.

Editor Buttons for Testing

When testing, there's a few extra buttons in the editor:

  • Rooms have a 'teleport' button, to instantly move to that room
  • Inventory items have a 'Give' button to give them to the player
  • Dialog trees have a "Test" button, which starts the dialog tree from wherever you are in the game

Super-speed hotkey

Just hold period/full stop '.' while the game is running to skip real fast.

It skips all text and cutscenes, and speeds the game up while it's held. A real life-saver!

Play From Functions

Sometimes you have rooms you revisit a lot, at different times in the game, and you dont want to have to play all that stuff just to test a later section. That's where "Play from functions" come in handy!

  • A "Play From Function" is just a regular where you can set up all the bits you need to be able to play from that part of the game. (giving items, turning props on and off, setting variables, etc).
  • To create one, click the Play from... drop down at the top of your room, type a name (eg. "Defeated Yeti"), and click Add.
  • Then add whatever you want to set up in there. Eg.
  • You can select the active PlayFrom function from the dropdown at any time. There's also a button to edit it's script or delete it from there.
  • Sometimes your room's OnEnter checks what room you were in previously, to set where the character should appear. In that case, you can use E.DebugSetPreviousRoom(R.YetiCave); to set that up in the play-from function.
  • You can also specify a room and Play From Function name in the E.Restart(...) function. Useful for debug menus that skip to various parts of your game.
  • Advanced Note: Internally, this is simply adding a function to your room script with the [QuestPlayFromFunction] attribute.

Adding Debug Keys in UpdateBlocking

I also often want a quick debug key to skip to an animation or something in a room. For this I just add a line to check the key is down in UpdateBlocking.

  • I usually make it so I have to hold TAB and another key, but you can use whatever you want. Eg:
  • Here E.IsDebugBuild checks that it's in debug mode, or has DEBUG set in the defines, incase you want to allow debug keys in a non-developer build.
  • Note: I always add a blocking bit of text, like Display: Testing blah so the debug key isn't detected multiple times (since GetKeyDown doesn't work in UpdateBlocking unfortunately)