JonnyBro / beatrun

Fork of infamous parkour addon for Garry's Mod
https://beatrun.jonnybro.ru
Do What The F*ck You Want To Public License
240 stars 40 forks source link

[Suggestion] Ghosts for Course Mode (Tracked player) #86

Closed Robo798814 closed 11 months ago

Robo798814 commented 1 year ago

My suggestion is to add a feature for courses where the mod will record the player's position then show it in the form of a ghost when the player restarts the course.

To prevent more than two ghosts from spawning (Unless in multiplayer or in other scenarios), the mod will delete the last ghost and use newly recorded data from the player's movement. This feature should be disabled by default.

Below is an image of what I meant. image

SleepyCatOfficial commented 11 months ago

Would be cool! But idk if you could do it tho

UnderSet commented 11 months ago

Would be cool! But idk if you could do it tho

Very likely possible, there's some commented out code for recording replays in Checkpoints.lua and also the entire Replay.lua file, which means theoretically you can make a ghost follow the recorded replay. I don't know how to make it work though, and I have no idea how to even draw a ghost in the first place, and there's no code about calling the replay playing function, so I don't know how to use that.

JonnyBro commented 11 months ago

Would be cool! But idk if you could do it tho

Very likely possible, there's some commented out code for recording replays in Checkpoints.lua and also the entire Replay.lua file, which means theoretically you can make a ghost follow the recorded replay. I don't know how to make it work though, and I have no idea how to even draw a ghost in the first place, and there's no code about calling the replay playing function, so I don't know how to use that.

This Replay.lua file plays replays of your courses when you finished but as I remember it's not implemented fully, thats why I commented all the code (it also was making some random errors)

UnderSet commented 11 months ago

This Replay.lua file plays replays of your courses when you finished but as I remember it's not implemented fully, thats why I commented all the code (it also was making some random errors)

Makes sense, probably partly because it's (presumably) only meant to be used in the lost training map (br_training) as that's apparently where most of the occurences of "replay" appears outside of the aforementioned Replay.lua*.

I also found out how to start a replay (ReplayPlay()), though I can't for the life of me understand how to use that function outside of the training map.

I'd like to try and finish this issue sometime, but that'll have to wait - I have tests to do this week, and besides I gotta get the replays themselves to work right first to get this issue to progress anyway.

This is getting a "little" offtopic from the main issue though.

*On 'shared' that is, there's quite a few references in the clientside stuff as far as I can see.

JonnyBro commented 11 months ago

@UnderSet I'll close this issue and will check on your repo sometime. Fell free to ping me in our Discord server for everything related!