Resources
Libraries for Quest 5
Score
A simple module that lets the writer easily add scores to the game.
To use:
1. In the start script on the game item, call the InitScore function with the following parameters
a. The maximum (or winning) score, as an integer.
b. A list of ranks, separated by commas, as a string. Remember to enclose in double quotes.
c. A boolean, indicating if you have status attributes.
Use true to indicate you have, false to otherwise.
2. When the player does something score worthy, call the IncScore function.
This takes two parameters, the first an identifying string, the second the amount
to increase the score by. The function will only change the score if the identifying string
is not recognised; i.e., if the player does the same thing several times, only the first time
will affect the score.
That is all that is required. The score will be displayed as an attribute, and if the player
types “score”, she will get her score, rank and a list of achievements.
Optionally, you might prefer to modify the score command so it calls PrintScore, rather than
PrintFullScore, so there is no list of achievements (you will need to give your new command a new
name, but the same pattern). Optionally you may want to have your own PrintScore (say for another language). You will then require your own command that calls your new function. both of these are illustrated in
Al_Score_Demo.
This should be robust enough to handle nagative scores and scores over the maximum score.
Feel free to modify this code as you wish.
Shopping
Contributed by The Pixie.
To use:
1. Have a Boolean attribute on your shop called “shop” set to true.
2. Have an integer attrubute on the player called “money”, set to the
amount of cash the player starts with. It would be good to set this
as a status attribute too.
3. Any goods for sale should be placed in the shop. Set to scenery and
not takeable (these will be changed when the item is purchased).
They also need an integer attribute “price”; this will be deducted
from the player’s money.
Clock
Contributed by The Pixie.
The Pixie Clock Library
This library will help you to track time during the game. Time is incremented whenever the player takes a turn, starting from midnight on day 1. By default, moving to another room will take 5 minutes, any other action will take 1 minute. If the player types “clock” she will discover the time.
What you can also do:
Set the start time
In the game.start script, call IncTime to set the time in game starts in minutes past midnight.
Have the time displayed as a status variable
Add the attribute “clock” to the player, and set it to string. Then add it as a status variable. It will automatically track the time.
Have long distance exits
You can change the time that passes when a specific exit is used by calling the LongExit function. Call the function in a script on the exit, with the parameters, this, and the time to elapse.
<exit alias=”north” to=”distance_room”>
<inherit name=”northdirection” />
<script type=”script”>
LongExit (this, 45)
</script>
</exit>
Have exits open at different times
You can also have exits that can only be used at certain times. There is not a lot of control over this. The day is divided into six hour slots, and you can specify which are open with the third parameter to the BusinessExit function. This should be a 4 character string, each character corresponding to a six hour slot, n indicates not open, y indicates yes it is.
<exit alias=”west” to=”business_room”>
<inherit name=”westdirection” />
<script type=”script”>
BusinessExit (this, 5, “nynn”)
</script>
</exit>
Convenience functions
In addition, there are a number of functions available that will hopefully make life easier for others..
GetTime
IncTime(int)
IsAfternoon
IsBusinessClosed(string)
IsEvening
IsDusk
IsMorning
IsNight
PartOfDay
TimeAsString
Journal
Contributed by The Pixie.
A very simple module that lets the writer easily put a journal into the game.
To use:
1. Create at item to be used as a journal as normal
2. In the start script on the game item, set up the journal
a. Call the SetJournalObject with the item you created in
step 1 as the parameter (as an object)
b. Optionally, call the SetJournalFont to define how the
journal text will be displayed. There are three parameters.
SetJournalFont(font name as string, font size as integer, colour as string)
3. Anywhere in you game where you want an event noted (if the player
is carrying her journal), invoke the AddToJournal command, with
the string to be added as a parameter.
Feel free to modify this code as you wish.
Clothing
Contributed by The Pixie.
A very simple module that builds wearable items into the game. To use, have garments inherit from “clothing_type”. They will be set to be takeable, and when worn will appear in the inventory with “(being worn)” appended to the name. Check the attribute “being_worn” to determine if the item is being worn in a script.
Translations for Quest 4
Quest translations take the form of LDF files. These convert the Quest player interface into different languages.
To install an LDF file, copy it to your Quest folder (usually C:\Program Files\Quest). Then, start Quest and click Tools, Options, then select the language from the drop-down list.
To create an LDF file, please see the documentation topic Translating Quest.
If you would like to submit an LDF file to be included on this page, please contact us.