This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
building:quests:dql [2019/08/22 20:30] EternalSenenity [Quest State Information] |
building:quests:dql [2019/11/30 00:38] EternalSenenity [Objects] |
||
---|---|---|---|
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. | + | 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; | ||
+ | * Persuade or intimidate collector B to sell it; | ||
+ | * Exchange the statue for a painting in collector A's collection; | ||
+ | * Make a fake statue and use that instead. | ||
+ | State | ||
0 = Not started: | 0 = Not started: | ||
- | When the PC talks to the collecter A offer them the quest and if they accept, move to 1 and tell them to obtain the statue from collecter B. | + | When the PC talks to the collecter A, offer them the quest and if they accept, move to 1 and tell them to obtain the statue from collecter B. |
If the PC is in the thieves guild and passes a lore and INT check, also suggest that they could obtain a fake statue from guild forger. | If the PC is in the thieves guild and passes a lore and INT check, also suggest that they could obtain a fake statue from guild forger. | ||
1 = Looking for the Statue: | 1 = Looking for the Statue: | ||
Line 78: | 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 85: | 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 122: | Line 127: | ||
===== Functions ===== | ===== Functions ===== | ||
- | |||
- | === Has === | ||
Line 246: | 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 257: | Line 260: | ||
=== ActionFaceNearest() === | === ActionFaceNearest() === | ||
- | Makes the NPC face in the direction of the nearest peaceable. Used for aligning them with chairs and tables. | + | Makes the NPC face in the direction of the nearest placeable. Used for aligning them with chairs and tables. |
=== EscapeArea() === | === EscapeArea() === | ||
Line 284: | Line 287: | ||
Returns TRUE if the object was created. | Returns TRUE if the object was created. | ||
+ | === Destroy() === | ||
+ | Destroy the subject, obviously, PCs are ignored so be sure to use something like QUEST_P_VICTIM.Destroy(). Returns TRUE if the subject was valid or FALSE if not. | ||
==== Animation ==== | ==== Animation ==== | ||
PMOTE may be a better option. | PMOTE may be a better option. | ||
Line 303: | Line 308: | ||
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 ===== |