Thread: Move camera packet [317]

Results 1 to 3 of 3
  1. #1 Move camera packet [317] 
    Registered Member
    Join Date
    Aug 2012
    Posts
    136
    Thanks given
    10
    Thanks received
    23
    Rep Power
    11
    I found tutorial in google for packet that rotates camera. It doesn't move camera thought and thats why I was wondering what packet moves camera? 177 rotates it. For example if camera is in edgeville bank I can make spin 360 degrees, but its stuck there, I cannot move it to for example wilderness.
    Reply With Quote  
     

  2. #2  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    967
    Thanks given
    47
    Thanks received
    161
    Rep Power
    366
    Short answer: 166

    Long answer:
    This is the information you need:

    Code:
    /**
     * Instantly moves the camera to a specified location;
     * @param location The new camera location.
     * @param zPos The new cameraHeight, in positions.
     * @return The action sender instance, for chaining.
     */
    public ActionSender moveCameraToLocation(Location location, int zPos){
        return moveCameraToLocation(location, zPos, 0, 100);
    }
    
    /**
     * Gradually moves the camera to a specified location;
     * @param location The new camera location.
     * @param zPos The new cameraHeight, in positions.
     * @param constantSpeed The constant linear camera movement speed as positions per cycle.
     * @param variableSpeed The variable linear camera movement speed as promile of what's left. Max 99, 100 is instant.
     * @return The action sender instance, for chaining.
     */
    public ActionSender moveCameraToLocation(Location location, int zPos, int constantSpeed, int variableSpeed){
        PacketBuilder bldr = new PacketBuilder(166);
        bldr.put((byte)(location.getLocalX(player.getLocation())));
        bldr.put((byte)(location.getLocalY(player.getLocation())));
        bldr.putShort(zPos);
        bldr.put((byte)constantSpeed);
        bldr.put((byte)variableSpeed);
        player.write(bldr.toPacket());
        return this;
    }
    
    /**
     * Instantly turns the camera to look at a specified location;
     * @param location The new camera location.
     * @param zPos The new cameraHeight, in positions.
     * @return The action sender instance, for chaining.
     */
    public ActionSender turnCameraToLocation(Location location, int zPos){
        return turnCameraToLocation(location, zPos, 0, 100);
    }
    
    /**
     * Gradually turns the camera to look at a specified location;
     * @param location The new camera location.
     * @param zPos The new cameraHeight, in positions.
     * @param constantSpeed The constant linear camera movement speed as angular units per cycle.
     *  In the XY angle there are 2048 units in 360 degrees.
     *  In the Z angle is restricted between 128 and 383, which are the min and max ZAngle.
     * @param variableSpeed The variable linear camera movement speed as promile of what's left. Max 99, 100 is instant.
     * @return The action sender instance, for chaining.
     */
    public ActionSender turnCameraToLocation(Location location, int zPos, int constantSpeed, int variableSpeed){
        PacketBuilder bldr = new PacketBuilder(177);
        bldr.put((byte)(location.getLocalX(player.getLocation())));
        bldr.put((byte)(location.getLocalY(player.getLocation())));
        bldr.putShort(zPos);
        bldr.put((byte)constantSpeed);
        bldr.put((byte)variableSpeed);
        player.write(bldr.toPacket());
        return this;
    }
    
    /**
     * Stops all cinematics (including earthquakes)
     * @return The action sender instance, for chaining.
     */
    public ActionSender stopCinematics(){
        player.write(new PacketBuilder(107).toPacket());
        return this;
    }
    With a combination of move and rotate, you can make some nice camera movements.
    Reply With Quote  
     

  3. Thankful users:


  4. #3  
    Registered Member
    Join Date
    Aug 2012
    Posts
    136
    Thanks given
    10
    Thanks received
    23
    Rep Power
    11
    Thank you so much! Propably first person that gives right ansver at first! I love you!
    Reply With Quote  
     

  5. Thankful user:



Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. [help] Construct Map Region Packet - 317
    By braybray125 in forum Help
    Replies: 3
    Last Post: 08-10-2012, 11:55 PM
  2. [hyperion] camera packets
    By ICEAuthority in forum Snippets
    Replies: 5
    Last Post: 01-23-2012, 12:02 AM
  3. Replies: 8
    Last Post: 07-23-2010, 02:18 AM
  4. Moving Camera - frames
    By R0cky 0wnz in forum Snippets
    Replies: 14
    Last Post: 07-11-2009, 05:24 PM
  5. [525] Move camera packet
    By Encouragin in forum Snippets
    Replies: 4
    Last Post: 02-17-2009, 09:56 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
  •