[Include] Rewind (Time machine)
#1


Time machine
- Updated Jan,8th 2019
Rewind



A rewind/time machine script that takes you back a few steps/actions! Includes textdraws and 3D text labels.
Github: https://github.com/RogueDrifter/Rewind

Screenshots
1-
2-
3-
Video
Epilepsy warning.
Make sure you got your sound on:
Another video without camera movements or flashes: CLICK ME
A third video without effects and with a faster rewind rate: CLICK ME settings used were 250 buffer and 10ms timer

Installation

Simply install to your project:

Code:
sampctl package install RogueDrifter/Rewind
Include in your code and begin using the library (Only in one script):

Code:
#include <Rewind>
Usage

There's a part newly added, now you can control the rewind times a player can go back:

Code:
#define REWIND_MAXIMUM_PHASES [NUMBER] //Between 5 and 29 (Or equal to either)
#define REWIND_CHOOSING_DIALOG [NUMBER] //Dialog ID for the fast rewind you can change for whatever reason
#define REWiND_FULLY_SYNCED_TIMER [NUMBER] //This is in MS you can change it depending on how fast you want the timers to record/play, default is 100ms
#define SYNCEED_REWIND_BUFFER [NUMBER] //This is the capacity of the fast rewind cells, don't change this if you don't know what you're doing, default is 85
Callbacks:

Code:
public OnPlayerRewindForPlayer(playerid, forplayerid)
public OnPlayerStartRewind(playerid)
public OnPlayerFinishRewind(playerid)

public OnPlayerFastRewind(playerid)
public OnPlayerFinishFastRewind(playerid)
Functions:

Code:
ShowTimeMachineSynced(playerid)
HideTimeMachineSynced(playerid)

StartRewinding(playerid) //This is automated keeps recording forever which shows on the 3D text label and the textdraw bar, can be disabled by an option above. Can be controllable for how many records to keep by the definition above.
StartRecordingRewindSynced(playerid) //This is the 'fast' synced rewind that asks by request with a dialog and lasts recording if you keep moving for 10-13 seconds

bool:IsPlayerInvolvedInRewind(playerid)
bool:IsPlayerRewinding(playerid)
bool:IsPlayerFastRewinding(playerid)

ToggleRewindFlash(bool:toggle)
ToggleRewindFlashForPlayer(playerid, bool:toggle)

ToggleRewindCameraMove(bool:toggle)
ToggleRewindCameraMoveForPlayer(playerid, bool:toggle)

ToggleRewindAuto(bool:toggle)
ToggleRewindAutoForPlayer(playerid, bool:toggle)

ToggleWorldRewind(bool:toggle) // This one and the one after it control the ability for when one rewinds with the automated feature does everyone around him also gets a forced rewind as well or not
ToggleWorldRewindForPlayer(playerid, bool:toggle)
Keep in mind all of the above are 'true' for disable and 'false' for enable that's how they're all enabled by default.

History

Updates:
Code:
1- Included interior, virtual world and angles of both cars and players in the rewind
2- Simplified code (Well actually more complicated but more self-independent) Which led to:
3- You can now choose how many steps you can go back! through the REWIND_MAXIMUM_PHASES part above in the usage
4- More screenshots added #3 above
5- Now the audio stream will loop itself every time the rewind happens to make sure the sound keeps going!
6- 3D Text label will go green when the player breaches the 3 bars limit
7- Fixed code errors and added fast rewind with more functions/callbacks and a video display
8- Added another video, 2 more features to control the fast rewind and further explanations in comments
Testing

To test, simply run the package:

Code:
sampctl package run
Extras

1- A timer that rolls over to sync all player's ability to rewind.

2- Textdraws that define the rewind ability.

3- 3D Text labels to mark for other players your ability to rewind.


Originally inspired from Life is strange video game, here's the rewind SFX used:
Do know that if someone rewinds, every streamed-in player will be forced to go back and rewind as well, that's how it works, which is also controllable by the functions above.

Topic is not open for discussions i'm not replying on anything anymore, if you're interested in this do your own fork and your own version of it i'm done, if anything do a pull request and if i'm interested enough i might merge it.
Reply
#2

Liked and subscribed.
Reply
#3

Nice.
You can also do this
PHP Code:
#if !defined FILTERSCRIPT
public OnGameModeInit()
#else
public OnFilterScriptInit()
#endif
{
    
//code

I checked the code a little bit. I think every thing under OnGameModeInit and OnFilterScriptInit is same....
Reply
#4

Quote:
Originally Posted by coool
View Post
Nice.
You can also do this
PHP Code:
#if !defined FILTERSCRIPT
public OnGameModeInit()
#else
public OnFilterScriptInit()
#endif
{
    
//code

I checked the code a little bit. I think every thing under OnGameModeInit and OnFilterScriptInit is same....
There's already a check for
pawn Code:
#if !defined FILTERSCRIPT
Click here
Reply
#5

Quote:
Originally Posted by RogueDrifter
View Post
There's already a check for
pawn Code:
#if !defined FILTERSCRIPT
Click here
I think he meant you can avoid repeated code blocks by using the macro that way..which is more cleaner and good programming habit..

Btw nice idea
Reply
#6

Thank you Santa.
Reply
#7

Quote:
Originally Posted by GhostHacker9
View Post
I think he meant you can avoid repeated code blocks by using the macro that way..which is more cleaner and good programming habit..

Btw nice idea
Oh now i get it! Mb misread that before, well only one part will get compiled but i do get where you're coming from I'll implement it later on. Thanks!


@Hunud, yw son c:
Reply
#8

Looks interesting, and very creative.
Reply
#9

Nice
Reply
#10

Thanks @Sys & @Pottus
Reply
#11

It time to get back in 90's, XD

Good Work, Keep it up.
Reply
#12

Can i rewind before me watching ******* rewind?
Reply
#13

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Can i rewind before me watching ******* rewind?
Will be available next version
Reply
#14

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
Will be available next version
can't wait
Reply
#15

Wait if you release the new version and i rewind from it that means i will have the new version from the future but you won't since i didn't ask you for it in the current reality, which means i will have the power to rewind and rewind and rewind and .....

Reply
#16

Rewind till I post https://github.com/Agneese-Saini/SA-MP/issues/29
Reply
#17

Quote:
Originally Posted by BigETI
Посмотреть сообщение
Wow.
Reply
#18

Quote:
Originally Posted by BigETI
Посмотреть сообщение
@BigETI Stop bully,

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Wait if you release the new version and i rewind from it that means i will have the new version from the future but you won't since i didn't ask you for it in the current reality, which means i will have the power to rewind and rewind and rewind and ..... [IMAGE]
@Gammix Stop paradox
Reply
#19

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
@BigETI Stop bully,


@Gammix Stop paradox
no u
Reply
#20

Quote:
Originally Posted by BigETI
Посмотреть сообщение
no u
You win.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)