minetest.hud_replace_builtin() doesn`t work correct

Post Reply
User avatar
Andrey01
Member
Posts: 2577
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

minetest.hud_replace_builtin() doesn`t work correct

by Andrey01 » Post

Here is my code:

Code: Select all

minetest.hud_replace_builtin("health", {
hud_elem_type = "statbar",
position = {x = 0.5, y = 1},
text = "poisonous_heart.png",
number = core.PLAYER_MAX_HP_DEFAULT,
direction = 0,
size = {x = 24, y = 24},
offset = {x = (-10*24) - 25, y = -(48 + 24 + 16)}     
})
And after calling of this function HUD healthbar appears invisible. Why does it happen?

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

Re: minetest.hud_replace_builtin() doesn`t work correct

by Krock » Post

Do you use a 5.0.0-dev client? If not, use this line:

Code: Select all

number = core.PLAYER_MAX_HP_DEFAULT or 20,
PS: lua_api.txt (version stable-0.4, currently 0.4.17.1)
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Andrey01
Member
Posts: 2577
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: minetest.hud_replace_builtin() doesn`t work correct

by Andrey01 » Post

Krock wrote:Do you use a 5.0.0-dev client? If not, use this line:

Code: Select all

number = core.PLAYER_MAX_HP_DEFAULT or 20,
PS: lua_api.txt (version stable-0.4, currently 0.4.17.1)
No, 0.4.16. 0.4.17 and 0.4.17.1 have not come for OpenSuse up to now that i use. Is there other way to get these versions?

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

Re: minetest.hud_replace_builtin() doesn`t work correct

by Krock » Post

Andrey01 wrote:No, 0.4.16.
Well so, let me emphasize my previous statement:
Krock wrote:Do you use a 5.0.0-dev client? If not, [then] use this line:
I hope that solves the issue for you.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Andrey01
Member
Posts: 2577
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: minetest.hud_replace_builtin() doesn`t work correct

by Andrey01 » Post

Krock wrote:
Andrey01 wrote:No, 0.4.16.
Well so, let me emphasize my previous statement:
Krock wrote:Do you use a 5.0.0-dev client? If not, [then] use this line:
I hope that solves the issue for you.
I`ve understood i should use that line if i don`t use 5.0.0-dev. But i ask how (this is separate question, nohow related with this topic) to get me 0.4.17 and 0.4.17.1 if it has not come up to now for OpenSuse (since 4th June)?

User avatar
Andrey01
Member
Posts: 2577
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: minetest.hud_replace_builtin() doesn`t work correct

by Andrey01 » Post

Krock wrote:Do you use a 5.0.0-dev client? If not, use this line:

Code: Select all

number = core.PLAYER_MAX_HP_DEFAULT or 20,
PS: lua_api.txt (version stable-0.4, currently 0.4.17.1)
Oh, damn. And this way doesn`t work, either! Maybe does this function not work at all? Btw, has anybody tested it any day? I don`t understand why the HUD becomes invisible.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests