Author Topic: Simple Animation Script v0.2 (Updated 26/01/2014)  (Read 4542 times)

0 Members and 1 Guest are viewing this topic.

Offline FelixJim

  • 28
  • User 11092
Simple Animation Script v0.2 (Updated 26/01/2014)
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.
« Last Edit: January 27, 2014, 02:45:06 am by FelixJim »
In-Mission Techroom Script v0.4 - See information from the techroom in game
Simple Animation Script v0.2 - Make your own on-screen animations for FSO
Visible Waypoints Script - Makes waypoints visible in-game
Run From File Script - Get around the pesky 31 character limit for script-eval

 

Offline FelixJim

  • 28
  • User 11092
Re: Simple Animation Script v0.2 (Updated 26/01/2014)
Update! New things in v0.2:

  • Animation script files changed from .txt files in data\scripts to .cfg files in data\config; this means they can be packed into VPs and still work
  • Multiple animations can now be played at once!
  • Circles no longer need to be filled - thanks to zookeeper for this
  • Arcs can now be drawn - zookeeper again!
  • Some error checking introduced - some crashes replaced with warnings (debug builds only)
  • Fixed a bug where if the setting Pause on Game Pause was set to false, the animation would become unpauseable even by the sas.pause() function
  • Fixed a bug where trying to set the Filled setting to true on Rectangle elements would result in a crash
  • Updated example mainhall script to stop animation playing in options screen and ship lab
  • Updated sas.mdlld() function with ability to automatically load models for all animation sequences - no longer have to specify a specific one
  • Added optional file sasanimationfiles.cfg to data\config which contains names of the animation scripts' filenames if you want to deviate from the defaults
  • Fixed bug where if animation is paused during game pause the next frame would be rendered over the pause screen
  • Added option where animations would automatically end if a mission ended during the animation
  • Updated sas.pause(), sas.unpause() and sas.stop() functions with ability to (un)pause/stop a specific animation, now that multiple animations can now be played at once; default functionality of (un)pausing/stopping all current animations still retained
In-Mission Techroom Script v0.4 - See information from the techroom in game
Simple Animation Script v0.2 - Make your own on-screen animations for FSO
Visible Waypoints Script - Makes waypoints visible in-game
Run From File Script - Get around the pesky 31 character limit for script-eval

 

Offline procdrone

  • Formerly TheHound
  • 29
  • Balance breaker! Thats me!
    • Steam
Re: Simple Animation Script v0.2 (Updated 26/01/2014)
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
--Did it! It's RELEASED! VeniceMirror Thread--