Page 1 of 1

Quest status not changing

Posted: Sat Jan 21, 2017 3:33 pm
by bakershah
Hi,

I'm having an issue with one of my quests in my game. I have it setup to where when I kill a specific enemy it triggers the quest to be a success.
Screen Shot 1.jpg
Screen Shot 1.jpg (96.32 KiB) Viewed 1267 times
Later on when I do a condition in a another conversation. I check if the quest was a failure or success. As in if the player killed that enemy or not.
Screen Shot 2.jpg
Screen Shot 2.jpg (89.5 KiB) Viewed 1267 times
Screen Shot 3.jpg
Screen Shot 3.jpg (87.83 KiB) Viewed 1267 times
However I've noticed the quest doesn't change its status to success. and I'm not quite sure what to do.

Re: Quest status not changing

Posted: Sat Jan 21, 2017 3:36 pm
by bakershah
As for triggering the change. When the enemy dies I turn on a loot object which contains these 2 components. At first I tried using the conversation trigger but it didn't work. then the quest trigger component to change it to success but it still wasn't working. As soon as the object turns on I have it set to on start where it should change the state of the quest.
Screen Shot 4.jpg
Screen Shot 4.jpg (81.07 KiB) Viewed 1266 times

Re: Quest status not changing

Posted: Sat Jan 21, 2017 3:59 pm
by Tony Li
Hi,

Have you confirmed that the GameObject "Quest Kill Orcs Change" becomes active?

Try temporarily setting the Quest Trigger's Alert Message to something like: "Kill Orcs in Forest = success!" Then make sure you see this message.

You can also use the Watches tab or Lua Console to check the quest state before starting the conversation with the Captain. If you're using the Lua Console, for example, press ~+L and enter:

Code: Select all

return Quest["Kill_Orcs_in_Forest"].State == "success"
If you're using Dialogue System 1.6.3 (I think) or higher, you can use this simpler form:

Code: Select all

return CurrentQuestState("Kill Orcs in Forest") == "success
and similarly to set quest states:

Code: Select all

SetQuestState("Kill Orcs in Forest", "success")
If that doesn't help, please feel free to send a reproduction project to tony (at) pixelcrushers.com. I'll be happy to take a look.

Re: Quest status not changing

Posted: Mon Jan 23, 2017 2:04 pm
by bakershah
I checked the object to make sure it turns on when I kill the enemy. It works and is active. However when I go to see the change it still doesn't change the outcome. By killing the enemy I get human reinforcements in another part of the game for a sequence. But if you don't kill the enemy and the quest = failure then you get more orcs enemies. That part works. Just the part where I kill the enemy and later on human reinforcements come is whats not working so it must have something to do with the quest change not working.

Re: Quest status not changing

Posted: Mon Jan 23, 2017 2:12 pm
by bakershah
Tried something new and found something. I decided to trigger a conversation when I kill the orc and I added a quest change on dialogue event component to the game object. However I noticed when I assign the component the quest it shows up where quest name is but as soon as I start the scene the quest name disappears. not sure if that has something to do with it.
Screen Shot 2017-01-23 at 11.09.32 AM.jpg
Screen Shot 2017-01-23 at 11.09.32 AM.jpg (72.79 KiB) Viewed 1261 times

Screen Shot 2017-01-23 at 11.13.13 AM copy.jpg
Screen Shot 2017-01-23 at 11.13.13 AM copy.jpg (117.41 KiB) Viewed 1261 times

Re: Quest status not changing

Posted: Mon Jan 23, 2017 3:11 pm
by Tony Li
That will happen if the dialogue database that you're using in the editor is different from the one that's active at runtime.

Here's an example scenario in which that can happen.
  • DatabaseA: Does not contain Kill Orcs quest.
  • DatabaseB: Does contain Kill Orcs quest.
  • Main Menu Scene: Dialogue Manager points to Database A.
  • Forest Scene: Dialogue Manager points to Database B.
While you're editing Forest Scene, the inspectors will grab text names (quests, variables, etc.) from the database assigned to the scene's Dialogue Manager.

When you play from Main Menu Scene and change to Forest Scene, the Dialogue Manager from Main Menu Scene will take precedence. Since it points to DatabaseA, at runtime the inspectors will grab text names from DatabaseA. Since DatabaseA doesn't have the Kill Orcs quest, the dropdown will be blank.

I don't know if that is what's happening, but it's one way to produce this issue. To fix it, make sure any instances of Dialogue Manager in all of your scenes point to the same database.

You may also find it helpful to temporarily set the Dialogue Manager's Debug Level to Info. This will log a lot of activity to the console, including what quests it's loading into memory (the Lua environment). You can check to see if your quest is being loaded.

Re: Quest status not changing

Posted: Tue Jan 24, 2017 3:16 pm
by bakershah
I checked the scenes. I only use one database for the game. I do have some scenes in between that don't have a dialogue manager object in them because they're cinematics and don't use any dialogue. Could that be it?


Also the quest itself is not trackable or abandonable. Could that be it?

Re: Quest status not changing

Posted: Tue Jan 24, 2017 4:07 pm
by Tony Li
bakershah wrote:I checked the scenes. I only use one database for the game. I do have some scenes in between that don't have a dialogue manager object in them because they're cinematics and don't use any dialogue. Could that be it?
That may be it. Try putting a Dialogue Manager in the first scene in your game, assign your database, and make sure Dont Destroy On Load and Allow Only One Instance are both ticked.

If your first scene uses any Dialogue System functionality but doesn't have a Dialogue Manager, it will create an empty Dialogue Manager with no database assigned. Since the checkboxes are ticked by default, this empty Dialogue Manager will persist through scene changes.

Another thing to check would be to pause the game after accepting or completing some part of the quest. Then inspect the Dialogue Manager. Make sure it's the one you intend, with your database assigned to its Initial Database field. You can also add a Lua Console to your scene (at runtime even) to check the contents of the Dialogue System's runtime environment. After adding the Lua Console component, press ~+L to open the console window. Then enter a command like this:

Code: Select all

return Quest
This will print out a list of all quests in the runtime environment.

bakershah wrote:Also the quest itself is not trackable or abandonable. Could that be it?
That shouldn't cause any problem.

If none of that helps, please feel free to send a reproduction project to tony (at) pixelcrushers.com. I'll be happy to take a look.