[Mod] More Chests [0.0] [chests_0gb_us]

User avatar
0gb.us
Member
Posts: 841
Joined: Sun Sep 16, 2012 01:55
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

Okay, thanks!

I can't work on building this right now, as I have several other things I'm working on at the moment, but I WILL get back to this, and that will be a big help when I do. (I am working on the plan for this, I just am not setting down and writing the code right now.)
4aiman wrote:Edit: beware of /clearobjects using entities
Yeah, way ahead of you on that. I'm not sure how to get around that without storing the inventory in the player, but that would allow the player to only have one chest following them. It would also require the chest to disappear when they log off ....

All I can think to do right now is attack a warning to the chest.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

0gb.us wrote:All I can think to do right now is attack a warning to the chest.
Why not set chest hp to 0 on_leaveplayer ?

User avatar
0gb.us
Member
Posts: 841
Joined: Sun Sep 16, 2012 01:55
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

... because that would kill the entity, and all the items in its inventory would be lost. How would that be better than waiting for /clearobjects to kill it?

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

0gb.us wrote:... because that would kill the entity, and all the items in its inventory would be lost. How would that be better than waiting for /clearobjects to kill it?
Of course you should store inventory somewhere beforehand!
And I don't think I should say that /clearobjects is very slow and has it's reasons to be slow.

User avatar
rarkenin
Member
Posts: 668
Joined: Tue Nov 20, 2012 20:48

by rarkenin » Post

The formspec could be synched with a player's hidden inv on action, but then you could only have one such object...
Admin pro tempore on 0gb.us:30000. Ask me if you have a problem, or just want help.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

I got that already. But what keep one from using some file with tables to store inventories? Just like sethome or warps mods do? (they're storing, but not inventories)
If the inventory's owner is not online, then files should be used anyway so when he/she'll come back he/she would get his/her stuff back.
Last edited by 4aiman on Sat Jan 19, 2013 12:19, edited 1 time in total.

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Post

Ogb.us if you do make a follower with an inventory could you post here please? Since technically it is a chest
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests

User avatar
0gb.us
Member
Posts: 841
Joined: Sun Sep 16, 2012 01:55
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

Yes, I'll post it if I figure it out.

The problem with storing it in a file, is there would need to be some sort of unique identifier for each following chest. Insuring no is no identifier reuse in a non-hacky way would be difficult to figure out. Not only that, but I still haven't figured out how to save an inventory to a file, which I also need for that mega wifi chest.

The wifi chest will happen, I just need time to figure it out, but I'm not sure the following chest can be done very well. I'll try when I can, but I have a lot to work on right now.

User avatar
rarkenin
Member
Posts: 668
Joined: Tue Nov 20, 2012 20:48

by rarkenin » Post

0gb.us wrote:Yes, I'll post it if I figure it out.
Not only that, but I still haven't figured out how to save an inventory to a file, which I also need for that mega wifi chest.
UUIDs aren't hacky... Just give each chest a UUID.
Admin pro tempore on 0gb.us:30000. Ask me if you have a problem, or just want help.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

Why not use player's name? One server - one 4aiman, one 0gb.us etc. The authentication using password when connecting to a server will ensure that 4aiman is 4aiman. Or at least someone who stole 4aiman's password if he's stupid enough to tell that to anyone.
Also you can cycle through the entities and check for 2 things: is this a chest? does it belongs to the disconnected player?
If both is yes then receive inventory via minetest.get_inventory()
and then cycle through the stacks of list by the name "main" to save name and count into the file. (Minetest can't serialize invref atm)

Edit:
Idea: before killing an entity, create a chest (maybe invisible and/or locked and/or not walkable) and store entity's inventory there
Last edited by 4aiman on Sun Jan 20, 2013 15:13, edited 1 time in total.

User avatar
0gb.us
Member
Posts: 841
Joined: Sun Sep 16, 2012 01:55
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

rarkenin wrote:
0gb.us wrote:Yes, I'll post it if I figure it out.
Not only that, but I still haven't figured out how to save an inventory to a file, which I also need for that mega wifi chest.
UUIDs aren't hacky... Just give each chest a UUID.
IDs aren't hacky, but I don't know a non-hacky way to make sure they are unique.
4aiman wrote:Why not use player's name? One server - one 4aiman, one 0gb.us etc. The authentication using password when connecting to a server will ensure that 4aiman is 4aiman. Or at least someone who stole 4aiman's password if he's stupid enough to tell that to anyone.
Also you can cycle through the entities and check for 2 things: is this a chest? does it belongs to the disconnected player?
If both is yes then receive inventory via minetest.get_inventory()
and then cycle through the stacks of list by the name "main" to save name and count into the file. (Minetest can't serialize invref atm)

Edit:
Idea: before killing an entity, create a chest (maybe invisible and/or locked and/or not walkable) and store entity's inventory there
Using the player's name causes it to only be possible for a player to have a single following chest, not multiple following chests. At that point, we might as well store the inventory in the player. So yes, there is only one 4aiman, but there in not necessarily only one following chest belonging to 4aiman.

The invisible chest would be hacky. Particularly because the chest would have to be not buildable_to, to prevent item loss. And it might be underwater. So we would have an odd patch of air that liquids can't flow through, and which cannot be built in. And if someone calls /clearobjects while people are logged in, those people are out of luck, and their chest contents are lost no matter what they do.

Thanks for the pseudo-serialization technique! No wonder I couldn't find it in the documentation when I was looking for it.

Ragnar
Member
Posts: 850
Joined: Thu Oct 25, 2012 15:19
Location: Estonia
Contact:

by Ragnar » Post

the WiFi chest should be called an ATM machine :D
it would make MUCH more sense :D
Are you saying that I put an abnormal brain into a seven and a half foot long, fifty-four inch wide GORILLA?

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

More than 1 following chests? O_o
That'll be totally COOL!!!
This way even offline one will be able to create his own glitching army-o-Wi-Fi-chests!
Well, that wouldn't glitch unless one wants a hundred and one minions ;)

I hadn't thought about buildable_to... there are a lot of unused space up in the sky. Well, forget I even mentioned that, 'cause using that IS hacky for sure :)
But the whole idea to create wi-fi chest instead of entity doesn't seem wrong to me - right now players have wifi chest as a block. So maybe make a compromise? When wifi chest is dug - create an entity of the following wi-fi chest. And if that get killed then add wifi chest to the player's inventory and store the contents of wifi chest in a bag (look into "bags" mod to depend on it or to take an idea of really vast inventory). The only difference with a bag will be the inaccessibility of the wi-fi chest contents from the inventory.

As for /clearobjects... Maybe we should create an "issue" at the github? Or ask someone, who can make a callback for "on_clear_objects", to do it? I got an impression that I'm somewhat annoying with my "issues", though.
It's only my suggestion, but I believe that not only /clearobjects should require a privilege but also have a parameter to specify the radius of the effect. Yes, we could simulate /clearobjects with radius, but I'm talking about changing /clearobjects itself.
How does /clearobjects works anyway? Anyone knows?

User avatar
0gb.us
Member
Posts: 841
Joined: Sun Sep 16, 2012 01:55
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

Ragnar wrote:the WiFi chest should be called an ATM machine :D
it would make MUCH more sense :D
They're called ATMs, as "ATM machine" is redundant. "ATM" means "automatic teller machine". So an "ATM machine" would be an "automatic teller machine machine".

I'll talk to my partner about that, and see if he likes the name change. It may require a texture redesign, and he might like the current textures or current name better. I manage the code, but other than that, this is his plugin.
4aiman wrote:More than 1 following chests? O_o
That'll be totally COOL!!!
This way even offline one will be able to create his own glitching army-o-Wi-Fi-chests!
Well, that wouldn't glitch unless one wants a hundred and one minions ;)
Huh. You do have a point. While a bit cumbersome to work with, that would basically give players an unlimited inventory ....
4aiman wrote:I hadn't thought about buildable_to... there are a lot of unused space up in the sky. Well, forget I even mentioned that, 'cause using that IS hacky for sure :)
But the whole idea to create wi-fi chest instead of entity doesn't seem wrong to me - right now players have wifi chest as a block. So maybe make a compromise? When wifi chest is dug - create an entity of the following wi-fi chest. And if that get killed then add wifi chest to the player's inventory and store the contents of wifi chest in a bag (look into "bags" mod to depend on it or to take an idea of really vast inventory). The only difference with a bag will be the inaccessibility of the wi-fi chest contents from the inventory.
Okay. that sounds doable. We don't even need the bag code though. The wifi chest already stores its information outside the node, in the players themselves. By getting the entity to use that same inventory space, items will not be lost, and can be accessed from elsewhere, preserving the wifi chest's intended functionality.

I think maybe a button in the chest's formspec might be a better idea than having it follow every time it is dug. I'll direct Rarkenin to this topic when I see him, and see what he thinks.
4aiman wrote:As for /clearobjects... Maybe we should create an "issue" at the github? Or ask someone, who can make a callback for "on_clear_objects", to do it? I got an impression that I'm somewhat annoying with my "issues", though.
It's only my suggestion, but I believe that not only /clearobjects should require a privilege but also have a parameter to specify the radius of the effect. Yes, we could simulate /clearobjects with radius, but I'm talking about changing /clearobjects itself.
How does /clearobjects works anyway? Anyone knows?
Nah, I don't think it's an issue in Minetest, but us trying to do things that shouldn't be in the game anyway. Storing inventories in objects was always a bad idea. Even with a callback function, any preservation of entity inventories would only be doable in a hacky way, in my opinion.

As for /clearobects, all I know is that it's handled in C++, not Lua. The Lua command just calls a C++ command (and sends a couple chat messages), but I forget which one.

User avatar
rarkenin
Member
Posts: 668
Joined: Tue Nov 20, 2012 20:48

by rarkenin » Post

Regarding WiFI chests->ATMs, I think that;s a great idea, so I;ll work on a texture redesign when I have time. Just the front, though.

Regarding UUIDs, they're known to be unique since they;re based on the MAC address of the machine, and the time, and it doesn't wrp around for years on end. Do something like rarkenin_UUID1, rarkenin_UUID2 using concatenation, or make a list of UUIDs for each player.
Admin pro tempore on 0gb.us:30000. Ask me if you have a problem, or just want help.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

the download does not work for me. when i unzip it gives me a tar
Last edited by jojoa1997 on Wed Jan 23, 2013 11:45, edited 1 time in total.
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
0gb.us
Member
Posts: 841
Joined: Sun Sep 16, 2012 01:55
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

jojoa1997 wrote:the download does not work for me. when i unzip it gives me a tar
Try unziping the tar. If that doesn't work, let me know, and I'll start posting zip files in addition to tarballs.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

i did and nothing came out
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
rarkenin
Member
Posts: 668
Joined: Tue Nov 20, 2012 20:48

by rarkenin » Post

jojoa1997 wrote:i did and nothing came out
The tarball works(or worked) for me.
Admin pro tempore on 0gb.us:30000. Ask me if you have a problem, or just want help.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.

User avatar
0gb.us
Member
Posts: 841
Joined: Sun Sep 16, 2012 01:55
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

jojoa1997 wrote:i did and nothing came out
Okay, I'll upload a zip.

My web server is not currently set up to handle zip downloads right now. I need to recode some stuff, then I'll get the zip up. Although, I'm getting pressure to update four different plugins as well, so I can't get this up right away. I have a week off from school now though, so I'll get this done soon.
rarkenin wrote:
jojoa1997 wrote:i did and nothing came out
The tarball works(or worked) for me.
I know the tarball works, it's just a matter of whether or not Jojoa1997 has the software needed to open it. I'd rather not make people install extra software that they don't want, so I'll start uploading zips along with the tarballs. If that format doesn't work, I have a few other formats my computer will compress in, but if tarball and zip don't cover it, I'm not sure the other formats will help.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

0gb.us wrote:Okay, I'll upload a zip.

My web server is not currently set up to handle zip downloads right now. I need to recode some stuff, then I'll get the zip up. Although, I'm getting pressure to update four different plugins as well, so I can't get this up right away. I have a week off from school now though, so I'll get this done soon.
Thank you and take your time.
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
0gb.us
Member
Posts: 841
Joined: Sun Sep 16, 2012 01:55
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

Okay, here we are: http://0gb.us/minetest/download.php?plu ... 0gb_us&zip

Please note that as I don't feel like keeping two archives of each past version, only tarballs of old versions will be available. A zip will only be provided for the very latest version.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

0gb.us wrote:Okay, here we are: http://0gb.us/minetest/download.php?plu ... 0gb_us&zip

Please note that as I don't feel like keeping two archives of each past version, only tarballs of old versions will be available. A zip will only be provided for the very latest version.
thanks. will you be adding the link to the first post.
Last edited by jojoa1997 on Thu Jan 24, 2013 12:22, edited 1 time in total.
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

i get an error saying that Google chrome and internet explorer cant display the webpage. could you make a zip from omploader.
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
lord_james
Member
Posts: 51
Joined: Sun Mar 11, 2012 22:06

by lord_james » Post

0gb.us wrote:You know what? I think it is possible. Entities CAN have inventories. I don't know how to make one follow you though. I haven't done much with entities. I've only made one, which was static, and I didn't even completely make it on my own. Zeg9 made part of it.
So... It's just a theory. It's possible create a node that place a entity like a chest and this chest is animated when you see in the inventory, isn't it?

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 6 guests