Page 1 of 1

Construct, Connective, and Build Helping

PostPosted: Wed Apr 24, 2013 00:31
by ashenk69
The title gives none of these mods any justice, but I have been working on these for quite some time. I didn't want to clutter the forum with 3 mod posts so I just decided to combine these but I did put them in separate repositories so it is easy to download them.

License: WTFPL

CONSTRUCT
https://github.com/metalstache/construct
This is probably the largest out of the 3. It adds 2 constructs you can build; A furnace and a stockpile(aka chest) and also a hammer for building. The hammer is crafted by
I = Steel Ingot
S = Stick
| | I | |
| I | S | I |
| | S | |
The hammer allows you to create the constructs. To adjust the settings like which recipe and which corner you want to build from, open its menu by right clicking with it. This menu is created through the tools metadata so there is actually only one tool registered through minetest.
|0| |0|
|0|
|1| |0|
|stockpile|
Each corner button represents a corner and the center one determines the front or back. The bottom button is the current recipe used to check against. Click on it to open the recipe selection menu and choose which you want. When you build with the hammer there will be 3 particles that appear on the 3 expected outer sides of the corner. These are meant to help in where to hit it.

The 2 constructs are not normal crafting recipes but instead building recipes. To build a stockpile, build a 2x2x2 box of wooden planks. Then choose the recipe in your hammer, choose a position to build it from and then hit that corner. The furnace works the same way but requires a 3x3x3 of cobblestone with a torch placed in the middle block.
STOCKPILE
2x2x2
2 pages of inventory and also 2 sort functions. Vertical and Horizontal sorts.
Pipeworks Supported

FURNACE
3x3x3
Fuel burns for 2x longer.
Pipeworks Supported

CONNECTIVE
https://github.com/metalstache/connective
Creation of Minecraft's connective textures. Currently only wooden planks work. Pretty self explanatory. Default wood is overwritten to use its construct function to check for neighbors and then update its neighbors in return.

BUILD HELPING
https://github.com/metalstache/building_helper
A function that I think has needed to be put into Minetest for a while. There are really only 2 functions. These do not check in your hotbar so things in your hotbar will not be moved around only things in your bottom inventory.
BUILDING
When you run out of whatever you are building in your hand, this will look for a stack within your inventory and put it into your hand.
DIGGING
Similar to Building but works for tools. When a tool breaks it will be replaced if there is one in your inventory to replace it with.
The next 2 functions are only active during creative mode.
EYE DROPPER
When holding nothing, right click on a node and you will now be holding that node.
CLEAR INVENTORY
/invclear - clears the current player's inventory

PostPosted: Wed Apr 24, 2013 00:42
by Traxie21
Very nice and useful!

PostPosted: Wed Apr 24, 2013 01:51
by jojoa1997
Uh there is nothing iiiiiiiiin the reeeeeeeepos. Has thesssssssse been released yet??

PostPosted: Wed Apr 24, 2013 02:32
by ashenk69
Sorry for that, I forgot to publish them to GitHub. They should be there now.

PostPosted: Wed Apr 24, 2013 03:01
by jojoa1997
mine Mine ALL MINE!!!!!I love the wood.

PostPosted: Thu Apr 25, 2013 04:48
by ashenk69
Building Helper: New warning function for tools that are about to break. Tools at 80% when used will display a warning texture below the cross-hair to remind the player their tool is close to breaking. If you are using a version that doesn't have hud support then remove the else if statement block that has the comment --HUD WARNING. Otherwise, it will crash every time your tool is about to break.

PostPosted: Thu Apr 25, 2013 05:09
by kaeza

PostPosted: Thu Apr 25, 2013 13:06
by ashenk69

PostPosted: Thu Apr 25, 2013 16:17
by ashenk69
Connective: Added 3d connective texture support. There isn't an implementation of it yet, but I plan on doing glass.

PostPosted: Fri Apr 26, 2013 03:41
by ashenk69
Just found out through testing that glass connective won't be possible. Currently a drawtype of glasslike only accepts one texture. Even if a table is defined it only uses the first entry. The only way I could get it to work is if I set to a normal node but then you lose the affect of glasslike.

PostPosted: Mon Apr 29, 2013 15:53
by ashenk69
Connective: I haven't commited this yet, but I have changed glass to work with the new glasslike-frame drawtype. I'll comment the code block out so it is more compatible with older versions. It would be useful if version checking would be implemented.
I have also been working on the 3D connective code. I found out that there are actually a lot more things I needed to do before it would work properly. I'm almost there though.

PostPosted: Mon Apr 29, 2013 16:50
by rubenwardy
You can do

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if minetest.hud_add then

end


to check to see if the gui is available.

PostPosted: Mon Apr 29, 2013 17:01
by ashenk69
I'm not so sure you can do that check. The hud_add is a function within the player and not minetest. Unless I am wrong that block of code would actually never execute.

PostPosted: Tue Apr 30, 2013 16:10
by rubenwardy
ashenk69 wrote:I'm not so sure you can do that check. The hud_add is a function within the player and not minetest. Unless I am wrong that block of code would actually never execute.


Do I have to write untested next to every script I give examples of?

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if player.hud_add then

end
then

PostPosted: Tue Apr 30, 2013 18:31
by ashenk69
It isn't that you should always write your code is untested, but when you write your statement with confidence that this is what you need to do to check for that. I took that as being code that you have tested and know works. I still haven't found a sure fire way of checking for HUD support or not.

PostPosted: Tue Apr 30, 2013 18:47
by rubenwardy

PostPosted: Wed May 01, 2013 15:48
by rubenwardy
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
table:function()


is short hand for

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
table.function(self)


self is a variable to the table.

In my pull request, you need to check if table.function exists, not execute it.
Because of this, table:function() would not work.

PostPosted: Wed May 01, 2013 16:15
by ashenk69
Thanks for that I didn't know that the ":" accessor was short hand for "." and self.

PostPosted: Sat May 18, 2013 20:52
by ashenk69
Build Helper: Added 2 new functions. Eye dropper lets you pick out nodes without having to dig them up. /invclear clears the players main inventory. Both of these functions are only usable in creative mode.