Previous Entry Share Next Entry
QL Stuff: Okay, let's build a Character Sheet
device
jducoeur wrote in querki_project
[Picking up from "Text Stages", having spent a week working on the OP Compiler, and then a week getting Lists working properly, so that I actually have this example running before I talk about it.]

The previous installments of this discussion of QL have explained the basic concepts. Let's take a look at a very simple but realish example -- indeed, the example that I originally created the system for a decade ago, writing Live-Action Roleplaying games (LARPs). Let's spend five minutes building a highly simplified game. I'm going to describe this one in exactly the order I actually built it, to show how the process works.

In any game, we have Characters -- those are the roles that players take. So I'll start out by creating Character as a Model. Initially, I just want to be able to say something about a Character. Okay, let's create a new Property called Description, which is an Optional Large Text Property. (Large Text is just Text that expects to need a bigger input box. I might eventually factor those differently.) So the initial Display Text property for Character is:
## [[Name]]

[[Description]]
Let's create a Character, and fill in his Name and Description properties. He displays as:

Joe

He's just this dude, y'know?
Okay, what next? Characters need to have stuff, so let's create a new model, named Item. Items will also have a Description, but just to make the example more interesting, let's say that our magic system is adjective-based: what you can do with it depends on its adjective. So we'll add two more properties, Adjective (a Required Text) and Basic Text (also a Required Text). So the Description of an Item wants to be based on that:
A *[[Adjective]]* [[Basic Text]]
Let's create three Items: Bell, Book and Candle. (I did say this was for a magic system.) Characters need to be able to possess items, so I add a new property Items, which is a List of Links to Item. I tweak the Display Text of Character to now say:
## [[Name]]

[[Description]]

## Items
[[Name]] has the following things in his possession:

[[Items -> ""¶* [[Description]] (____)""]]
You'll recall from last time that the QL expression at the end basically means "A bullet list of Items, with each showing the Description and then a link to the Item's own page". I fill in Joe's Items with all three of the ones I just built, so he now shows as:

Joe

He's just this dude, y'know?

Items

Joe has the following things in his possession:
  • A shiny chime (Bell)

  • A musty tome (Book)

  • A bright flame (Candle)
Hmm. Who does Joe hang out with? Let's add a new model called Faction, which describes a group of Characters. Faction also gets a Description property. We'll create one Faction, named Slackers, and add a property named Factions, which is a List of Links to Factions. We tweak Character again, to add Factions, and add it to the Display Text:
## [[Name]]

[[Description]]

## Factions
[[Factions -> ""¶* ____ - [[Description]]""]]

## Items
[[Name]] has the following things in his possession:

[[Items -> ""¶* [[Description]] (____)""]]
We add Slackers to Joe's Factions, and he now displays as:

Joe

He's just this dude, y'know?

Factions

  • Slackers -- These guys you find hanging out at the mall.

Items

Joe has the following things in his possession:
  • A shiny chime (Bell)

  • A musty tome (Book)

  • A bright flame (Candle)
And so on. A real LARP would typically have a lot more Properties and Models than this, all linked together into a complex web.

But this should give you a sense of how you work in Querki. It isn't intended for projects where you spend a month sweating about the precise design in advance -- instead, it's intended to make it very easy to build Models that seem to make sense, add Properties to them, instantiate them, link them together, and so on, very experimentally and quickly, so that you can focus on putting in information instead of designing a program.

And yes, this whole example took me maybe five minutes to build. I spent several times as long writing this blog entry than I did creating the example itself. That's pretty much the point...

Next time: probably some burbling about the UI for List
Tags:

?

Log in

No account? Create an account