playMaker

Author Topic: Pause the system and specific object/character  (Read 183 times)

hoyoyo80

  • Junior Playmaker
  • **
  • Posts: 74
    • View Profile
Pause the system and specific object/character
« on: July 01, 2019, 06:24:04 PM »
Hi all😁

I ve come to the phase of developement where i need pause button and also pausing/halt character/object to highlight sometime and then resume.

I know of the existence of time scale 0. But is there any other method for pause and then for pause/halt object?

Thanks

daniellogin

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Re: Pause the system and specific object/character
« Reply #1 on: July 01, 2019, 09:13:21 PM »
No  :)
Actually yes  ;)

What I mean is there is a way to 'pause', but it's a little bit indirect and can be a lot of work.

Here is how it works, broken down in to steps:

* Create a blank action in your character controlling FSM (or where ever you want to pause), which you can call something like Idle.

* Go to the Events tab in that FSM, and create one called something like "Pause". Find the check box next to it and mark it. That makes it a Global Event (one that other FSM's can talk to).

* You can then have another FSM to control pausing. Let say it simply gets a button down and then it goes to another action to start the pause.

* In this second action, you do a Send Event To FSM. Change the gameobject from the default own object to the one you want to pause. Enter the name of the FSM on that gameobject and set the event name to Pause (or what ever you named your global event).

* When you run that, your character controller will now go to your blank action. It's doing nothing, so it's "paused" :)
But now it's stuck on a dead end.

* You use the same process again to unpause. Simple set another Global Event in your character controller (called UnPause maybe) and then send that event from your pause controller or what not.

* But this is where it can get a bit fiddly. For a start, you need to individually set all of this up for every single FSM you want to pause and unpause. You also need to consider where you will set your UnPause global events. Is it the same place that the FSM starts? Is it a common loop back point?

OR is it important that the FSM carries on where it left off?

If it's important where the FSM restarts at, and a single point can't be used, you need to think up some kind of record system to log where you are at.

For example, let's say you can end up on a loop point for when you are crawling or where you standing. Let's say it's important because the key inputs at each point are different, and it needs to send the right animation or etc.

What you can do is set an Int when you go to each crucial point. When you go in to the crawling action, you could set the Int to 1. When you are standing, you could set the Int to 2.

OK now when you go to unpause, you make a specific action which does an Int Compare to see if it's 1 or 2. It then knows where to route off to next, so it goes back into your regular flow at the correct location.

So there ya go. As far as I know, this is the only way to do pausing. The actual way you hook it up can vary, but basically it comes down to using events with dead ends to halt your FSMs.
« Last Edit: July 01, 2019, 09:15:36 PM by daniellogin »

hoyoyo80

  • Junior Playmaker
  • **
  • Posts: 74
    • View Profile
Re: Pause the system and specific object/character
« Reply #2 on: July 02, 2019, 12:48:03 AM »
I get your explaination. But i dont know it going to be so complicated but doable and tedious😂😅
Thanks a lot😁👍



hoyoyo80

  • Junior Playmaker
  • **
  • Posts: 74
    • View Profile
Re: Pause the system and specific object/character
« Reply #3 on: July 09, 2019, 09:41:06 PM »
I ended up purchasing Chronos.Havent dive into it really deep but hope its worth the money.

daniellogin

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Re: Pause the system and specific object/character
« Reply #4 on: July 10, 2019, 03:42:44 AM »
I thought that was for doing cool stuff like actual replays, not just video but the game going back and forward in time. Ever played Turbo Dismount? It's just a crash dummy thing. You pick a vehicle, pick a path, then plow yourself into oncomming traffic or what not to get points based on how damaged your crash dummy gets. It's cool because after the action, you get to rewind and fast forward (at slow mo, regular, or fast speed) back and forward on the timeline while moving the camera around anywhere at the same time. I figured Chronos was for that kind of thing.