playMaker

Author Topic: check if a fsm variable is local or global [SOLVED]  (Read 1406 times)

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
check if a fsm variable is local or global [SOLVED]
« on: August 22, 2018, 10:50:16 AM »
Hi

I am using a custom script for an action and want to know if the local FsmBool is pointing to the fsm variables or the global variables.

I'm using...

Code: [Select]
targetaction.boolVariable("Example 1")
Any idea how i can do this?

« Last Edit: September 14, 2018, 09:29:38 AM by coxy17 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: check if a fsm variable is local or global
« Reply #1 on: September 06, 2018, 03:59:58 AM »
Hi,

 Catching up with pending threads,

 have you been able to resolve this?

I would use PlayMakerGlobals.Instance.Variables to check if there is a variable named like the bool variable selected i the target action AND that the fsm doesn't have a bool variable, else it will use this local one and not the globa.



 Bye,

 Jean

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: check if a fsm variable is local or global
« Reply #2 on: September 12, 2018, 02:38:44 PM »
Hi

no i haven't found a solution, I want to check if an existing variable is a global or local. So I cannot check if it exists in the local and global lists as there could be an occasion when there is a local and a global named the same. So there is no telling which one it uses.

Looks like I cant achieve this. I basically wanted to create a editor script to tell me what actions are using global variables in my game in all scenes.

Nick

Nick

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: check if a fsm variable is local or global
« Reply #3 on: September 13, 2018, 02:51:37 AM »
Hi,

I think you misunderstood, an fsm will use the local variable instead of the global if they are the same, so that is a rule you can implement in your scan, and so you can know all the actions that use global variables, by simply not counting the one that have the case mentionned above.

 I have worked ( and trying to find time to finish this) on an introspection scanner that output all infos into an xml file, I think you could inspire on this. If you want I can send you an alpha package and check how it works.

 Bye,

 Jean

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: check if a fsm variable is local or global
« Reply #4 on: September 13, 2018, 08:46:12 AM »
Hi Jean,

Oh i see well I didn't know that was the case. That makes sense. I'll give it a go and see what happens.

Nick