Hi,
BigDaddio wrote: ↑Sat Apr 13, 2019 2:41 pmI would like to assign a quest and have it active when a level is started, without a quest giver. Basically something like "Kill every damn thing in this level"
There are two ways to do this:
1. Add the quest to the player's Quest Journal, and set it active. Example:
Code: Select all
questJournal.AddQuest(quest);
quest.SetState(QuestState.Active);
QuestMachineMessages.RefreshIndicators(quest);
Side note: If 'quest' is a hand-written quest asset in your project, don't add it directly. Clone it, and use the clone:
Code: Select all
var instance = quest.Clone();
questJournal.AddQuest(instance); //etc...
2. Or create an empty GameObject with a Quest Giver component. Add the quest to the Quest Giver's list. Also add a Timed Event component. Tick Activate On Start. Configure the OnTimeReached() event to call QuestGiver.GiveAllQuestsToQuester(player). In this case, the Quest Giver GameObject isn't an NPC, it's just a container that holds quests to give the player.
BigDaddio wrote: ↑Sat Apr 13, 2019 2:41 pmI'd also like to add a quest on a unity trigger object. So when the player walks in a door they automatically get assigned a quest like "Steal the jewel from the idol"
Just like #2 above, except add a Trigger Event instead of a Timed Event.
BigDaddio wrote: ↑Sat Apr 13, 2019 2:41 pmMy game is all procedural. So the quests can be scripted, but only added on the event or thing being added. At the end of the level I want to count up the finished quests and assign points or such.
That's no problem with Quest Machine. Since Quest Machine has an extensive API, I'm sure you'll have questions, so ask any time.
BigDaddio wrote: ↑Sat Apr 13, 2019 2:41 pmI was thinking I'd build the quest using the quest builder
Here's the API:
QuestBuilder.
Did you want to use Quest Machine's procedural quest generator? Or will you write your own code that builds quests using QuestBuilder? If you plan to write your own code, perhaps as part of the level generation process, then these are the general steps:
1. Create a player in the scene.
2. Add a Quest Journal component to the player.
3. Build a quest.
4. Call
QuestMachine.RegisterQuestInstance(quest) to tell Quest Machine about the quest.
5. Use one of the methods above to add it to the player.
6. Repeat steps 3-5 for as many quests as you want.