Bug Camera somehow mixes up pitch and yaw

Discussion in 'Developer Support' started by Exia, Jan 28, 2016.

  1. Exia

    Joined:
    Nov 3, 2013
    Messages:
    590
    Likes Received:
    236
    @Arbiter @Cloud

    This is a very strange exception I"m getting:
    Code (Text):
    1. java.lang.IllegalArgumentException: Pitch must be a value between 0 and 1
    which corresponds to this line:
    Code (Text):
    1. Camera.concurrentlyTurnTo((int)(Camera.getYaw() + Random.nextInt(0, 360)) % 360);
    So either somehow java is switching that in method call to the double one, or the exception message is incorrect.
     
  2. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,425
    Likes Received:
    1,006
    Is the exception occurring locally or on the Bot Store? If it's on the Bot Store, it could be obfuscation related. You could try clarifying the line by setting a temporary variable "final int yaw = Camera.getYaw() + Random(0, 360);" and then using it in the following line "Camera.concurrentlyTurnTo(yaw % 360);" If this does fix it, we will look into fixing the obfuscator.
     
  3. Exia

    Joined:
    Nov 3, 2013
    Messages:
    590
    Likes Received:
    236
    Both I think. But mostly on the store. I don't see a need to clarify. The % operator can only be used on and output ints (in java).
     
  4. Cloud

    Cloud The Developer

    Joined:
    Jul 28, 2013
    Messages:
    2,300
    Likes Received:
    729
    I'm interested in what the value of getPitch is when this occurs.
     
  5. SlashnHax

    SlashnHax The Chosen One

    Joined:
    Dec 10, 2014
    Messages:
    2,783
    Likes Received:
    738
    I've had this occur once when testing a bot locally, does turnTo(yaw) determine a pitch if you don't specify one?
    It's only ever happened to me once, but I'm pretty sure I define the pitch most of the time, so it might be that the pitch that gets determined/generated doesn't fit the bound?
     
  6. blisterz

    Joined:
    Nov 2, 2015
    Messages:
    132
    Likes Received:
    24
    I had this problem locally when moving the camera to a random yaw.


    Other camera issues:
    And runemate moves the camera left almost everytime. Even if the item it is focusing on is just a little to the right the bot will move it all the way around (almost 360)
     
  7. Cloud

    Cloud The Developer

    Joined:
    Jul 28, 2013
    Messages:
    2,300
    Likes Received:
    729
    Nope, it passes the current pitch into the method that accepts both as an argument. That's why I was curious what the current pitches value was, if it was somehow outside of the bounds than the issue would make sense.
     

Share This Page

Loading...