Post your modding questions here

User avatar
Ferk
Member
 
Posts: 337
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: Post your modding questions here

by Ferk » Fri Sep 25, 2015 22:24

paramat wrote:minp.y of the surface mapchunk is -32, so this code only acts on empty mapchunks, mgv6 doesn't rise above the surface mapchunk (-32 to 47).
Perhaps just ignore any heightmap value of y = 47 as that is usually inside a mountain (not in mgv6 though because of the above fact).

Thanks! that makes sense.

I changed the dungeon maze to generate from -35 downwards and I had no problems anymore. I'll limit the generation of the entrances to the chunks in the ground level only (from -32 to 47).

Entrances will sometimes generate inside of mountains, but I think I prefer to leave it like that rather than prevent the entrance from getting generated at all.
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }
 

User avatar
Ben
Member
 
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: Post your modding questions here

by Ben » Sat Sep 26, 2015 11:34

Hybrid Dog wrote:there's a better way
https://github.com/minetest/minetest/co ... t-13428878
obviously calling the vmanip:read_from_map(minp,maxp) makes minetest. Get node work in those chunk(s).


Wow, thanks, "emerging" the area sounds exactly like what I wanted! I'ma go test for minetest.emerge_area(), and use it if present. I won't be relying on the result, anyway (it's very legit for the area to not be emerged yet / be unloaded again by the time I do my checks). Thanks!
 

User avatar
Don
Member
 
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Tue Sep 29, 2015 17:16

I am trying to figure out item_drop. I am not sure if it is the right function to use.
I am trying to make it so when you punch a node the node stays but an item is placed into the players inventory.

Code: Select all
on_punch = function(pos, node, puncher, pointed_thing)
      minetest.item_drop("default:cobble 1", puncher, pos)
end
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
Nathan.S
Member
 
Posts: 973
Joined: Wed Sep 24, 2014 17:47
Location: Bigsby Texas
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Post your modding questions here

by Nathan.S » Wed Sep 30, 2015 14:14

I use minetest.add_item(pos, 'mod:thing') which works just fine, I think this may be an area where multiple functions can accomplish the same thing.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course
 

User avatar
Hybrid Dog
Member
 
Posts: 2735
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Wed Sep 30, 2015 14:51

Don wrote:[…] when you punch a node the node stays but an item is placed into the players inventory.

just get the inventory of the puncher
https://github.com/HybridDog/treecapita ... t.lua#L262
and add an item there
https://github.com/HybridDog/treecapita ... ua#L72-L77

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪
 

User avatar
Don
Member
 
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Wed Sep 30, 2015 14:52

Nathan.S wrote:I use minetest.add_item(pos, 'mod:thing') which works just fine, I think this may be an area where multiple functions can accomplish the same thing.

Thanks. I will do it that way.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
Don
Member
 
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Wed Sep 30, 2015 14:52

Hybrid Dog wrote:
Don wrote:[…] when you punch a node the node stays but an item is placed into the players inventory.

just get the inventory of the puncher
https://github.com/HybridDog/treecapita ... t.lua#L262
and add an item there
https://github.com/HybridDog/treecapita ... ua#L72-L77

Thanks.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
Hybrid Dog
Member
 
Posts: 2735
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Wed Sep 30, 2015 14:55

Is it possible to change the light at a specific place (e.g. using vmanip) that it looks like a shadow?

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪
 

User avatar
kaadmy
Member
 
Posts: 706
Joined: Thu Aug 27, 2015 23:07
GitHub: kaadmy
IRC: KaadmY
In-game: KaadmY kaadmy NeD

Re: Post your modding questions here

by kaadmy » Wed Sep 30, 2015 16:10

Hybrid Dog wrote:Is it possible to change the light at a specific place (e.g. using vmanip) that it looks like a shadow?

Hmm, interesting...
If you used worldedit and fixed light, the shadows would be removed, though :(
Never paint white stripes on roads near Zebra crossings.

Pixture
 

User avatar
Hybrid Dog
Member
 
Posts: 2735
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Wed Sep 30, 2015 16:15

kaadmy wrote:
Hybrid Dog wrote:Is it possible to change the light at a specific place (e.g. using vmanip) that it looks like a shadow?

Hmm, interesting...
If you used worldedit and fixed light, the shadows would be removed, though :(

that wouldn't be a problem, shadows need to get recalculated often and l don't use the fixlight command

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪
 

User avatar
Don
Member
 
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Wed Sep 30, 2015 21:01

I want to get_objects_inside_radius to find players. Then I want it to get the player names and make them strings.
Using the example from the wiki how would I change it so I can send a chat message to people within a set radius?

Code: Select all
      local all_objects = minetest.get_objects_inside_radius({x=0, y=0, z=0}, 10)
      local players = {}
      local _,obj
      for _,obj in ipairs(all_objects) do
         if obj:is_player() then
            table.insert(players, obj)
         end
      end
      minetest.chat_send_player(players, name.." placed a "..descr)
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
Nathan.S
Member
 
Posts: 973
Joined: Wed Sep 24, 2014 17:47
Location: Bigsby Texas
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Post your modding questions here

by Nathan.S » Wed Sep 30, 2015 22:51

Don you might try looking at this code. https://github.com/minetest-australopithecus/minetest-australopithecus-voice/blob/master/mods/voice/voice.lua#L321 I won't do anything for bystanders that aren't playing the game, but might that might not be a problem. I can't imagine there would be too many people interested in watching but not playing.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course
 

DoyleChris
Member
 
Posts: 252
Joined: Sat Jul 25, 2015 19:54
In-game: DoyleChris

Re: Post your modding questions here

by DoyleChris » Wed Sep 30, 2015 23:03

I am trying to figure out how to make the Nuke Mod 1.6 drop lumps when detonated. I have been comparing the code to the TNT mod and trying to figure out what to add from the TNT mod to the Nuke Mod to make it work.
 

User avatar
Don
Member
 
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Thu Oct 01, 2015 12:47

DoyleChris wrote:I am trying to figure out how to make the Nuke Mod 1.6 drop lumps when detonated. I have been comparing the code to the TNT mod and trying to figure out what to add from the TNT mod to the Nuke Mod to make it work.

You would use item_drop. Make a list of items that you want it to drop either by get_objects_inside_radius or making your own list.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

bark
Member
 
Posts: 35
Joined: Thu Sep 24, 2015 13:25
In-game: bark

Re: Post your modding questions here

by bark » Thu Oct 01, 2015 17:33

EDIT: Posted in the wrong place.
Last edited by bark on Fri Oct 02, 2015 08:15, edited 1 time in total.
 

User avatar
eduardomezencio
Member
 
Posts: 73
Joined: Tue Sep 08, 2015 17:48
GitHub: eduardomezencio

Re: Post your modding questions here

by eduardomezencio » Fri Oct 02, 2015 01:22

Games can have a minetest.conf file that will override some settings, right? (I never found this in the documentation, but I found a minetest.conf file in a lot of games)

Can a mod do the same?
 

User avatar
Ferk
Member
 
Posts: 337
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: Post your modding questions here

by Ferk » Fri Oct 02, 2015 08:19

eduardomezencio wrote:Games can have a minetest.conf file that will override some settings, right? (I never found this in the documentation, but I found a minetest.conf file in a lot of games)

Can a mod do the same?


Maybe it would work to use minetest.setting_set (http://dev.minetest.net/minetest.setting_set).
But would this override the global settings for the user? I hope it only affects the minetest.conf of the world, the documentation doesn't explain.
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }
 

User avatar
eduardomezencio
Member
 
Posts: 73
Joined: Tue Sep 08, 2015 17:48
GitHub: eduardomezencio

Re: Post your modding questions here

by eduardomezencio » Fri Oct 02, 2015 11:22

Ferk wrote:Maybe it would work to use minetest.setting_set (http://dev.minetest.net/minetest.setting_set).


This would help, but only if it could be executed before anything is loaded. That's because the thing I want to change is the chunk size, to optimize my mapgen. Changing it after the world starts generating would not help.
 

User avatar
Ferk
Member
 
Posts: 337
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: Post your modding questions here

by Ferk » Fri Oct 02, 2015 11:28

eduardomezencio wrote:This would help, but only if it could be executed before anything is loaded. That's because the thing I want to change is the chunk size, to optimize my mapgen. Changing it after the world starts generating would not help.


I guess if you put it directly in the init.lua of your mod it should be effective as soon as the mods get loaded (which I believe precedes mapgen).

Or maybe it also works if you add it as a handler for mapgen init: http://dev.minetest.net/minetest.regist ... apgen_init

But I don't know for sure what's the right way.. can someone else answer? I would also be interested.
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }
 

User avatar
eduardomezencio
Member
 
Posts: 73
Joined: Tue Sep 08, 2015 17:48
GitHub: eduardomezencio

Re: Post your modding questions here

by eduardomezencio » Fri Oct 02, 2015 15:32

Ferk wrote:I guess if you put it directly in the init.lua of your mod it should be effective as soon as the mods get loaded (which I believe precedes mapgen).


I don't know if this is the right thing, but it kinda 'feels like' the right thing. I'll test it soon.
 

User avatar
Ferk
Member
 
Posts: 337
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: Post your modding questions here

by Ferk » Fri Oct 02, 2015 18:57

I also have a question: how come there's a "minetest.dir_to_wallmounted" but not a "minetest.wallmounted_to_dir"?

I'm implementing some rotation logic and I need to be able to convert the values to vector, transform them and convert them back. I can do this with facedir nodes but not wallmounted.

EDIT: Not sure if there's some other way to convert wallmounted to dir right now, but I opened a pull request to add that function to the engine.
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }
 

User avatar
eduardomezencio
Member
 
Posts: 73
Joined: Tue Sep 08, 2015 17:48
GitHub: eduardomezencio

Re: Post your modding questions here

by eduardomezencio » Sat Oct 03, 2015 01:31

Ferk wrote:Maybe it would work to use minetest.setting_set (http://dev.minetest.net/minetest.setting_set).


I tested it, and it's not the solution. First problem is that it changes the user setting in his minetest.conf file, so it may cause problems with his other worlds. Second that just putting it in init.lua does not make the setting change before mapgen starts. Only after closing and opening the world again it starts to work.
 

User avatar
rubenwardy
Moderator
 
Posts: 6021
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Post your modding questions here

by rubenwardy » Sat Oct 03, 2015 12:09

minetest.set_mapgen_params(MapgenParams) may be the solution

https://github.com/minetest/minetest/bl ... .txt#L2007

you can set seed, flags, water level and mgname.
 

User avatar
eduardomezencio
Member
 
Posts: 73
Joined: Tue Sep 08, 2015 17:48
GitHub: eduardomezencio

Re: Post your modding questions here

by eduardomezencio » Sat Oct 03, 2015 17:01

rubenwardy wrote:minetest.set_mapgen_params(MapgenParams) may be the solution

https://github.com/minetest/minetest/bl ... .txt#L2007

you can set seed, flags, water level and mgname.


Thank you very much for your answer. This seems to be the solution, but the information in the wiki contradicts it. First, chunksize is not listed as a possible value for mapgen_params here: http://dev.minetest.net/minetest.set_mapgen_params

Second, this page http://dev.minetest.net/Mapgen_Parameters says the following about chunksize:
http://dev.minetest.net/Mapgen_Parameters wrote:This parameter cannot be modified through the Lua API.


I'll test your suggestion. I hope it works, but then it will mean that the wiki definitely needs some fixing.
 

User avatar
eduardomezencio
Member
 
Posts: 73
Joined: Tue Sep 08, 2015 17:48
GitHub: eduardomezencio

Re: Post your modding questions here

by eduardomezencio » Sat Oct 03, 2015 17:18

And it didn't work. You can get chunksize with get_mapgen_params() but you can't change it with set_mapgen_params().
 

PreviousNext

Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 3 guests