playMaker

Author Topic: global variable categories  (Read 534 times)

Redome

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
global variable categories
« on: October 04, 2019, 02:23:16 PM »
You can categorize gobal variables, but, can you separate those variables while showing them on the selection menus?

I mean, could i separate "A's" "B's" and so one?

https://imgur.com/NF7tLVs

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 5945
    • View Profile
    • jinxtergames
Re: global variable categories
« Reply #1 on: October 04, 2019, 05:27:18 PM »
Hi.
Wow that way to much globals that you are using.

If you need to reference with many you can make a dedicated fsm and use get/set fsm actions.

Have a look at this wiki page : https://hutonggames.fogbugz.com/default.asp?W1462

For variables you can group by using a /  for example A/A  A/AA A/AAA

But again you should not set that many globals.

My projects never reach more that 5 globals :)

Redome

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: global variable categories
« Reply #2 on: October 05, 2019, 06:22:47 AM »
I use those global variables because i need to use them on multiple FSM's

I'm going to leave this tutorial on that tip you gave me to substitute gobal variables, in case it's useful for someone else in the future.

https://styly.cc/tips/english-global-variable-alternatives-how-to-share-variables-between-fsm-machines/

Anyway, both tips you gave me are working, thank you!  ;D

« Last Edit: October 05, 2019, 07:29:25 AM by Redome »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 5945
    • View Profile
    • jinxtergames
Re: global variable categories
« Reply #3 on: October 05, 2019, 08:41:41 AM »
Hi.

What i do is have 1 object with a fsm (i call it 'meta data') and set that as global @start.

Then on other fsms i can use that global to reference variables on it.

if i need some values @ start on other fsms, i use a 'Game Object Is Null' with every frame enabled to make sure that the Meta Data game object is loaded.

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 634
    • View Profile
Re: global variable categories
« Reply #4 on: October 07, 2019, 09:45:26 AM »
Begone with your "metadata" heresy!

I use dozens of Globals in my last project and it's doing very very well.
Plus it's very easy to see how many times they are used and where, priceless information which saved me entire centuries worth of precious time.
No amount of Get/Set FsmVar or over-complicated event managements will ever give you that.

I think TPTB will just to accept the fact that many users naturally and instinctively gravitate towards the use of Globals, find them practical and simple to manipulate. :)