Skip to content
deanljohnson edited this page Jun 24, 2015 · 2 revisions

Motivations

Motivations are assigned to a quest giving entity to represent types of quests that the entity could give. For example, a priest would probably give out quests based on his "religion" or "knowledge" motivations. That priest should probably not have a "destruction" motivation. Motivations essentially work as an array of strategies that are randomly selected from to build a quest. You can define a motivation as follows:

questGen.motivations.knowledge = QUESTIFY.createMotivation([questGen.strategies.explore, questGen.strategies.goAndLearn]);

You then give an npc a motivations property that is an array and add the npc's motivations to that array

priest.motivations.push(questGen.motivations.knowledge);

Now, when you pass the priest to generateQuest() as the subject npc, a random motivation will be selected, and then a random strategy from that motivation will be selected to build the quest off of.

Clone this wiki locally