Project

General

Profile

Feature - New #1844

Provide branching in scripted task

Added by ethreayd about 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Start date:
2017-02-22
Due date:
% Done:

0%

Estimated time:
vbulletin_issue_id:

Description

Today task for QuestBot are linear. They go from step-1 to the last step. Sometime something make the task stop before the end like "Confirm_ZoneName".

With the new NPC_Dialogue we can go directly to a step depending on the matched text in the dialogue. The issue is that we can not easily have a branch for each case.

What could be done today is to do :

a NPC_Dialogue with 3 possibility that will use as next step at let says, step-100, step-200 or step-300

When going, by example at step-200, the issue is that at one point, it will reach the step-300. So we need an EXIT before step-300. This could be done by using the confirm_ZoneName with a dummy zone.

But that means that it will not do, by example step-400 and so.

So if by example I have a minimal script like that :

step-1 : Do a NPC_Dialogue that continue to step-2 for choice A, step-3 for choice B, step-4 for choice C

step-2 : /dance

step-3 : /hug

step-4 : /smile

step-5 : /autodestruct

For choice A, it will do step 2, 3, 4, 5, in case of B, it will skip 2 but do 3,4,5 and in case C, it will skip 2 & 3 and do 4 & 5

You can not do 2 then 5, 3 then 5 by example.

what you can do is :

step-1 : Do a NPC_Dialogue that continue to step-2 for choice A, step-5 for choice B, step-8 for choice C

step-2 : /dance

step-3 : /autodestruct

step-4 : Confirm_ZoneName("Land of Oz") --> Will stop the task

step-5 : /hug

step-6 : /autodestruct

step-7 : Confirm_ZoneName("Land of Oz") --> Will stop the task

step-8 : /smile

step-9 : /autodestruct

 

Which can be really heavy when you have a lot to do after a choice.

Different possibilities are available to deal with that, one of them is to do like in the programmation langage BASIC, GOTO

step-1 : Do a NPC_Dialogue that continue to step-2 for choice A, step-4 for choice B, step-6 for choice C

step-2 : /dance

step-3 : GOTO(step-7)

step-4 : /hug

step-5 : GOTO(step-7)

step-6 : /smile

step-7 : /autodestruct

 

Another way to do it will be sub task

<main_task>

step-1 : Do a NPC_Dialogue that continue to st1 for choice A, st2 for choice B, st3 for choice C and go to next step when sub task is finished

step-2 :  /autodestruct

</main_task>

<st1>

step-1 : /dance

</st1>

<st2>

step-1 : /hug

</st2>

<st3>

step-1 : /smile

</st3>

 

No data to display

Also available in: Atom PDF