Quest testing

degrassi

New member
I've seen here and there a desire to know if a quest is completed or not. This is what I tossed together to do this. It currently reports the status of a quest as simply "unavailable" (not given by the quest giver yet), "current" (active but incomplete), and "complete".

I'd like it to be able to be more granular and say what step of a particular quest you're on, but I haven't had the actual need yet, so didn't add it. Once I do, or if someone clever adds it and wants to share with me, it'll be in there.

The script basically works like this:

import the file into your .ash file.

Then, these three functions will be available:

Code:
void PrintQuests(boolean print_unavailable)
This will print to the cli all of the quests and if they are available, completed, or in work. If print_unavailable is false, anything that hasn't been given out won't be included.

Code:
void UpdateQuests()
This updates the quest list. It *shouldn't* ever need to be run, as there are internal checks to see if the quest log has been looked at. For a long script, or a script that is trying to complete a quest, you can run this re-check the quest log.

Code:
int QuestStatus(string quest)
This is the main function in this. It will return one of these values:
Code:
int QUEST_UNKNOWN = -1;
int QUEST_UNAVAILABLE = 0;
int QUEST_CURRENT = 1;
int QUEST_COMPLETE = 2;

So you could run it with something like:
Code:
if (QuestStatus("Galaktik")==QUEST_COMPLETE)
{
// do something knowing that you've finished the Doc Galaktik quest
}

If you look in the script, it'll have the list of quests so you'll know what are valid values for the QuestStatus() function.

I'll move this to the quest related section once I have sub-quest returns available (so you can know where in a quest you are).
 

Attachments

  • quest.ash
    2.8 KB · Views: 79
Top