playMaker

Author Topic: Global Variables for Unlocked Moves?  (Read 1243 times)

Knuckleup

  • Playmaker Newbie
  • *
  • Posts: 14
    • Sugarhigh Shakedown Dev Blog (A love letter of tragedy to beat em ups)
Global Variables for Unlocked Moves?
« on: April 24, 2018, 11:21:59 PM »
Goal: Character collects specific items to unlock a special move or weapon. 
(Example: Collect 50 coins and can select a new move or new weapon and then continue to collect more coins for more moves/weapons)

How do I set up a Global Variable for this or is there a better way to do so?

I was also planning to set up the player with game starting moves (FSM and make it a prefab so I can easily load them for each Scene/level, but then I thought it might not work because ...say the player earns a new move during level one and when the next level loads it will load the Prefab without the newly earned move.  Kind of stuck on this.  Any help if someone has time would be appreciated.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Global Variables for Unlocked Moves?
« Reply #1 on: April 25, 2018, 02:48:52 PM »
Hi,
Always try to avoid using globals.

if you have multiple things to "UnLock" maybe look into array's

There is also a more advanced array and hash table available on the Ecosystem (Array Maker)

You can find some tutorials on the user tutorial wiki page

Hash table works similar as an array but instead of using index numbers , it is using keys and you can name the keys.

if you want to save the progress and load it again after you stopped the game,
There are also actions on the Ecosystem for saving them into "easy save" (3rd party asset)

Knuckleup

  • Playmaker Newbie
  • *
  • Posts: 14
    • Sugarhigh Shakedown Dev Blog (A love letter of tragedy to beat em ups)
Re: Global Variables for Unlocked Moves?
« Reply #2 on: April 25, 2018, 05:20:36 PM »
Thanks.  I went to start viewing some of the Array/Hash Table tuts.
If I choose Array for an action to a State of a Player’s FSM, then I can maybe have each move correspond to a specific element.  Do you know of a tutorial that explains the process of making each element enabled once x amount of coins are collected?

Thanks again.