An actual scroll bar that works, maybe but I think it would be very difficult to do. You could however have an up arrow button and a down arrow button and use them to scroll through different inventories. To do something like that I would suggest you study the code for unified inventory which is part of the technic mod.Krock wrote:Topic: Are things like this here possible? (A scrollbar in chests)
http://i.imgur.com/ohpm62H.png
Reason: Mods
More Info: Could be interesting to work with that
Post your modding questions here
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Wow, and I didn't even test it :3Nightshade wrote:This worked perfectly, thanks!
Okay thanks, maybe are scrollbars needed somewhenLionsDen wrote:To do something like that I would suggest you study the code for unified inventory which is part of the [unified infentory mod]
Last edited by Krock on Sun Dec 08, 2013 19:08, edited 1 time in total.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
- Nightshade
- Member
- Posts: 25
- Joined: Thu Oct 24, 2013 15:25
Ok, so maybe it didn't work as perfectly as I thought. First what I did was take out my "on_use" then put in yours. that didn't allow the soda to heal. Then I combined the two, but if you tried to drink one from a whole stack, the whole stack was taken. SO, I added a stack limit of 1, and that fixed it. I ended up with this:Nightshade wrote: This worked perfectly, thanks!
Code: Select all
minetest.register_craftitem("morestuff:apple_soda", {
description = "Apple Soda",
inventory_image = "apple_soda.png",
stack_max = 1,
on_use = minetest.item_eat(4),
on_use = function(itemstack, user, pointed_thing)
-- Dig if pointed on node
if pointed_thing.type == "node" then
return
end
minetest.item_eat(4)
return ItemStack({name = "vessels:glass_bottle"})
end,
})
Last edited by Nightshade on Mon Dec 09, 2013 03:18, edited 1 time in total.
Topic: [0.4.8]How to get the seed string?
Reason: I want to make a mod that generates pseudo random number based on kikito/md5.lua .
More Info(optional): The seed string, which is available in 0.4.8 but not in 0.4.7 .
Reason: I want to make a mod that generates pseudo random number based on kikito/md5.lua .
More Info(optional): The seed string, which is available in 0.4.8 but not in 0.4.7 .
Minetest can be better if
*better data structure for players and unstackable items like JSON
*multi sqlite files so that multi dimension can be easily implemented
*more convenient mob developing interface
*better data structure for players and unstackable items like JSON
*multi sqlite files so that multi dimension can be easily implemented
*more convenient mob developing interface
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Spoiler
Topic: How do I use "minetest.show_formspec" correctly?
Reason: I've this problem:
In the node definition: ("cust_ow" and "cust_og" are defined with 2*2 as size in on_construct)
More info: I don't see any lists
Reason: I've this problem:
Code: Select all
function get_prochest_formspec(number) -- returns string with formspec:
"invsize[12,10;]"..
"label[0,0;ProChest]"..
"label[1,0.5;Your grid:]"..
"list[current_name;cust_ow;1,1;2,2;]"..
"button[3,1.5;2,1;exchange;Exchange]"..
"label[6,3;You get:]"..
"list[current_name;cust_og;6,3.5;2,2;]"..
"list[current_player;main;2,6;8,4;]")
Code: Select all
on_rightclick = function(pos, node, clicker, itemstack)
local meta = minetest.env:get_meta(pos)
if clicker:get_player_name() == meta:get_string("owner") then
minetest.show_formspec(clicker:get_player_name(),"testing:prochest_formspec",get_prochest_formspec(1))
else
minetest.show_formspec(clicker:get_player_name(),"testing:prochest_formspec",get_prochest_formspec(1))
end
end,
Last edited by Krock on Tue Dec 10, 2013 16:33, edited 1 time in total.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
- BrunoMine
- Member
- Posts: 1082
- Joined: Thu Apr 25, 2013 17:29
- GitHub: BrunoMine
- Location: SP-Brasil
- Contact:
I do not know how to skip lines.
Code: Select all
meta:set_string("formspec",
"size[8,9]"..
"textarea[0,0;8,8;Texto;Aventura de Minerador (O Troféu);Para conseguir o troféu de minerador você deverá encontrar o livro de receiras 'Corpo de Troféo' e 'Base de Troféu', depois faça os itens e unaos para obter o belo troféu]"
)
return formspec
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
Comunidade Minetest Brasil
www.minetestbrasil.com
- BrunoMine
- Member
- Posts: 1082
- Joined: Thu Apr 25, 2013 17:29
- GitHub: BrunoMine
- Location: SP-Brasil
- Contact:
HELP!brunob.santos wrote:I do not know how to skip lines.Code: Select all
meta:set_string("formspec", "size[8,9]".. "textarea[0,0;8,8;Texto;Book of bla;Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla]" ) return formspec
Last edited by BrunoMine on Wed Dec 11, 2013 00:27, edited 1 time in total.
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
Comunidade Minetest Brasil
www.minetestbrasil.com
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
skip lines? how do you mean that?
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
- PilzAdam
- Member
- Posts: 4026
- Joined: Fri Jul 20, 2012 16:19
- GitHub: PilzAdam
- IRC: PilzAdam
- Location: Germany
brunob.santos wrote:HELP!brunob.santos wrote:I do not know how to skip lines.Code: Select all
meta:set_string("formspec", "size[8,9]".. "textarea[0,0;8,8;Texto;Book of bla;Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla]" ) return formspec
Code: Select all
meta:set_string("formspec",
"size[8,9]"..
"textarea[0,0;8,8;Texto;Book of bla;Bla bla bla bla bla bla bla bla bla bla"..
" bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla"..
" bla bla bla bla bla bla bla]"
)
return formspec
- BrunoMine
- Member
- Posts: 1082
- Joined: Thu Apr 25, 2013 17:29
- GitHub: BrunoMine
- Location: SP-Brasil
- Contact:
Does not work!PilzAdam wrote:Code: Select all
meta:set_string("formspec", "size[8,9]".. "textarea[0,0;8,8;Texto;Book of bla;Bla bla bla bla bla bla bla bla bla bla".. " bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla".. " bla bla bla bla bla bla bla]" ) return formspec
Spoiler
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
Comunidade Minetest Brasil
www.minetestbrasil.com
- PilzAdam
- Member
- Posts: 4026
- Joined: Fri Jul 20, 2012 16:19
- GitHub: PilzAdam
- IRC: PilzAdam
- Location: Germany
Oh, you want the newlines in-game. Use \n for that.brunob.santos wrote:Does not work!PilzAdam wrote:Code: Select all
meta:set_string("formspec", "size[8,9]".. "textarea[0,0;8,8;Texto;Book of bla;Bla bla bla bla bla bla bla bla bla bla".. " bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla".. " bla bla bla bla bla bla bla]" ) return formspec
'm sorry but I have tried in several ways. I'm not able to change the position of a HUD through "hud_change ()"
EXAMPLE of not working test:
EXAMPLE of not working test:
someone could pass me an example?minetest.register_tool("player_radar:radar_hud",{
description="radar hud",
inventory_image = ("portable_receiver.png"),
tool_capabilities = {
groupcaps={
snappy = {times={[2]=0.95}, uses=20, maxlevel=1},
--fleshy = {times={[3]=1.6}, uses=10, maxlevel=1}
}
},
on_use=function(itemstack,user)
player_radar_hud[user:get_player_name()] = user:hud_add({
hud_elem_type = "image",
position = {x=0.5,y=0.5},
scale = {x=0.1, y=0.1},
text = "radar13cmp2.png",
number = 1,
alignment = {x=0,y=0},
offset = {
x = 0;
y = 0;
},
})
end,
on_place=function(itemstack,placer)
placer:hud_change(player_radar_hud[placer:get_player_name()],"position",{x=0.1,y=0.1})
print(dump(placer:hud_get(player_radar_hud[placer:get_player_name()])))
end,
})
sorry for bad english
Linux debian 7 wheezy 64
kde
Linux debian 7 wheezy 64
kde
- kaeza
- Moderator
- Posts: 2162
- Joined: Thu Oct 18, 2012 05:00
- GitHub: kaeza
- IRC: kaeza diemartin blaaaaargh
- In-game: kaeza
- Location: Montevideo, Uruguay
- Contact:
Pandaro: seems like a typo in the Lua HUD. I have submitted a patch for it.
For now, you can use "pos" instead of "position".
For now, you can use "pos" instead of "position".
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!
Check out my stuff! | Donations greatly appreciated! PayPal
Check out my stuff! | Donations greatly appreciated! PayPal
kaeza thanks, it works!kaeza wrote:Pandaro: seems like a typo in the Lua HUD. I have submitted a patch for it.
For now, you can use "pos" instead of "position".
I hope that your patch is accepted.
sorry for bad english
Linux debian 7 wheezy 64
kde
Linux debian 7 wheezy 64
kde
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
About the hud; No matter what I set "direction" to, it always looks the same. Could it be that this is not implemented yet?
Code: Select all
player_bubbles[name] = player:hud_add({
hud_elem_type = "statbar",
text = "bubble.png",
number = 20,
direction = 1,
position = {x=0.5,y=0.9},
offset = {x=0, y=19},
})
Last edited by Casimir on Fri Dec 20, 2013 20:12, edited 1 time in total.
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Depending on what you want, there are two things I can think of. Both would be possible in Lua.
1. With some portal thing when entered the player file is copied to the second world, in one file there is saved that the player left the world. Then the player is kicked out of the server and can not connect until the "player is not in this world" file is changed from an other world. You would have to manually connect to the new server.
2. A shared build area. When ever a node is altered in the defined area, it is saved in a worldedit file and sent to the second server/world together with a timestamp and then loaded into the second world.
1. With some portal thing when entered the player file is copied to the second world, in one file there is saved that the player left the world. Then the player is kicked out of the server and can not connect until the "player is not in this world" file is changed from an other world. You would have to manually connect to the new server.
2. A shared build area. When ever a node is altered in the defined area, it is saved in a worldedit file and sent to the second server/world together with a timestamp and then loaded into the second world.
Last edited by Casimir on Sun Dec 22, 2013 14:15, edited 1 time in total.
couldn't I make a .js file to use theplayer profile to automatically log the player into the new server?Casimir wrote:Depending on what you want, there are two things I can think of. Both would be possible in Lua.
1. With some portal thing when entered the player file is copied to the second world, in one file there is saved that the player left the world. Then the player is kicked out of the server and can not connect until the "player is not in this world" file is changed from an other world. You would have to manually connect to the new server.
2. A shared build area. When ever a node is altered in the defined area, it is saved in a worldedit file and sent to the second server/world together with a timestamp and then loaded into the second world.
- fairiestoy
- Member
- Posts: 191
- Joined: Sun Jun 09, 2013 19:25
- Location: Germany
Question is: What are you exactly aiming at? Do you want to cross-connect several servers by portals? If you just want to give the player the imagination that hes wandering between different worlds, you could create a mod which adds unpassable borders at specific heights and generate new land above this borders. If a player gets ported to the destination, he cannot get back to the original level without the portals. Thats at least the most useable solution ( imo ) when you don't want to kick out the user from his server and force him to reconnect somewhere else ( where he might run into problems when not finding it in the server list for example ).
If you want the crossconnect stuff ( which is interesting ), you have to suggest a API facility to the devs ( like minetest.client_connect_to( <connection parameters> ) ) which holds the current connection but tries to get the user into the other server. On success, he gives free the original connection. Should be a client-only thing.
If you want the crossconnect stuff ( which is interesting ), you have to suggest a API facility to the devs ( like minetest.client_connect_to( <connection parameters> ) ) which holds the current connection but tries to get the user into the other server. On success, he gives free the original connection. Should be a client-only thing.
Last edited by fairiestoy on Mon Dec 23, 2013 05:30, edited 1 time in total.
Interesting about new things is, to figure out how it works ...
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Topic: Can someone put this C# code into LUA?
Reason: Mods
More Info: This here is the code:
In short: it should dig a 3*3*3 block, without changing the "pos" variable.
Reason: Mods
More Info: This here is the code:
Code: Select all
//for the 3D-coords
struct Position {
public int x, y, z;
}
//node
struct Node {
public int param2;
}
//nplayer
class Player {
//just pointing to the existence of this
}
//now the codes
void testing(Position pos, Node node, Player player) {
for(int x = pos.x - 1, x <= pos.x + 1, x++) {
for(int y = pos.y - 1, y <= pos.y + 1, y++) {
for(int z = pos.z - 1, z <= pos.z + 1, z++) {
Position xpos = new Position();
xpos.x = x;
xpos.y = y;
xpos.z = z;
minetest.env:remove_node(xpos);
}
}
}
}
Last edited by Krock on Mon Dec 23, 2013 19:47, edited 1 time in total.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Oh thanks, I simply thought too much.Hybrid Dog wrote:function dig3(pos)
for i = -1,1 do
for j = -1,1 do
for k = -1,1 do
minetest.remove_node({x=pos.x+i, y=pos.y+j, z=pos.z+k})
end
end
end
end
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
Who is online
Users browsing this forum: No registered users and 6 guests