[Mod] Upgrade the player stats [upgrade_packs]

Post Reply
User avatar
Krock
Developer
Posts: 4652
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

[Mod] Upgrade the player stats [upgrade_packs]

by Krock » Post

Upgrade Packs

This post is more or less a converted copy of the README.md file.

Description
Image
This server mod provides upgradeable packs in form of items to players which give them additional health or breath. However, the better the health packs are and the more of them you use, the faster they will wear out.
Please note that the builtin HP bar maximum is always 10 hearts. With two additional "+10 HP" packs, one heart equals 4 HP (instead of previously 2).

Features
  • Unified Inventory and sfinv support
  • Chat command fallback formspec when no inventory mod was detected
  • + 10 HP pack (damages player on craft)
  • + 5 breath pack (takes breath on craft)
Dependencies: default, vessels (minetest_game content)
Optional dependencies: unified_inventory, sfinv
Requires Minetest 5.0.0-dev and optionally #7360 to ensure that everything is displayed correctly
License: MIT
Links: GitHub Source (.git), Nasty *.zip
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: [Mod] Upgrade the player stats [upgrade_packs]

by Lejo » Post

Great!

nolombic
New member
Posts: 9
Joined: Sat Mar 28, 2020 19:06
In-game: nolombic
Location: Germany

Re: [Mod] Upgrade the player stats [upgrade_packs]

by nolombic » Post

Hi, so I've found a rather big bug in your mod.
What I've noticed is that everytime a player leaves the game the server crashes if said player has any upgrade packs equipped. Minetest crashes with this error:

Code: Select all

AsyncErr: ServerThread::run Lua: Runtime error from mod 'upgrade_packs' in callback on_leaveplayer(): ...minetest-5.2.0-win64\bin\..\builtin\common\serialize.lua:151: Can't serialize data of type userdata
stack traceback:
	[C]: in function 'error'
	...minetest-5.2.0-win64\bin\..\builtin\common\serialize.lua:151: in function 'dump_or_ref_val'
	...minetest-5.2.0-win64\bin\..\builtin\common\serialize.lua:138: in function 'dump_or_ref_val'
	...minetest-5.2.0-win64\bin\..\builtin\common\serialize.lua:166: in function 'serialize'
	...t\minetest-5.2.0-win64\bin\..\mods\upgrade_packs/api.lua:29: in function <...t\minetest-5.2.0-win64\bin\..\mods\upgrade_packs/api.lua:24>
	...nt\minetest-5.2.0-win64\bin\..\builtin\game\register.lua:429: in function <...nt\minetest-5.2.0-win64\bin\..\builtin\game\register.lua:413>
I've tested this with most 5.x versions already and it happens on all of them (including, but not limited to 5.2.0 and 5.1.1).
I would really appreciate if you could fix this bug as I would love to deploy this mod on my private server.

User avatar
ninnetyer
New member
Posts: 1
Joined: Wed Sep 27, 2023 14:26
GitHub: Ninnetyer
In-game: Ninnetyer

Re: [Mod] Upgrade the player stats [upgrade_packs]

by ninnetyer » Post

Hello, may I ask how do I eat these hearts?, or how to use them to increase health beyond 20HP.

User avatar
Krock
Developer
Posts: 4652
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] Upgrade the player stats [upgrade_packs]

by Krock » Post

@ninnetyer

You cannot eat the hearts. They are items that you can put into the new upgrade slots of your inventory to increase the maximal health of your character. The heart count in the status bar will not change, but 1 HP no longer corresponds to 1/2 status bar heart.
You should find these upgrade slots in a separate tab (for Minetest Game's sfinv inventory) or as the button shown in the second part of the image (for Unified Inventory). Other inventory mods (such as inventory_plus and i3) are currently not supported.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Post Reply

Who is online

Users browsing this forum: No registered users and 37 guests