This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
building:quests:dql [2019/08/22 23:16] EternalSenenity [Quest State Information] |
building:quests:dql [2019/11/30 00:09] EternalSenenity [Functions] |
||
---|---|---|---|
Line 52: | Line 52: | ||
The only major downside is the PC can end up with hundreds of pointless journal entries. | The only major downside is the PC can end up with hundreds of pointless journal entries. | ||
Builders can help by removing journal entries when a quest or quest chain is complete. | Builders can help by removing journal entries when a quest or quest chain is complete. | ||
- | If you want to avoid journal clutter but still want to track quest history, then consider using both Journal and the quest_census item. Remove the journal entry but leave the quest_census local variable. DQL will actually cache the journal state in the quest_census if found, or the PC is not, so using the quest_census to store quests results is seamless. | + | If you want to avoid journal clutter but still want to track quest history, then consider using both Journal and the quest_census item. Remove the journal entry but leave the quest_census local variable. DQL will actually cache the journal state in the quest_census if found, or the PC if not, so using the quest_census to store quests results is seamless. |
Include an NPC in the city, perhaps the library, who can clean up all the quests for your island. | Include an NPC in the city, perhaps the library, who can clean up all the quests for your island. | ||
=== Example Quest Using States === | === Example Quest Using States === | ||
- | Let us design a quest given by a collector to the PC to acquire a silver Statue from another collector. The quest has a few paths: | + | Let us design a quest given by a collector, to the PC, to acquire a silver Statue from another collector. The quest has a few paths: |
* Simply steal the statue; | * Simply steal the statue; | ||
* Persuade or intimidate collector B to sell it; | * Persuade or intimidate collector B to sell it; | ||
Line 83: | Line 83: | ||
Potentially the PC is free to steal the statue in any state but it is good practice to only spawn it when the quest is running, same for the painting. | Potentially the PC is free to steal the statue in any state but it is good practice to only spawn it when the quest is running, same for the painting. | ||
You could also add other requirements such as checking that Collector B is still alive if Collector A is squeamish. | You could also add other requirements such as checking that Collector B is still alive if Collector A is squeamish. | ||
- | Ideally, a quest should offer lots of alternative solutions and alternative paths for completion both using different skills/abilities and also allow them alternate moral choices. | + | Ideally, a quest should offer lots of alternative solutions and alternative paths for completion using different skills/abilities and also allow them alternate moral choices. |
===== Syntax ===== | ===== Syntax ===== | ||
The quest_aw script searches for the following three special character sequences. | The quest_aw script searches for the following three special character sequences. | ||
Line 90: | Line 90: | ||
**|PMOTE** - Pass the following text to the pmote script with Self as Subject and the PC Speaker as the partner. | **|PMOTE** - Pass the following text to the pmote script with Self as Subject and the PC Speaker as the partner. | ||
- | DQL itself has a very simple syntax consisting of a option object reference with a dot and a function name followed by the function arguments inside a pair of parenthesis, optionally followed by an operator and more DQL. | + | DQL itself has a very simple syntax consisting of a optional object reference with a dot and a function name followed by the function arguments inside a pair of parenthesis, optionally followed by an operator and more DQL. |
For example, if the PC if paying for something we would need to take something, then give something back. | For example, if the PC if paying for something we would need to take something, then give something back. | ||
- | * [The shop keeper takes your gold and hands over the hammer.]|DO PC.Take(GOLD, 500) AND PC.Give(QUEST_MAGIC_HAMMER) | + | * [The shop keeper takes your gold and hands over the hammer.]|DO PC.Take(GOLD, 500) AND PC.Give(quest_magic_hammer) |
Usually it is not necessary to include the "PC." part as the PC Speaker is selected by default. | Usually it is not necessary to include the "PC." part as the PC Speaker is selected by default. | ||
The AND operator is very important as DQL evaluates left hand side first and only evaluates the right hand side if the left and side if true. | The AND operator is very important as DQL evaluates left hand side first and only evaluates the right hand side if the left and side if true. | ||
Line 127: | Line 127: | ||
===== Functions ===== | ===== Functions ===== | ||
- | |||
- | === Has === | ||
Line 251: | Line 249: | ||
=== RemoveJournalEntry(PlotId) === | === RemoveJournalEntry(PlotId) === | ||
- | Removes the quest from the journal, this will allow the PC to repeat the quest. It is also a good helpful to keep journals uncluttered unless you really need to keep the entry. | + | Removes the quest from the journal, this will allow the PC to repeat the quest. It is also a helpful to keep journals uncluttered unless you really need to keep the entry. |
=== RJE(PlotId) === | === RJE(PlotId) === | ||
Line 308: | Line 306: | ||
Random number generator that simulates a dice throw. | Random number generator that simulates a dice throw. | ||
* DieSize The size of the dice, d(4),d(6),d(8),d(20), could be anything though. | * DieSize The size of the dice, d(4),d(6),d(8),d(20), could be anything though. | ||
- | * discount The number of dice thrown. Defaults to 1. | + | * DieCount The number of dice thrown. Defaults to 1. |
====== Examples ====== | ====== Examples ====== | ||
===== Stand Alone Example NPCs ===== | ===== Stand Alone Example NPCs ===== |