bakkesmodorg / BakkesModSDK

The current BakkesModSDK (Unofficial SDK for Rocket League)
http://bakkesmod.com
223 stars 49 forks source link

GetCamra().GetRotation() causes crash. #2

Closed jakecrowley closed 3 years ago

jakecrowley commented 7 years ago

Creating an ActorWrapper with ActorWrapper cam = gw->GetCamra(); and then attempting to pull the rotation of it using cam.GetRotation(); causes a crash.

Bakkes commented 7 years ago

Good one. For now the camera is hidden since I currently don't have a system which will prevent people from altering the camera when in an online game. I will try adding a camera wrapper to ensure this behavior and make camera alterations possible.

May I ask what you're working on and maybe I can prioritize the functions you need?

jakecrowley commented 7 years ago

I'm trying to make a plugin that draws a line in-game showing me where to fly to hit the ball when aerialing so I can learn what angles i have to fly up to hit it at. For now, the easiest way I've though of doing it is using the pitch of the camera while in ball cam, but if there is any other ways you can think of that don't involve the camera feel free to share ;)

Bakkes commented 7 years ago

Ah, I believe you want something that was already in the mod. It used to have a line predicting where the ball would go (like in this video https://www.youtube.com/watch?v=o73hRJP_MUE&t=52s @ 52 seconds).

Unfortunately, Psyonix removed pretty much every in-game drawing method because there was that one thread on reddit showing hacks, which also resulted in this feature not working anymore. (+ it ruined quite a few training features I was working on :( )

Wanting the same behaviour now is going to be quite hard, you'd need a working worldtoscreen method and then also create a custom overlay in order to make this work.

I'll see if I can add some methods that will help you out, can't promise too much though.

jakecrowley commented 7 years ago

Darn, still would be useful to be able to have the camera angles though, I might be able to do something like it logging in the console if you are undershooting or overshooting the angle so you can correct it, although i completely agree you need something that prevents use in online play, because that could be taken advantage of and used to give an unfair advantage in something such as competitive

Bakkes commented 7 years ago

I spent some time today updating/rewriting parts of the SDK. You should now be able to get the camera location and rotation using gamewrapper->GetCamera().GetLocation()/GetRotation().

I've also added support for drawing which might help debugging or show other relevant info.

Let me know if there are mistakes/crashes or if you need help with anything.

The experimental SDK can be found at http://updater.bakkesmod.com/static/bakkesmod_experimental.zip. Just paste the contents of the zip over the bakkesmod folder in Rocket Leagues win32 folder.

Edit: There's also a predictball method which will predict the ball x time ahead in free play (gamewrapper->GetCalculator()->PredictBall() which might help with your plugin.

jakecrowley commented 7 years ago

Thank you so much! This will help a ton.