Quests trigger in order

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
field2012
Posts: 17
Joined: Fri Apr 15, 2016 2:11 am

Quests trigger in order

Post by field2012 »

Hi Tony,

I have a situation where quests are triggered in order.

For example, Main Quest - Entry 1 - would require player to go and speak to npc, and then Entry 2 would require player to kill enemies and then report back to npc.

The problem is player can kill enemies before completing Entry 1, and quest log says Entry 2 completed. After speaking to npc, it resets Entry 2 and then it gets stuck there, because the enemies are already dead.

Is there a way to avoid this, where quest can only get completed if player has completed Entry 1 or so?

I checked the Increment Quest Variable script, there is nothing about conditions.

Thanks
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quests trigger in order

Post by Tony Li »

Hi,

Which script are you using, Increment On Destroy? How about if I add a Condition section to it, so it will only increment if Entry 2 is active?

The problem remains that the player can still kill the enemies before Entry 2 goes active. This is a common design question. Here are a few suggestions:

- You could set up a spawner (like in MMOs) that keeps respawning enemies. This way the player will never run out of enemies to kill.

- Or you could keep the enemies inactive until Entry 2 goes active. Group the enemies under an empty GameObject. Then Entry 2 goes active, use the SetActive() sequencer command to activate the empty GameObject. You'll probably want to hide the enemies behind obstructions so the player won't see them suddenly pop into the scene.
field2012
Posts: 17
Joined: Fri Apr 15, 2016 2:11 am

Re: Quests trigger in order

Post by field2012 »

Hi Tony,

Ya i am using increment quest variable script, there is no section for condition. So would be handy if its added.

I would use the second option of activating enemies when Entry 2 goes active. This second option worked, but would be good to have the first option aswell.

Thanks

P.S How will this work with a game object in a different scene? Can it still be activated?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quests trigger in order

Post by Tony Li »

Hi,

Version 1.6.5, which is on the Pixel Crushers customer download site now and should be on the Asset Store soon, adds a Condition section to Increment On Destroy .

To use the active GameObject method with objects in another scene, use a Persistent Active Data component in the other scene to activate the parent object based on a Condition.
field2012
Posts: 17
Joined: Fri Apr 15, 2016 2:11 am

Re: Quests trigger in order

Post by field2012 »

Thanks Tony.

Will update to 1.6.5 when it becomes available.

Cheers
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quests trigger in order

Post by Tony Li »

Version 1.6.5 is also on the Asset Store now, too. :-)
Post Reply