For my game, The Abandoned Planet, I sorted out all of the new Google Billing 7/8 stuff, I upgraded to Unity 6, updated to the Unity IAP package 4.13.0, and updated to AC 1.84.3. There were several issues I had to sort out, but the two that took the most time were:
Basically, when either of these occur, they set a Global AC variable to true. Here is the chunk of code that gets called in my IAPManager script on Start:
void Start()
{
StartCoroutine(WaitForIAPAndCheckPurchases());
}
private IEnumerator WaitForIAPAndCheckPurchases()
{
float timeout = 3f;
float timer = 0f;
while (CodelessIAPStoreListener.Instance == null ||
CodelessIAPStoreListener.Instance.StoreController == null)
{
if (timer > timeout)
{
Debug.LogWarning("Timed out waiting for Codeless IAP Store Listener to initialize.");
yield break;
}
timer += Time.unscaledDeltaTime;
yield return null;
}
Debug.Log("Codeless IAP Initialized — checking previous purchases...");
storeController = CodelessIAPStoreListener.Instance.StoreController;
CheckPreviousPurchases();
}
private void CheckPreviousPurchases()
{
if (storeController == null)
{
Debug.LogError("StoreController is not initialized.");
return;
}
var productFullGame = CodelessIAPStoreListener.Instance.GetProduct(purchaseFullGame);
var productPlayPass = CodelessIAPStoreListener.Instance.GetProduct(playPassAccess);
if (productFullGame != null && productFullGame.hasReceipt)
{
GlobalVariables.GetVariable("IAP_FullGameUnlocked").BooleanValue = true;
return;
}
if (productPlayPass != null)
{
#if UNITY_ANDROID && !UNITY_EDITOR
var gpExtensions = CodelessIAPStoreListener.Instance.GetStoreExtensions<IGooglePlayStoreExtensions>();
var purchaseState = gpExtensions.GetPurchaseState(productPlayPass);
Debug.Log($"Play Pass purchase state: {purchaseState}");
if ((int)purchaseState == 1)
{
GlobalVariables.GetVariable("PlayPassActiveNow").BooleanValue = true;
GlobalVariables.GetVariable("PlayPassWasActive").BooleanValue = true;
}
else
{
GlobalVariables.GetVariable("PlayPassActiveNow").BooleanValue = false;
}
#else
// Simulate or default behavior for Editor or other platforms
Debug.Log("Play Pass check skipped (not running on Android device)");
GlobalVariables.GetVariable("PlayPassActiveNow").BooleanValue = false;
#endif
}
else
{
GlobalVariables.GetVariable("PlayPassActiveNow").BooleanValue = false;
}
}
This isn't the complete script as there are some more mandatory methods for IAPs to work, but these are the ones that are of the most concern here. You can see that there's a delay on Start; a coroutine ensures that it the player's device has enough time to grab the storeController.
In AC, I have an Actionlist on the MainMenu that also waits 2 seconds, and then it checks those bools PlayPassActiveNow, PlayPassWasActive, and IAP_FullGameUnlocked. If those are true, then the "Buy Full Game button" is disabled, and it says "Full Game Unlocked" on the Main Menu.
The issue I'm having is that for those that were playing the game prior to this update, is that they cannot load their previous saves. You can see this in the video that a player sent me:
When they tap on the Save files, nothing happens.
I'm not saying that this is an AC issue, but my question is more like -- what could cause a AC save file from not loading?
One important thing to note; in the video, the player had advanced past the first Act. So, there should be a "Jump to Act" button on the Main Menu that gets enabled. But it's not there. Meaning the the AC Global Bool "JumpToActUnlocked" (kept in Options Data) isn't being read as true.
Any thoughts about what I could do to help these players recover their previous saves? Or are they likely lost forever? If that's the case, I'll have to accept it, let them now, and just deal with the bad reviews.
I look forward to any insight. Thanks! - Jeremy
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
A save-file wouldn't load if the requested file was not found - in which case, an error would be reported in the Console or log file. As the saves are listed, though, that doesn't seem to be the case.
These may be two separate issues. Regardless of the state of the variables, the save system should still allow for the loading of previous saves.
Ultimately what we really need is a way to reliably test the issue.
Hello Chris, I was previously on AC 1.79.3.
Like I said in my last "Discussion" on the forum, which I updated to the new AC and to Unity 6, I had to reset a bunch of settings in the AC managers. Perhaps I was using Save Profiles. To be honest, I may have had the box checked, but I wasn't actually utilizing the feature. That's a possibility.
So, I checked the "Save Profiles" box, created an internal test, and uploaded it to the Play Store console. I'm asking one of the people that reported the problem if they'd like to be a guinea pig to see if this resolves the issue for them.
I'll report back with my finding. Thanks! - Jeremy
I was more asking about the general use of Profiles, rather than the change between versions. I don't hold out much hope checing the box will fix it.
I will need to know as much detail about the above as possible. In particular, details of the Load menu/element/ActionLists that are at the source of the issue.
Oh OK -- I think I know that you mean. There is one actionlist that gets called in the "Actionlist after loading". You can see it here:
https://imgur.com/bCRH2VT
https://imgur.com/Dmp85SL
(I couldn't figure out how to embed those images right here, sorry!)
As you can see the actionlist basically checks the following:
If it's not clear, this was something that the PlayPass team at Google needed to approve, if someone had an active PlayPass subscription, but canceled the subscription, the in that case, Save states that send the player to premium content need to be blocked.
This didn't cause any problems before the update, and I don't think this is the culprit here. I tested this with the new update, and it all works fine. But again, I'm not able to personally test previous saves prior to the update. I simply don't have any.
Still waiting on a guinea pig to offer themself to test out an internal test. We'll see what happens.
Please let me know if I misunderstood. Thanks! - Jeremy
Are the variables being checked having their values restored by the file being loaded, and was this setup as it was before the update?
I wouldn't deem this approach entirely safe, as it's causing a scene-switch at the same time that AC is attempting to also do as part of the loading process.
That said, if it did cause a conflict - it would likely break the game, preventing the user from backing out of the Load menu as they do in the video.
Is it possible to get the save file(s) from the user? They'll be stored in the Application.persistentDataPath folder - this changes depending on platform, but details for Android can be found here:
https://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html
Chris, thank you for helping out with this. the Profiles being unchecked or checked wasn't the issue - a user confirmed it for me when I gave them access to an internal test version with Save Profiles enabled.
I think that if I get any more negative reviews, I'll dive deeper into this, but I'm going to have to leave it as is for now. New positive reviews are coming in, and there aren't any new negative reviews or emails reaching me about the issue. Android has a high turnover rate, and since adventure games are typically a "play-through-it-once" kind of game, once a person has completed the game, they move on to the next game.
Again, I appreciate it. And I appreciate the link to the Unity doc... I didn't know that you could find save files on an Android device. Wild!