making TV in a map is easy!
Here are the things you need:
1. a GIF animation file.
2. A program that can save EACH frame of the GIF.
After making all the frames saved as textures (I recommend using DDS format), you will want to open Radiant.
Now create as many the same brushes as many frames you have, so that they make up the whole film.
Afterwards put all the textures on all the "frames". Use "Fit Texture" function.
If you have many frames, it will take pretty long time, but how nicely it will be looking afterwards!
Done? now select all the "frames" and turn them all into a script_brushmodel.
If you want the animation to be played by a trigger, make one.
The last thing you should do is learning the frame's length (a SINGLE frame, not all taken together).
Here we're ending the mapping part and starting the scripting one.
I assume you are familiar with the scripting.
there are several ways to animate the thing you have just created. I advise you to follow the way below:
using a "for" loop:
Code: Select all
animation = getent("animation", "targetname");
trig = getent("anim_trigger", "targetname");
while(1)
{
trig waittill ("trigger");
for (i = 0; i < 200; i++) //it assumes your animation consists of 200 frames.
{
animation.origin += (0, 100, 0); //it immediately shows the next frame by the means of a momentary motion the brushmodel along the axis Y on 100 units, which are the frame's length. (this example assumes the length is 100)
wait 0.1; //delay between two frames.
}
animation.origin = (0, 0, 0); //after playback, returns the animation to the start point.
}
By the way, this example assumes that the animation moves along the axis Y. if you want it to move to another side, use the negative value of the length.
If you want it to move along the axis X, use
animation.origin += (frame's length, 0, 0);
If you want it to move along the axis Z, use
animation.origin += (0, 0, frame's length);
I added that to my map, and it looked really nice.