[Mod] Inventory Plus [20120917.1] [inventory_plus]

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

[Mod] Inventory Plus [20120917.1] [inventory_plus]

by 0gb.us » Tue Nov 27, 2012 01:49

[mod] Inventory Plus [unknown version] [inventory_plus]

This is a simple plugin, which adds the ability for other plugins to add buttons for other menu pages to the player formspec. The original design is by Cornernote, but I'm maintaining it now.

New features include a more user friendly interface for players (the crafting grid displays at the same time as the buttons) and a removal of redundancy created in the creative inventory page in Minetest 0.4.4.

Copyright (C) 2012 cornernote, Brett O'Donnell <cornernote@gmail.com>

Code license: GPLv3
Image license: No images included.

Dependencies: none

Latest version: https://github.com/0gb-us/inventory_plus
Last edited by 0gb.us on Sat Mar 23, 2013 02:15, edited 1 time in total.
 

foxinsky
Member
 
Posts: 25
Joined: Fri Dec 14, 2012 11:56

by foxinsky » Wed Dec 26, 2012 10:23

Folks,could you please take a look at the following bug:

Bug occures when player try to login to the server. Minetest 0.4.4

11:18:39: ACTION[ServerThread]: zZz joins game. List of players: zZz
11:18:39: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error: ...est/world_minetest/worldmods/inventory_plus/init.lua:72: bad argument #1 to 'pairs' (table expected, got nil)
11:18:39: ERROR[main]: stack traceback:

In thread b7391700:
/build/buildd/minetestc55-0.4.4/src/main.cpp:1760: int main(int, char**): Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD b7391700:
#0 int main(int, char**)
(Leftover data: #1 Dedicated server branch)
(Leftover data: #2 virtual void ServerMap::save(ModifiedState))
(Leftover data: #3 void ServerMap::saveMapMeta())
Aborted
 

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

by 0gb.us » Wed Dec 26, 2012 16:09

This error isn't happening on my copy of 0.4.4.

What other plugins do you have installed? Perhaps inventory_plus isn't playing nicely with another plugin.
 

foxinsky
Member
 
Posts: 25
Joined: Fri Dec 14, 2012 11:56

by foxinsky » Wed Dec 26, 2012 21:48

0gb.us wrote:This error isn't happening on my copy of 0.4.4.

What other plugins do you have installed? Perhaps inventory_plus isn't playing nicely with another plugin.


Yep, looks like. I'll try check which mod is incompotible with inventory_plus.
 

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

by 0gb.us » Thu Dec 27, 2012 04:41

If you figure it out, let me know so I can fix inventory_plus if possible. Or, you could post a list of plugins you use, and I'll find the problem.
 

foxinsky
Member
 
Posts: 25
Joined: Fri Dec 14, 2012 11:56

by foxinsky » Thu Dec 27, 2012 06:59

It sounds strange, but error occures with only inventory_plus in worldmods.

~/mtest$ ls ./world_minetest/worldmods/
inventory_plus


07:57:15: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error: ...est/world_minetest/worldmods/inventory_plus/init.lua:72: bad argument #1 to 'pairs' (table expected, got nil)
07:57:15: ERROR[main]: stack traceback:

In thread b731f700:
/build/buildd/minetestc55-0.4.4/src/main.cpp:1760: int main(int, char**): Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD b731f700:
#0 int main(int, char**)
(Leftover data: #1 Dedicated server branch)
(Leftover data: #2 virtual void ServerMap::save(ModifiedState))
(Leftover data: #3 void ServerMap::saveMapMeta())


Line #72 from init.lua:

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
    for k,v in pairs(inventory_plus.buttons[player:get_player_name()]) do

Is it possible that at the moment of getting player name, core (minetest) doesn't know it?

UPD#1: No, core know it :

----cut form modyfied init.lua-----
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 page=="main" then                                                                                     
                -- buttons                                                                                       
                print('DBG. PlayerName: '..player:get_player_name())                                             
                print('DBG. buttons:'..inventory_plus.buttons[player:get_player_name()])                         
                local x,y=0,0                                                                                   
                for k,v in pairs(inventory_plus.buttons[player:get_player_name()]) do


---- cut from output-----
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
08:21:02: ACTION[ServerThread]: zZz joins game. List of players: zZz
DBG. PlayerName: zZz
DBG. PlayerName: zZz
08:21:03: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error: ...est/world_minetest/worldmods/inventory_plus/init.lua:75: attempt to concatenate field '?' (a nil value)


So as for me we have non-initialyzed buttons list.

end this code is not executing:

---cut from init.lua start from line#21
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
-- register_button                                                                                               
inventory_plus.register_button = function(player,name,label)                                                     
        local player_name = player:get_player_name()                                                             
        print('ready to check if nil')                                                                           
        if inventory_plus.buttons[player_name] == nil then                                                       
                inventory_plus.buttons[player_name] = {}                                                         
                print('buttons nil checking at 27')                                                             
        end                                                                                                     
        print('out of checking condition')                                                                       
        inventory_plus.buttons[player_name][name] = label                                                       
end                                                         
Last edited by foxinsky on Thu Dec 27, 2012 07:54, edited 1 time in total.
 

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

by 0gb.us » Fri Dec 28, 2012 04:01

When I move inventory_plus to worldmods, I still don't have the problem. Can you post a list of plugins you are using please?
 

foxinsky
Member
 
Posts: 25
Joined: Fri Dec 14, 2012 11:56

by foxinsky » Fri Dec 28, 2012 07:23

Sure, sorry.

3dforniture
4seasons
conifers
craft_guide
desert_uses
exchange
farming
farming_plus
locked_sign
minetest-protect-master
moreblocks
moreflowers
moreores
peaceful_npc
plantlife-master
unified_inventory
 

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

by jojoa1997 » Fri Dec 28, 2012 07:26

foxinsky wrote:Sure, sorry.

3dforniture
4seasons
conifers
craft_guide
desert_uses
exchange
farming
farming_plus
locked_sign
minetest-protect-master
moreblocks
moreflowers
moreores
peaceful_npc
plantlife-master
unified_inventory

unified_inventory does not work with inventory_plus. also if you decide to keep unified_inventory delete the creative mod in the default folder.
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

by 0gb.us » Fri Dec 28, 2012 19:06

jojoa1997 wrote:unified_inventory does not work with inventory_plus.


Yes, that's the issue.

unified_inventory is great, but it takes over the entire menu. No other menu-based plugins can be used with it. In truth, inventory_plus does the same thing, but it also provides an API for adding new menu pages.
 

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

by jojoa1997 » Wed Feb 06, 2013 01:58

when i use a mod like specialties or armor when ever i press a button that has an action it always sends me back to the creative menu.
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

by 0gb.us » Thu Feb 07, 2013 02:54

jojoa1997 wrote:when i use a mod like specialties or armor when ever i press a button that has an action it always sends me back to the creative menu.


That's an incompatibility between those plugins and creative. Those plugins SHOULD call inventory_plus.set_inventory_formspec() to set the formspec when the buttons are used, but it sounds like they are either calling player:set_inventory_formspec() directly or not setting the formspec at all, assuming it is already set. When creative mode is turned off, that works fine, but when creative mode s turned on, creative tries to hog the menu.

Report this in the specialties / armor topics, as I can't fix it on my end. Those plugins will need to be fixed themselves.
 

J-Block
Member
 
Posts: 39
Joined: Sun Dec 23, 2012 20:04

by J-Block » Wed Feb 27, 2013 02:36

The file downloaded as a file, not a zipped folder. I tried to make a folder for it named "inventory_plus" but I don't know how to make an "init.lua". The mod should be in a zipped folder form in the fist place anyway.
 

Temperest
Member
 
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Wed Feb 27, 2013 03:42

It's a tar.gz. A decent archiver will do the trick. On Windows (I assume you are using Windows), 7-zip is the best one around IMO.

http://7-zip.org/
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
 

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

by 0gb.us » Wed Feb 27, 2013 06:13

J-Block wrote:The file downloaded as a file, not a zipped folder. I tried to make a folder for it named "inventory_plus" but I don't know how to make an "init.lua". The mod should be in a zipped folder form in the fist place anyway.


By a "zipped folder", do you mean a .zip file? A .zip file is as much a file as anything else is.

Temperest wrote:It's a tar.gz. A decent archiver will do the trick. On Windows (I assume you are using Windows), 7-zip is the best one around IMO.

http://7-zip.org/


Yeah, if you're not on an operating system that supports .tar.gz (Might I recommend Linux Mint or Ubuntu?), 7-zip will do the trick.
 

User avatar
nomohakon
Member
 
Posts: 207
Joined: Fri Aug 10, 2012 16:34
IRC: nomohakon
In-game: nomohakon

by nomohakon » Wed Feb 27, 2013 14:25

0gb.us wrote:
Temperest wrote:It's a tar.gz. A decent archiver will do the trick. On Windows (I assume you are using Windows), 7-zip is the best one around IMO.

http://7-zip.org/


Yeah, if you're not on an operating system that supports .tar.gz (Might I recommend Linux Mint or Ubuntu?), 7-zip will do the trick.

Ehm, i use 7-zip and i have to unpack it twice. First .gz, then .tar.
"To learn who rules over you, simply find out who you are not allowed to criticize." - Voltaire
"Knowledge, like air, is vital to life. Like air, no one should be denied it." - Alan Moore, V for Vendetta
- - -
"To never die... and to conquer all, that is winning." ―Illyria
 

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

by rarkenin » Wed Feb 27, 2013 14:43

nomohakon wrote:Ehm, i use 7-zip and i have to unpack it twice. First .gz, then .tar.


On Linux, you're only a tar -xvzf file.tar.gz away.
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.
 

J-Block
Member
 
Posts: 39
Joined: Sun Dec 23, 2012 20:04

by J-Block » Wed Feb 27, 2013 14:54

How do I save it as a 7-zip?
 

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

by 0gb.us » Wed Feb 27, 2013 21:24

J-Block wrote:How do I save it as a 7-zip?


You can't. You save it as a .tar.gz, and use the 7-zip application to open the .tar.gz.
 

User avatar
Tedypig
Member
 
Posts: 284
Joined: Tue Mar 05, 2013 12:33
IRC: Piggybear87
In-game: Piggybear

by Tedypig » Tue Mar 05, 2013 12:50

First, let me say nice work on the mod. My girlfriend and I love it.

HOWEVER! There is a small visual glitch and another small glitch.

The visual glitch is the "refill" box is scrambled (the word not the box).

The other one is, it does not look like the pics. It flashes at that and the goes almost normal.

Any help is appreciated. Thank you.

-Teddypig
01010100 01100101 01100100 01111001 01110000 01101001 01100111
 

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

by 0gb.us » Tue Mar 05, 2013 20:40

Tedypig wrote:First, let me say nice work on the mod. My girlfriend and I love it.

HOWEVER! There is a small visual glitch and another small glitch.

The visual glitch is the "refill" box is scrambled (the word not the box).

The other one is, it does not look like the pics. It flashes at that and the goes almost normal.

Any help is appreciated. Thank you.

-Teddypig

The refill box glitch is caused by using the wrong version of inventory_plus. Use version 20120917.1, not version 20120917.0, and it should be fixed.

What pictures? I didn't include pictures.

Does the flashing only happen in creative mode? If yes, it's not something I can fix. The creative mode menu fights to take control, then inventory_plus takes over. The slight delay between the two causes the flash you see.
 

User avatar
Tedypig
Member
 
Posts: 284
Joined: Tue Mar 05, 2013 12:33
IRC: Piggybear87
In-game: Piggybear

by Tedypig » Wed Mar 13, 2013 14:41

Can you post a .zip download for the latest version please?
01010100 01100101 01100100 01111001 01110000 01101001 01100111
 

Temperest
Member
 
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Wed Mar 13, 2013 15:32

You can extract the archive using any decent archiver. A good example is 7-zip.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
 

User avatar
Traxie21
Member
 
Posts: 753
Joined: Mon Dec 31, 2012 10:48

by Traxie21 » Fri Mar 22, 2013 21:53

The download is 404-ing.
 

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

by rarkenin » Fri Mar 22, 2013 22:37

Traxie21 wrote:The download is 404-ing.


Recently, it looks like 0gb.us had a hard disk failure.
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

by 0gb.us » Fri Mar 22, 2013 23:27

Hmm. I just realized that means I lost all the plugins I built. They're all gone, my only copy was on the hard drive that blew.

EDIT: Does anyone have a copy of the latest version of this? I'd love to get it back online.
Last edited by 0gb.us on Fri Mar 22, 2013 23:29, edited 1 time in total.
 

User avatar
Traxie21
Member
 
Posts: 753
Joined: Mon Dec 31, 2012 10:48

by Traxie21 » Fri Mar 22, 2013 23:35

GitHub?
Always
It'd be a good idea to always push to something on github, so you always have a backup.
 

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

by 0gb.us » Sat Mar 23, 2013 01:10

Traxie21 wrote:GitHub?
Always
It'd be a good idea to always push to something on github, so you always have a backup.


I hadn't even started with Github at that point. I use it now, but not back then.

Also, Github is a bit of a pain to work with, particularly the uploading and deleting. I wouldn't want to use it for a small project lie this, it would require a bunch of nested directories on my computer, just to get around Github's renaming tenancies. Why can't it just leave the directory names as you set them?

Anyway, I should have had a backup copy. I realize this is my own fault. However, Github isn't a great fit for me. Backing up to my other computer would be a better option.

Speaking of which, I believe I do have a backup of this, it's just on my misplaced USB flash drive. I should have moved it to my other computer. My mistake. Hopefully someone has a copy of this we can use, but if not, we'll just have to wait for the flash drive to turn up.

EDIT: It's also a pain to rename files. There really should be a web interface for all of this.
Last edited by 0gb.us on Sat Mar 23, 2013 01:11, edited 1 time in total.
 

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

by jojoa1997 » Sat Mar 23, 2013 01:29

here is one. it is my copy and i dont know if it is the most recent or if i have not edited it but here it is. https://github.com/jojoa1997/0gb.us-repo
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

by 0gb.us » Sat Mar 23, 2013 02:08

Awesome, thanks Jojoa!

I think the only difference between that version and the up to date version is that we had to delete the trash slot added by inventory_plus, due to creative incorporating the trash slot into the default game.

Come to think of it, we should now also remove the refill slot, as it is pointless in 0.4.5. I'll fork it and make the changes.

After that, I'll probably do a full rewrite. Unfortunately, this will break compatibility a bit, but it will give better options and allow me to add it to 0gb.us_game, where it will be maintained on Github, and be kept up to date. Currently, there's a licence incompatibility, but a rewrite should fix that.

EDIT: Maybe a rewrite wouldn't be advisable ....

EDIT: It looks like maybe you had a copy where I already removed the trash slot? I just didn't do it very cleanly ....

https://github.com/0gb-us/inventory_plus
Last edited by 0gb.us on Sat Mar 23, 2013 02:14, edited 1 time in total.
 

Next

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 36 guests