Post your modding questions here

Locked
User avatar
Casimir
Member
Posts: 1189
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

Depends on the mod. Paramat most of the time chooses a different hight, so the Lua mapgen actually starts at 7000 and you have to teleport your self there. Some other mods just add new regions and you might have to search for them.
Do you have papyrus and cactus in your world? When normal mapgen would revert the Lua things, those would be missing too.

User avatar
i1abnrk
Member
Posts: 20
Joined: Sat May 11, 2013 03:20
GitHub: i1abnrk
IRC: i1abnrk
In-game: mervyncoll
Location: Wisconsin
Contact:

by i1abnrk » Post

Yes, there are cactus, etc on the mapgenv6 ans mapgenv7 produces just default:stone and water. It seems to me from testing that minetest.on_generate is being processed but the minetest.update_map isn't pushing changes to the map on any of the lua maps. I'm going to try a full reinstall to resolve potential issues from 0.4.7 I installed over.

User avatar
i1abnrk
Member
Posts: 20
Joined: Sat May 11, 2013 03:20
GitHub: i1abnrk
IRC: i1abnrk
In-game: mervyncoll
Location: Wisconsin
Contact:

by i1abnrk » Post

Yeah that fixed things. I pooched the manual update. Sorry and thanks.

User avatar
DeepGaze
Member
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze
Location: Take your best guess

by DeepGaze » Post

+ Spoiler
I am assuming that location for block c is loaded. this is something I am learning (modding) I haven't written any code yet for the simple reason of not knowing any.
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards

User avatar
wcwyes
Member
Posts: 145
Joined: Wed Jul 31, 2013 22:42

by wcwyes » Post

I'm trying to connect 2 worlds that you can't go back and forth without the portals without decreasing the expansion of the main world. Preferably on the same server.
fairiestoy wrote: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.

User avatar
i1abnrk
Member
Posts: 20
Joined: Sat May 11, 2013 03:20
GitHub: i1abnrk
IRC: i1abnrk
In-game: mervyncoll
Location: Wisconsin
Contact:

by i1abnrk » Post

So what you need is a way to run two server instances and to bounce the connected client to the second server. You'll need two configuration files on the host machine, probably two copies of the minetestserver binary, each with its own config file. (Or a fork server but that's even more complicated) and way to rewrite the configuration on the client, at least in memory, so it connects to the port address of the second server. Port redirection is something minetest doesn't do yet. You can ask dev about it, as Toy suggested before, or you'll have to write it yourself.
Your surest course of action is to go to the github site from the Development link on www.minetest.net. There make a username and submit a feature request with a title like "multiple server config file support, lua port redirection' and try to describe what you are trying to accomplish. They are interested in new ideas.
Last edited by i1abnrk on Wed Feb 12, 2014 07:35, edited 1 time in total.

User avatar
pandaro
Member
Posts: 323
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro
Location: behind

by pandaro » Post

I tried to add a feature to the player's hand.
However, I have some problem:
if I call the function: "on_use (itemstack, user, pointed_thing)" everything works perfectly.
but if I call: "on_place (itemstack, user, pointed_thing)"
the function on_place is not called, does not work

here the code:
minetest.register_item(":", {
type = "none",
wield_image = "wieldhand.png",
wield_scale = {x=1,y=1,z=2.5},
on_place=function(itemstack,placer,pointed_thing)
print(tostring("on place hand"))
end
end,
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level = 0,
groupcaps = {
fleshy = {times={[2]=2.00, [3]=1.00}, uses=0, maxlevel=1},
crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
oddly_breakable_by_hand = {times={[1]=7.00,[2]=4.00,[3]=1.40}, uses=0, maxlevel=3},
}
}
})
There is a reason why "on_place" can not be defined by the hand?
or I'm wrong something?
sorry for bad english
Linux debian 7 wheezy 64
kde

User avatar
Casimir
Member
Posts: 1189
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

print(tostring("on place hand"))
You turn a string into a string.

This works for me.

Code: Select all

    on_place = function(itemstack,placer,pointed_thing)
        print("on place hand")
    end,

User avatar
pandaro
Member
Posts: 323
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro
Location: behind

by pandaro » Post

casimir thanks for trying to answer, but you did not understand the question.
The problem is in the
"on_place"
, but only within the definition of the item
":"
that is, the player's hand.
The function as I posted above works in any other tool, item, node; But it does not work in the definition of the hand.
sorry for bad english
Linux debian 7 wheezy 64
kde

User avatar
DeepGaze
Member
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze
Location: Take your best guess

by DeepGaze » Post

1)is it possible to make an action repeat on a player after they eat something?
2)is there a tutorial on teleporting?
3)how do you make a dialogue(menu for a block)
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards

User avatar
Casimir
Member
Posts: 1189
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

@ pandora
Don't know if I understand you. I tried it with the hand, and it worked. All the other tools worked just as usual. If you want the function for all tools you would have to overwrite minetest.tooldef_default in /builtin/item.lua

@ DeepGaze
1) It is possible, but not the easy way. E.g. you could override the function eat_item, but you would have to load it before all other mods that use it. That means before "default".

User avatar
AMMOnym
Member
Posts: 682
Joined: Tue Sep 10, 2013 14:18
IRC: AMMOnym
In-game: AMMOnym
Location: Slovakia

by AMMOnym » Post

is possible with minetest make code for this : i destroy (Dirt) and i dont get dirt but (wool) ?

User avatar
DeepGaze
Member
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze
Location: Take your best guess

by DeepGaze » Post

Where is my error and what is it?
+ Spoiler
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards

User avatar
Novacain
Member
Posts: 285
Joined: Sat Aug 31, 2013 01:03
Location: Skaaro

by Novacain » Post

there is something wrong in the syntax of it. I put it into eclipse and got this error:
Description Resource Path Location Type
unexpected symbol near '}' main.lua /Test/src line 19 DLTK Problem


"test" is simply what I called the project.

you also spelled initial wrong in your comment.

PS, eclipse is your friend. it helps you realize you made an API error before you waould otherwise have noticed.
Last edited by Novacain on Fri Feb 14, 2014 14:29, edited 1 time in total.
EXTERMINATE!!!
My Tronrealm modpack
My tronblocks mod

User avatar
pandaro
Member
Posts: 323
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro
Location: behind

by pandaro » Post

I go back to my little problem.
I understand that: The function "on place" work if it is called within the definition of the player's hand. However, she only works if "pointed_thing" is not a player.
If the target of the "right_click" is a player, then minetest returns:
"20:34:49: ACTION [ServerThread]: john right-clicks the object 1: player Pandarus"
and the function "on_place" does not work.

I want to be able to bring up a "formspec" if I click with the right mouse button on another player.

Can someone explain to me how to get around this problem?
sorry for bad english
Linux debian 7 wheezy 64
kde

Sokomine
Member
Posts: 4184
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Post

pandaro wrote: want to be able to bring up a "formspec" if I click with the right mouse button on another player.

Can someone explain to me how to get around this problem?
Perhaps it might work if you use a tool for the pointing?
A list of my mods can be found here.

User avatar
pandaro
Member
Posts: 323
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro
Location: behind

by pandaro » Post

Sokomine wrote:Perhaps it might work if you use a tool for the pointing?
yes, I know. However, my goal is to allow the exchange of objects between two players, without being forced to throw objects on the ground, and without having to build a chest to make the trade-off. To do this I was thinking of integrating a small menu of exchange that appears when a player is clicked by another player.

What I find frustrating is that by using "on_use" I can do what I want, but with "on_place" I can not
sorry for bad english
Linux debian 7 wheezy 64
kde

User avatar
Topywo
Member
Posts: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Post

AMMOnym wrote:is possible with minetest make code for this : i destroy (Dirt) and i dont get dirt but (wool) ?
Maybe this mod is useful for what you're looking for

viewtopic.php?id=3675

Sokomine
Member
Posts: 4184
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Post

pandaro wrote: yes, I know. However, my goal is to allow the exchange of objects between two players, without being forced to throw objects on the ground, and without having to build a chest to make the trade-off.
Sounds like a very good idea. There was a thread about that here which did not make it into a mod so far.
A list of my mods can be found here.

User avatar
pandaro
Member
Posts: 323
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro
Location: behind

by pandaro » Post

Ah! I think if that works, try it yourself, it goes mod "default", look for the definition of the item ":" and add:
on_use=function(itemstack,user,pointed_thing)

print(dump(user:get_player_control().RMB))
print("on place hand")
if pointed_thing.ref and pointed_thing.ref:is_player() and then
local usr_name=user:get_player_name()
local target_name=pointed_thing.ref:get_player_name()
local swap = minetest.create_detached_inventory(usr_name..target_name,{})
swap:set_size("main",8*4)

minetest.show_formspec(usr_name,"trade-off","size[8,9]"..
"list[current_player;main;0,5;8,4;]"..
"list[detached:"..usr_name..target_name..";main;0,0;8,4;]")

minetest.show_formspec(target_name,"trade-off","size[8,9]"..
"list[current_player;main;0,5;8,4;]"..
"list[detached:"..usr_name..target_name..";main;0,0;8,4;]")
end
end,
that anger
sorry for bad english
Linux debian 7 wheezy 64
kde

User avatar
BrunoMine
Member
Posts: 1081
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

by BrunoMine » Post

how to shine node?
I'm creating a mod.
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com

User avatar
fishyWET
Member
Posts: 160
Joined: Tue Jan 01, 2013 07:43
GitHub: neinwhal
IRC: neinwhal
Location: Nowhere

by fishyWET » Post

brunob.santos wrote:how to shine node?
I'm creating a mod.
I think you meant how to make a node light up?

Add this to the node's code

Code: Select all

light_source = 14,
14 is the strongest light, and it decreases as the number decreases.
Edit: Made a mistake at the max light source
Last edited by fishyWET on Sat Feb 15, 2014 15:26, edited 1 time in total.

User avatar
Topywo
Member
Posts: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Post

fishyWET wrote:
brunob.santos wrote:how to shine node?
I'm creating a mod.
I think you meant how to make a node light up?

Add this to the node's code

Code: Select all

light_source = 8,
8 is the strongest light, and it decreases as the number decreases.
I thought 15 is daylight, but I'm not sure if the max is 14 or 15.

Jordach
Member
Posts: 4527
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

Topywo wrote:
fishyWET wrote:
brunob.santos wrote:how to shine node?
I'm creating a mod.
I think you meant how to make a node light up?

Add this to the node's code

Code: Select all

light_source = 8,
8 is the strongest light, and it decreases as the number decreases.
I thought 15 is daylight, but I'm not sure if the max is 14 or 15.
Maximum light is 14.
viewtopic.php?f=10&t=19056 Solar Plains Dev Server

User avatar
DeepGaze
Member
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze
Location: Take your best guess

by DeepGaze » Post

how do you animate a brick (do you have a code example I could steal)
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards

Locked

Who is online

Users browsing this forum: No registered users and 1 guest