Page 1 of 10

Character save at save point

Posted: Tue Jun 21, 2016 9:18 am
by supadupa64
I don't know if this is dialogue systems, but when I save my game the character always returns to the starting point of the game. Is there a way to make it so the character stay in the spot where the game was saved at?

Re: Character save at save point

Posted: Tue Jun 21, 2016 9:46 am
by bohnstudios
Have you checked this out....

http://www.pixelcrushers.com/dialogue_s ... sitionData

I think the save / load demo does what you are asking. However, if you are using asynchronous loading for your open world game, this has potential to make that more complicated...at least it did when I was attempting something similar.

- Ron

Re: Character save at save point

Posted: Tue Jun 21, 2016 10:19 am
by Tony Li
Thanks, Ron! That's exactly what you want to do.

Since Ruction has multiple levels, make sure to tick Record Current Level.

Re: Character save at save point

Posted: Tue Jun 21, 2016 10:24 am
by supadupa64
Are we all talking about the same thing? I have stuff that gets saved in game, but I'm only taking about where the character spawns at on a loaded game. Each time I save the game that character always spawns at the starting point of the entire game and not in the spot where the game was saved at. Maybe I'm missing what you guys are saying.

Also, the game is one big scene and I took out multiple scene loads.

Re: Character save at save point

Posted: Tue Jun 21, 2016 11:40 am
by Tony Li
I think we're talking about the same thing. When you add a Persistent Position Data component to your player GameObject, it will include the player's current position in saved game data. Then, when you load a saved game, it should move the player to that saved position.

When you save, the Console should have a debug line with something like:

Code: Select all

Dialogue System: Save data: <lots of stuff>
Somewhere in that line, you should see something like:

Code: Select all

Actor["Player"] = { Name="Player", IsPlayer=true, Position="1;2;3;4" }
where Position is the player's saved position.

Re: Character save at save point

Posted: Tue Jun 21, 2016 1:27 pm
by bohnstudios
Yep I think we are all talking about the same thing! Just a heads up.....you might notice a "jump" or jitter when the script moves your player controller to the saved coordinates....don't worry this is just you seeing what it's supposed to be doing because it loads the player/data and then moves it to the saved coordinates :)

Either way, you'll want to hide this "jump" from people playing your game with your loading scene, fading-in from black or whatever is best for your game.

Re: Character save at save point

Posted: Tue Jun 21, 2016 1:32 pm
by supadupa64
I don't have the Persistent Position Data component added to my player. I guess I missed that step along the way. I'll test it out.

Re: Character save at save point

Posted: Tue Jun 21, 2016 2:45 pm
by supadupa64
Ok, so nothing saves at all. In the UI it shows a saved game, but when you go to load it it just starts the game over from the beginning. Hmm

Re: Character save at save point

Posted: Tue Jun 21, 2016 3:10 pm
by Tony Li
Did it used to save? If so, do you recall what changed in your project since then?

Are there any warnings or errors in the Console view?

Re: Character save at save point

Posted: Tue Jun 21, 2016 3:13 pm
by supadupa64
Actually I changed a couple things and I got the quest system to save. So if I'm on a certain task it saves, but the position does not. It actually never has. I added the Persistent Position Data to the player, but maybe something is blocking it?