edited January 2015 in General Discussion
If I need specific objects to remain in the same position, even if the Player reloads their game, would using PlayerPrefs be the best way to go about it? It's not really the intended use, I realize...

For example, let's say I make a game where the player Saves their game, and then throws an apple into the next room, where it lands and sits there.

The player reloads their game, and the apple is still there, in that spot.

To do this, I imagine I would just save the position/spawn/scene data in PlayerPrefs and access it on the newly loaded game? Are there any downsides to doing this?

Of course, this also means that I would need a new step:

Something like 'Check Save Slot;' so that I can run a check in events and make sure I save and load data specific to each save slot so no data gets mixed up. Would that be possible?
Tactics RPG Grid Battle System for ORK
---------------------------------------
Personal Twitter: https://twitter.com/AMO_Crate
I make RFI! https://twitter.com/NootboxGames
  • edited January 2015
    If the apple is an item, you can simply use ORK's internal item drop saving. You can turn it on in Menus > Save Game Menu in the Save Settings. Set Save Drops to Save and dropped items will be remembered when changing scenes and in save games.

    Otherwise, you can store this information (scene, position, etc.) into game variables as well :)
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited January 2015
    Oh of course, but that wasn't the problem. The problem is retaining the Apple even though you reload the game. :P

    To help clarify a bit, this is to retain a Dark-Souls-style Bloodstain mechanic while being able to even utilize Save/Load games. So for example, the Player dies, it leaves a Bloodstone (tombstone) that contains all of the player's money on the spot where they died; and then the game reloads to the last point saved. When the player returns to that spot, the Tombstone will still be there.

    I originally solved this problem by never loading a new game and simply teleporting the player back to a save and reviving them. While this method works well, it's also a big headache for having to reset all variables that the player has triggered since saving, and reloading the save does that so much more efficiently.

    But on second thought, though; this method may raise new design issues as well. But is there any downside to using Playerprefs as a method for storing variables that you'd want to persist across even newly loaded games? (make a serious choice, even reloading won't change it, etc)
    Post edited by Kirb on
    Tactics RPG Grid Battle System for ORK
    ---------------------------------------
    Personal Twitter: https://twitter.com/AMO_Crate
    I make RFI! https://twitter.com/NootboxGames
  • Yeah, if it should stay there when loading without saving, you'll need to use PlayerPrefs for that :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Gotcha, I'll experiment with them a bit, then.
    Tactics RPG Grid Battle System for ORK
    ---------------------------------------
    Personal Twitter: https://twitter.com/AMO_Crate
    I make RFI! https://twitter.com/NootboxGames
Sign In or Register to comment.