PowerQuest
Introduction
title.png

PowerQuest is a unity tool for creating 2d point and click adventure games!

For a better introduction, read the Editor Manual. This page gives some basics on how to edit scripts in PowerQuest, The PowerQuestAPI tab gives access to the main functions you'll use.

Here's some examples of games made with it:

Current Version

v0.8.1

Last updated 14 August 2019

Getting started

This documentation is by no means complete, it only covers the scripting and API.

Some other things you need to know:

  • Older LTS versions of unity are likely to be more stable and tested. Versions from 5.6 onward work. Unless you NEED a feature in the latest, I recommend downloading Unity LTS releases for stability.
  • Save early, save often. Definitely use version control like SVN or GIT. Something will sooner or later trash your files or scripts ;)

There's also some older youtube vids I made too if you're keen.

Quest Scripting Basics

The PowerQuest tool manages scripts for you to make it easy to find the bit you want to edit.

The tool has a button for each "interaction" that can be made on each object. Clicking it will open the script editor at the rigth place for you, so you don't have to go scrawling through scripts to find the right file and function to edit.

So, say you have a prop called "door", clicking the "Use" button next to it in the editor will:

  • Create a .cs script file for that room if it doesn't exist, and add an OnInteractHotspotDoor() function automatically.
  • Open the script editor at the right function so you can start typing your script.

Eg.

WalkToClicked
Dave: I'd better try the door   
if ( m_doorState == eDoorState.Unlocked )
    Display: the door swings open   
else        
    Display: The door won't open

The Quest Script Editor

When you open a script from the Power Quest Editor, it'll open initially in the Quest Script Editor. This is a streamlined script editor for quickly editing dialog and quick interactions. For more complex behaviour and coding, click the "View in Script" button to explore the script in MonoDevelop/Visual Studio. There you have access to the entire files to add your own functions, proper autocomplete, syntax and error highlighting, debugging tools, etc, etc.

The Quest Script Editor makes things easier in a few ways:

  • You don't have to put 'yield return' in front of every blocking function (ones that return Coroutine ) Eg:
    • C.Dave.WalkTo(12,34); instead of yield return C.Dave.WalkTo(12,34);
  • Dialog lines have simple syntax. Eg:
    • Dave: Hello! instead of yield return C.Dave.Say("Hello");
    • Bill: Hi Dave!
    • Display: This is a message box instead of C.Display("This is a message box");
  • Props, Hotspots and Points have simpler access. Eg:
    • Props.Door instead of Props("Door")
  • Some other simplified commands:
    • WalkToClicked instead of yield return C.WalkToClicked();
    • FaceClicked instead of C.FaceClicked();
    • ... instead of yield return E.WaitSkip(); (use more or less dots for longer/shorter pauses)

BUT, there's certain limitations (at least currently):

  • You can only access the inside of functions, and the very top of the class, so accessing variables to a charater/room script isn't really possible
  • Autocomplete is limited to certain things, mainly QuestObjects. So it's not as nice as you'll get in a real IDE
  • The actual text editing is a bit janky, cause it's just using unity's text editor in the background

Game state and logic

You can add member variables to any of these scripts, and access them in the functions. They'll be automatically saved/restored in-game if they're simple types.
eg: bool m_doorOpened = false;

Note that references to gameobjects and other unity objects won't be saved/restored, if you need that you'll have to use the OnPostRestore() functions to re-initialise these and hook references back up.

If you need to access a variable from multiple scripts, the best place for it is in the global script Global Script (GlobalScript.cs). This is like the other scripts, but it's easier to access from anywhere, and has some extra global functions too. Access the global script like this: Globals.m_doorOpened = true;

You can also access variables from other scripts, for example in from a Room's script: RoomKitchen.Script.m_doorOpened = true; or from a character: CharacterDave.Script.m_wearingPants = false;