Jump to content

TranslateTo not working


Zorkaz

Recommended Posts

Scriptname JNRElevatorScr extends ObjectReference


ObjectReference Property Elevator Auto


Event OnTriggerEnter(ObjectReference akActionRef)
Elevator.TranslateTo(0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 12.0)
EndEvent

Event OnTriggerLeave(ObjectReference akActionRef)
 
EndEvent

I have floor (Movable Static) as ObjectReference but upon entering the Triggerzone it still will not move up. Any suggestions?

 

Link to comment
Share on other sites

The coordinates and angles are gloabal unlike MoveTo in which are relative, so unless your elevator floor is right in the middle of the world/cell, you're trying to translate it pretty far probably, so if you want to pass relative cordinates and angles you need to sum/subtract them to the current angles and positions, for example

Elevator.TranslateTo(Elevator.X, Elevator.Y, Elevator.Z + 12.0, Elevator.GetAngleX(), Elevator.GetAngleY(), Elevator.GetAngleZ(), 12.0)

Or you can make use of markers instead and TranslateToRef, for example:

Elevator.TranslateToRef(MarkerTopRef, afSpeed=12.0)

or

Elevator.TranslateToRef(MarkerBottomRef, afSpeed=12.0)

Where MarkerTopRef and MarkerBottomRef would be markers at the top and the bottom position of the elevator, of course you can use an array of marker references to get more thant two floors.

 

 

On the other hand, it seems not moving because you need to set motion to keyframed for most of the objects:

Elevator.SetMotion(Elevator.Motion_Keyframed)

That usually works fine on most object types, but I had better results using activators and statics.

 

This method might result in a shaking platform, which could be ugly or make it look more realistic, depends on your view. At any case the elevator helper method works smoother but might be a pain to setup for multiple floors.

 

 

Additionally, if you want to attach objects to this platform, like for example activators (buttons), you'll need to add an attach node to the floor's nif, but that's another story for another post.

Edited by DieFeM
Link to comment
Share on other sites

If you want smooth movement when standing on a platform animated with TranslateTo(), you have to do this:

 

- Use indirect drive (translateto moves an intermediate object, to which the actual elevator platform is refattached)

- Set the "Use as Platform" flag on the elevator platform

 

Using refattached stuff will of course open a whole new can of worms re engine bugs. Having spent a lot of time on this, I think refattaching is the most terribly bugged part in all of Creation Engine: None of it works right.

But once you master these difficulties, it allows you to make elevators however you want them to be, completely unrestricted by any of the preexisting methods in game.

You can check my elevator mod for details. Or even use it's scripts, in case you want to profit from the several hundreds of hours I sunk into cracking the elevator problem for good.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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