Results 1 to 3 of 3

Thread: MakeCompass with Random Degree

  1. #1
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default MakeCompass with Random Degree

    SCAR Code:
    program New;

    {.include SRL/srl.scar}

    var d: integer;

    begin
      setupsrl;
      D := 180 + Random(20) - Random(20);
      MakeCompass(IntToStr(D));
      writeln(inttostr(d));
      wait(1000);
      writeln(floattostr(rs_GetCompassAngleDegrees));
    end.

    It always makes it perfectly south. The debug will say
    SRL Compiled in 15 msec
    174
    180
    It SHOULD make it 174 deg, but it does not, it makes it 180!? This is quite n00by probably, but I need to know ^^.

    Thanks,
    ~ Harry


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  2. #2
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Well it doesn't always make it 180, but it never makes it the correct degree

    Code:
    171
    169.695153531234
    However thats close enough


  3. #3
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Everytime I run mine, it gives 180 as the second number. Every time. Every stinking time Unless it is lag or something in MakeCompass?

    Edit: It must be lag. When I manually make the compass to west, it sometimes works. I think MakeCompass has stuff in it to not spin when it is within the amount it should be
    193
    199.9831065219
    Successfully executed


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. MakeCompass
    By SirPa in forum OSR Help
    Replies: 4
    Last Post: 11-04-2008, 05:35 PM
  2. Procedure AWalkCol(Degree, Radius, Color, Ranx, Rany:integer)
    By itSchRis917 in forum Research & Development Lounge
    Replies: 10
    Last Post: 07-25-2007, 08:33 PM
  3. MakeCompass
    By passiondrive in forum OSR Help
    Replies: 2
    Last Post: 07-05-2007, 05:03 PM

Posting Permissions

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