playMaker

Author Topic: How to rename global variables?  (Read 150 times)

kentcheung2000

  • Playmaker Newbie
  • *
  • Posts: 19
    • View Profile
How to rename global variables?
« on: August 14, 2018, 11:52:48 PM »
Hi,

How to rename global variables?...

Thanks.

KC

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 777
    • View Profile
    • Fat Pug Studio
Re: How to rename global variables?
« Reply #1 on: August 15, 2018, 03:38:41 AM »
Unfortunately, it is not possible at this moment. So choose your names wisely.

http://hutonggames.com/playmakerforum/index.php?topic=3585.15

Broken Stylus

  • Junior Playmaker
  • **
  • Posts: 60
    • View Profile
Re: How to rename global variables?
« Reply #2 on: September 21, 2018, 01:09:42 PM »
BZZZZZT! WRONG QUESTION!

 ;D

One useful tip: name your local vars like "home", and the global ones like "Home". The capital letter quickly helps you differentiate the nature of the var.

I really wonder why globals cannot be renamed. There are no problems in Unity to rename about any form of prefab or any other asset.

You'll have the exact same problem with events that are global. The only way to untick the global status of an event in the Events browser is to find every single instance of it in every single FSM, make them local or delete them, and only then you'll be able to rename the global event... but it won't be used any longer.

So same deal here, be careful with the way you name your global events.
I recently decided to avoid ALL CAPS because that's stuff for the default/native events, so decided to use an underscore in front of the event's name if it's global (ex: _My Global Event).
It has the benefit of pushing the global events to the bottom of the list in the Events browser window.

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 777
    • View Profile
    • Fat Pug Studio
Re: How to rename global variables?
« Reply #3 on: September 21, 2018, 01:25:14 PM »
Great idea, i wish i don't already have zillion variables. There are other fine ways too, you can use something like [L]LocalVariableName and [G]GlobalVariableName, though it really need an iron discipline  ;D

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3387
    • View Profile
    • jinxtergames
Re: How to rename global variables?
« Reply #4 on: September 22, 2018, 03:38:53 AM »
Hi.
Actually the best thing is to avoid using globals.

https://hutonggames.fogbugz.com/default.asp?W1462