TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Results 1 to 15 of 15

Thread: how do you rotate an object by lever?

  1. #1
    Member
    Registered: May 2002
    Location: Texas

    how do you rotate an object by lever?

    I have an object in my FM. I want to be able to rotate it 90 degrees when a lever is frobbed, and return to 0 when the lever is frobbed to normal position.

    I know how to make objects rotate on their own. I've added the rotate and rotatestate properties.

    Thanks!!

    John

  2. #2
    Member
    Registered: Dec 2000
    Location: Finland
    Adding S>Script:StdLever to the object should do it. Just make sure it doesn't have Engine Features>FrobInfo: Script.

  3. #3
    Member
    Registered: Jan 2000
    Location: Taylors, SC
    You could also set it up with a Tweq: Rotate and use the script TweqOnOff. Then you can control it with a lever or button.
    Shadowspawn's Thief Pages
    Darkness is always faster than light. No matter how fast light travels, it always finds the dark waiting for it.

  4. #4
    Member
    Registered: Mar 2001
    Location: Ireland
    In more detail:

    Add S->Scripts and put in "TweqOnOff"
    Add Tweq->Rotate and set it up as follows:
    Halt: Stop Tweq
    AnimC: Sim
    MiscC: [None]
    CurveC: [None]
    Primary Axis: (This depends on which way you want it to rotate. Lets use Y as an example)
    x rate-low-high: 0 0 0
    y rate-low-high: 5 0 90
    z rate-low-high: 0 0 0

    The 'X' box is the speed at which the object rotates, the 'Y' box is the starting rotation (usually only used if you want to rotate anti-clockwise), and the 'Z' box is the final rotation.

    Add Tweq->RotateState. Just leaving it blank should work okay.

    Link from the lever to the rotating object with a ControlDevice link.

    - NV

  5. #5
    Member
    Registered: May 2002
    Location: Texas
    Thank you Nameless_Voice, Shadowspawn, and Dark Arrow. I got it to work.

    John

  6. #6
    Member
    Registered: Feb 2002
    Location: Go is to the fountain.
    Funny, I've never gotten TweqOnOff to do more than start/stop tweqs. But then again, maybe it's different with subparts.

  7. #7
    Member
    Registered: May 2002
    Location: Texas
    Basically that is what it did for me, so I made a conversation to frob the switch, wait for the rotate to finish, and then frob the switch again.

    John

  8. #8
    Member
    Registered: Mar 2001
    Location: Ireland
    If you just want the object to rotate straight back to the start position after it's finished rotating the first time, you just need to give it the OneBounce flag for the appropriate joint.

    - NV

  9. #9
    Member
    Registered: May 2002
    Location: Texas
    The object starts at 90 degrees and is rotated to 0 degrees with one pull of the lever which is what is supposed to happen. I don't want it to go from 90 to 0 and back to 90 because (without spoilers) it wouldn't serve any purpose. Everything you told me with the addition of the conversation makes it work acceptably.

    Thanks Nameless_Voice

    John

  10. #10
    Member
    Registered: May 2017
    Location: USA
    Sorry for the necro-- suppose I wanted to rotate an object 90 degrees (in the same direction) each time a button is pushed? With TweqOnOff, the object will just toggle back and forth between a fixed starting angle, and a ending angle. I'd like the ending angle to be the starting angle plus 90--can this be done without much heroics?

    Thanks!

  11. #11
    Dóttirin klęšist oft móšur möttli
    Registered: Apr 2015

  12. #12
    Member
    Registered: Aug 2004
    Location: netherlands
    you might want to use tnh scripts:

    trapmoverelative
    does exactly what you want...

    and here you find the demo that comes with the scripts . makes it a bit easier to understand how to use it....

    that is the script I used for the turning brigdes puzzle in the spear of destiny

  13. #13
    Member
    Registered: May 2017
    Location: USA
    This looks perfect! Thanks, nightshifter! Not sure how I didn't think of this---I use trapmoverelative for teleportation all the time!

    EDIT: though this will make it move instantaneously, right? Rather than twist from one position smoothly to another? I might be able to work with that, but rotating smoothly from one position to the next would be preferable.

  14. #14
    Member
    Registered: Aug 2004
    Location: netherlands
    ah, you're right. I had to check my own mission how I got them to turn smootly.

    I did set the designnote for trapmoverelative to h=-1 and I used a nvrelaytrap with designote set to : NVRelayRepeat=45;NVRepeatOnly=1;NVRelayDelay=10 to make my bridge move smoothly for 45 degrees to the right
    so basicly the bridge gets turned 1 degree , 45 times with a 10 ms interval...

  15. #15
    Member
    Registered: May 2017
    Location: USA
    Brilliant!

    EDIT: works perfectly thank you!
    Last edited by trefoilknot; 21st Dec 2018 at 11:38.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •