Forum rules - please read before posting.

Help! Player switch inventory issue.

Hi guys, I have been playing around building a test level in Adventure Creator for a few months now and have just signed up to the forums. I'm using player switching and have this issue come up, I can't find the reference anywhere, anyone with any scripting knowledge able to help out?:

NullReferenceException: Object reference not set to an instance of an object
System.Int32.ToString () (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System/Int32.cs:672)
AC.SaveSystem.CreateInventoryData (AC.RuntimeInventory runtimeInventory) (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:1418)
AC.SaveSystem.SavePlayerData (AC.Player player) (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:480)
AC.SaveSystem.SaveCurrentPlayerData () (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:460)
ActionPlayerSwitch.Run () (at Assets/AdventureCreator/Scripts/Actions/ActionPlayerSwitch.cs:86)
AC.ActionList+<RunAction>c__Iterator1.MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:194)
UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:164)
AC.<RunAction>c__Iterator1:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:230)
UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:164)
AC.<RunAction>c__Iterator1:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:230)
UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:164)
AC.<RunAction>c__Iterator1:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:230)
UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:164)
AC.<RunAction>c__Iterator1:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:230)
UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:164)
AC.<RunAction>c__Iterator1:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:230)
UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:164)
AC.<RunAction>c__Iterator1:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:230)
UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:164)
AC.<RunAction>c__Iterator1:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:230)
UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:164)
AC.<RunAction>c__Iterator1:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:230)
UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:164)
AC.ActionList:BeginActionList(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:142)
AC.ActionList:Interact() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:111)
AC.<UseObject>c__Iterator6:MoveNext() (at Assets/AdventureCreator/Scripts/Controls/PlayerInteraction.cs:787)

Comments

  • Are you sure you're using the latest version?  Please upgrade to 1.40b if not, then let me know the steps taken to have this error appear.
  • Hi Chris, thanks for the response, I updated to the new version and unfortunately didn't save my managers so they were over-written and I decided to start over... So this is no longer an issue. Lesson learned though, I am now saving my managers into a separate folder after each session on the game.
  • OK.  You may have missed the New Game Wizard feature if you were working on an older version - you can use that to have your managers created and stored in a new folder automatically for you.
  • Yeah it was my first effort so for that version I literally started building it over the demo project I think. Just out of interest, where does the NGW save the managers, just so I can check...
  • It'll create a new folder just inside Assets by the "game name" you enter on the NGW's second page.

    It's not recommended to edit the demo project beyond testing things, since it'll get overwritten when you update AC.
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.