playMaker

Author Topic: Keeping a set of information together and transferring between different scenes?  (Read 1778 times)

mokona99

  • Playmaker Newbie
  • *
  • Posts: 3
Hi there, I've been enjoying Playmaker and it has really gotten me into scripting.

I was just wanting some advice on how I can go about solving this particular problem.

In the main menu of the game, I want the player to be able to mix and match preferences to taylor a challenge level to what they want.

For example, being able to choose between 5, 10 or 20 minute challenges.
Then after choosing that, say only allowing one weapon to use out of 5 for example.
Then after that, specifying a certain enemy type that inhabits the level.

I want all this information to be stored in a container to be able to be transferred between scenes. I have a set of 5 scenes right now, but I want to be able to alter the scenes to whatever their preferences are based on what I stated above. Along with that, I want the users to be able to jump into another scene from a current scene with their specified preferences which can be changed even within a scene with an in game menu.

What do you guys think is the best way I go about doing this?

Thanks for all those who are able to reply! :)
« Last Edit: September 15, 2015, 10:50:20 AM by mokona99 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Hi,
you can use global variables, they do not reset when you change to a different scene.

MABManZ

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 125
    • MABManZ.com
Use global variables or a game object with "Don't destroy on load" that will hold the variables you need

mokona99

  • Playmaker Newbie
  • *
  • Posts: 3
DontDestroyOnLoad seems to be a good solution with the global variables. I'm guessing going with PlayerPrefs might be a bad idea..?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Hi,
playerprefs is ok, it depends on your project

the playerprefs values are saved, so even when you quit the game and restart they will be the way they are set the last time

a downside from playerprefs is that it is easy (for cheaters) to hack

An alternative is EasySave2 (asset, not free) it has data encryption and full playmaker support