in my game there are a number of cutscenes that are used for loading screens and so on, and for now i have them saved as
.mp4. However, in my final game i would like if these could be in some way converted to something that cannot be accessed so easily. Recently, user Wolf suggested in an unrelated post that video files can be converted to
.egg files using this method, but i find unclear how to exactly use it. Does someone have a code snippet that does this?
I fear that a relevant code-snippet would be pretty much as those given on the page.
In short, the process for each video-file should be something like this, if I’m not much mistaken:
- Outside of your program, you run the “egg-texture-cards” command-line utility, providing it your file as input (i.e. in place of “explosion*.jpg”).
- In your code, you:
- Load the resulting egg-file as a model
- Use the “find” method to locate the “SequenceNode”-object in the loaded model
- Use that “SequenceNode” to control the animation
That said, I don’t think that I’ve used this process for movie-files, so I don’t know offhand whether there might be pitfalls or processes specific to such.
Let me note, however, that there may be another way: Multifiles.
These can be a little more technical to set up in code, but shouldn’t require processing your videos into a new format.
In short: Your videos would be stored in a “container file”–the “multifile”. In your code, you would then “mount” this file, which causes Panda to treat its contents (in this case your videos) as though they were present individually in the file-system. They should then be usable much as they normally are.