Jump to content

Any Good Rotation Scripts out there?


Zorkaz

Recommended Posts

Does anyone have a good rotation script leftover that maybe uses floats?

 

  Reveal hidden contents

 

I created a slow moving one for asteroids and while it works the game crashes when moving too far away. (In an interior cell)

Link to comment
Share on other sites

https://www.creationkit.com/index.php?title=Spatial_functions_and_snippets

You can probably tweak that for your needs(requires some what advanced knowledge in trig, which I myself don't have). The coordinate system still uses ZYX like in Skyrim.

 

Maybe experiment with OnTimer, or DistanceGreaterThan/LessThan events to turn on/off the operation to prevent the crash when the player's distance is x units away.

 

As its in an interior, you can handle resets with OnCellDetach() and not rely on Unload which may or not fire.

Edited by Rasikko
Link to comment
Share on other sites

I would also use translateto and the corresponding event ontranslationcomplete as puting an infinite loop in the onload event is a very bad idea.

Especially as everytime it loads again it will create another such loop on the same object.

 

With trasnlateto you trigger the first small rotation increment on the 'onload' then the ontranslationcomplete triggers the next one.

Then all you need is an 'is3dloaded' check in that logic to not trigger another rotate when you move out of range.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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