UPD:
Perhaps my addition wasn't noticed, so I'll duplicate it:
How do you create a task with sub-tasks, i.e., so that one task includes 3 others, for example? And so that it is considered completed when all 3 of these tasks are completed.
The simplest way is to start a thread at the beginning of the main task that checks whether the 3 secondary tasks have been completed. For example, like this:
function CheckSecondaryQuestsCompleted()
while 1 do
if GetObjectiveState('quest_1') == OBJECTIVE_COMPLETED and
GetObjectiveState('quest_2') == OBJECTIVE_COMPLETED and
GetObjectiveState('quest_3') == OBJECTIVE_COMPLETED then
SetObjectiveState('main_quest', OBJECTIVE_COMPLETED)
break
end
sleep()
end
end