playMaker

Author Topic: Debugging - See what action/state that changed a variable  (Read 2435 times)

Krillan87

  • Beta Group
  • Full Member
  • *
  • Posts: 185
Debugging - See what action/state that changed a variable
« on: February 23, 2020, 09:17:42 AM »
Hi,

I have a global bool that a lot of different FSM/States interact with. When I debug I want to know which of all the FSMs that interacted wit hit.

Are there any way, while in debug-mode, to see which one of all the FSM that flipped the global bool?

/Christian

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Debugging - See what action/state that changed a variable
« Reply #1 on: February 23, 2020, 09:53:18 AM »
Hi.
you could set breakpoints on the places where you do the bool flip so the game pauses when it reaches that state (right click on a state header and select breakpoint)

rechronicle

  • Full Member
  • ***
  • Posts: 119
  • Mystvaldia
    • Indie RPG Creator
Re: Debugging - See what action/state that changed a variable
« Reply #2 on: February 23, 2020, 09:54:19 AM »
Maybe you can put Debug.Log action to the FSM that flips the bool to track which one is actually flipping it?

Krillan87

  • Beta Group
  • Full Member
  • *
  • Posts: 185
Re: Debugging - See what action/state that changed a variable
« Reply #3 on: February 23, 2020, 10:05:02 AM »
Maybe you can put Debug.Log action to the FSM that flips the bool to track which one is actually flipping it?

Hmm...good idea but it debug.log just shows the bool value.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Debugging - See what action/state that changed a variable
« Reply #4 on: February 23, 2020, 10:16:29 AM »
Hi.
you can do something like 'Get fsm name' (Ecosystem) and use that in the 'Debug Log' action

Krillan87

  • Beta Group
  • Full Member
  • *
  • Posts: 185
Re: Debugging - See what action/state that changed a variable
« Reply #5 on: February 23, 2020, 10:18:52 AM »
Hi.
you could set breakpoints on the places where you do the bool flip so the game pauses when it reaches that state (right click on a state header and select breakpoint)

Yeah I know, but the breakpoint do not help me here. I need to know which on of all the FSM that makes the bool flip. The State that flips the bool is not in the same FSM.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Debugging - See what action/state that changed a variable
« Reply #6 on: February 24, 2020, 03:48:31 AM »
Hi,

Switch debugFlow on, and you can then trace back all changes of variables.



Bye,

 Jean

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Debugging - See what action/state that changed a variable
« Reply #7 on: February 24, 2020, 10:46:02 AM »
Hi,

I have a global bool that a lot of different FSM/States interact with. When I debug I want to know which of all the FSMs that interacted wit hit.

Are there any way, while in debug-mode, to see which one of all the FSM that flipped the global bool?

/Christian

That is something I wanted too for a long time.
A Log to be created for a Global variable. GlobalVarLog.
It would be the equivalent of FsmLog, but for a variable. FsmLog is nice because it's chronological and provides an accurate enough time counter too (00:00:00).
It would show which FSM, state and action used the var, either read (implied get) or written (implied set).

Obviously this could be done for local vars too!
Since vars are hardly private at all because they can be changed by other FSMs,
GlobalVarLog could be recycled to create a (Local)VarLog tool too (it's easy, coders are wizards!). Very useful to quickly check all the changes brought to a var (or more).

I wanted this for events too (EventLog) so we could track the behavior of any specific event, local or global, one or more at a time (you'd preselected them from the list of events): who uses it, who calls it, who receives it, when, time needed to process it, etc.
With, again, FSM, state and action details as a tree to be deployed. Playmaker is very secretive about how events are launched and managed, so I'd love this to be more exposed. Sorry for the hijack btw.

@Jean: Unless I missed something, FsmLog has a focus on a FSM; it will not track accurately the changes brought to a given Global var (those you hate with a passion :P) since it limits itself to the selected FSM.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Debugging - See what action/state that changed a variable
« Reply #8 on: February 25, 2020, 02:03:31 AM »
Hi,

 I don't hate global vars at all, you just have to be careful with them :)

yep, I would also enjoy a variable log, and not just that but to know what action actually changed the value. same with events, and also some callbacks on that so that a script can catch a variable being set or an event being fired.

Bye,

 Jean

Krillan87

  • Beta Group
  • Full Member
  • *
  • Posts: 185
Re: Debugging - See what action/state that changed a variable
« Reply #9 on: February 26, 2020, 08:33:22 AM »
Hi,

 I don't hate global vars at all, you just have to be careful with them :)

yep, I would also enjoy a variable log, and not just that but to know what action actually changed the value. same with events, and also some callbacks on that so that a script can catch a variable being set or an event being fired.

Bye,

 Jean

Yes this is the issue I have. I do not know what action that actuall chaned the value, I only know that he value HAS been changed. :(

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Debugging - See what action/state that changed a variable
« Reply #10 on: February 28, 2020, 01:41:04 PM »
I suppose adding vars/events in adjacent columns to compare them in real time and see which ones get fired up would be nice too.