Skip to content

Quest Events

Dagait edited this page Apr 18, 2022 · 7 revisions

Quest Events

You can add new quest events in the script "QuestEvents".

Example:

public void NewQuestEvent(Quest quest)
{ 
     // Quest event... 
}

The quest events are located in the "QuestEvents" game object:

Hierarchie_QuestEvents


Add a Quest Event to a Quest

Click onto the quest file, after that, you have to decide when a specific event should be triggered (See Conditions):

Inspector_QuestEvents

Simply, click on the "+" sign to add a new event, and the "-" sign to remove the currently selected event from the list. After you added an event, the window should look like this:

Inspector_AddEvent

Next to "None (Object)", you have to press the small circle. Select the Prefab "QuestEvents". For function, you have to select the method which should be executed on this event. After you selected a method, there should appear a field that says "None (Quest)". In there, you have to insert the quest itself again (File).


OnAddGrain()

Execute this event, if the hamster picks up one or more grains.


OnRemoveGrain()

Execute this event, if the hamster drops one or more grains.


OnMove()

Execute this event, if the hamster moved.