Jump to content

TranslateTo doesn't work on Static objects?


jamesCag

Recommended Posts

I'm a newbie so forgive me if I missed some vital tutorial. I've been trying to write a script that translates a static floor piece, but it won't work. I tried it again on MovableStatic object (as a wild debug step), and that seems to work.

 

Is there any way to move static objects, or are they not meant to move (as the name implies)?

Link to comment
Share on other sites

I seem to be doing these posts a lot where I figure out the answer immediately after my post. I had the positions of the translation reversed so that up was down and down was up.

 

Here's my script in case anyone else is working on an elevator:

Scriptname MyFirstButtonScript extends ObjectReference
{My first Papyrus script}

bool Property up = true Auto
ObjectReference Property ElevatorReference Auto Const

 Auto State AtRest
    Event OnActivate(ObjectReference akActionRef)
      GoToState("Busy")

	If up == true
		debug.Notification("Go down")
		debug.Notification(self.GetPositionZ())
		ElevatorReference.TranslateTo(ElevatorReference.GetPositionX(), ElevatorReference.GetPositionY(),32, ElevatorReference.GetAngleX(), ElevatorReference.GetAngleY(), ElevatorReference.GetAngleZ(), 100.0, 0)
		debug.Notification(self.GetPositionZ())
		up = false
	Else
		debug.Notification("Go up")
		debug.Notification(self.GetPositionZ())
		ElevatorReference.TranslateTo(ElevatorReference.GetPositionX(), ElevatorReference.GetPositionY(), 192.0, ElevatorReference.GetAngleX(), ElevatorReference.GetAngleY(), ElevatorReference.GetAngleZ(), 100.0, 0)
		debug.Notification(self.GetPositionZ())
		up = true
	EndIf
 
      GoToState("AtRest")
    EndEvent
 EndState
 
 State Busy
    Event OnActivate(ObjectReference akActionRef)
       debug.Notification("Cripes Eva, I'm busy!  Sign it yourself.")
    EndEvent
 EndState


Link to comment
Share on other sites

So having had my glorious revelation, I'm not noticing that the object doesn't animate moving. It just pops to the position I've specified after a certain amount of time dictated by the speed parameter. Further, the collision box only moves after it pops into existence elsewhere. I must be missing something. If anyone has pointers I'd be grateful!

Link to comment
Share on other sites

Take any misc object, set its motion type to keyframed (SetMotionType()) and look how this will be translated. Any MovableStatic should do the trick too. Statics will not.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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