NitrOP7674 / FreeplayCheckpoint

Rocket League Freeplay Checkpoint plugin
MIT License
12 stars 4 forks source link

Add cvar boolean (cpt_is_frozen) for other plugins to detect state #21

Closed mgavin closed 2 years ago

mgavin commented 2 years ago

I love this plugin and if I were to complete one myself, I would like to check being in the freeze state to stop/pause my own operations. For instance: I want to do something after a certain amount of time has elapsed, unless freeplay is currently "frozen" as reported by this plugin (I'm thinking when going through checkpoints, cpt_freeze, where the state of freeplay is frozen in place: is_frozen = 1, when play resumes: is_frozen = 0)

I'd make a pull request, but I have to figure out how to make a pull request. Thanks.

NitrOP7674 commented 2 years ago

Interesting idea. I already have a boolean for this, it's just not a cvar, so it should be pretty easy to connect the variable to a cvar, I think.

NitrOP7674 commented 2 years ago

One complication is that "frozen" is now actually a tri-state. Car & ball frozen, only ball frozen, or neither frozen. So maybe two booleans, cpt_car_frozen and cpt_ball_frozen?

mgavin commented 2 years ago

What's the state during cpt_freeze or cpt_do_checkpoint when it seems like the whole map is frozen until you do an input? That's the state I'm imagining

NitrOP7674 commented 2 years ago

As I said, it's a tri-state, not binary. I do have a boolean to indicate if it is recording vs. rewinding/frozen, and when the ball is frozen but the car is not, it's in the "recording" state (since we save car movements in order to rewind them later). However, if you had a plugin that wanted to alter the ball and check to see if it was frozen, you'd want to check the ball's frozen state. But if you're going to do something like recoveries that bump your car around, you'd want to check the other state. I think having two bools is probably the way to go.

NitrOP7674 commented 2 years ago

Added in a750292!