Allow only one instance

Announcements, support questions, and discussion for Quest Machine.
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: Allow only one instance

Post by GorkaGames »

Thanks for the quick patch!!!

1. Unfortunately the error persists. At least I think I have fount the cause, I get this warning every time I push one of the offers and the questo doesn't show up:
It says thay there is not Player Quest component but there is for sure. Even the error is random, I mean that every 4 times that I aproach the quest giver at the same moment works fine 1 and it doesn't work 3, but always you finish getting the quest if you insist going backwards and forward to the quest giver.

2. I get warning Number 2 also when I'm close to the giver but before getting the dialogue panel.

3. I've added again the Input Device Manager and the Rewired Device Manager. Rewired it works but It doesn't work the cancel button (on the keyboard yes it works)

Warning N.1:
Quest Machine: There is no Player Quest List Container. Can't offer quest 'Havana`s Tresure'.
UnityEngine.Debug:LogWarning(Object, Object)
PixelCrushers.QuestMachine.QuestGiver:ShowOfferQuest(Quest) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest MonoBehaviours/Quest List/QuestGiver.cs:470)
PixelCrushers.QuestMachine.QuestGiver:OnSelectQuest(Quest) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest MonoBehaviours/Quest List/QuestGiver.cs:495)
PixelCrushers.QuestMachine.<AddQuestList>c__AnonStorey2:<>m__0() (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest UIs/Unity UI/Unity UI Quest Dialogue UI/UnityUIQuestDialogueUI.cs:238)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
Rewired.Integration.UnityUI.RewiredStandaloneInputModule:SendSubmitEventToSelectedObject() (at Assets/Rewired/Integration/UnityUI/RewiredStandaloneInputModule.cs:791)
Rewired.Integration.UnityUI.RewiredStandaloneInputModule:Process() (at Assets/Rewired/Integration/UnityUI/RewiredStandaloneInputModule.cs:646)
UnityEngine.EventSystems.EventSystem:Update()


Warning N.2:
Quest Machine: Can't start dialogue with Character_Gentleman_Quest Giver. Player doesn't have a Quest Journal.
UnityEngine.Debug:LogWarning(Object, Object)
PixelCrushers.QuestMachine.QuestGiver:StartDialogue(GameObject) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest MonoBehaviours/Quest List/QuestGiver.cs:409)
UnityEngine.Events.UnityEvent`1:Invoke(T0)
PixelCrushers.TriggerEvent:OnTriggerEnter(Collider) (at Assets/Plugins/Pixel Crushers/Common/Scripts/UnityEvents/TriggerEvent.cs:36)
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: Allow only one instance

Post by GorkaGames »

Just to remind you thay I'm using invector controllet and it's always in the "Do'nt destroy on load" and not in the escene, just in case this helps a bit
What I mean is that sometimes I have to ask (after search for it) if I found it and it's not null.

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

Re: Allow only one instance

Post by Tony Li »

Hi,

Does your scene have more than one GameObject that is tagged "Player"? If so, each time it starts the conversation it might be finding a different GameObject, only one of which would have the Quest Journal component.

If this is the case, you can either (1) make sure that only one GameObject is tagged "Player", or (2) call QuestGiver.StartDialogue(GameObject) instead of QuestGiver.StartDialogueWithPlayer(). This way you can specify the correct GameObject that has the Quest Journal component.
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: Allow only one instance

Post by GorkaGames »

1. I have got 3 objects with tag player as I change the controller sometimes (por skyping boats or flying a bird :)
But only 1 active at the time, does look for non active ones as well?

2. I have change to start dialogue with GameObject, I'll tell you how it goes but.... can be problematis as the player is instanciated?

Thanks

EDIT: NO WORKING AFTER THE CHARACTER DIES (DESTROY OBJECT)
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Allow only one instance

Post by Tony Li »

What if you put the player's Quest Journal on a dedicated GameObject in each scene? Use the same ID and Save Key on it in each scene:

Image

This GameObject doesn't need to be tagged Player.

Then you can assign that GameObject to the scene's Quest Givers. For example:

Image

Or another example:

Image
Post Reply