playMaker

Author Topic: [Solved] Advice on organizing Global Variables (renaming / putting in folders)  (Read 3573 times)

createasaurus

  • Full Member
  • ***
  • Posts: 146
Now that my project is getting bigger, I realize that I have a lot of global variables that I am having trouble keeping organized.

Is putting them in folders or renaming them possible?  Is there some tip or trick you use to keep your globals manageable?

Thank you!!
« Last Edit: October 21, 2015, 01:16:07 PM by createasaurus »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Hi,
It is not possible for now to rename them,
but in the 1.8 beta version you can group the global variables.

Maybe you can ask for a beta access.
You can send a PM to Alex Chouls

If you get beta access, do not forget to make a backup of your project folder!

createasaurus

  • Full Member
  • ***
  • Posts: 146
Thank you djaydino.  :D

ManicMinerUK

  • Junior Playmaker
  • **
  • Posts: 51
I had the same problem, and my solution was to create game objects with FSMs on them that just served as holding objects for sets of variables...

For example, in my first game, I was storing player progress via global bool variables (two per level, "Entered?" and "Completed?") and this meant my 50 level game had a monster of a global variables list before you even considered anything else I wanted to store.

So created an object which set itself to "Do Not Destroy On Load" and put itself into a global Game Object variable. The object simply held all these booleans for me as local variables... then if I needed to interact with those variables, I could just use Get/Set FSM actions to retrieve the data.

It's not quite as user friendly to do as interacting with global variables, but if you are finding your list getting unmanageable (and believe me, having that many global vars to scroll through to get to "playerhealth", or whatever, is a real pain) it might be an option?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Hi,
@ManicMinerUk
For your example i think i would go for arraymaker to manage those.

ManicMinerUK

  • Junior Playmaker
  • **
  • Posts: 51
that's probably fair - arraymaker still baffles me a bit :)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Hi,
it is quite easy to use actually if you need some help with it just ask :)