Rotate

Discussion in 'Mapping Questions & Discussion' started by Haggis, Sep 11, 2009.

  1. Haggis

    Haggis L2: Junior Member

    Messages:
    86
    Positive Ratings:
    1
    I have made a simple cog in Sketchup and would like to know how i can rotate it on its own axis.The cog will be lying flat on the ground,i want to be able to trigger it to start and then stop after a few seconds,what do i need to do to get this to work.
     
  2. Sgt Frag

    Sgt Frag L14: Epic Member

    Messages:
    1,443
    Positive Ratings:
    356
    I think there's a way to import, in the tuts section.

    Or make one in Hammer.

    Then make it (or another small cube with nodraw) a func_door_rotate.

    The speed and open angle (rotation, whatever it's called) can be adjusted to spin the lenght of time you want.

    100 speed is probably fine, then add degrees for how many rotations, adjust.

    Use one of your triggers (like on map start) to send an open signal to it.
     
  3. Washipato

    Washipato L3: Member

    Messages:
    149
    Positive Ratings:
    99
    Like sgt Frag ansered, use a door. Func_door_rotating.

    Here is a nice tutorial tu build a door. Apply it to the cog you want to use (link)

    I will give you some extra advices about the entity:

    1) Set "Delay Before Reset" to -1, so your door will not close after opening
    2) If you want to rotate it multiple times, do the following:

    - Set the "Rotation Distance" in a high number, for example 3600000
    - When you want to rotate the cog, issue a "open" input.
    - Before making it stop, set the speed with "SetSpeed" to 0. The speed will not be updated until the door changes what it was doing (now it's opening, the speed will change when it closes or when it's fully open)
    - Order the door to close. The door will immediately stop, because it's speed is 0.
    - After that, change the speed back to the value you had before changing it

    Aplied to a relay, it would end:
    Code:
    OnTrigger -> my_door -> Open (delay: 0.00)
    OnTrigger -> my_door -> SetSpeed -> 0 (delay: 0.50)
    OnTrigger -> my_door -> Close (delay: 4.00)
    OnTrigger -> my_door -> SetSpeed -> 100 (delay: 4.01)
    With this, the door will rotate for 4 seconds before stoping. Take in mind that you will need to wait 0.01 seconds before opening it again
     
    Last edited: Sep 11, 2009
  4. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    There are various ways, but another one is phys_motor, if you want it to spin up and slow down and such.
     
  5. Haggis

    Haggis L2: Junior Member

    Messages:
    86
    Positive Ratings:
    1
    I have managed to get it the cogs turning.What i want to do now but i dont know if it is possible is parent it to another 2 entities.I have the cogs turning but i also want it to move up the way and round,here is a picture to explain things better.
    [​IMG]

    Part 3 is moving no problem,i now want part 3 and part 1 to move level with part 2 and also turn 90 degrees so the track is in line with the steps,is this possible.
     
  6. Mick-a-nator

    aa Mick-a-nator

    Messages:
    640
    Positive Ratings:
    314
    quite simple, just parent you func_doorrotating (or w/e its called) to the other moving parts.

    e.g. ("->" means "parented to")
    cog model -> func_doorrotating -> rotating platform -> 2nd func_doorrotating ... etc.

    NOTE: too many steps like this and it could get expensive and more likely to break.
     
  7. Washipato

    Washipato L3: Member

    Messages:
    149
    Positive Ratings:
    99
    Parent both 3's func_door_rotating, 1 and 2 to a third func_door_rotating with the center in the middle of 1. Use the last one to rotate the whole thing. It shouldn't give problems
     
  8. Haggis

    Haggis L2: Junior Member

    Messages:
    86
    Positive Ratings:
    1
    Ive done it whoohoo.It took a bit of doing as when the func_door_rotating was fully open it would then come back the way even though i had the flag set for one direction,lots of outputs later i have it working and it looks awsome.Cheers everybody for your contribution.