Accept Quest Event
-
- Posts: 86
- Joined: Mon May 02, 2022 12:16 am
Accept Quest Event
Hi again, is there an event that I can handle when a quest is very first accepted? I see that I can have an event for while the quest is active, but does that execute more than once, while the quest is in an active state? What I am trying to accomplish is once a quest is accepted, to then add markers on my map relating to that quest, so I'm thinking that handling an event is the way to go for this but can't seem to find anything. I'm sure I missed it somewhere. Thanks!
Re: Accept Quest Event
Hi,
A good way to activate markers is to use the quest's States > Active > Actions section. For example, in the demo's Pesky Rabbits quest, I could add this action:
These actions will run when the quest becomes active.
If I were using the save system, I'd also want to set up an Active Saver component to save the active/inactive state of the 'Rabbit Markers' GameObject.
If you don't want to just activate a GameObject, you can write a custom action to do whatever you want. Duplicate QuestActionTemplate.cs and fill in your code where the comments indicate.
A good way to activate markers is to use the quest's States > Active > Actions section. For example, in the demo's Pesky Rabbits quest, I could add this action:
These actions will run when the quest becomes active.
If I were using the save system, I'd also want to set up an Active Saver component to save the active/inactive state of the 'Rabbit Markers' GameObject.
If you don't want to just activate a GameObject, you can write a custom action to do whatever you want. Duplicate QuestActionTemplate.cs and fill in your code where the comments indicate.
-
- Posts: 86
- Joined: Mon May 02, 2022 12:16 am
Re: Accept Quest Event
What I did, and seems to be working is for the quest Start node True state, I execute/handle an event. I'm not sure if this is the best way though. I do like your approach but my game objects are already active, I'm just adding notations to the map to make the player aware of them.
Re: Accept Quest Event
That's totally fine, too. The quest's main Active state and the Start node's Active and True states all run when the quest becomes active. And the UnityEvent action is exactly for purposes like that.
-
- Posts: 86
- Joined: Mon May 02, 2022 12:16 am
Re: Accept Quest Event
After thinking about it, I need a way to save these markers also. In that case they would need to be game objects with a saver component on it, is that right? Then I can use the Activate/Deactivate GameObject Action I think.
-
- Posts: 86
- Joined: Mon May 02, 2022 12:16 am
Re: Accept Quest Event
I am trying to set up the Action to Activate/Deactivate a game object but running into a problem. I have the Action set up in the Active State of the quest, and a game object in my scene that is initially set to inactive. I must have missed something somewhere because it is not activating the game object when the player accepts the quest. Does the game object need a specific component?
-
- Posts: 86
- Joined: Mon May 02, 2022 12:16 am
Re: Accept Quest Event
Ok, I got it working now. I was enabling/disabling the wrong object.
Thanks for the help!
Thanks for the help!