Forum rules - please read before posting.

I lost all my Action data after upgrading

I just upgraded from 4.5.5 & 1.29 to 4.6.3 & 1.42c and I've lost all my Action data. Man I hate ScriptableObjects X( :((

Any suggestions? I've assigned my managers, so it's not that.

I presume the data is somewhere serialized and just hidden. How can I double-check that's the case?


  • For what its worth, I lost all my Tags during the upgrade, have recreated the list, and a bunch of tag references got broken as a result. I don't think that'd affect serialization, but maybe it's a sign of a larger problem?
  • edited February 2015
    Ok good news. I restarted Unity and noticed that some ActionLists don't even have a default Action in there. I then went to my ActionsManager and refreshed the list.

    An error and a warning pair show up; from what I can tell it's once for each messed up Action. They also show up when I view an ActionList in the Inspector. The error:

    ArgumentOutOfRangeException: Cannot be negative.
    Parameter name: length
    System.String.Substring (Int32 startIndex, Int32 length) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/String.cs:348)
    AC.ActionsManager.GetActionCategory (Int32 number) (at Assets/AdventureCreator/Scripts/Managers/ActionsManager.cs:339)
    AC.ActionListEditor.GetCategoryNumber (Int32 i) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditor.cs:245)
    AC.ActionListEditor.DrawSharedElements () (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditor.cs:121)
    CutsceneEditor.OnInspectorGUI () (at Assets/AdventureCreator/Scripts/Logic/Editor/CutsceneEditor.cs:37)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty)

    and the warning:

    Unexpected top level layout group! Missing GUILayout.EndScrollView/EndVertical/EndHorizontal?
  • I started spitting out the 'number' that gets sent to GetActionCategory. For Actions that work, I get an int somewhere from 2 to 89 (so far). Actions that are broken report 99.
  • edited February 2015
    Most, if not all, of the Actions show up in the ActionList Editor. I don't get the warning for some reason there, although I get the error every frame for the Actions that are messed up.

    And when I play the game, I get both the error & warning, I think maybe once per execution of the Action.
  • That's quite a gap between upgrades!  So long as you don't save any actionlists until these problems are solved, then they should recover.

    First off, let's get new Actions working - we'll leave existing ones alone until then.  Make sure your Actions Manager is correctly set up (and to be even safer, leave out custom actions for now).  Then check that you can create a new Cutscene etc without problems.  Once done, add in any custom actions by defining their folder in the Actions Manager.

    Only once you're happy with that, move onto an existing Cutscene or ActionList asset.  As it happens, I've been re-writing the relationship between the ActionList Editor and the Actions Manager, with the intent of making it much "safer".  While I don't know the exact cause of this error in particular, I'm hoping that the changes 1.43 will bring will solve it.  Still, let me know how far through these steps you get until errors appear, and we'll see what can be done about it.
  • Thanks Chris. Yeah it was a scary upgrade, but so far so good. Based on my testing so far, the only issue is with specific Actions I've already created. Although I have created a new Cutscene with a new working Action and saved one of the scenes, but I can roll back if need be.

    One of the consistently broken Actions is an ActionWait script, which is basically ActionTemplate but it returns waitTime, which is a value set as a FloatField (instead of Pause's Slider which is limited to 0 through 10). In the pause I notice you do some parameter stuff I don't understand. Is that necessary? I don't use that anywhere currently.
  • edited March 2015

    Chris, I think I figured it out. You relied on title strings in ActionsManager. That makes an assumption that all Actions, including custom Actions that can be given any string name, are formatted a certain way, it seems at the very least with a colon. Not having one seems to break things.

    I think the safe thing to do would be a find another way to categorize Actions. Alternatively I guess devs should follow a strict guideline for naming Actions that’s outlined in the manual?

    I'm trying to get a build done with this big upgrade in the next day or two, do you recommend a good approach for patching this?

  • It looks like I've also lost some references within Actions themselves. In all the uses of Player: Switch I've seen, our selection for Replace Current Player got list. I also see an Object: Teleport that teleports the player to a marker, but the marker ref is blank.
  • Re: Parameters
    If you aren't familiar with parameters, they're a way of overriding an Action's values with a local instance at the time the ActionList is run (just like function parameters).  Using this, you can create ActionLists that perform common tasks, but slightly varied each time, like adding an inventory item and increasing a score.  The parameter in Engine: Pause game can be used to pause the game by a float of your choice, when the Action is run using the Engine: Run ActionList Action.  You can read more about parameters here.

    Re: Action naming
    You're right about the need of a colon, and it's a good suggestion to change the way this works.  I may make the category (i.e. before the colon) an Enum, so it's impossible to break.  I've been doing a lot of work to the way Actions are called (it's been a long struggle to change things such that they can be renamed onced used), and the overriding concern is that nothing should break.  As for patching, the "Upgrade notes" section at the top of each release's changelog is where anything you need to be aware of gets listed.

    Re: Missing references
    Am I to understand that only some of the fields in an Action are missing (i.e. it's not just completely reset)?  It could be that it can no longer find the referenced objects - are you referring to scene- or asset-based Actions?  Asset Actions actually reference the Constant ID number of an object, not the object itself, but this should automatically be assigned once an object is dragged onto the field.
  • Thanks for the info Chris. I managed to solve my issue with the Wait action by adding a "Custom: " before it. Before I had tried to use the prefix we've set for all our other actions, which is "TDC: " but for some reason that didn't work. It might be because those actions get categorized as Custom even though they have their own prefix?

    I've still lost all my replace player actions, but at least the player to replace the current one with is still there. To answer your question, they are all scene-based ActionLists.

    The Teleport action I saw blank was actually like that originally, so that one is fine. I'll keep an eye out for any other gotchas.
  • It seems I spoke too adding the Custom prefix to Wait, it broke all other actions that had been placed in the Custom category. 
  • edited March 2015
    I managed to recover my data for the Wait action by adding some code in ActionListEditor to check for a Wait action, save the data temporarily, create a new action TDC: Wait, and then apply that data back. I now need to go through every scene and view every ActionList to upgrade them, just like the Hotspots with AC in general.

    Speaking of, I've noticed another part where I lost data is in some Hotspots. So now I have to go through all of them one-by-one to make sure they're ok. What may have happened is we had hotspots that responded via custom code, and had an interaction with a custom icon but no responding interaction, to force the cursor to change while our code responded. I think those are the ones we may have lost data for.
  • If you're using custom code injections to affect hotspots, I'm not sure I'm going to be able to support any problems you may encounter.  However, I've gone and switched to Enums for the Action category code.  You'll have to upgrade custom Actions with a category variable, otherwise they'll be listed as "Custom: TDC: Wait" for example.  The old problem of renaming Actions and having them break as also been fixed in the upcoming 1.43.
  • That's great to hear! Thanks Chris, I appreciate your help :)
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.