Page 4 of 10

Re: Character save at save point

Posted: Wed Jun 22, 2016 9:59 am
by supadupa64
I got two errors when I imported the script.

1)
Assets/Scripts/UpdateQuestTrackerOnLoad.cs(3,41): error CS0246: The type or namespace name `MonoBehavior' could not be found. Are you missing a using directive or an assembly reference?

2)
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.UI.Graphic.OnRebuildRequested () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:480)
UnityEngine.UI.GraphicRebuildTracker.OnRebuildRequested () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/GraphicRebuildTracker.cs:33)
UnityEngine.CanvasRenderer.RequestRefresh () (at C:/buildslave/unity/build/artifacts/generated/common/modules/UI/CanvasRendererBindings.gen.cs:314)

Re: Character save at save point

Posted: Wed Jun 22, 2016 10:09 am
by Tony Li
Sorry, that was a typo. (Classless American here ;) .) Change "MonoBehavior" to "MonoBehaviour". Unity's fancy and European like that.

I just fixed it in my previous post, too.

Re: Character save at save point

Posted: Wed Jun 22, 2016 10:24 am
by supadupa64
Awesome I'll try it now!

Re: Character save at save point

Posted: Wed Jun 22, 2016 10:54 am
by supadupa64
Everything seems to be working. I think there was one glitch where it put me back at the starting point of the game again, but I'll keep testing it.

Re: Character save at save point

Posted: Wed Jun 22, 2016 11:27 am
by Tony Li
Great!

If you can reproduce that glitch, and if your player GameObject is spawned into the scene instead of being present in the scene from the get-go, you may need to tell the PersistentPositionData component to run after your spawn script. You'd need to edit the Script Execution Order to do this. (Press "+", select PixelCrushers.DialogueSystem.PersistentPositionData, and set the value to something high like 500.)

Re: Character save at save point

Posted: Wed Jun 22, 2016 11:37 am
by supadupa64
My player spawns at the starting location only the first time I load a saved game. Every loaded game after that seems to work just fine.

Re: Character save at save point

Posted: Wed Jun 22, 2016 11:40 am
by bohnstudios
Monobehaviour; "...the base class every script derives from." So classless Tony....haha....HILARIOUS :lol:

Re: Character save at save point

Posted: Wed Jun 22, 2016 12:19 pm
by Tony Li
supadupa64 wrote:My player spawns at the starting location only the first time I load a saved game. Every loaded game after that seems to work just fine.
Try setting the Script Execution Order. If that doesn't work, please let me know how your player GameObject gets into the scene.
bohnstudios wrote:Monobehaviour; "...the base class every script derives from." So classless Tony....haha....HILARIOUS :lol:
;-)

Re: Character save at save point

Posted: Wed Jun 22, 2016 12:56 pm
by supadupa64
Alright so I did all that and set it to 500. It still does the same thing. The quests look like they are saving perfectly, but the players spawns at the start on the first loaded game.

My player object is just sitting there from the start in the scene when you hit "start" to play the game for the first time.

Re: Character save at save point

Posted: Wed Jun 22, 2016 1:11 pm
by Tony Li
How does your player spawn? Can you remind me if you're using a player controller asset, like maybe Opsive's Third Person Controller or something?