Jump to content

Quest w/ multiple simultaneous objectives


Laxarvala

Recommended Posts

Hey there,

 

As part of a quest mod i'm working on, there's a quest with three objectives that's supposed to progress to the next stage, where the player returns to the questgiver, but i am having a problem w/ making this occur. As the quest is non-linear - all three objectives can be completed in any order - i'm unsure how to force the quest to progress when all three objectives are done. How do I go about doing this?

 

Some failed attempts: I tried to script it so that when all objectives are completed, it setstages to the next one. This refuses to work no matter what I do.

Another was shorting some terms for all three objectives, (e.g. ObjectiveA ; 0 = no, 1 = yes - setobjectivecompleted questexample 10 1), then making a variable that checks if all three objectives are met (e.g. AllObjectiveComp ; 0 = no, 1 = yes - setstage questexample 35)

 

Am i just overcomplicating this? I'm unable to find anything regarding this type of non-linear quest; help would be appriecated and apologies if this is a rookie mistake.

 

 

Link to comment
Share on other sites

You have the right idea of keeping track of completed objectives with a quest variable, but you are indeed over-complicating it.

 

You can keep track of everything you need to with one int variable; Id call it something like "Objectivescompleted"

 

Using a little bit of ALGEBRA, you can increment that variable everytime you complete an objective with the statement:

Set MyQuest.ObjectivesCompleted to (MyQuest.ObjectivesCompleted + 1)

So let's say one of the objectives is killing a Baddie, I'd attach the following script on them:

 

;;;;;;

 

Begin OnDeath

If MyQuest.ObjectivesCompleted < 2

Set MyQuest.ObjectivesCompleted to (Myquest.ObjectivesCompleted + 1)

Elseif MyQuest.ObjectivesCompleted == 2

Set Stage Myquest 20

Endif

end

 

;;;;;;

 

To break this script down:

 

The Script runs when the NPC it's attached to Dies.

 

We compare the value of MyQuest's ObjectivesCompleted Variable to 2

 

If the value is less than 2, we Increase the value of MyQuest's ObjectivesCompleted variable by 1

 

If the value equals 2, we advance MyQuest to stage 20. (We have three objectives in mind, but if this value equals 2, then the player must have already completed two of our three objectives, meaning the player must have just completed the third and final objective, and the quest is ready to advance to the next stage.)

 

 

 

Now just give all three of the relevant npcs/activators/dialogues similar scripts, and there you go: non-linear objectives that advance the quest when all three are done. (Note that you can use If statements in result scripts for dialogue topics, so you can use this Counter Engine pretty much anywhere.)

Edited by Radioactivelad
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...