[Mod] Backpacks [backpacks]

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

[Mod] Backpacks [backpacks]

by everamzah » Post

Adds backpacks made of wool and leather, that can store anything but themselves in an 8*4 8*2 inventory. The backpacks can only be accessed once they're placed. Picking them up preserves their contents. They obey regular protection rules.

License: GPL3+
Depends: defualt, wool
Download: GitHub or master.zip

Image
Attachments
backpacks-1.0.zip
1st version with bigger inventory and more backpacks
(16.15 KiB) Downloaded 319 times
screenshot_20160619_083215.png
screenshot_20160619_083215.png (213.48 KiB) Viewed 2552 times
1.0
1.0
screenshot_20160508_171313.png (117.31 KiB) Viewed 2552 times
Last edited by everamzah on Sun Jun 19, 2016 12:37, edited 1 time in total.

User avatar
Napiophelios
Member
Posts: 1035
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [Mod] Backpacks [backpacks]

by Napiophelios » Post

these are pretty neat, it reminds me of prestibags mod.

I think it should not be able to hold as much as a chest though.
Also think it would be better to just have one type based on a single texture
instead of registering 16 different backpacks using the wool textures.

any way, its a cool mod despite my opinion :)

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

Re: [Mod] Backpacks [backpacks]

by everamzah » Post

Okay, now it's just a wool backpack and leather backpack. Inventory was reduced to half.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Backpacks [backpacks]

by Sokomine » Post

unified_inventory also has bags, though those are mostly items that store other items. They do not really appear ingame apart from beeing a craftitem. Your bag gave me an idea...how about changing the player model if and when the player carries a bag?
A list of my mods can be found here.

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

Re: [Mod] Backpacks [backpacks]

by everamzah » Post

That was the original intention. Also, swapping backpacks would swap your lower 8*3 inventory.
https://github.com/everamzah/dcb/commit ... ckpack.lua

PS. I got it to work, I don't remember where exactly I left off. Probably around the time I noticed problems with drag & drop into forbidden lists.

User avatar
Fixer
Member
Posts: 904
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

Re: [Mod] Backpacks [backpacks]

by Fixer » Post


xisd
Member
Posts: 54
Joined: Sun Oct 02, 2016 22:38

Re: [Mod] Backpacks [backpacks]

by xisd » Post

Nice mod ! I was looking for something like that !

depends.txt is wrong though : there is hard dependency on "mobs"

Checking for the mod existence before registering leather backpack recipe would fix it

Code: Select all

-- The recipe is only registered if mobs mod exist
if minetest.get_modpath("mobs") then
	minetest.register_craft({
		output = "backpacks:backpack_leather",
		recipe = {
			{"mobs:leather", "mobs:leather", "mobs:leather"},
			{"mobs:leather", "", "mobs:leather"},
			{"mobs:leather", "mobs:leather", "mobs:leather"},
		}
	})
end

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [Mod] Backpacks [backpacks]

by taikedz » Post

Thanks for the suggestion

I've updated this so that the leather backpack and the recipe are both dependent on mobs

xisd
Member
Posts: 54
Joined: Sun Oct 02, 2016 22:38

Re: [Mod] Backpacks [backpacks]

by xisd » Post

taikedz wrote:Thanks for the suggestion

I've updated this so that the leather backpack and the recipe are both dependent on mobs
Nice ! But you should check the existence of mobs mod using minetest.get_modpath instead of (or at least before) looking for the mobs variable, mainly because it result in this warning if the table doesn't exist :

Code: Select all

2017-01-21 19:27:36: WARNING[Main]: Undeclared global variable "mobs" accessed at .../minetest_game/mods/backpacks/init.lua:106
and also because an other mods could have a variable called mobs (even if they should not)

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [Mod] Backpacks [backpacks]

by taikedz » Post

I've updated the mod to use colourful backpacks. Should make sorting a little easier.

Image
Last edited by taikedz on Tue Jan 31, 2017 18:24, edited 2 times in total.

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Backpacks [backpacks]

by TenPlus1 » Post

I would remove the 'mobs' dependency from the depends.txt file and use something like this instead:

if minetest.get_modpath("mobs") then
-- add recipe here
end

Chibi ghost
Member
Posts: 845
Joined: Fri Jan 08, 2016 21:17
In-game: Ghost

Re: [Mod] Backpacks [backpacks]

by Chibi ghost » Post

nice I like this I can mine for longer

Drgnrdr
Member
Posts: 34
Joined: Tue Jul 11, 2017 08:57

Re: [Mod] Backpacks [backpacks]

by Drgnrdr » Post

Leather backpack craft not showing in craft guide. Changing this - if minetest.get_modpath("mobs") and mobs and mobs.redo then to this - if minetest.get_modpath("mobs") then gets the leather backpack to show in the craft guide.

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [Mod] Backpacks [backpacks]

by taikedz » Post

Sorry, i'm having trouble following what you said...

Also, which craft guide is not showing this recipe?

Drgnrdr
Member
Posts: 34
Joined: Tue Jul 11, 2017 08:57

Re: [Mod] Backpacks [backpacks]

by Drgnrdr » Post

Unified_inventory. In init.lua on line 171 it said:
if minetest.get_modpath("mobs") and mobs and mobs.redo then
craft doesn't show in guide. Change to
if minetest.get_modpath("mobs") then
Able to craft leather backpack.

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [Mod] Backpacks [backpacks]

by taikedz » Post

I believe the correct fix is to re-add an optional dependency on `mobs` ; please try it again from the master branch.

If I apply the changes you suggest (removing sanity checks), at best I'll just get reports of "the mod does not check for the presence of the right `mobs` mod" bug reports instead for people who use different `mobs` mods; at worst it will cause crashes.

Drgnrdr
Member
Posts: 34
Joined: Tue Jul 11, 2017 08:57

Re: [Mod] Backpacks [backpacks]

by Drgnrdr » Post

Just tried it. Back to not being able to craft leather backpacks. The only way I can get them is by using creative.

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [Mod] Backpacks [backpacks]

by taikedz » Post

Right well I'll havea deeper look at this when I have a proper moment. Thanks for letting me know

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [Mod] Backpacks [backpacks]

by taikedz » Post

Fixed. It was mobs_redo, it changed the way it identified itself.

backpacks now does a check for both the old and the new mobs_redo

Drgnrdr
Member
Posts: 34
Joined: Tue Jul 11, 2017 08:57

Re: [Mod] Backpacks [backpacks]

by Drgnrdr » Post

Just tested it works now. Thank You.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Backpacks [backpacks]

by texmex » Post

Would you care to look at the bug I filed some time ago taikedz?

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [Mod] Backpacks [backpacks]

by taikedz » Post

Should be fixed with latest update ?

DreamGuardian
Member
Posts: 12
Joined: Wed Feb 13, 2019 02:10
In-game: Dream_Guardian

Re: [Mod] Backpacks [backpacks]

by DreamGuardian » Post

This shows up with only unified_inventory toolranks mods on:

2019-10-02 13:42:52: ERROR[Main]: ... (1)\minetest-5.0.1-win64\bin\..\mods\backpacks\init.lua:84: attempt to index global 'dye' (a nil value)
2019-10-02 13:42:52: ERROR[Main]: stack traceback:
2019-10-02 13:42:52: ERROR[Main]: ... (1)\minetest-5.0.1-win64\bin\..\mods\backpacks\init.lua:84: in main chunk
2019-10-02 13:42:52: ERROR[Main]: Check debug.txt for details.
2019-10-02 13:42:52: ACTION[Main]: Server: Shutting down

ThorfinnS
Member
Posts: 311
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

Re: [Mod] Backpacks [backpacks]

by ThorfinnS » Post

Try adding Unified Inventory Plus, since you are running Unified Inventory. Backpacks are already incorporated.

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

Re: [Mod] Backpacks [backpacks]

by jas » Post

Does the dye mod no longer have a dye global? Are you not using the dye mod? I should update the mod if dye mod changed.

In the version I use in Lavaland, bags can be dug and placed anywhere and can be named. I really should update then..

Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 14 guests