Open benchristel opened 11 years ago
Had a new idea for this that would fit into our existing system. We could add global variables to our DSL, which would be manifested only once for a given character generation, and then branch based on the values of those variables.
|$gender
10@male
10@female
unknown
|$race
human
elf
dwarf
|profession
[genericProfession]
$race = elf
2@[elfProfession]
$race = dwarf
2@[dwarfProfession]
|objectPronoun
$gender = male
him
$gender = female
her
$gender else
them
Maybe we can use treetop.
Rather than have the $
variables be global, we probably want to be able to scope them, so we can have multiple nodes with different values of the variables. For example:
|root
[person]; [person]; [person]
|person $race
[name], the [$race] [profession]
|$race
human
elf
dwarf
|profession
$race = human
fighter
cleric
$race = elf
ranger
wizard
$race = dwarf
miner
barbarian
This should generate output like:
Hele, the elf wizard; Kiyor, the dwarf miner; Pufkliir, the human cleric
Users should be able to generate output like this:
From input like this:
The DSL needs some work... if the user wants to, for, example, change the name of a town, they also have to change all correlation rules that reference the name. There's also no obvious way to express two-way dependencies, e.g. dwarves are more likely to be miners, and miners are more likely to be dwarves. We basically need a GUI to manage this stuff... or a smarter DSL.