playMaker

Author Topic: Reset level  (Read 14311 times)

tim.holman

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 49
Reset level
« on: January 13, 2012, 02:41:30 PM »
I was wondering if anybody knew of an easy way to reset the current level when dying. In other words, all fsm's should reset and start where they normally would at the beginning of the game. I was thinking about disabling, then re enabling all fsm's in the scene, however, I feel like there should be an easier way to go about this. Any ideas would be greatly appreciated!!

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • Blog
Re: Reset level
« Reply #1 on: January 13, 2012, 03:25:38 PM »
Try "restart level" action.
Bye

tim.holman

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 49
Re: Reset level
« Reply #2 on: January 13, 2012, 05:34:15 PM »
I searched for "Restart Level" and didn't see anything. Is this a new action? Would "Load Level" essentially be the same thing? I'm using Playmaker 2.2 (beta 10). I believe Alex sent me an updated beta, however, I have not had time to implement yet. Thank you for your help.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Reset level
« Reply #3 on: January 13, 2012, 05:45:05 PM »
Sebastiao is probably talking about this action:
http://hutonggames.com/playmakerforum/index.php?topic=800.0

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • Blog
Re: Reset level
« Reply #4 on: January 13, 2012, 05:46:01 PM »
You can make it with Load Level action and you set the same level.
But if you search in this forum Restart Level, you will find the action.
Bye

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • Blog
Re: Reset level
« Reply #5 on: January 13, 2012, 05:46:42 PM »

tim.holman

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 49
Re: Reset level
« Reply #6 on: January 17, 2012, 10:43:43 AM »
Isn't this essentially the same as "Load Level" or "Load Level Num"? What's the difference?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Reset level
« Reply #7 on: January 24, 2012, 04:29:46 PM »
Yes. It's just for convenience really, so you don't have to store the name of the current level.

Reloading the level is probably the best/easiest way to make sure everything resets properly (physics etc.).

But it might make sense for Playmaker to have some high level call for this (e.g., ResetAllFSMs). I'll look into it...

smiffy

  • Junior Playmaker
  • **
  • Posts: 54
Re: Reset level
« Reply #8 on: June 07, 2012, 12:40:22 PM »
Just had to implement this exact thing today and this is what I came up with.

Create a global variable int that can be used to set which level you are on.

Create a new empty scene (I named mine resetter) and create an int switch based on the global var that points to each level. The level transitions just have load movie on them and draw fullscreen colour to keep the screen black.

The player dies and hits the restart level button.
The button sets the global variable for which point in the game they are at. Level 1 = 1 and so on.
It then fades to black and loads the resetter scene.


jasonshow

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Reset level
« Reply #9 on: February 20, 2013, 09:36:13 AM »
I try restartlevel.cs ,but it will not reset all my variables,and it seem not to make all objects reseting.
how can I reset my all variables to default,and make all itween stop,and all gameobjects init to default.

thanks a lot.

PET

  • Full Member
  • ***
  • Posts: 139
    • GamerPET
Re: Reset level
« Reply #10 on: January 28, 2016, 11:25:26 AM »
I have used Restart Level in the past without any problems.

In my project it works without problems, however when I make a build and I do a restart... the level restarts wierdly... I see a white screen.

Any ideas? thanks
Technical Game Designer
www.GamerPET.com