NitrOP7674 / FreeplayCheckpoint

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

Feature: Be able to use the plugin in training packs #22

Closed SeeringPhil closed 2 years ago

SeeringPhil commented 2 years ago

Idea: That we could use the plugin inside regular custom training packs. That way, we could record a good setup in an interesting training pack and focus for a while on the finishing touches.

Potential caveats :

NitrOP7674 commented 2 years ago

I don't know if we can access the same position / velocity data when inside training packs

I'm pretty sure it can be accessed. I'm not sure if they can be set, or whether it's possible to change the time remaining in the shot, which would be the biggest hurdle, I think.

If not, maybe there could be a way to still save the data, but allow the player to scroll through history when coming back in freeplay?

This should be doable. I've had this idea before, or the ability to convert a training pack into a bunch of checkpoints.

NitrOP7674 commented 2 years ago

Surprisingly this wasn't too difficult. However, there is a lot of complication around loading checkpoints (namely, the car does some strange thing that looks like it's being hit continuously if you do it at the beginning of a shot, and the goal you're heading for might be the wrong one), so for now I've just allowed freezing, rewinding, fast-forwarding, and loading the last quick checkpoint in a48c9ae.

Even loading the last quick checkpoint could be dodgy. And rewinding all the way back to the start of a shot breaks because the initial impulse on the ball is lost. I think it's fine for all practical purposes, but it is not ideal.

The only thing I think I'd possibly add beyond this is the ability to save a checkpoint while rewinding (or after loading the quick checkpoint), with a little UI feedback indicating it was added, and the ability to remove that checkpoint immediately thereafter if it was created by mistake.

SeeringPhil commented 2 years ago

Hello there! @NitrOP7674

I was just able to test out the beta release with this change in it and I must say it's quite nice. Your ideas for future functionalities would be really cool too!

A little heads up though, there was only one issue that made me think it was not working at first and it's that in custom training, the default button to reset shots is the same as the one that is set by default in the plugin (I think, not sure if I changed it or not) so the default game binding was being used before the plugin's and I couldn't use it.

I just changed it to left thumbstick click and now it works, but I guess there could be a warning? or maybe overwride the default binding if possible? Maybe a single press could go back to the checkpoint, but double pressing the button bring back to start of shot?

EDIT: Just noticed after going back in freeplay that the back button was overridden by the plugin in freeplay before, so I guess it can be done 🤔

Thank you very much for your work, really cool plugin!

NitrOP7674 commented 2 years ago

I believe "reset shot" by default is R1/RB. In the plugin, the default checkpoint button is select/share/back.

I don't recommend setting these two functions to the same button; I'm not sure what will happen if you do. AFAIK a plugin can't prevent an action that is native to the game. It might be possible to wait 1ms for the reset shot to complete and then load the checkpoint, but that's pretty hacky and it might not be something that I can detect needs to be done, either. It's probably possible to make a double-push of the checkpoint button do a reset shot, but the checkpoint button already means something (take/delete a checkpoint) when you are frozen. It's easier to just not use the same button for these two things.