Echo
9th Jul 2007, 01:22 PM
Animations are tricky things, and a lot of elements have to be just perfect for them to work correctly. Here are the symptoms of a few of the frequently made mistakes, and an explanation about what causes them.
My multi-tile object intermittently says it's not animatable
This problem occurs because multi-tile objects have multiple OBJD files but only one skeleton. That means that only one of the OBJDs can know about the skeleton, and that's the "lead tile". If your interaction is pointing at one of the other tiles, then you will get an error.
You can set the stack object ID to the current object's lead tile using an expression like this:
Stack Object ID 0x00 := Stack Object's lead tile ID
Add that just before you need to run anything on the object and it should work again, assuming everything else is correct!
When my object is turning in a circle, it suddenly spins around in the opposite direction for no reason!
This happens because of a difference between the way Milkshape works and the way The Sims works. In Milkshape, the angles in a circle go from -179 through to +180. If you rotate something 181 degrees in the positive direction, Milkshape will store that as -179, because it wraps around. The Sims doesn't work that way though, if you rotate something 181 degrees in the positive direction, the game sees that to be +181 degrees.
When Milkshape exports its rotation as -179, the game things it has to go 360 degrees in the negative direction to get to the right point. That's why your animation spins.
At the moment there are three options to deal with this issue:
(1) Make sure your animation never rotates more than 180 degrees from its start point,
(2) Disguise the flip somehow (by covering it up or integrating it in your interaction), or
(3) Edit the rotation manually in SimPE.
I can't loop my animation / My interaction finishes before the object animation does / I keep getting "Requesting animation for the third time" errors
For many BHAV coders, this is probably the first non-blocking primitive you've encountered, so you'll need to learn a few tricks to deal with them.
Most commands in BHAVs are 'blocking' commands. That means that you call them, they do what they need to do, then they return. If you tell a sim to "go to relative position", then they will walk to that location and then the command will return either true or false. Animate object and animate overlay are different though. When they get run, the start the animation then return immediately. That is how it is possible to run an object animation and a sim animation at the same time, or run an overlay over a regular sim animation. Unfortunately, it makes them quite difficult to use in loops, because you'll endup starting the next animations before the previous ones finish, potentially causing the irritating "third time" error.
There are numerous ways to work around this, and which one you want to use depends on what you're trying to achieve. I'll leave the investigation up to you, but to point you in the right direction, here are a couple of common techniques:
(1) "Stop animation" primitive
(2) Event threads
(3) Forced idling, and
(4) Synchronized blocking animations (eg, "Animate Sim").
My multi-tile object intermittently says it's not animatable
This problem occurs because multi-tile objects have multiple OBJD files but only one skeleton. That means that only one of the OBJDs can know about the skeleton, and that's the "lead tile". If your interaction is pointing at one of the other tiles, then you will get an error.
You can set the stack object ID to the current object's lead tile using an expression like this:
Stack Object ID 0x00 := Stack Object's lead tile ID
Add that just before you need to run anything on the object and it should work again, assuming everything else is correct!
When my object is turning in a circle, it suddenly spins around in the opposite direction for no reason!
This happens because of a difference between the way Milkshape works and the way The Sims works. In Milkshape, the angles in a circle go from -179 through to +180. If you rotate something 181 degrees in the positive direction, Milkshape will store that as -179, because it wraps around. The Sims doesn't work that way though, if you rotate something 181 degrees in the positive direction, the game sees that to be +181 degrees.
When Milkshape exports its rotation as -179, the game things it has to go 360 degrees in the negative direction to get to the right point. That's why your animation spins.
At the moment there are three options to deal with this issue:
(1) Make sure your animation never rotates more than 180 degrees from its start point,
(2) Disguise the flip somehow (by covering it up or integrating it in your interaction), or
(3) Edit the rotation manually in SimPE.
I can't loop my animation / My interaction finishes before the object animation does / I keep getting "Requesting animation for the third time" errors
For many BHAV coders, this is probably the first non-blocking primitive you've encountered, so you'll need to learn a few tricks to deal with them.
Most commands in BHAVs are 'blocking' commands. That means that you call them, they do what they need to do, then they return. If you tell a sim to "go to relative position", then they will walk to that location and then the command will return either true or false. Animate object and animate overlay are different though. When they get run, the start the animation then return immediately. That is how it is possible to run an object animation and a sim animation at the same time, or run an overlay over a regular sim animation. Unfortunately, it makes them quite difficult to use in loops, because you'll endup starting the next animations before the previous ones finish, potentially causing the irritating "third time" error.
There are numerous ways to work around this, and which one you want to use depends on what you're trying to achieve. I'll leave the investigation up to you, but to point you in the right direction, here are a couple of common techniques:
(1) "Stop animation" primitive
(2) Event threads
(3) Forced idling, and
(4) Synchronized blocking animations (eg, "Animate Sim").