playMaker

Author Topic: Renaming Global events  (Read 1904 times)

abend

  • Playmaker Newbie
  • *
  • Posts: 36
Renaming Global events
« on: January 11, 2020, 01:07:03 PM »
I know the whole forum says this is not supported. I have a workaround question, I just want to know if my workaround is messing something up under the hood.

1. find global event in events list of FSM.
2. uncheck the global checkbox
3. this allows you to rename the event
4. after renaming the event, check the global check box again.

Does this get around the issue, or would localizing a global event create it's own set of issues?

My events are so many from when I started I need to come up with a new naming scheme for the globals, I am using a color code for when an event is coming or going to a different FSA, but I just got myself into a situation where I want to be able to tell them apart better. My plan is to use Topic\event for the name, but I don't want to go down this path if I'm going to cause a lot of issues for myself.

Thanks!

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Renaming Global events
« Reply #1 on: January 11, 2020, 01:36:17 PM »
After years of using, my best advice on Global Variables is - don't use them. They're extremely convenient and my hand always moves towards that "create global variable" button. But the whole system is messy and problematic, so it's best to use one object which will be referenced by one single global variable as the global variable manager and whenever you need to get or set something just use get fsm/set fsm and voila.

As for moving variable from global to local and global again, i haven't tried it, don't think that can end up well or even work :P
Available for Playmaker work

abend

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Renaming Global events
« Reply #2 on: January 11, 2020, 01:44:40 PM »
These are events, not variables. I have a handful of global variables, but they are all booleans. I would like to move away from them. Initially, I had FSMs waiting on the global bools to flip over, but as I've learned to broadcast events to other FSMs, I think I can move those global variables to events. and be rid of them all together. I also have an FSM that holds local variables that I check for things.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Renaming Global events
« Reply #3 on: January 11, 2020, 02:12:35 PM »
No, not events, variables. I suppose i didn't explain it quite well.

Instead of using a global variable Ball, you will put a local variable Ball in the variable manager and get the value from that object with get fsm variableType or set it with set fsm variableType. Only global variable will the the reference to the variable manager, nothing else. It has one extra step, but it keeps the project tidy. If something screws up with global variables, and usually does, you're toast.

You can also have multiple game objects for multiple variable types (player variables manager, weapon variables manager and so on) and reference them via global variables.
Available for Playmaker work

abend

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Renaming Global events
« Reply #4 on: January 11, 2020, 02:18:44 PM »
I understand what you are saying. My original question is about renaming events. you can check a box and make an event global. currently, you are not allowed to rename an event when it is global, the name textbox is greyed out. I posted my workaround.

You spoke about global variables, and I explained that I have some - which I will eventually get rid of, but I also have an FSM that acts as a manager like you describe.

also, your message footer is broken.
« Last Edit: January 11, 2020, 02:22:15 PM by abend »

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Renaming Global events
« Reply #5 on: January 11, 2020, 02:28:37 PM »
Haha my bad, i'm reading variables instead of events all the time, sorry :D I am messing with some globals right now so i must have switched my brain on that.

Thanks for the footer.

The idea for events is great, i don't know why it's not allowed to change the name of the global event in a normal way.
« Last Edit: January 11, 2020, 02:31:38 PM by krmko »
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Renaming Global events
« Reply #6 on: January 14, 2020, 12:57:48 AM »
Hi,

 Renaming global events is not supported as such, that's correct, but the work around works likely for all cases, basically the "global" flag for an event is merely an interface constraint to filter out local events from global event when selecting them in actions.

However, ALWAYS back up before doing that, and triple check that everything is working after you renamed a global event using this hack.

Bye,

 Jean

abend

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Renaming Global events
« Reply #7 on: January 14, 2020, 10:04:41 AM »
Thanks Jean!

I plan to go SLOW, but this gives me confidence. I will report back as to how well it goes.


abend

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Renaming Global events
« Reply #8 on: January 14, 2020, 12:24:33 PM »
Happy to report: 6 Global events renamed in 22 places, tested after each state was renamed. wWorks perfectly! Thank you for helping me add clarity to my project! The Events Window helped me to track where I needed to rename things. It does not update immediately upon the change. Going to a specific FSM seemed to trigger the events to update in the window. Once I caught on to that, it was much smoother to be sure I was catching all the events. Super happy I can give things better names! Thanks Jean!