Firstly, if you want to make a weapon, go to this tutorial: http://community.playstarbound.com/index.php?threads/mod-tutorial-3-how-to-make-your-own-gun.42937/ This tutorial assumes you have already made the desired weapon, and now you want to animate it. WARNING: This tutorial is not fully complete; some things are left to the reader to figure out. These will be pointed out explicitly. First, so that we're all on the same page, here's the file I'm starting with. It was created in the tutorial linked above. Now, in order to animate the gun, we need an animation. There are three types of animations: linear, extrapolated, and wrapping. linear animations work like the bow: the animation will happen once, and that's it. Wrapping animations work like a loop: the animation will keep repeating over and over. I don't know what extrapolated animations do. Animations are just a series of copies of an image in the same png file. For an example, look at the bow's animation: Starbound requires a file to specify the number of frames and dimensions of each frame. This file should have the same name as the image, but with a *.frames file ending. For this example, our frames file would be named "revolver.frames". See the link at the top of this post for the format of the frames file; it's exactly the same format as any other starbound frames file. Next, we need to modify our file. Here's the changes we'll make: Change "image" from "revolver.png" to "revolver.png:<frame>". DO NOT actually change the image file's name; it can stay revolver.png. Add "imageFrameSelector" : "yourFrameSelector", Now we need to go to the ../leveling/ folder. Here, we need to make a new text file called <weapon_name>.lvlfunction. So, since our gun file is "revolver.gun", we make a new file called "revolver.lvlfunction". As usual, start with an open curly bracket, and end the file with a closing curly bracket. Here, we do the following: Add "yourFrameSelector" : [ "linear", "clamp", [0,0], ...etc. Here is where you tell starbound how you want your animation to play out. The first parameter is the interpolation; the options are "halfStep", "linear", or "cubic". If you don't know what this means, just use "linear". The second parameter is the animation type. The options are "clamp", "extrapolate", or "wrap". These are the same choices I talked about earlier; use whichever one you want. And now you're done! There's a ton of fancy things you can do with lvlfunctions, like tying a projectile's strength to the amount of time you charge it. In fact, this is how bows work in the game; if you want to experiment, just go into the files and mess around with the bow. DISCLAIMER: I have not personally tried this stuff (yet - college finals and al :/). I've painstakingly pieced this information together from several hours pouring over disassembled Starbound code & data, and cross-referencing this with the assets folder. Please reply with any additions or corrections, and I'll fix this post as soon as I can.
Unfortunately, this doesn't seem to do jack for melee weapons. Looks like my animated sword might not be possible right now. T_T
so that won't work for random generated weapons either will it? Since you need to use a directories folder, split your image in parts and it doesn't use a .frames file from what i know.
It works for tools, but not for melee weapons. I was incredibly bummed out to learn this, too. I'm hoping this is something that just hasn't been finished yet. I've posted a suggestion about it here.
Great tutorial, helped me alot. Works perfectly for gunanimations. (like spinning parts while shooting). cheers
How do the numbers in brackets after the animation types work? They make no bloody goddamn sense whatsoever... I'm trying to make a gun have a slide animation that is synchronized with firing, but I'm ripping my hair out. Really wish Chucklefish would set up an official modding documentation Wiki.