playMaker

Author Topic: Control variables resets themselves on play  (Read 7040 times)

David

  • Playmaker Newbie
  • *
  • Posts: 18
Control variables resets themselves on play
« on: March 20, 2013, 07:56:06 AM »
Hi,

I've got a strange bug (unity 4.0.1f2, playmaker 1.5.4) with the Control variables for FSM and prefabs depending if playmaker editor is displayed or not.

Here are the steps to reproduce the bug :

Note : I usually have my workspace with Scene view, Game view, and Playmaker Editor tabs in the central window (see attached screenshot), it seems important in the process to recreate the bug.
- Create a new projet, import playmaker package
- Create a cube in the scene
- Add FSM
- Create a float variable (for example but any type should do)
- Tick "show in inspector" for this variable
- Drag drop the cube in the project view to make a new prefab
- Switch to scene view (click on scene view tab) so the Playmaker Editor isn't displayed anymore (very important... it took me a long time to find that but it seems that if the playmaker editor window is displayed when you do the next step, everything works as expected and will work forever for this instance)
- Create one instance of the cube, set its variable to 1 from inspector
- Press play...
- Variable has been reset to default value (0) :(

It seems that if you want to reproduce this bug more than 1 time for a single project, you need to choose another name for your test variable.

Edit : Forgot to send a bug report via Playmaker menu, just did it now (Case 648).
« Last Edit: March 20, 2013, 09:44:41 AM by David »

David

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Control variables resets themselves on play
« Reply #1 on: March 20, 2013, 02:22:39 PM »
That gets worse when working with templates as the "have the playmaker editor open" doesn't seems to work in this case. My controls vars keeps being reset.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Control variables resets themselves on play
« Reply #2 on: March 20, 2013, 02:38:59 PM »
Are you looking at the variable's Times Used in the playMaker Editor?

I'm not able to duplicate this. My prefab shows zero on the prefab and the instance in the scene shows as the number i changed it to as well as so in the editor.

Test this further by making float labels on the GUI that reflect the variable's value.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

David

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Control variables resets themselves on play
« Reply #3 on: March 20, 2013, 02:56:52 PM »
That's terrible  :o. Reproduced the case 10 times at least this morning, tested again the same procedure and it works some times, some times it doesn't...

But in my project the bug is still there, I'm trying to find a way to rereproduce this case each times.

David

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Control variables resets themselves on play
« Reply #4 on: March 20, 2013, 03:30:54 PM »
Please have a look here :
It seems I can reproduce the bug each time like this... Reproduced it on two different computers.

The variable isn't just reset to default value during play mode but stays resetted then even when you stop the playmode.
« Last Edit: March 20, 2013, 03:32:52 PM by David »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Control variables resets themselves on play
« Reply #5 on: March 20, 2013, 03:38:16 PM »
Interesting. It doesn't do it for me, using unity 3.5, I'll try later with 4.x.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Control variables resets themselves on play
« Reply #6 on: March 20, 2013, 03:44:57 PM »
Does the same thing happen if you use the controls in the Playmaker FSM tab?

David

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Control variables resets themselves on play
« Reply #7 on: March 20, 2013, 03:57:56 PM »
Lane : I tried with 3.5, same problem here if I reproduce exactly the steps from the video.

Alex : As soon as I select the instance and displays it in the FSM tab the bug doesn't occurs, so if I modify the variable from the Playmaker FSM tab it will stay modified. But it doesn't solve the problem for the templates given that you can't modifiy the controls from playmaker fsm tab when using a template.
« Last Edit: March 20, 2013, 04:01:31 PM by David »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Control variables resets themselves on play
« Reply #8 on: March 20, 2013, 04:33:01 PM »
Quote
But it doesn't solve the problem for the templates given that you can't modifiy the controls from playmaker fsm tab when using a template.

Not sure I follow. You should be able to select the fsm tab for a template... basically anything you can do in the Unity FSM inspector you should be able to do in the FSM tab in Playmaker.

David

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Control variables resets themselves on play
« Reply #9 on: March 20, 2013, 04:36:56 PM »
I can select it, but the controls are grayed out (see screenshot below)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Control variables resets themselves on play
« Reply #10 on: March 20, 2013, 11:50:15 PM »
If you need to edit the template you can click the graph view or select it in the Template Browser.

The idea is you can override exposed variables, but the rest of the settings come from the template. That's why they're grayed out...

David

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Control variables resets themselves on play
« Reply #11 on: March 21, 2013, 03:09:56 AM »
Yes sorry I misunderstood your previous question, I know about the templates :) I was just saying that you can only modify the exposed variables from the inspector and not from the FSM but you already know that ;).

What I was saying about the problem with the template is that if you reproduce the steps from the video I made but using a template the bug always occurs, even if the FSM tab is displayed (I suppose it's because only the template is "selected" and displayed and not really the current instance).

Edit : Ok I've just done some more testing and the above statement is wrong, sorry. Using a template or not, as long as you display at least once the instance's fsm in the playmaker editor window the bug doesn't occur.
If you create a new instance and never display its fsm the bug will occur.
It isn't the case when you duplicate objects from scene, but only when you create a new instance from a prefab when in scene view.
« Last Edit: March 21, 2013, 09:34:06 AM by David »