Character save at save point
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Re: Character save at save point
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)
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)
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Re: Character save at save point
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.
I just fixed it in my previous post, too.
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Re: Character save at save point
Awesome I'll try it now!
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Re: Character save at save point
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.
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Re: Character save at save point
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.)
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.)
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Re: Character save at save point
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.
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
-
- Posts: 68
- Joined: Sun Aug 16, 2015 3:01 am
- Location: St. Louis, MO
- Contact:
Re: Character save at save point
Monobehaviour; "...the base class every script derives from." So classless Tony....haha....HILARIOUS
Re: Character save at save point
Try setting the Script Execution Order. If that doesn't work, please let me know how your player GameObject gets into the scene.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.
bohnstudios wrote:Monobehaviour; "...the base class every script derives from." So classless Tony....haha....HILARIOUS
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Re: Character save at save point
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.
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.
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Re: Character save at save point
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?