Ideas regarding item metadata, and knockback

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Ideas regarding item metadata, and knockback

by orwell » Mon Nov 23, 2015 11:50

The item metadata string is useful for some mods, but it is not used by the engine itself.
There should be a way to override some properties of the item definition with item metadata.

For example, the item name should be changeable, to allow for named swords used in story maps or such things, same goes for damage groups of tools.
Edit: I forgot item enchantments! (or similar stuff)

To do this, it is necessary to transform the metadata string into a table. For the save format, nothing has to be changed, since that table can be serialized. It is some work to keep compatibility to the string metadata, but it should be possible.

Another suggestion: add another special damage/armor group to provide knockback functionality. Knockback in damage group tells how far entities are knocked back, armor group is knockback resistance. This would provide smoother knockback effects on client, since this can be implemented client-side.
(entities not having knockback armor group just don't get knocked back)
Last edited by orwell on Sat Jan 02, 2016 16:11, edited 1 time in total.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: Ideas regarding item metadata, and knockback

by everamzah » Mon Nov 23, 2015 12:29

Having to remove a book from a chest and then wield and use it in order to read its contents is a surprisingly large amount of work. It'd be nice to hover over the item and read its contents in a tooltip.
 

User avatar
yyt16384
Member
 
Posts: 46
Joined: Mon Nov 03, 2014 12:16
GitHub: yyt16384
IRC: yyt16384
In-game: yyt16384

Re: Ideas regarding item metadata, and knockback

by yyt16384 » Mon Nov 23, 2015 13:26

So we already have item metadata support? I think I missed it when reading lua_api.txt last time.

It's a great feature. I can start to write a nice mod with this. :)
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: Ideas regarding item metadata, and knockback

by orwell » Mon Nov 23, 2015 14:45

yyt16384 wrote:So we already have item metadata support? I think I missed it when reading lua_api.txt last time.

It's a great feature. I can start to write a nice mod with this. :)

Yes we have, but remember, ATM it has to be a string.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Ideas regarding item metadata, and knockback

by rubenwardy » Mon Nov 23, 2015 15:14

Meta data for stacks guide:

http://rubenwardy.com/minetest_modding_ ... l#metadata

Strings are a list of bytes, so you could represent anything in them. Doesn't mean it's always a good idea. Use Minetest.serialize to turn tables into strings.

Also, there is an old pr which adds node def based on node metadata.
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

Re: Ideas regarding item metadata, and knockback

by BrunoMine » Sat Jan 02, 2016 15:39

I wish there was the knockback function.
Is there a mod that allows this?
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: Ideas regarding item metadata, and knockback

by orwell » Sat Jan 02, 2016 15:58

Tenplus1's mobs redo has this, but it's server side and therefore laggy.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: Ideas regarding item metadata, and knockback

by orwell » Sat Jan 02, 2016 16:01

rubenwardy wrote:Strings are a list of bytes, so you could represent anything in them. Doesn't mean it's always a good idea. Use Minetest.serialize to turn tables into strings.

Yes, that was my idea for saving the metadata. But in order for the engine to actually do something with it, it has to be deserialized into a table.

Wait, are item stack metadata transferred to the client yet?
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Ideas regarding item metadata, and knockback

by rubenwardy » Sat Jan 02, 2016 16:06

Yes, I think they are.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Ideas regarding item metadata, and knockback

by kaeza » Sun Jan 03, 2016 03:48

There's more discussion about itemstack metadata on issue #3449 for those interested.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 10 guests

cron