Andrey01
Member
Posts: 2579 Joined: Wed Oct 19, 2016 15:18
GitHub:
Andrey2470T
In-game: Andrey01
Location: Russia, Moscow
by Andrey01 » Fri Jul 06, 2018 08:16
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?
Krock
Developer
Posts: 4650 Joined: Thu Oct 03, 2013 07:48
GitHub:
SmallJoker
Location: Switzerland
Contact:
by Krock » Fri Jul 06, 2018 09:00
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)
Andrey01
Member
Posts: 2579 Joined: Wed Oct 19, 2016 15:18
GitHub:
Andrey2470T
In-game: Andrey01
Location: Russia, Moscow
by Andrey01 » Fri Jul 06, 2018 11:34
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?
Krock
Developer
Posts: 4650 Joined: Thu Oct 03, 2013 07:48
GitHub:
SmallJoker
Location: Switzerland
Contact:
by Krock » Fri Jul 06, 2018 13:45
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.
Andrey01
Member
Posts: 2579 Joined: Wed Oct 19, 2016 15:18
GitHub:
Andrey2470T
In-game: Andrey01
Location: Russia, Moscow
by Andrey01 » Fri Jul 06, 2018 14:48
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)?
Andrey01
Member
Posts: 2579 Joined: Wed Oct 19, 2016 15:18
GitHub:
Andrey2470T
In-game: Andrey01
Location: Russia, Moscow
by Andrey01 » Fri Jul 06, 2018 14:53
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.
Users browsing this forum: No registered users and 9 guests