TranslateTo firing only once...

Post » Wed Apr 10, 2013 6:31 am

So this script is supposed to rotate a misc object for 10 times in a While loop, and then delete itself, but...it's not working.


Scriptname PO3_GlyphRepulsionActivate extends ObjectReference; ------------------------ PROPERTIES ----------------------------------------------Actor Property PlayerRef  Auto  SPELL Property po3CassGlyphRepulsionEffectSpell  Auto  Float fCount = 0.0; ------------------------ EVENT ONLOAD() ----------------------------------------------Event OnLoad()float posx = GetPositionX()float posy = GetPositionY()float posz = GetPositionZ()po3CassGlyphRepulsionEffectSpell.RemoteCast(self, PlayerRef)SetMotionType(Motion_Keyframed)while  fCount &--#60; 10.0Debug.Notification(" Glyph is about to rotate for the " + fCount + " time.")TranslateTo(posx, posy, posz, 0, 0, 180, 30.0, 50)fCount += 1.0Debug.Notification(" Glyph has been rotated " + fCount + " times.")Utility.Wait(0.1)endwhileDisable(true)Delete()Debug.Notification(" Glyph is deleted after rotating for " + fCount + " times.")EndEvent

What happens is that the glyph rotates once, then fades out and disables itself,.

The glyph fades out on when fCount = 2.00 (I get no delete notification however), but the other debug notifications still show up correctly afterwards. According to those notifications, the glyph gets rotated 10 times and then deletes itself after, just like I wanted.

So it seems that the While loop is working, but the TranslateTo part stops prematurely.

Any help?
User avatar
Sarah MacLeod
 
Posts: 3422
Joined: Tue Nov 07, 2006 1:39 am

Return to V - Skyrim