Jump to content

How to use SetScale on Actors?


Recommended Posts

I'm trying to make small adjustments to an NPC scale. From .98 to 1.0 to be exact.


However, when I use:




targetActor.SetScale(1.0)



They stay at 0.98.


Where it gets confusing is when you enter a large number like 2.0. As expected, they get large. But, the scale they grow to is often slightly off from the number. So, it seems like some kind of odd rounding system.


Any help would be greatly appreciated.

Link to comment
Share on other sites

Ok. It looks like SetScale is indeed relative.

 

So, anyone know what the geometry is to have it go from .98 to 1.0?

 

It's not as simple as just 1.0/.98. That only gives the relative difference. Not the amount that .98 needs to grow by (relative to its starting scale) to land on 1.0 even.

Edited by dagobaking
Link to comment
Share on other sites

SetScale always operates on the base object scale. That is, if the object is set at 1.3 scale, SetScale(1.0) will set it back to 1.3 scale, not 1.0. This is all according to the Skyrim Wiki entry.

 

Thank you! I should have remembered to check the Skyrim entry. That link covered everything I needed to know.

Link to comment
Share on other sites

I could be off. But, I am not sure about the math in that link.

 

It seems to me that scaleA/scaleB as they use it in that link would be the proportional difference. But, the number to scale by would be slightly different than that because it is relative to a different starting value.

 

They say that the imprecise number is due to floating point limitations. But, it looks like the number is always off in one direction. If it were a rounding issue I would expect it to be off in both directions.

Link to comment
Share on other sites

For the note 1. Debug.MessageBox() is basically calling Show() which is a latent function, that and message boxes freeze game time, so that will affect testing SetScale I guess.

 

For many of skyrim calculations(particularly with enchantments) the values are always rounded down. I want to say this is the case for ALL calculations, but I'm not so sure.

Edited by Rasikko
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...