[Mod] Inventory Plus [20120917.1] [inventory_plus]

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

[Mod] Inventory Plus [20120917.1] [inventory_plus]

by 0gb.us » Post

[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.

User avatar
foxinsky
Member
Posts: 25
Joined: Fri Dec 14, 2012 11:56
Location: Ukraine

by foxinsky » Post

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
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

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.

User avatar
foxinsky
Member
Posts: 25
Joined: Fri Dec 14, 2012 11:56
Location: Ukraine

by foxinsky » Post

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
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

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.

User avatar
foxinsky
Member
Posts: 25
Joined: Fri Dec 14, 2012 11:56
Location: Ukraine

by foxinsky » Post

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:

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-----

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-----

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

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
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

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?

User avatar
foxinsky
Member
Posts: 25
Joined: Fri Dec 14, 2012 11:56
Location: Ukraine

by foxinsky » Post

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
Location: Earth

by jojoa1997 » Post

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
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

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
Location: Earth

by jojoa1997 » Post

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
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

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.

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

by J-Block » Post

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.

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

by Temperest » Post

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
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

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: 219
Joined: Fri Aug 10, 2012 16:34
IRC: nomohakon
In-game: nomohakon
Location: VanessaE's servers

by nomohakon » Post

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

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

by rarkenin » Post

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.

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

by J-Block » Post

How do I save it as a 7-zip?

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

by 0gb.us » Post

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: 286
Joined: Tue Mar 05, 2013 12:33
IRC: Piggybear87
In-game: Piggybear
Location: Largo, FL, USA

by Tedypig » Post

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
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

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: 286
Joined: Tue Mar 05, 2013 12:33
IRC: Piggybear87
In-game: Piggybear
Location: Largo, FL, USA

by Tedypig » Post

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

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

by Temperest » Post

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
Location: McKinney, Texas U.S.A.
Contact:

by Traxie21 » Post

The download is 404-ing.

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

by rarkenin » Post

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests