Bertram made some changes to enable animation scripting. This is a good idea, but his implementation is not ideal for a couple reasons. First, he creates a new Lua file for every single animation. So Claudius would have a script for idle, walking, attack, running, and so on. Second, all these script files are placed in the img/ directory, which is supposed to only hold images. Of course, we can script more than just sprite animations in here. We can also use these scripts for effects in battle, such as fire, that are a result of skills being executed. Or for animating the battle backdrop images. The only type of animations that this won't be used for are animated map tiles. The goal, as usual for this type of thing, is to have several files that contain groups of related animations, rather than having a single file for each individual animation or a single file with all animations.
Here's my proposed plan for animation scripts:
- Create folder dat/animations
- Within dat/animations, create subfolders as appropriate (characters, enemies, creatures, backdrops, etc)
- A Lua file is created for each object. Ie, claudius.lua would contain all of Claudius' animations
- Within the file are multiple tables. Each table is named according to the animation it represents (ie "attack").
- Each table contains: the filename of the image used in the animation, the number of frames, the way to construct the frames (for multi images only), and the animation sequence
I'm going to be gradually implementing this scheme over the next week or two. I wanted to give a heads up in case anyone has any issues with this or a better proposal. Here are some commits that Bertram made in his own animation implementation for reference:
https://github.com/Bertram25/ValyriaTea ... 598c4292cb
https://github.com/Bertram25/ValyriaTea ... 5746647d0a
https://github.com/Bertram25/ValyriaTea ... a7846b2f47
For discussion of the code running behind the game
2 posts • Page 1 of 1
Forgot to mention that I will also add some routines in src/common/common.h for loading and parsing these animation scripts and returning the AnimatedImage objects that they produce. That way the different modes should not need to all do this themselves.
Who is online
Users browsing this forum: No registered users and 4 guests