playMaker

Author Topic: Get Fsm Bool doesn't seem to work [SOLVED]  (Read 3101 times)

inediblered

  • Playmaker Newbie
  • *
  • Posts: 13
Get Fsm Bool doesn't seem to work [SOLVED]
« on: November 19, 2013, 07:03:58 AM »
Hello, I've followed a tutorial on "get Fsm bool" and it doesn't seem to work for me:

So in a separate object I have a bool variable "enemy_detected" which I know is working because it's connected to a trigger.

I set up my get fsm bool like this:



then when I start the game I don't get any errors but the fsm doesn't start/doesn't turn green, what am I doing wrong ?
« Last Edit: November 19, 2013, 11:14:18 AM by Alex Chouls »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Get Fsm Bool doesn't seem to work
« Reply #1 on: November 19, 2013, 07:17:18 AM »
Every Frame checkbox.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

inediblered

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Get Fsm Bool doesn't seem to work
« Reply #2 on: November 19, 2013, 07:46:05 AM »
no, that is not the problem sadly :(

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Get Fsm Bool doesn't seem to work
« Reply #3 on: November 19, 2013, 07:53:16 AM »
You have to get the value of it consistently, otherwise it will only update once, then leave the state and do something else and the value will be stuck at whatever it was when it left the state until you tell it to get the value again. In this case you need to either get the value every frame or when there is a collision you need to send an update to this fsm that changes the value.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Fsm Bool doesn't seem to work
« Reply #4 on: November 19, 2013, 07:57:08 AM »
Hi,

 the problem could be that you renamed the fsm target or it's variable name and the Get Fsm XXX will fail to get to your variable.

 Double check by re setting your get Fsm XXX using the drop downs provided within the action interface.

Bye,

 Jean

inediblered

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Get Fsm Bool doesn't seem to work
« Reply #5 on: November 19, 2013, 08:01:31 AM »
Thank you jeanfabre !!!! that was it :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Fsm Bool doesn't seem to work [SOLVED]
« Reply #6 on: November 19, 2013, 11:40:51 AM »
Hi,

 Yes, Get/set Fsm XXX are VERY powerfull, but subject to refactoring issues, so use it wisely being aware of this fact. Name your Fsm and variable properly and avoid refactoring then to break such loose referencing.

 The very good pro of such loose reference is to work with prefabs and other unknown gameobjects, and simply "Expect" a fsm and a variable, I use this feature all the time and it allows to create "Interfaces" withotu worrying about null referencing for example, so while it can be seen as a con, it's actually a very powerful feature indeed.

Bye,

 Jean