In .animation files it used to be that each part could only be assigned to one 'rotationGroup'. They have since changed this and now each part can be assigned to one or more 'transformationGroups'. The problem that I am encountering is that I don't know how to specify the center of rotation for a transformationGroup. It used to be that you would specify the rotationCenter in each part, but that doesn't seem to work any more. I can't seem to find any examples in the code for how to do this. Does anyone know what the JSON property is called or know where I can find an example? Thanks!
I'm pretty sure that the rotation center is now fixed default to one of the corners of the image. ([0, 0] I think...?) I haven't played much with it but does the "offset" key only displace the image or both the image and rotation point? I can't find many examples, but the closest I can find a hint to is the animation for the ballista vehicle. Tell me if you figure it out. I was wondering about this a couple weeks ago for a mod request, but I gave up.
I was able to do things the old way, by creating a rotationGroup and assigning parts to it. It worked when the vehicle was facing the default direction, but as soon as I flipped directions the rotation center went back to the center of the vehicle. Weird.
I know that there is a flip group under transformation groups, does that one handle images when facing the other direction? Tbh, I'm just suggesting ideas. I actually hate working with animations, so I'm not very adept with them.
Ok, I found the answer, and I guess it should've been obvious in retrospect. With transformationGroups, there is a lua function that many vehicles use to rotate the group: animator.rotateTransformationGroup("group", angle) Sooo, if you want to offset the rotation you just follow that function with this one: animator.translateTransformationGroup("group", {x, y}) Thanks for looking into this with me @Inf_Wolf14 --- Post updated --- I think I have discovered a bug though (or maybe I just don't understand how Starbound handles transformations). I'm making a boat with guns that rotate independently of the main body, so I have three transformation groups: Code: "transformationGroups" : { "rotation" : { "interpolated" : true }, "gunRotation" : { "interpolated" : true }, "flip" : {} }, I first want to translate the gunRotation group (which should just move the guns to their correct position on the ship because only the guns are assigned to the gunRotation group) and THEN scale the flip group to flip everything, which should scale everything because I have both the guns and the ship body assigned to the flip group. My problem is that the guns ALWAYS get flipped and THEN translated, no matter the order in which I put the code. Here's the code: Code: animator.translateTransformationGroup("gunRotation", {3.9, 0.6}) if self.facingDirection < 0 then animator.scaleTransformationGroup("flip", {-1, 1}) end I would think that if a part is assigned to multiple transformation groups then it would still apply the transformations from each group in order that they happen, but it doesn't seem to be working that way
I dont know if it will affect how it applies the animator, but see if seperating the translations and flip into individual functions within your script, and call them from there? I cant see why it applies the changes in that order unless the game interprets and categorizes the functions before applying them in the engine.
What does it look like in your parts? Code: "parts" : { "hand" : { "properties" : { "offset" : [ 0, 0 ], "transformationGroup" : "hand" }, "partStates" : { "default" : { "default" : { "properties" : { "image" : "<partImage>:default" } } } } }, Because transformationGroup isn't working for me, and rotationGroup crashes the game
I figured it out, this is what I changed it to Code: ... "hand" : { "properties" : { "offset" : [ 0, 0 ], "transformationGroups" : ["hand"] }, ...