Hard Light Productions Forums

FreeSpace Releases => Scripting Releases => Topic started by: FelixJim on August 06, 2013, 03:18:44 am

Title: Simple Animation Script v0.2 (Updated 26/01/2014)
Post by: FelixJim on August 06, 2013, 03:18:44 am
The name says it all! Nearly.
The simple animation script is like Adobe Flash for FSO cut down beyond just "bare bones" to something so hideously basic it would make one feel ill just to make the comparison. But there it is! You put down in a text file that you want something to appear on your screen with these properties at this time, altered properties at that time, and one property tweaked halfway in between, and the script will happily interpret that and do all the hard leg work for you. I can see this being used for briefings and the like, which is what I've done in the examples, but goodness knowns you could slap just about anything up on-screen and have it dance about to your heart's content. Enough waffling from me though, let's take a look!

An animation at the main hall:

One in-game:

Damn you FRAPS demo and your 30s time limit. All the awesome stuff comes after that! Although this quality wouldn't do it justice anyway. Full version in the download if you want to see it.
You get the idea though, yes? Making an animation like these is simplicity itself. A simple one would look something like this:

Code: [Select]
Time: 0

Element: Alpha 1
Type: Icon
Filename: Tfight.png
x: 0
y: 0.5

End

Time: 5

Element: Alpha 1
x: 1

End

This would make the icon Tfight.png wizz happily from halfway down the left-hand side of the screen to halfway down the right-hand side of the screen over a space of 5 seconds. But what if we wanted to move it to the bottom of the screen in 2 seconds but leave the horizontal movement unchanged?

Code: [Select]
Time: 0

Element: Alpha 1
Type: Icon
Filename: Tfight.png
x: 0
y: 0.5

End

Time: 2

Element: Alpha 1
y: 1

End

Time: 5

Element: Alpha 1
x: 1

End

With the exception of the Type, which must be declared when a new Element comes into existence, all the information is optional at every stage - it will be calculated from other Times, or just loaded from the defaults.

Anyway, here's a download link:  https://www.mediafire.com/?xjn7yezs0gln6io
This requires a recent nightly - tested with 10348 - so use that or later. Includes documentation and examples.

Here is version 0.1 which is buggy and has less features, but works with FSO 3.7.0: http://www.mediafire.com/?l7qil4a522ivnvm
Please don't use this without very good reason though.

Note that the examples included aren't meant to be fully polished standards to which all animations should be held up to - I'm not actually very good at this sort of thing. These are just two quick examples to give you an idea of how it works.

I feel I ought to point out that this doesn't really add any new functionality to FSO - it just makes existing functionality a heck of a lot easier to use.

Feel free to ask lots of questions.
Title: Re: Simple Animation Script v0.2 (Updated 26/01/2014)
Post by: FelixJim on January 26, 2014, 06:26:56 pm
Update! New things in v0.2:

Title: Re: Simple Animation Script v0.2 (Updated 26/01/2014)
Post by: procdrone on January 28, 2014, 10:33:55 am
Oh my, this is outstanding job! The Briefing animations are are... I'm just impressed! Going to use this right away!

P.S. Yea, this FRAPS demo is really a problem with its 30 sec's :D