playMaker

Author Topic: [SOLVED] Cannot set FSM variables stored in an object  (Read 5169 times)

ryf9059

  • Full Member
  • ***
  • Posts: 100
[SOLVED] Cannot set FSM variables stored in an object
« on: June 10, 2013, 12:24:27 PM »
Basically I have a fire action which spawns a bullet and upon the creation of the bullet object (a prefab) a speed variable is assigned to it. I stored the bullet in temp variables and wanted to use set FSM float to set the speed variable that's in the FSM of the bullet. But I can't, the temp doesn't contain any available FSM regardless the bullet object contains 2 FSM. Casting problem maybe?

Let the screenshot explain the problem




Please advise
« Last Edit: June 11, 2013, 02:19:18 PM by ryf9059 »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Cannot set FSM variables stored in an object
« Reply #1 on: June 10, 2013, 05:23:49 PM »
The Variable Name parameter is a string. So you either enter the name of the float variable, or use a name stored in a string variable. Does that make sense?

ryf9059

  • Full Member
  • ***
  • Posts: 100
Re: Cannot set FSM variables stored in an object
« Reply #2 on: June 11, 2013, 11:07:25 AM »
The Variable Name parameter is a string. So you either enter the name of the float variable, or use a name stored in a string variable. Does that make sense?

Still don't understand, the float is stored in the FSM but the FSM option is none in the first place how can I get the name from FSM? Even I type it it's not working.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Cannot set FSM variables stored in an object
« Reply #3 on: June 11, 2013, 11:48:59 AM »
By using that particular dropdown type you're telling it that you want to use a String Variable there.

Click the grey icon to the right to cycle through the dropdown box types until you can select the FSM by name. It seems like that is what is happening, anyway.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

ryf9059

  • Full Member
  • ***
  • Posts: 100
Re: Cannot set FSM variables stored in an object
« Reply #4 on: June 11, 2013, 12:11:08 PM »
By using that particular dropdown type you're telling it that you want to use a String Variable there.

Click the grey icon to the right to cycle through the dropdown box types until you can select the FSM by name. It seems like that is what is happening, anyway.

I don't quite understand what you are saying because I there is nothing in the dropdown box, I recorded a video for you to see:
http://screencast.com/t/le4facLBkGl

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Cannot set FSM variables stored in an object
« Reply #5 on: June 11, 2013, 12:12:48 PM »
Make sure a target object is assigned.

Toggle the FSM grey button like you just did in the video.

Click the Up/Down arrow button that appears.

Choose the FSM.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

ryf9059

  • Full Member
  • ***
  • Posts: 100
Re: Cannot set FSM variables stored in an object
« Reply #6 on: June 11, 2013, 01:33:16 PM »
Make sure a target object is assigned.

Toggle the FSM grey button like you just did in the video.

Click the Up/Down arrow button that appears.

Choose the FSM.


...Well, that's exactly the problem, I do have target object assigned. I created an object first and store it in temp and then set the FSM value of that temp object.



I created the Bullet prefab object with 2 FSM in it but they are not shown in the FSM dropdown box
« Last Edit: June 11, 2013, 01:35:35 PM by ryf9059 »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Cannot set FSM variables stored in an object
« Reply #7 on: June 11, 2013, 01:46:32 PM »
Because that dropdown is looking for a Variable.

You can assign it in 3 ways: Toggle to the part with the text field and up/down arrow button - you can here either 1. type the fsm manually or 2. click the new button to choose the FSM from a list.

Toggle again and it gives you 3. a list of strings, you could use a string variable to store the name if you needed to.

If there are no FSM's in the #2. option then make sure you have an object targetted and that it is not an empty gameObject variable you're filling at during runtime. If it is then you have to manually type it in.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Cannot set FSM variables stored in an object
« Reply #8 on: June 11, 2013, 01:59:23 PM »
'doh just read over it again and it hit me, the problem is in the end of the post above but its this:

You're telling it to Create a new object from a Prefab, then store it in a variable. That happens at runtime. So at editor time the 'temp' variable is actually empty. Just manually type in the data.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

ryf9059

  • Full Member
  • ***
  • Posts: 100
Re: Cannot set FSM variables stored in an object
« Reply #9 on: June 11, 2013, 02:19:02 PM »
You're telling it to Create a new object from a Prefab, then store it in a variable. That happens at runtime. So at editor time the 'temp' variable is actually empty. Just manually type in the data.

Oh okay now I understand, for things happen at runtime I need to manually set the FSM. Thanks!