The Meaning of Life, the Universe, and Everything.
Location:
Auckland
Join Date:
9/20/2014
Posts:
126
Minecraft:
softmage114486
Xbox:
softmage114486
Member Details
Hello i am softmage and i have just discovered something pretty cool when i was playing around with custom blocks!
If you have mad a custom block before then you will know of the Block.setShape(); function and you will know how limited it is as to setting the shape of the block...
Well i have discovered a way to make blocks with more then just one basic shape, with this you can make chairs with four legs, a seat and a back rest that all fit into the space of one block (16*16) and only using .js!!!
If you look at the attached photos you will see an odd looking block sort of like an upside down two legged table but it is only 16*16 px like a normal block, now i am going to show you how i did this, it is not complicated but it might not be very useful at the moment...
simply copy and paste the code below and use tmi to get the blocks
Next get the blocks and then a third normal block like dirt, use the dirt and make a 3x1 dirt pillar thing, use "250" and tap the bottom dirt block, use "251" and tap the middle dirt and the same for 252 except tap the third dirt, then break the dirt! Make sure you do this all on the same side of the dirt tower too!
As you can see in the code above the y axis of the blocks has been dropped down so all three occupy the same block space when really it is actually 3 blocks high, now like I said before this might nkt be very usefull but I hope you guys like it, play around with the code and add more blocks and comment what you can make !
The yellow and orage clay is there to show that is is 16*16
Also this is probably most likely to be used by people who make maps and mods to go with them, like you could make chairs for a cafe in a city map, or fire hydrants for the street so on, I hope you guys like it
ATTACHMENTS
Screenshot_2015-07-04-15-05-39
Screenshot_2015-07-04-15-04-34
Rollback Post to RevisionRollBack
This is my signature..
clicked block quote Hey..How do i turn it off?Help! I'm scared This is my life now...
The Meaning of Life, the Universe, and Everything.
Location:
Auckland
Join Date:
9/20/2014
Posts:
126
Minecraft:
softmage114486
Xbox:
softmage114486
Member Details
If cubik is a software then I don't know how it would work, this is just straight code, its creating custom blocks that appear to have lost of faces, when really it doesn't it is just forced into the same space, like in the images above, (what you are seeing is three separate blocks forced into one space) so really it is just multiple blocks having different offsets which i used to make them occupy the same block space, its kind of hard to explain it sorry
Rollback Post to RevisionRollBack
This is my signature..
clicked block quote Hey..How do i turn it off?Help! I'm scared This is my life now...
The Meaning of Life, the Universe, and Everything.
Location:
Auckland
Join Date:
9/20/2014
Posts:
126
Minecraft:
softmage114486
Xbox:
softmage114486
Member Details
Think of it this way, if we take a regular block, we can move its offset by using the Block.setShape(blockId, x1, y1, z1, x2, y2, z2); function, a normal block is 0, 0, 0, 1, 1, 1, (this replaces x1-z2) this is saying start the block at xyz 0 and finish it at xyz 1, a slab would be, 0,0,0,1,0.5,1 or 0,0,0,1,8/16,1 so it starts at xyz0 and finishes at xz 1 y 0.5, now using this we can change its offset by doing this,
Block.SetShape(blockId, 0, -1, 0, 1, 0, 1); so say we tapped a block at x0,y64,z0, using the block we made, it would be physically placed at x0,y65,z0 but we would see it at y64 becaus although it is a 16*16 block it has been pushed down a block, to break it you would need to break the block at y65, hopefully this can help a bit, like I said its hard to explain
Rollback Post to RevisionRollBack
This is my signature..
clicked block quote Hey..How do i turn it off?Help! I'm scared This is my life now...
Hello i am softmage and i have just discovered something pretty cool when i was playing around with custom blocks!
If you have mad a custom block before then you will know of the Block.setShape(); function and you will know how limited it is as to setting the shape of the block...
Well i have discovered a way to make blocks with more then just one basic shape, with this you can make chairs with four legs, a seat and a back rest that all fit into the space of one block (16*16) and only using .js!!!
If you look at the attached photos you will see an odd looking block sort of like an upside down two legged table
but it is only 16*16 px like a normal block, now i am going to show you how i did this, it is not complicated but it might not be very useful at the moment...
simply copy and paste the code below and use tmi to get the blocks
Block.defineBlock(250, "§1My Block 1", [["stone", 0]], 3, false, 0);
Block.setShape(250, 0, 0, 0, 1, 1/16, 1);
Block.defineBlock(251, "§2My Block 2", [["stone", 0]], 3, false, 0);
Block.setShape(251, 12/16, -1, 12/16, 1, 0, 1);
Block.defineBlock(252, "§3My Block", [["stone", 0]], 3, false, 0);
Block.setShape(252, 0, -2, 0, 4/16, -1, 4/16);
Next get the blocks and then a third normal block like dirt, use the dirt and make a 3x1 dirt pillar thing, use "250" and tap the bottom dirt block, use "251" and tap the middle dirt and the same for 252 except tap the third dirt, then break the dirt! Make sure you do this all on the same side of the dirt tower too!
As you can see in the code above the y axis of the blocks has been dropped down so all three occupy the same block space when really it is actually 3 blocks high, now like I said before this might nkt be very usefull but I hope you guys like it, play around with the code and add more blocks and comment what you can make
!
The yellow and orage clay is there to show that is is 16*16
Also this is probably most likely to be used by people who make maps and mods to go with them, like you could make chairs for a cafe in a city map, or fire hydrants for the street so on, I hope you guys like it
That is pretty cool I am going to get some friends and we will work with this to make a chair that you can set and and possibly make a car.
Just remember that it can get quite complicated the more blocks you add in the same block space, good luck and send me a photo once its done
ok it might be a rather big chair because of how they work but I will work on making it all smaller
another thing is you dont only need to do it using the y axis you can use x and z i just used y for testing
yeah ok
could you explain the whole thread more easly? i am making custom blocks with cubik and want to understand what you mean
If cubik is a software then I don't know how it would work, this is just straight code, its creating custom blocks that appear to have lost of faces, when really it doesn't it is just forced into the same space, like in the images above, (what you are seeing is three separate blocks forced into one space) so really it is just multiple blocks having different offsets which i used to make them occupy the same block space, its kind of hard to explain it sorry
Think of it this way, if we take a regular block, we can move its offset by using the Block.setShape(blockId, x1, y1, z1, x2, y2, z2); function, a normal block is 0, 0, 0, 1, 1, 1, (this replaces x1-z2) this is saying start the block at xyz 0 and finish it at xyz 1, a slab would be, 0,0,0,1,0.5,1 or 0,0,0,1,8/16,1 so it starts at xyz0 and finishes at xz 1 y 0.5, now using this we can change its offset by doing this,
Block.SetShape(blockId, 0, -1, 0, 1, 0, 1); so say we tapped a block at x0,y64,z0, using the block we made, it would be physically placed at x0,y65,z0 but we would see it at y64 becaus although it is a 16*16 block it has been pushed down a block, to break it you would need to break the block at y65, hopefully this can help a bit, like I said its hard to explain