Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

Is there a FailAllObjectivesExcept sort of function?



I want to fail every objective except for one, at a certain stage in a quest. I could do:



FailAllObjectives()


SetObjectiveCompleted(MyException)



But would that not show:



Objective - Failed


Objective - Failed


Etc.


MyException - Failed


MyException - Completed?



Or does failing all objectives not affect those already completed?


Link to comment
Share on other sites

The only way to find that out is to test FailAllObjectives() yourself. I'm betting it is one of those functions that is hardly ever used.

 

I was working a custom function to do this easily, via arrays but ran into an interesting discovery with isObjectiveCompleted() and SetObjectiveFailed(). Passing arrays into the former will only return the index, instead of what the index is holding(in this case myQuest.IsObjectiveCompleted(Obj)), resulting in an error and printing to the log about unknown quest objective. Since obviously the indexes will not match the values representing that objectives.

Edited by Terra Nova
Link to comment
Share on other sites

The only way to find that out is to test FailAllObjectives() yourself. I'm betting it is one of those functions that is hardly ever used.

 

I was working a custom function to do this easily, via arrays but ran into an interesting discovery with isObjectiveCompleted() and SetObjectiveFailed(). Passing arrays into the former will only return the index, instead of what the index is holding(in this case myQuest.IsObjectiveCompleted(Obj)), resulting in an error and printing to the log about unknown quest objective. Since obviously the indexes will not match the values representing that objectives.

Well I suppose I'll test it and then add a note to the wiki about my findings.

Link to comment
Share on other sites

Nah, I did it for you lol.

 

If a stage is already completed, it is still flagged(in the journal) as failed with FailAllObjectives. But the completed stage will not display on screen with the rest of the failed objectives, if you know what I mean.

Edited by Terra Nova
Link to comment
Share on other sites

Nah, I did it for you lol.

 

If a stage is already completed, it is still flagged(in the journal) as failed with FailAllObjectives. But the completed stage will not display on screen with the rest of the failed objectives, if you know what I mean.

Hmm. Does it fail non-displayed objectives? Ones that haven't been shown yet?

Link to comment
Share on other sites

 

Nah, I did it for you lol.

 

If a stage is already completed, it is still flagged(in the journal) as failed with FailAllObjectives. But the completed stage will not display on screen with the rest of the failed objectives, if you know what I mean.

Hmm. Does it fail non-displayed objectives? Ones that haven't been shown yet?

I don't know how to properly test non displayed ones.

 

This is how I tested it.

 

I made 5 Objectives:

 

SetObjectiveDisplayed(10)

SetObjectiveDisplayed(20)

SetObjectiveDisplayed(30)

SetObjectiveDisplayed(40)

SetObjectiveDisplayed(50)

 

SetObjectiveCompleted(40)

 

utility.wait(8.0)

FailAllObjectives()

 

utility.wait(10.0)

debug.notification("Check" +IsObjectiveCompleted(40)) ← false

 

10-30, and 50 will show up on screen, 40 gets completed as expected.

 

When FaillAllObjectives kicks in, this shows up on the screen:

 

Failed Test 1

Failed Test 2

Failed Test 3

Failed Test 5

 

But in the journal all are flagged failed. Seems to me like it does what its intended, and not the function you're looking for.

 

 

Edit: the check works as expected. Even though 40 is completed, it is set to failed, and returns false.

Edited by Terra Nova
Link to comment
Share on other sites

Hmm. That kind of works but not as well so I gues I'll just fail all possible objectives based on when something happened.

For example, if the thing happened at stage 20 fail stage 10, and set the stage to 200 which will complete 15. If done at stage 80, fail all objectives below <= 80, except 15, set the stage to 200 which completes stage 15.

Link to comment
Share on other sites

I tried testing a non displayed one with the console command's version of SetObjectiveDisplayed (I used 30 for this) and nothing happened.

Alright then. I won't use FailAllObjectives. Doesn't work for me in this case.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...