+ Reply to Thread
Results 1 to 6 of 6

Thread: Holos won't return to original angle

  1. #1
    Wire Noob Arend's Avatar
    Join Date
    Oct 2009
    Posts
    3

    Thumbs down Holos won't return to original angle

    I have a car (designed by me, made to work by Balto the Wolf Dog) that moves, yadda yadda... A single problem is, the wheels are supposed to turn when A or D is hit. The only problem I have is they turn, but when neither A or D is hit they do not return to their original set angle. Basically;

    if ($A & A) {
    holoAng(1,holoEntity(1):toWorld(ang(0,0,30)))
    holoAng(two through four about the same)}
    else {holoAng(1,holoEntity(1):toWorld(ang(0,0,0)))
    (two through four still about the same)
    }

    and D just makes the angle -30. But it still will not return to it's original angle.

  2. #2
    Wire Amateur kyle273's Avatar
    Join Date
    Dec 2009
    Posts
    44

    Default Re: Holos won't return to original angle

    if (A) {
    Ang=ang(0,0,30)
    }
    if(D){
    Ang=ang(0,0,-30)
    }
    for(H=1,4)
    holoAng=(H,holoEntity(H):toWorld(ang(0,0,0)+Ang)
    }
    I believe this will make it so when A or D are held down, the wheels will turn, then snap back when A or D is released.

    Is this what you want?

  3. #3
    billywitchdoctor.com Whosdr's Avatar
    Join Date
    Dec 2008
    Posts
    2,300

    Default Re: Holos won't return to original angle

    Code:
          if (A) {Ang = ang(0,0,30)}
    elseif (D) {Ang = ang(0,0,-30)}
    else        {Ang = ang()}
    for(H=1,4) {holoAng=(H,holoEntity(H):toWorld(ang(0,0,0)+Ang)}
    Last edited by Whosdr; 02-17-2010 at 04:33 AM.
    .siht daer ot gniyrt emit detsaw ev'uoY

  4. #4
    Wire Noob Arend's Avatar
    Join Date
    Oct 2009
    Posts
    3

    Default Re: Holos won't return to original angle

    Quote Originally Posted by kyle273 View Post
    if (A) {
    Ang=ang(0,0,30)
    }
    if(D){
    Ang=ang(0,0,-30)
    }
    for(H=1,4)
    holoAng=(H,holoEntity(H):toWorld(ang(0,0,0)+Ang)
    }
    I believe this will make it so when A or D are held down, the wheels will turn, then snap back when A or D is released.

    Is this what you want?
    tried it, two holos would return to their original angle, but the other two would toggle left or right

  5. #5
    Wire Amateur kyle273's Avatar
    Join Date
    Dec 2009
    Posts
    44

    Default Re: Holos won't return to original angle

    That is just pretty weird.
    It might be that the holo indexes are not 1,2,3,and 4 as I thought.
    Try toying around with the code to see if you can get it to work on your own.

  6. #6
    Master of Mars Magos Mechanicus's Avatar
    Join Date
    May 2008
    Posts
    852

    Default Re: Holos won't return to original angle

    Look at this again
    holoAng(1, Expression)
    So far, so good, sets the angle of the hologram to the value of the expression.
    holoEntity(1):toWorld(ang(0,0,0)
    This expression returns what you get when you take the angle of hologram 1 and apply no rotation (as specified by ang (0,0,0) ). You're telling the hologram to rotate from where it is to where it is, so naturally it doesn't move.
    You'll have to reset them using a different way to specify the set angle.
    I can wire anything directly into anything! I'm the Professor!
    -Professor Hubert Farnsworth

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots