Forum rules - please read before posting.

Playmaker Variable Load/Save Broken?

The value in AC will update when I click save or load, but its never actually saved or loaded.

I first thought that maybe AC just wasn't sending the variable over to Playmaker, looked around for a few ways to get around this but hit nothing but dead ends. Realized that would be a silly thing for AC not to do, what would even be the point of handling Playmaker variables if they are never updated on load? So I tried some things out..

I tested this multiple ways.
I tried handling all the variables locally in the FSM and only updating the global variable when needed. Thinking maybe my FSM was just over riding AC somehow, but this didn't change anything.
I then tried enabling an FSM to change the value before saving and then reopened the game without the FSM enabled. Attempted to load to see if the variable in AC updated. No luck..
I attempted changing all my int to float as well.
And of course tried close and reopening the entire project multiple times.

It also appears the Globals are using Playmaker's Initial values and not AC even though I have it set to be handled by AC. Which really shows me something must be wrong.

My only conclusion at this point is that it's simply not working. Unity 2022.3.21f1 OpenGL 4.5 Linux/Ubuntu.

And yes, PlayMakerIsPresent in Project Settings/Player.

Comments

  • edited April 2024

    Apologies for the trouble.

    I can't reproduce either issue - to be clear, it's specifically that the PM variables aren't updating, while AC variables are still being correctly restored?

    Which versions of both Playmaker and AC are installed? I'm assuming the latest.

    If you can provide clear steps on how to recreate the issue in its most basic form - with a Global Variable - I'll follow them and see.

  • Playmaker 1.9.8 and Adventure Creator 1.80.3

    The AC variables are not being restored at load. They do correctly update to the values that the FSM currently has for them when I hit load, but the load isn't loading the saved value as much as just updating to what the FSM currently has. Which is why I disabled the FSM after saving to load without it as a test.

    I just ran another test now. I disabled the FSM from counting up on the int and then enabled it at runtime, Then saved at int 10 and loaded the save after waiting for 13 to hit. It loads 13.
    Checked the Playmaker globals while the FSM was disabled and after the save was loaded, just to be sure.. And the Playmaker global were still at 13.

    That combined with the fact it's totally ignoring AC's initial values and just using playmaker's makes me think playmaker is just somehow taking priority over AC?

  • Which is why I disabled the FSM after saving to load without it as a test.

    To be clear: what was the result in that test? Was the AC variable loading once the FSM was no longer running?

    We can check if this is a case of AC not saving the variable at all by checking the raw Save data.

    If you open up the Save-game file Manager (top of the Settings Manager), select the save file and scroll down the Main data section to find the "Global Variables" section. Does it list the variable and its correct value, and are non-linked variables stored correctly?

    If you're experienced with scripting: the PM/AC variable connection is handled by the GVar script's Download and Upload functions - the first being PM -> AC, the latter for AC -> PM. Placing some Debug.Log statements in them may help reveal what's going on. Alternatively, you're welcome to PM me a sample project that shows the issue.

  • Yea, okay.. It appears to be saving it. But still just loads the current Playmaker values, not the ones saved.

    I'll see about sending you the project. I'm not very far into anything so I might just try restarting with a clean slate as well. Already saved the bits of FSM I have done.

    I have very little knowledge of scripting, but have been using Playmaker and AC for years without issue. Should also say that I really love AC and have already got my money's worth from it. These recent experiences are not the majority of my time with it.. I don't know if its that I'm on Linux now or what, but it wouldn't shock me. I've had dozens of issues with Unity since moving to Linux.

  • Thanks for the details.

    I have very little knowledge of scripting

    No worries, try this. Open up AC's GVar script, and add the following to the top of the Download function (line 194 in the latest release):

    if (id == 1) Debug.Log ("Download " + label + ". PM (" + PlayMakerIntegration.GetInt (pmVar, _variables) + ") -> AC (" + val + ")");
    

    (Replace the "1" with the ID of a Global PM-linked Integer variable to test with)

    Then, add the following to the top of the Upload function (line 259):

    if (id == 1) Debug.Log ("Upload " + label + ". AC (" + val + ") -> PM (" + PlayMakerIntegration.GetInt (pmVar, _variables) + ")");
    

    (Similarly replacing the "1")

    Then, with a save-file ready, open up the Load game menu. Clear the Console, and then load the file - what Upload/Download messages then appear as a result, stacktrace included?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.