playMaker

Author Topic: Countdown[SOLVED]  (Read 4265 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Countdown[SOLVED]
« on: August 07, 2013, 06:57:22 AM »
Hi!
When the timer is equal 0, something will happen. But the timer GUI also disappear. I think I now the reason. On State 1, I have "Int Compare" where Integer 1 is set to Variable Countdown.
Integer 2 is set to 0. So when the timer is 0, then the player die. And also the timer GUI disappear. How can I fix that problem, so the timer GUI is not disappearing?
And I also want it to reset back to start. For example 60
« Last Edit: August 14, 2013, 04:37:04 AM by jeanfabre »
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Countdown
« Reply #1 on: August 07, 2013, 12:48:59 PM »
What object are you destroying when it goes to the next state? If the gui is the child of this object you should take it out so it doesn't get destroyed.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Countdown
« Reply #2 on: August 07, 2013, 01:36:57 PM »
Hi!
It's destroying another object, so the problem is not that.
It must be Int Compare, because when the integer 2 is equal 0, the timer GUI disappear. Even if nothing happen.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Countdown
« Reply #3 on: August 07, 2013, 01:55:35 PM »
So if you disable that action the gui wont disapear, can you post a picture of the state that the int compare transitions to?
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Countdown
« Reply #4 on: August 07, 2013, 02:28:24 PM »
In state 1, I have these actions:
-GUILayout Int Label
-Send Event
-Int Compare

In state Tick Down, I have this action:
-Int Add

In state Go!!, I have these actions:
-Destroy Object (Destroy the Player)
-Create Object (Create an Explotion)
-Audio Play
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Countdown
« Reply #5 on: August 07, 2013, 05:25:37 PM »
I would suggest unchecking each action just to make sure it is the int compare that is destroying the gui so you can isolate the problem going backwards from the last state to the first.

As for resetting it back to 60 you could either do this with a load level so that it resets the whole game or by adding the action (set int value) setting the int value to 60 in the Go!! state.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Countdown
« Reply #6 on: August 08, 2013, 03:37:00 PM »
Hi!
I also tried a Countdown sample that came together with Playmaker. It's the same there. I also made an example where I push the space to lose a life, and when the lives are equal "0", then "Game Over!" And this is working! But the Lives GUI still disappear.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Countdown
« Reply #7 on: August 14, 2013, 03:30:50 AM »
Hi!

I made it by myself!

You can't have GUI text and Int Compare in the same FSM. That's the reason why the GUI text disappear. :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Countdown[SOLVED]
« Reply #8 on: August 14, 2013, 04:37:40 AM »
Hi,

 You can have both, I think it's simply because your logic was making the content of the gui text empty. Did you had any log in the console?

bye,

Jean

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Countdown[SOLVED]
« Reply #9 on: August 14, 2013, 04:44:15 PM »
Hi, jeanfabre!
I have no log in the console!
I just tried to make a countdown in a new FSM. And I have
GUI text and int compare in the same FSM and also the same state. Maybe I didn't say that. maybe I can have it in the same FSM, but not in the same state?

Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Countdown[SOLVED]
« Reply #10 on: August 16, 2013, 05:03:46 AM »
Hi,

 yes, it's probably this, you may have a race condition and you set it to empty after you compute it and therefore the bug.

bye,

Jean