Getting the 4 end corners of a schematic?

Discussion in 'Plugin Development' started by TheWolfBadger, Jun 16, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    TheWolfBadger

    How would I take the lengths and widths of a schematic and find the 4 corners of the schematic? I would then also need to take the 4 corners and make them visible on the ground to where the cursor moves. I then need to also make sure it doesn't overlap another structure. How would I go about all of this?
    ---
    Example:
    I have a building in a schematic. It is 10 by 10. How would I find the 4 end corners of this schematic with that info, and do the following I stated above?
    ---
    I then need to figure out how to take the schematic and register every block to store it's meta data or some kind of data so it's all the same. This way I can read the block when they point at it with their cursor and I can tell which player owns it.
    ---
    Thank you and if you have any questions, please ask, I will answer in due time. - Jack
     
  2. Offline

    Zombie_Striker

    @TheWolfBadger
    I'm assuming there is a way to get each block, and I'm asumming that the way you get the block is a Location value. If this is the case, then all you need to do is get block 0,0,0,/ max,0,0/ 0,0,max and max,0,max to get all corners.
     
  3. Offline

    TheWolfBadger

  4. Offline

    Zombie_Striker

    @TheWolfBadger
    Are you saying those all return the same coordinates, or that you think they are all the same?
     
  5. Offline

    TheWolfBadger

    @Zombie_Striker Oh I see what you mean. so those are all the coordinates for corners assuming the schematic starts at 0, 0, 0?
     
  6. Offline

    Zombie_Striker

    @TheWolfBadger
    Correct. If that is not the case and that 0,0,0 is the center of the build, then use -max/2 to get the corners.
     
  7. Offline

    TheWolfBadger

    @Zombie_Striker Also, any ideas on how I can make the selecting system where it shows the corners on the ground and moves with the cursor?
     
  8. Offline

    Zombie_Striker

    @TheWolfBadger
    player.setBlock() or player.updateBlock() or something like that will set the blocks at the given location to a the given type, without it actually doing anything. (all it's doing is sending false packets to the player, and once the player interacts with the block it turns back to what it should be)

    Try using that, and try getting the player.getTargetBlock(null,100....) to get the block the player is looking at.
     
  9. Offline

    TheWolfBadger

    @Zombie_Striker Yes I know this, but how do I show the 4 corners on the ground and it moves with the cursor being at the center spot. The corners would then move corresponding to the center block (where cursor is pointing)? thanks. - Jack
     
  10. Offline

    Zombie_Striker

    @TheWolfBadger

    If the curser will be the center spot, and (0,0,0) is one corner and (max,0,max) is the other, then (max/2, 0 , max/2) would be the center. The way you would set the blocks would be:
    Code:
    Location curser = player.getTargetBlock(...);
    Location dump = curser;
    dump.add(max/2,0,max/2);
    player.setBlocck(...);
    
    Location dump = curser;
    dump.add(max/2,0,-max/2);
    player.setBlocck(...);
    
    Location dump = curser;
    dump.add(-max/2,0,max/2);
    player.setBlocck(...);
    
    Location dump = curser;
    dump.add(-max/2,0,-max/2);
    player.setBlocck(...);
     
  11. Offline

    TheWolfBadger

    @Zombie_Striker Here's an example of what I mean, so maybe you will be able to help me out.
    [​IMG]
    In the picture you can see the green stained glass corners. As you move your cursor the corners move with it so that your cursor is always the center of the corners. How would I make this happen when I move the cursor with the corners I have obtained? Thanks. - Jack

    anyone?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 12, 2016
  12. Offline

    RingOfStorms

    Don't bump within 24 hours of the last post.

    And you will have to use the player move event and update what you show the player based on where they have moved their cursor.

    I see a clash of clans clone in the works...
     
  13. Offline

    TheWolfBadger

    @RingOfStorms Boom beach actually... Sorry for bumping so soon. Thank you.
     
  14. Offline

    crolemol

    @TheWolfBadger
    i know this server xD i see you redid the clash of clans plugin
     
  15. Offline

    TheWolfBadger

    @crolemol Making Boom Beach version actually. May partner with JupiterTree also.
     
  16. Offline

    crolemol

    @TheWolfBadger
    is that boom beach? where's the water
    PM: looking at nearly the same dock now :p
     
  17. Offline

    TheWolfBadger

    @crolemol Map hasn't been rendered yet with the api of the plugin yet. Made a prototype map which was modeled off of the clash of clan plot from JupiterTree's server.
     
  18. Offline

    crolemol

    @TheWolfBadger
    ah this should be in the work in progress section, would love to see it
     
Thread Status:
Not open for further replies.

Share This Page