Character save at save point

Announcements, support questions, and discussion for the Dialogue System.
User avatar
supadupa64
Posts: 200
Joined: Sun Mar 06, 2016 9:40 pm
Contact:

Character save at save point

Post 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?
bohnstudios
Posts: 68
Joined: Sun Aug 16, 2015 3:01 am
Location: St. Louis, MO
Contact:

Re: Character save at save point

Post 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
User avatar
Tony Li
Posts: 22091
Joined: Thu Jul 18, 2013 1:27 pm

Re: Character save at save point

Post 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.
User avatar
supadupa64
Posts: 200
Joined: Sun Mar 06, 2016 9:40 pm
Contact:

Re: Character save at save point

Post 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.
User avatar
Tony Li
Posts: 22091
Joined: Thu Jul 18, 2013 1:27 pm

Re: Character save at save point

Post 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.
bohnstudios
Posts: 68
Joined: Sun Aug 16, 2015 3:01 am
Location: St. Louis, MO
Contact:

Re: Character save at save point

Post 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.
User avatar
supadupa64
Posts: 200
Joined: Sun Mar 06, 2016 9:40 pm
Contact:

Re: Character save at save point

Post 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.
User avatar
supadupa64
Posts: 200
Joined: Sun Mar 06, 2016 9:40 pm
Contact:

Re: Character save at save point

Post 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
User avatar
Tony Li
Posts: 22091
Joined: Thu Jul 18, 2013 1:27 pm

Re: Character save at save point

Post 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?
User avatar
supadupa64
Posts: 200
Joined: Sun Mar 06, 2016 9:40 pm
Contact:

Re: Character save at save point

Post 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?
Post Reply