Page 1 of 2
Notice to mod developers: upcoming changes

Posted:
Mon Jan 16, 2012 22:59
by celeron55
This will be merged upstream in the near future (days or weeks):
http://c55.me/minetest/wiki/doku.php?id=changes:itemdefIt will break some of the mods and you might want to make an upgraded version of your mod beforehand so that it will be available when people need it.

Posted:
Mon Jan 16, 2012 23:32
by jordan4ibanez
:D thank you for fixing the hand and glass! that was my pet peeve :P

Posted:
Tue Jan 17, 2012 00:05
by neko259
You mean all registers in the mods will need to be changed to the new format? If so, I'll start adapting mine tomorrow :)

Posted:
Tue Jan 17, 2012 01:27
by MarkTraceur
I should note that I don't have time to do anything of the sort, and add_tool will probably need updating. Anyone is free to do so, or wait for me to get around to it in a month or so.

Posted:
Tue Jan 17, 2012 05:02
by rahonejm
Hey, here's something that i would like to see and i'm sure that many other people would:
A keyboard shortcut when collecting itens you've made in your inventory. EX:
| = 99 stick
| |
| = 99 ladders
| |
This would give me 99 ladders right? But the problem is, that you have to click twice to get one ladder. So, if i'm right, 99x2 = 198. This are 198 clicks for 99 ladders (when not lagged). Now, think with me, i need to use 5x99 sticks to get 99 ladders. Considering that you need 25 wood to get 99 sticks, you need 125 woods to get all the sticks. 125x2 = 250. This give me a total of 448 clicks for 99 ladders (again, when not lagged). Please consider doing a keyboard shortcut to get all the makeable itens you're doing. If this would possible, to make 99 ladders i would need only 5 clicks to make the sticks (99 sticks per block ) and 1 click to make 99 ladders!
What i mean to a keyboard shortcut, is like pressing shift then click. Think about it ;D
P.S I know that this is not the ladder recipe, for ladder would be even more clicks. Is just an example.

Posted:
Tue Jan 17, 2012 07:32
by MarkTraceur
rahonejm wrote:Hey, here's something that i would like to see and i'm sure that many other people would:
Please don't post this in the mods forum, it should go in the General Discussion. Especially not in this topic.

Posted:
Tue Jan 17, 2012 09:27
by rahonejm
MarkTraceur wrote:rahonejm wrote:Hey, here's something that i would like to see and i'm sure that many other people would:
Please don't post this in the mods forum, it should go in the General Discussion. Especially not in this topic.
Well, sorry about that, but this topic doesn't addresses only changes on modding so i tought that would be appropriate.

Posted:
Tue Jan 17, 2012 09:31
by neko259
I've noticed that furnace_burntime is deprecated and I should use new craft syntax. Formerly I used this parameter to check material flammability in my fire mod. How can I check it now?

Posted:
Tue Jan 17, 2012 09:41
by Nemo08
neko259 wrote:I've noticed that furnace_burntime is deprecated and I should use new craft syntax. Formerly I used this parameter to check material flammability in my fire mod. How can I check it now?
Shortcomings
It's currently not possible to retrieve the result of a crafting operation from Lua. ...
Fuel soon be craft, seems no way(((

Posted:
Tue Jan 17, 2012 09:43
by neko259
You can now use all fields allowed in item definitions.
Maybe I can use material.flammability for nodes from now?

Posted:
Tue Jan 17, 2012 19:02
by randomproof
neko259 wrote:You can now use all fields allowed in item definitions.
Maybe I can use material.flammability for nodes from now?
Most people use the "minetest.digprop_woodlike()" like functions that are defined in "data/builtin.lua" and none of those set "material.flammability" even in this patch.

Posted:
Tue Jan 17, 2012 19:09
by randomproof
I noticed that in the new defualt/init.lua file has the old style in node dug_item file. Is this still right?:
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
dug_item = 'node "default:dirt" 1',

Posted:
Wed Jan 18, 2012 07:27
by kahrl
@MarkTraceur
I might do it on the weekend if noone else did it by then.
@neko259
I don't know. Maybe once the furnace is completely redone in Lua, the cooking and fuel business will be moved again, possibly with registration functions implemented in Lua. Maybe a field material.flammability could indeed be added instead of fuel recipes, although that would mean if a mod wants to add flammability to an item defined by a different mod, it would have to redefine the whole item, but anyway doing so is not as useful as
adding cooking recipes to existing items. I don't really have time to think about this stuff now :/
@randomproof
Thanks, didn't spot that. The documentation at the top is outdated in that respect too. It works because the old format is still supported (for compatibility with old maps), but it should be changed.

Posted:
Wed Jan 18, 2012 17:24
by xyz
Will we somewhen be able to create our "crafting tables"? (like minecraft or "chemistry table", for example)? I think, for implementing this in current script api it needs at least callbacks like on_put_item/on_take_item (that could return true if everything OK or false if player can't take/put this => locked chests functionlity. This callbacks should work for every inventory in our chest/node - for example, some inventories can be "read only", some - fully accessible) and inventory preview support (currently we cannot determine from player's craftresult if it is preview or not).

Posted:
Sat Jan 21, 2012 02:06
by Temperest
I love the new documentation :)
Very useful since I couldn't find descriptions for a lot of parameters before.
Great work and keep it up!

Posted:
Sun Jan 22, 2012 12:22
by celeron55
This is going upstream today in some hours from now.
Check out the latest API changes in the
wiki (there have been some since the first post in this thread).

Posted:
Sun Jan 22, 2012 21:27
by neko259
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
minetest.register_craft({
type = "fuel",
output = "default:leaves",
burntime = 3,
})
Needs to be changed to
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
minetest.register_craft({
type = "fuel",
recipe = "default:leaves",
burntime = 3,
})
Otherwise it doesn't work.

Posted:
Sun Jan 22, 2012 21:37
by kahrl
@neko259
Indeed, thanks. Fixed.

Posted:
Sun Jan 22, 2012 21:51
by neko259
How can I check node flammability now? furnace_burntime is deprecated, and material.flammability is inaccessible.

Posted:
Mon Jan 23, 2012 02:16
by kahrl
@nekoi259
This might take a while, sorry! First of all, flammability of nodes in the world should be unrelated to how long they burn in the furnace (e.g. mese burns very well in the furnace, but you might not want it to catch fire in the world so easily, that might be devastating). celeron55 and I have been talking about building nodes out of material components, one of those components would be "flammable". These components are basically nothing different than custom fields in node definitions, but with a (hopefully) well understood way how they interact with other nodes and material components and items. For example, digging duration and tool wear would be decided by the tool based on the material components that a node has. Obviously nothing of this is near any kind of implementation yet. If you want, you can
read the
discussion on IRC about this stuff.
For now the best way is probably to check material.cuttability and material.weight. Of course this is far from ideal.

Posted:
Mon Jan 23, 2012 06:27
by neko259
For now the best way is probably to check material.cuttability and material.weight. Of course this is far from ideal.
How does weight show if the node is flammable?

Posted:
Mon Jan 23, 2012 06:36
by neko259
Hmm. Using cuttability works. I wish API to be much more descriptive and have comments for every parameter :)

Posted:
Mon Jan 23, 2012 09:25
by kahrl
I meant using weight to determine how long a node burns, and cuttability to determine how easily fire spreads to it.

Posted:
Mon Jan 23, 2012 14:26
by neko259
Weight doesn't show if the node flammable or not (like stone for example). For now I use cuttability, but I'll try to change it and make more realistic.

Posted:
Tue Jan 24, 2012 19:00
by jn
kahrl,
since your update the inventory images of node-like items that don't have their inventory_image explicitly set to minetest.inventory_cube(...) or something else are not shown on my system that doesn't support render-to-target.
Slightly further investigation has shown that the "if(rtt == NULL)" block isn't reached for these items (generate_image probably isn't even called).
Thanks --jn

Posted:
Tue Jan 24, 2012 19:05
by kahrl
Hmm. How were they shown before (or are with inventorycube) if render-to-target isn't supported?
EDIT: Oh, I see, it just rendered the texture of one side. I guess something similar should be done at itemdef.cpp:420.

Posted:
Tue Jan 24, 2012 20:28
by jn
Maybe updateTexturesAndMeshes could call generate_image with the right options / texture name. (just speculating)
EDIT: btw, you can simulate rtt inavailability by changing line 423 of mesh.cpp.

Posted:
Tue Jan 24, 2012 20:51
by kahrl
This works (after the call to generateTextureFromMesh)
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
// Handle the case where render-to-texture
// is not supported
if(def->inventory_texture == NULL)
{
def->inventory_texture =
tsrc->getTextureRaw(f.tname_tiles[0]);
}

Posted:
Tue Jan 24, 2012 21:45
by randomproof
I noticed that chests with stuff in them disappear in the client if they are dug. They stay in the server but not in the client.

Posted:
Wed Mar 07, 2012 16:54
by jn
@randomproof: I have a fix (or workaround)
here.