[SOLVED] Is It Possible? Climbing Walls.

Discussion in 'Plugin Development' started by SnowGears, Aug 10, 2012.

?

Do you think it is possible to give players the ability to climb walls like spiders do?

  1. Yes

    89.5%
  2. No

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

    SnowGears

    I am wondering is it possible to let players climb walls like spiders do? Thats pretty much it. And if you think there is a way, how would you personally go about coding that. Because I do not know where to start. Thanks! Looking forward to knowing more about this.
     
  2. Offline

    travja

    You would need to put a vine or a ladder on the wall and remove it as they go up to make the illusion.
     
    Tooner101 likes this.
  3. Offline

    SnowGears

    Oh I didn't event think of that. That would make things easier. Then I could keep destroying old one and making a new one on the wall where they are. The only problem is if they tried to climb an already existing vine or ladder it may destroy it behind them...
     
  4. Offline

    travja

    Just store their location in a list and when you are adding to the list and making the vine, just check to see if one is already there, if it is, don't store it.
     
    Tooner101 likes this.
  5. Offline

    SnowGears

    Thanks for the advice. I will try this later tonight and let you know how it goes.
     
  6. Offline

    skore87

  7. Offline

    SnowGears

  8. Offline

    WarmakerT

    I'm not sure, but maybe setting the block to a vine/ladder and sending a air block change to every player on that block?
    I don't know if this will work though, probably not :p
     
  9. Offline

    skore87

    I've personally experimented with changing player viewed blocks before and found it that you're able to even "fly" or walk on water with it as other players would view it. But you cannot go through a mountain for example with it and would have to change the actual world.
     
  10. Offline

    HON95

    As in changing the actual block to a ladder/vine, and sending a fake air update to the players? That would actually be the opposite of the solution, as the client needs to know the block is climbable.

    BTW, the server might kick the player, thinking it's fly hack, if the block is actually air. And if the player was to interact with the block, the real block could be sent to the player. As long as you're not manipulating the vanilla code anyways.
     
  11. Offline

    skore87

    There might be the possibility that something like NoCheatPlus would assume it is a flyhack, but worst case scenario you could either create the actual vine or hook into NCP. But there is no need to hide it to all the other players if all you are doing is making it is visible to just the climbing player.
     
  12. Offline

    HON95

    Actually, changing the block temporarily to a vine/ladder and sending a fake air update to all the other nearby players would work.
     
  13. Offline

    skore87

    Of course it would, but it is highly unnecessary.
     
    Tooner101 likes this.
  14. Offline

    SnowGears

    Ya the vine block will be somewhat hidden behind the player while he is climbing anyway.
     
  15. Offline

    skore87

    I'm kind of curious to see who voted No on the poll lol
     
    Tooner101 likes this.
  16. Offline

    WarmakerT

    I want to know why there is a poll actually xD
     
    Anrza likes this.
  17. Offline

    SnowGears

    I initially thought this would require something much more complicated than this. Just me making things more complicated than they need to be (as usual xD)
     
  18. Offline

    travja

    What do you still need to do?
     
  19. Offline

    HON95

    I honestly don't see how, but whatever...
     
    WarmakerT likes this.
  20. Offline

    skore87

    What I was saying is that you only need to fake the blocks for the individual, not server wide, nor would you need to actually place the block in the world, potentially causing grief to players' structures.
     
  21. Offline

    HON95

    When you put it that way, yeah that -would- be easier. But it could easily get buggy.
     
  22. The result is publicy visible. Just click on "1 Vote(s)" at the No line... ;)
     
  23. Offline

    SnowGears

    I am having trouble hiding the vines the player is on
     
  24. Offline

    travja

    I don't know if this will work but what would happen if you didn't call block.getState().update()?
     
  25. Offline

    SnowGears

    I never call that anyway... I am also having trouble getting if the player is near a wall and making the vines appear in the first place...

    Edit: I am trying to use playerMoveEvent to check but I don't know how to check if they are near a wall. Once I have that I can just spawn a vine block at my location but...
     
  26. Offline

    travja

    ok, if you never call it they won't be visible, to check if they are near a wall(PlayerMoveEvent) use: if(p.getLocation().getBlock().getRelative(BlockFace.NORTH).getType()!=Material.AIR) therefore saying that the north block is not air it must be something else then you can set it to vines, NOTE that is only north.... so you need to check what side has the wall, north east south west and then set their location as the vine.
     
  27. Offline

    SnowGears

    So just do the same thing for north south east and west? And then put vines on all of them? Seems like that would cause some errors...
    Like say the player is in a 2 block deep hole that is just one block wide
     
  28. Offline

    travja

    Actually, get what direction the player is looking, then get if their location and the relative block in the direction they are looking isn't air.. that would probably be better
     
  29. Offline

    SnowGears

    But then the player couldn't climb the wall looking sideways like they can do on a ladder correct?
     
  30. Offline

    WarmakerT

    You could just fly them up though :p
     
Thread Status:
Not open for further replies.

Share This Page