Topic category: User side tutorials
Before I start, I want to say thank you to Tbroski and Klemen for helping me create this tutorial.
First, have a video ready, best if short and low-res.
Convert it to a PNG image sequence, you can use any service you so desire. (if you have photoshop, follow this tutorial https://ihatetomatoes.net/convert-video-image-sequence)
Then, you get a folder full of your images and name them accordingly. If you have 100 frames for example, name them from 0 to 99.
Go to the "Import Other Textures" section in MCR, and import all of them clicking the first and shift-clicking the last texture
Now to the code part, create a procedure element, and set the trigger to on player tick update.
Go to the code, and add the following:
Entity entity = (Entity) dependencies.get("entity");
entity.getPersistentData().putDouble("Frame", ((entity.getPersistentData().getDouble("Frame")) + 1));
entity.getPersistentData().putString("Location",
(("yourmodid:textures/") + (Math.round((entity.getPersistentData().getDouble("Frame")))) + (".png")));
if (((entity.getPersistentData().getDouble("Frame")) >= maxframe)) {
entity.getPersistentData().putDouble("Frame", 0);
}
Replace yourmodid with your mod Id and maxframe with your max frame number.
This code snippet will create a Frame variable that increases per tick, and get the location of a frame with that variable.
Next, create an overlay element, select a dummy base texture, lock the code, and change the line of code that binds your base texture to this:
Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation((entity.getPersistentData().getString("Location"))));
Run your mod and you should be seeing a silky smooth video playing, the video will repeat once it reaches the end.
Add sound and customize the code any way you want.
Dont forget to like comment and subscribe!
If you have any errors, post it below
anyone in?
Really nice! However, if we have a lot o GIF, we will have a ;lot of textures/pictures, so i think it's bretter to create a folder for each GIF, as we can define the GIf path ourself.
yep
so would this work if i wanted to make a "cutscene"in a story mode mod (a mod that has a story that you must follow)
yes
Updated the tutorial a little bit
Was waiting for you to publish this ;) Nicely written, good work!
XD
Wow i cant believe its really possible
It is xD
For a 300 frame 30 fps cutscene how much storage are we looking at once the mod is exported?
Depends on image size