playMaker

Author Topic: Show Variable in Inspector on Play Mode  (Read 2961 times)

JKWater

  • Playmaker Newbie
  • *
  • Posts: 19
Show Variable in Inspector on Play Mode
« on: September 28, 2017, 11:52:22 AM »
Basically having all variables hidden and then on Start() show chosen variables. Hopefully this will improve the editors performance a bunch in a big scene in edit mode.
Is it possible to do this?

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Show Variable in Inspector on Play Mode
« Reply #1 on: September 28, 2017, 10:38:13 PM »
Not sure I understand this. Why would you want to expose variables dependent of state?

1) You can tick a tiny checkbox called Inspector at the variables tab, then these variables are exposed to the inspector in the respective FSM component.

2) there is also a debug variables mode in the FSM editor, which shows you the variables as they currently are at runtime (in play made) per each action.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Show Variable in Inspector on Play Mode
« Reply #2 on: September 29, 2017, 03:00:11 AM »
Hi,

How many variables do you expose in the inspector in general? in percent of the total amount of variables for a given fsm?

 Usually, the only variables you need to show in inspectors are the one you want to control during editing for prefabs, or templates or variable you promote as public knowing other fsm will get to them using Get/Set Fsm XXX, other variables should not be in the inspector.

Bye,

 Jean

JKWater

  • Playmaker Newbie
  • *
  • Posts: 19
Re: Show Variable in Inspector on Play Mode
« Reply #3 on: September 29, 2017, 09:53:06 AM »
I try not to expose a lot of variables, only the ones that I need to monitor or change to test during playmode.
The game is an RPG with many stats per character, so important values like "coldResistance" and "charisma" I would like to keep exposed in the inspector so I can easily test and monitor.
If I don't expose them, pausing and searching through the fsm's variables list to find them is a slight pain when there are other similar hidden variables like "coldResistance_GO", "coldResistance_Text", "coldResistance_String" etc that I don't want to change.

I suppose I could go the long way and create an in game Dev like UI, with the values all clumped up there, I was just wondering if exposing the variable in the inspector can be accessed through script or custom action, so I can expose chosen variables when playmode starts.


EDIT: Never mind! Found it, so dumb, I need to sleep lol...
Code: [Select]
FsmFloat fsmFloat = fsm.FsmVariables.GetFsmFloat("accuracy");
fsmFloat.ShowInInspector = true;

Thanks for your help guys
« Last Edit: September 29, 2017, 10:07:51 AM by JKWater »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Show Variable in Inspector on Play Mode
« Reply #4 on: October 20, 2017, 02:29:04 AM »
Hi,

 yep :) sometimes getting away from the problem helps. I always do that, I don;t let my self getting stuck too long, I do something else or talk about it to a fellow developer

 bye,

 Jean