25.12.2018, 06:24
(
Last edited by RogueDrifter; 10/01/2019 at 01:18 AM.
)
Time machine
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-
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
Code:
#include <Rewind>
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
Code:
public OnPlayerRewindForPlayer(playerid, forplayerid) public OnPlayerStartRewind(playerid) public OnPlayerFinishRewind(playerid) public OnPlayerFastRewind(playerid) public OnPlayerFinishFastRewind(playerid)
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)
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
To test, simply run the package:
Code:
sampctl package run
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.