dagobaking Posted May 30, 2018 Share Posted May 30, 2018 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 More sharing options...
deadbeeftffn Posted May 30, 2018 Share Posted May 30, 2018 Well, i think it's a relative value:1.0 -> keep the current size0.5 -> half the current size2.0 -> double the current size not sure though :-) Link to comment Share on other sites More sharing options...
dagobaking Posted May 30, 2018 Author Share Posted May 30, 2018 Aha. That could be. I will test. That seems to conflict with the description of the function that says its based on the original art size: https://www.creationkit.com/fallout4/index.php?title=SetScale_-_ObjectReference Link to comment Share on other sites More sharing options...
dagobaking Posted May 31, 2018 Author Share Posted May 31, 2018 (edited) 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 May 31, 2018 by dagobaking Link to comment Share on other sites More sharing options...
Reneer Posted May 31, 2018 Share Posted May 31, 2018 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. Link to comment Share on other sites More sharing options...
dagobaking Posted May 31, 2018 Author Share Posted May 31, 2018 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 More sharing options...
dagobaking Posted May 31, 2018 Author Share Posted May 31, 2018 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 More sharing options...
Evangela Posted June 1, 2018 Share Posted June 1, 2018 (edited) 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 June 1, 2018 by Rasikko Link to comment Share on other sites More sharing options...
Recommended Posts