QM+UIS data sync works in editor but not on my phone
QM+UIS data sync works in editor but not on my phone
Hi,
I'm using QM 1.2.21+UCC 2.4.4+UIS 1.2.3, and the quest counters sync UIS item amount with Value Mode: Data Sync. It works well in Unity editor, but if I build and run on my android phone, the counter does not sync with UIS item. The screenshots show the error that occured when the player pickup an UIS item.
Edit:
I just found the Release Note of QM 1.2.21, the last null reference exception in UISItemAmountQuestCondition seems like the issue I have. But I'm using QM 1.2.21 and this issue still.
I'm using QM 1.2.21+UCC 2.4.4+UIS 1.2.3, and the quest counters sync UIS item amount with Value Mode: Data Sync. It works well in Unity editor, but if I build and run on my android phone, the counter does not sync with UIS item. The screenshots show the error that occured when the player pickup an UIS item.
Edit:
I just found the Release Note of QM 1.2.21, the last null reference exception in UISItemAmountQuestCondition seems like the issue I have. But I'm using QM 1.2.21 and this issue still.
Last edited by bitmore on Thu Dec 02, 2021 1:34 pm, edited 1 time in total.
Re: QM+UIS data sync works in editor but not on my phone
Hi,
Your screenshots didn't come through. Would you please post them again?
Try playing in the editor from the first scene in build settings. Keep in mind that the Quest Machine GameObject survives scene changes and supplants any Quest Machine GameObjects in subsequently-loaded scenes. It may be that you've assigned a direct reference to something in the Quest Machine hierarchy and it's losing the reference when changing scenes.
Your screenshots didn't come through. Would you please post them again?
Try playing in the editor from the first scene in build settings. Keep in mind that the Quest Machine GameObject survives scene changes and supplants any Quest Machine GameObjects in subsequently-loaded scenes. It may be that you've assigned a direct reference to something in the Quest Machine hierarchy and it's losing the reference when changing scenes.
Re: QM+UIS data sync works in editor but not on my phone
Thank you for replying so quickly. Everything works well in the editor. The issue only happens on the phone, and with no changing scenes, I test it in one scene. Also I double-checked the reference in the Quest Machine they all reference the children game objects.Tony Li wrote: ↑Thu Dec 02, 2021 1:33 pm Hi,
Your screenshots didn't come through. Would you please post them again?
Try playing in the editor from the first scene in build settings. Keep in mind that the Quest Machine GameObject survives scene changes and supplants any Quest Machine GameObjects in subsequently-loaded scenes. It may be that you've assigned a direct reference to something in the Quest Machine hierarchy and it's losing the reference when changing scenes.
I just found the Release Note of QM 1.2.21, the last null reference exception in UISItemAmountQuestCondition seems like the issue I have. But I'm using QM 1.2.21 and this issue still.
Re: QM+UIS data sync works in editor but not on my phone
Hi,
Have you downloaded and imported the latest UIS integration for Quest Machine? Here's a download if you haven't already imported it:
OpsiveUIS_QuestMachine_Integration_2021-10-14.unitypackage
Have you downloaded and imported the latest UIS integration for Quest Machine? Here's a download if you haven't already imported it:
OpsiveUIS_QuestMachine_Integration_2021-10-14.unitypackage
Re: QM+UIS data sync works in editor but not on my phone
Yes, I redownloaded the packages hours ago.
And I just downloaded the package you provided, the import window shows Nothing to import which means I already import this package.
I just check the UIS QM Demo, there is a UIS Saver on Player and a UIS Saver on Pixel Crusher Save System, do we need both of them at the same time?
And I just downloaded the package you provided, the import window shows Nothing to import which means I already import this package.
I just check the UIS QM Demo, there is a UIS Saver on Player and a UIS Saver on Pixel Crusher Save System, do we need both of them at the same time?
Re: QM+UIS data sync works in editor but not on my phone
Hi,
Are you specifying an inventory name in the UI Item Amount Quest Condition?
If not, does your scene have a GameObject tagged "Player" that has an inventory?
You can try this version of the package, which logs a warning if it doesn't find an inventory:
OpsiveUIS_QuestMachine_Integration_2021-12-02.unitypackage
If that doesn't help, the error is happening inside UIS's EventHandler class, which is a closed class. Would you please contact Opsive about the error? If you send them the Console window screenshot of the ArgumentNullException, they should be able to help. You can post on the Opsive forum or try messaging @Sangemdoko in the ultimate inventory system - #general channel on discord.
Are you specifying an inventory name in the UI Item Amount Quest Condition?
If not, does your scene have a GameObject tagged "Player" that has an inventory?
You can try this version of the package, which logs a warning if it doesn't find an inventory:
OpsiveUIS_QuestMachine_Integration_2021-12-02.unitypackage
If that doesn't help, the error is happening inside UIS's EventHandler class, which is a closed class. Would you please contact Opsive about the error? If you send them the Console window screenshot of the ArgumentNullException, they should be able to help. You can post on the Opsive forum or try messaging @Sangemdoko in the ultimate inventory system - #general channel on discord.
Re: QM+UIS data sync works in editor but not on my phone
Thanks, Tony. I appreciate your time.
It logs a warning that it doesn't find the inventory.
I leave the inventory name blank in the UI Item Amount condition, but my player is spawned by script after the scene was loaded, this could cause the Quest Machine can't find the player, right?
Is there any way I can set the player to Quest Machine after the player was spawned?
It logs a warning that it doesn't find the inventory.
I leave the inventory name blank in the UI Item Amount condition, but my player is spawned by script after the scene was loaded, this could cause the Quest Machine can't find the player, right?
Is there any way I can set the player to Quest Machine after the player was spawned?
Re: QM+UIS data sync works in editor but not on my phone
Hi,
Is your player tagged 'Player'? If so, then it should work, generally speaking.
If the quest condition is running at the very start of the scene, you can delay it. For example, if you're changing scenes using the Save System (e.g., Scene Portal component or SaveSystem.LoadScene() method), then set the Save System component's Frames To Wait Before Apply Data to 1 or more. This will make Quest Machine wait 1 or more frames to apply data to savers (including activating conditions). Otherwise, you can use a Timed Event. But it's better to get to the bottom of the issue first. It may just be as simple as making sure the player GameObject that has the Inventory component is tagged 'Player'.
Is your player tagged 'Player'? If so, then it should work, generally speaking.
If the quest condition is running at the very start of the scene, you can delay it. For example, if you're changing scenes using the Save System (e.g., Scene Portal component or SaveSystem.LoadScene() method), then set the Save System component's Frames To Wait Before Apply Data to 1 or more. This will make Quest Machine wait 1 or more frames to apply data to savers (including activating conditions). Otherwise, you can use a Timed Event. But it's better to get to the bottom of the issue first. It may just be as simple as making sure the player GameObject that has the Inventory component is tagged 'Player'.
Re: QM+UIS data sync works in editor but not on my phone
Hi Tony,
After debugging in the UISUtility script I found the problem:
The player is tagged 'Player'. And there is a collider in the player's children object also tagged 'Player'.
In the editor this line finds the player object, on the phone it finds the child game object.
While on the phone, this line can't get the Inventory that is in the parent.
I changed the collider's tag to something else and make sure there is only one 'Player' tag in the scene, now it works well.
Thanks for your help, Tony.
After debugging in the UISUtility script I found the problem:
The player is tagged 'Player'. And there is a collider in the player's children object also tagged 'Player'.
Code: Select all
subject = GameObject.FindGameObjectWithTag("Player");
Code: Select all
var inventory = subject.GetComponent<Inventory>() ?? subject.GetComponentInChildren<Inventory>();
I changed the collider's tag to something else and make sure there is only one 'Player' tag in the scene, now it works well.
Thanks for your help, Tony.
Re: QM+UIS data sync works in editor but not on my phone
Hi,
Happy to help. I'm glad you got it working. The next update to the UIS integration will check all GameObjects that are tagged 'Player' and use the one that has the Inventory component.
Happy to help. I'm glad you got it working. The next update to the UIS integration will check all GameObjects that are tagged 'Player' and use the one that has the Inventory component.