ID:1897843
 
Not a bug
BYOND Version:508
Operating System:Windows 7 Pro 64-bit
Web Browser:Chrome 43.0.2357.134
Applies to:Dream Maker
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary: After using translate on an object before any transformations and then multiplying its scale by 3, I use a transform on it to make it shrink back down. Instead of being centered while it shrink down during the animation, it also animated a translation.
This is occurring in Beta 508.1293

Numbered Steps to Reproduce Problem:
Before performing a scale animation on the object, translate it.

Code Snippet (if applicable) to Reproduce Problem:
var/obj/o = new /obj
var/matrix/m = o.transform
m.Translate(10,0)
o.transform = m*3
spawn(10) animate(o,transform=o.transform/3,time=3)


Expected Results:
Expected for the scale animation to be centered.

Actual Results:

Does the problem occur:
Every time? Or how often? Everytime
In other games? N/a
In other user accounts? N/a
On other computers? N/a

When does the problem NOT occur? No idea

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.) N/a

Workarounds:
If there is a work around, I like to know. This might not even be a bug since I'm new to the animate() proc.

Please provide the full version number of the release you're using, simply '508' isn't enough information as there have been a number of fixes relating to animate() and transforms in the 508 release cycle.
Lummox JR resolved issue (Not a bug)
Think about the order of operations here.

The transform you're using before animation is basically translate(10,0) * scale(3). Scaling impacts everything, including prior translations, so this is equivalent to scale(3) * translate(30,0).

The transform you're animating to is simply translate(10,0). So while the scaling resets to 1, the translation is moving from 30 to 10.

If you want to translate by 10 the entire time, this is the code you need:

var/obj/o = new /obj
var/matrix/m = new // assuming obj.transform is normal by default
var/matrix/m2 = new(m)
m *= 3
m.Translate(10,0)
m2.Translate(10,0)
o.transform = m
spawn(10) animate(o,transform=m2,time=3)

Now the translation will stay put at 10,0.