Want videos to play inside Amnesia? On a TV or computer monitor? Don't like the built-in gobo animation for spotlights?
This tool will let you animate a sequence of images in the game easily.
This application is written in Java which means it's platform independent. It should work fine on Windows, macOS and various distributions of Linux.
Requirements
Java 7 or newer
A video split into individual images
Amnesia - The Dark Descent
The HPL Tools
Download
Latest version 2.0.0:
Usage
Spoiler below!
To start off, you need to acquire a sequence of images that will make up your
video. There are tools for extracting videos and gifs into separate images.
Adobe Photoshop can do this, and probably other free tools like Gimp.
Once you have your sequence, use the app to generate the required files for
Amnesia:
- File setup
--- Name prefix
- Whatever your sequence is named (for example frame_00.png,
frame_01.png, frame_02.png etc), this is the prefix. In this case
"frame_".
--- Number progression
- x+ will number things normally. The others will use a certain amount
of leading zeros. The appropriate setting for the above example is
"xx". Remember that numbering starts at 0.
--- File extension
- The extension matching your image files.
- Animation
--- Number of frames
- The total number of frames in your animation. If you have 100 frames
input 100. The total is the number of your last frame + 1 (because
it starts at 0).
- Export options
--- Material files
- The .mat files needed. Required.
--- Entity files
- The .ent files needed. Also required.
--- Level script
- The script which animates the frames in the game. Optional if you
want to make your own script, but I highly recommend this one. You
can also edit it if you want to.
-- Minimalized
- If you don't plan on editing or reading the script, you can use this
setting which will make the script highly compact and spread across
a single line. Useful if you want it to take as little space in your
.hps file as possible.
--- Video placeholder files
- You need 1 set of these files for the animation to work. Keep them in
the same folder as your frames.
Once you're done, hit "Generate files" and choose the folder for your frames.
== IN-GAME ==
Copy the exported script into your <Level>.hps file. The script gives you the
folling functions:
void PreloadAnimation(string asName, string asArea, int frameAmount);
void StartImageAnimation(string asName, string asArea, string asFromArea, int
frameAmount, int fps, bool abLoop);
void StopImageAnimation(string asName, bool abRemove);
You MUST call PreloadAnimation before you play start the animation. This will
load all your frames into the game at a specified area (place them outside your
level somewhere hidden for best effect).
After the animation is loaded, you can play and stop it using the other two
scripts. the asFromArea refers to the area used in the preload function.
Remember that asName here must be the same as the prefix you put into the app.
E.G. "frame_"
Changelog
August 7, 2018 - v2.0.0
Re-wrote the application. GUI is mostly the same, but the underlying functionality is very different. The animation is now more optimized, so it can run at a higher resolution and faster framerate with much less lag.
August 16, 2014 - v1.1.0
Completely re-made the design to look prettier and be more clean.
June 5, 2014 - v1.0.2
Fixed a bug I overlooked causing the .expobj file to only load 1 entity.
28 mins vid, mudbill ? can't you explain what this does in a shorter way?
It's a tool that takes images and turns them into one object (a .expobj file), that you can import into level editor. This object shows these images, loops through images like a .gif or whatever. Is this correct?
This app takes the images set you have, in the format you specify, like name+number, and it creates an entity out of each (a billboard inside with the image).
So if I have like image_chocolate_01.jpg, I end up with the entity image_chocolate_01.ent and so on for each image.
Then, all these entities get listed/enumerated in a .expobj file so you can import all the entities together (at 0,0,0 coords).
And last, you get a .hps file with code to make these entities go active/inactive with timers. And that's how it loops through images.
That's awesome, it takes some skill to come with this in Java. I wanna learn too :[
I'll see if I can use your tool instead of spotlights and see the difference. Good job.
Basically, the whole file is actually written inside the Java app, then printed with the incremented numbers. Perhaps not the more effective way, but it works, and that's what matters, yea? It took me about 5 days to make.
Okay, I just decided to pull out an update to fix the design, now that I'm more familiar with GUI design in Java. I think it looks good.
Since no one have reported any issues, I'm assuming it's working fine. Unless I decide to revisit it again, this might be the last update, at least for a while.