Block grab (like gravity gun)

Discussion in 'Archived: Plugin Requests' started by Byamarro, Feb 12, 2013.

  1. Offline

    Byamarro

    Is it possible to make sth like this?


    ( 1:43 )
     
  2. Offline

    drtshock

    Just by the looks of the cover here, no. You can't add items with Bukkit.
     
  3. Offline

    LaxWasHere

    You can however re texture stuff, and just convert the blocks into entities.
     
  4. Offline

    RingOfStorms

    drtshock I think he is asking for something like the portal gun mod. All it does is pick up blocks and then you can throw them. Which with the falling block entities could be possible, no? Doesn't need a whole new gun item, can just be a configured item.
     
  5. Offline

    drtshock

    /me watches video this time.
    Oh I see, the levitation. Yeah that would be possible :) Pretty interesting actually.
     
    RingOfStorms likes this.
  6. Offline

    Byamarro

    Yea I don't want new weapon. I just want to make that player can grab configured blocks (+ WorldGuard & Factions Hook) in hands and lob them if He want.
    Will anyone do it?
     
  7. Offline

    Ugleh

    Wont work exactly like in the video. Bukkit can do something like this just not as amazing looking.
    The way the block moves when picked up looks like its not an actual block but maybe part of the gun at the moment, seeing as you cant set a block to a float position but only integers.. not sure if you understand what im saying, however I can create something simple as a recording to see if you want me to still make it.

    However picking up players will be simple.
     
  8. Offline

    Byamarro

    But You know that there are Falling Block entities (like fallling sand) and it works for most blocks isn't it?
    They don't need to be aligned to grid (I think that You mean this by telling me about integer values).


    Good example of plugin that uses fallling block entities is Block Lobber.
     
  9. Offline

    Ugleh

    BlockLobber does not really lob blocks besides sand and gravel.
    Not every block has the falling block entities as of yet, until bukkit updates.
    Well, in the latest update 13w06a (Feb 7th)
    • FallingSand support for block IDs > 128
    However most important blocks are below id 128 anyways, and only the brand newest blocks are past 128, like Emerald Ore, Anvil, exc. Ill see what I can do when I get home.
     
  10. Offline

    TKramez


    This is wrong. I have created falling blocks of blocks below 128. See video for proof with netherrack
    https://www.dropbox.com/s/zfnjyppaghb9rqk/Plague Demo_v0.2.0.wmv
     
  11. Offline

    Ugleh

    > means greater than. For a person considered a programmer you should know this.

    Anyways here is my test on how it would look if I did it.
    Although, this is by the players target block, and not a ray cast. I should later instead do a ray cast.

     
    XlegitXcrazymanX likes this.
  12. Offline

    TKramez

    Ah I misunderstood. I thought you meant only blocks greater than 128 were currently supported. I get it now
     
  13. Offline

    Ugleh

    Came home, did about an hour of coding. This is what I got.


    You can notice at some points in the video the bedrock shares the same space as another block. This should not happen, and only happens if there is no free block from distance 5-0. So i think once the getTargetBlock distance is 0 and its still not a free slot, I think the player should be pushed back, just like in Gmod.
     
  14. Offline

    RingOfStorms

    Ugleh are you just spawning and removing it every tick? Or are you updating the vector? Maybe you should see if you can do it smoother with vectors.
     
  15. Offline

    Ugleh

    I cant. I tried, the block falls and the entity dies. Even when I canceled the entity from dieing it dies when i try to update the vector.
     
  16. Offline

    drtshock

    Ugleh Put this on github? :)
     
    XlegitXcrazymanX likes this.
  17. Offline

    Ugleh

    This is all coded as a test to see how it visually would look. It kind of looks good, so I may create it.. not quite sure yet. Ill keep tweaking the code to look more like the effects of a gravity gun.

    https://github.com/Ugleh/GravityGun/tree/master/src/com/ugleh/gravitygun

    Test 3
    Figure id finish the left click process before I start the right click launch. However for now right click just drops the block.


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

    Byamarro

    If we compare test vid and DisguiseCraft - in ur vid block tries to fall. In DisguiseCraft this problem don't happen. Why?
     
  19. Offline

    Ugleh

    DisguiseCraft isn't an Entity, I wanted the block to look like its shaking, as if it still has some gravity to it. Should I not?I can change it from being an Entity to just a regular block, however that may cause more issues in the long run.
     
  20. Offline

    Byamarro

    It must be entity in dusguise craft because it's not aligned to grid. When You're disguised as block and You run then block move smoothly.

    Actually if it shake it looks like glitched :/
     
  21. Offline

    Ugleh

    I thought originally you meant Block Disguise. The reason it doesn't shake is because its on the ground.. Just like in my video. When the blocks are on the ground in my video they dont shake.

    The falling shake is clientside anyways, nothing I can do about it.

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

    Byamarro

    Can't You assign him vector that will have equal power to gravity so it will negate gravity?
    Example: gravity power =1, "Up" vector power = 1
    the resultant forces = 0;
     
  23. Offline

    Necrodoom

  24. Offline

    Ugleh

  25. Offline

    Necrodoom

    yes. it looks identical when you lob lava, fire, or wood, and when you lob sand and gravel. did you try it out?
     
  26. Offline

    Ugleh

    Must of been lag because it did not look like the sand. I lobbed sand and then stone, both looked different.

    setting the velocity to y= 0.1 I get a slightly less shaky effect, ill record it later.

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

    Byamarro

  28. Offline

    xXShadowGuy3Xx

    So is this going to be made into an actual plugin?
     
  29. Offline

    logangorence

    Sounds like it, it would be a great plugin. I would love it to just play around with!
     
  30. Offline

    xXShadowGuy3Xx

    Well, If so it will be a pretty big part of my server if i can make my plans work :p
     

Share This Page