Post your modding questions here
Re: Post your modding questions here
There is probably a very simple answer to this, but how would one create a flat area of certain dimensions. For example: Say you have a hill, but you want something to generate there via a mod. However when you generate your structure there are nodes from the hill inside. Therefore a flat area needs to be set.
- srifqi
- Member
- Posts: 570
- Joined: Sat Jun 28, 2014 04:31
- GitHub: srifqi
- IRC: srifqi
- In-game: srifqi
- Location: Indonesia
Re: Post your modding questions here
prestidigitator wrote:Where did you start the server?
Singleplayer
No. Just a normal outputprestidigitator wrote:Can you see any error output in the console there, or in the log file?
That's why i want it works in singlenode mapgenchinchow wrote:There is probably a very simple answer to this, but how would one create a flat area
of certain dimensions. For example: Say you have a hill, but you want something to
generate there via a mod. However when you generate your structure there are nodes
from the hill inside. Therefore a flat area needs to be set.
Saya dari Indonesia! · Terjemahkan Minetest! · my mods · My nickname in IPA: /es.rif.qi/
- Krock
- Developer
- Posts: 4649
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: Post your modding questions here
viewtopic.php?p=145653#p145653Chinchow wrote:flat area
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
Re: Post your modding questions here
I apologize it seems I did not specify. I want a normal world with hills and the like, and I want a contained area to be flattened.Krock wrote:viewtopic.php?p=145653#p145653Chinchow wrote:flat area
- Krock
- Developer
- Posts: 4649
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: Post your modding questions here
Contains streets, hills, flatlands. viewtopic.php?f=9&t=9296Chinchow wrote:I apologize it seems I did not specify. I want a normal world with hills and the like, and I want a contained area to be flattened.Krock wrote:viewtopic.php?p=145653#p145653Chinchow wrote:flat area
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
Re: Post your modding questions here
Check out paramat's terrain flattener mod.
viewtopic.php?f=11&t=7701
This may be a lot more like you want.
viewtopic.php?f=11&t=7701
This may be a lot more like you want.
- philipbenr
- Member
- Posts: 1897
- Joined: Fri Jun 14, 2013 01:56
- GitHub: philipbenr
- IRC: philipbenr
- In-game: robinspi
- Location: United States
Re: Post your modding questions here
How to use the multiple drop function? I am trying to get a node to drop more than one thing when it is dug.dev.minetest.net wrote:> drop — alternatively drop = { max_items = ..., items = { ... } }
- Krock
- Developer
- Posts: 4649
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: Post your modding questions here
Something similar tophilipbenr wrote:How to use the multiple drop function? I am trying to get a node to drop more than one thing when it is dug.dev.minetest.net wrote:> drop — alternatively drop = { max_items = ..., items = { ... } }
Code: Select all
drop = {
max_items = 2,
items = {
{items = {"mod:item"}, rarity = 10 },
{items = {"mod:item"}, rarity = 2 },
}
},
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
- philipbenr
- Member
- Posts: 1897
- Joined: Fri Jun 14, 2013 01:56
- GitHub: philipbenr
- IRC: philipbenr
- In-game: robinspi
- Location: United States
Re: Post your modding questions here
Ohhhh. Thanks Krock! ;)
Edit1: So, one is will drop and 10 really rare.
Edit2: More info (forgot to post this ;) I'm making a sub-game, and I want the birch tree (separate mod in the game) to drop a birch tree unit always and paper unit sometimes.
Edit1: So, one is will drop and 10 really rare.
Edit2: More info (forgot to post this ;) I'm making a sub-game, and I want the birch tree (separate mod in the game) to drop a birch tree unit always and paper unit sometimes.
- philipbenr
- Member
- Posts: 1897
- Joined: Fri Jun 14, 2013 01:56
- GitHub: philipbenr
- IRC: philipbenr
- In-game: robinspi
- Location: United States
Re: Post your modding questions here
Question #2:
Is there a way to make sure that texture packs are not enabled in game.conf (when making a game...) I want to have the textures be default and stay that way (There is a good reason too). Or at least disabled at first entry.
Edit:
And for question #3:
What is the simplest way to define a tree and have it spawn in the world? I want to have a simple birch tree, close to the default elm or whatever. Anyhow, I saw that there is the L system, but I was hoping there would be a better way to do it now in 0.4.10
Is there a way to make sure that texture packs are not enabled in game.conf (when making a game...) I want to have the textures be default and stay that way (There is a good reason too). Or at least disabled at first entry.
Edit:
And for question #3:
What is the simplest way to define a tree and have it spawn in the world? I want to have a simple birch tree, close to the default elm or whatever. Anyhow, I saw that there is the L system, but I was hoping there would be a better way to do it now in 0.4.10
- Casimir
- Member
- Posts: 1206
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Re: Post your modding questions here
#2 I don't think so. You can not prevent the clients from doing what they want.
#3 Look at minetest_game's default/trees.lua and functions.lua
#3 Look at minetest_game's default/trees.lua and functions.lua
- philipbenr
- Member
- Posts: 1897
- Joined: Fri Jun 14, 2013 01:56
- GitHub: philipbenr
- IRC: philipbenr
- In-game: robinspi
- Location: United States
Re: Post your modding questions here
#2: That's what I was afraid of... Oh well. Cant be helped. Also, when I look in minetest.conf, I see the line:
"mainmenu_last_selected_TP = 1" and the line "texture_path = ____" So I was wondering if those made any difference.
#3: I already looked in trees.lua so I suppose it would be in functions.lua...
"mainmenu_last_selected_TP = 1" and the line "texture_path = ____" So I was wondering if those made any difference.
#3: I already looked in trees.lua so I suppose it would be in functions.lua...
- kaeza
- Moderator
- Posts: 2162
- Joined: Thu Oct 18, 2012 05:00
- GitHub: kaeza
- IRC: kaeza diemartin blaaaaargh
- In-game: kaeza
- Location: Montevideo, Uruguay
- Contact:
Re: Post your modding questions here
As said by Casimir, you can't force the client to do what you want, but you can recommend people to use the default textures. If it looks bad with other texture packs, it's the user's fault, not yours.
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
- philipbenr
- Member
- Posts: 1897
- Joined: Fri Jun 14, 2013 01:56
- GitHub: philipbenr
- IRC: philipbenr
- In-game: robinspi
- Location: United States
Re: Post your modding questions here
@kaeza: question, but do you know of you can change the facedir of a node on a spawning tree?
I want to have ivy growing on trees that is climbable. It would look horrible with random ladderlike nodes facing only one direction...
I want to have ivy growing on trees that is climbable. It would look horrible with random ladderlike nodes facing only one direction...
Re: Post your modding questions here
#2: Just rename all textures in the texture folder and in the source code e.g. default_stone.png --> philipbenr_stone.png
- philipbenr
- Member
- Posts: 1897
- Joined: Fri Jun 14, 2013 01:56
- GitHub: philipbenr
- IRC: philipbenr
- In-game: robinspi
- Location: United States
Re: Post your modding questions here
Very very original thinking. XD Might even use. (probably a no; either that or release the textures as a separate TP.)RHR wrote:#2: Just rename all textures in the texture folder and in the source code e.g. default_stone.png --> philipbenr_stone.png
- paramat
- Developer
- Posts: 3700
- Joined: Sun Oct 28, 2012 00:05
- GitHub: paramat
- IRC: paramat
- Location: UK
Re: Post your modding questions here
I've been meaning to ask a question for perhaps a year, i'm in the habit of adding 'modname = {}' to a mod's init.lua file, but i still don't know why this is done, which is why i title that with the comment 'Stuff' in my code. What is the purpose and (when) is it essential?
Re: Post your modding questions here
Topic - How do you get the player's position, or better, the position of the block they are standing on?
Reason - I am making a gold touch mod: it makes blocks the player walks on into gold blocks
More Info - I really want to get into coding mods and I want to succeed in making this one so I can get my self esteem up.
Reason - I am making a gold touch mod: it makes blocks the player walks on into gold blocks
More Info - I really want to get into coding mods and I want to succeed in making this one so I can get my self esteem up.
- Krock
- Developer
- Posts: 4649
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: Post your modding questions here
minetest.get_node(vector.round(player:getpos())yaman wrote:Topic - How do you get the player's position, or better, the position of the block they are standing on?
Reason - I am making a gold touch mod: it makes blocks the player walks on into gold blocks
More Info - I really want to get into coding mods and I want to succeed in making this one so I can get my self esteem up.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
- Casimir
- Member
- Posts: 1206
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Re: Post your modding questions here
@paramat
(Please anyone correct me if I'm wrong on this.)
Normally you don't need this. Only it you want that definitions made by your mod can be used by other mods too.
From within your mod you can call both functions by there name. From an other mod you can only call yourmod.second_func because it is part of the table "yourmod" which is a global variable.
edit: see webdesigners post
(Please anyone correct me if I'm wrong on this.)
Normally you don't need this. Only it you want that definitions made by your mod can be used by other mods too.
Code: Select all
yourmod = {} -- global variable
local modname = "yourmod" -- local variable
local function first_func(pos, player)
-- this is a local function
end
function yourmod.second_func(pos, player)
-- this is a global function
end
edit: see webdesigners post
Last edited by Casimir on Sun Jul 13, 2014 19:04, edited 1 time in total.
- webdesigner97
- Member
- Posts: 1328
- Joined: Mon Jul 30, 2012 19:16
- GitHub: webD97
- IRC: webdesigner97
- In-game: webdesigner97
- Location: Cologne, Germany
- Contact:
Re: Post your modding questions here
first_func() is also global, make it local by putting "local" before "function". In theory, you don't need to put your mod's functions in a table, but to make sure that they are unique and don't get overriden accidently by other mods, many modders do put their function in tables.Casimir wrote:@paramat
(Please anyone correct me if I'm wrong on this.)
Normally you don't need this. Only it you want that definitions made by your mod can be used by other mods too.From within your mod you can call both functions by there name. From an other mod you can only call yourmod.second_func because it is part of the table "yourmod" which is a global variable.Code: Select all
yourmod = {} -- global variable local modname = "yourmod" -- local variable function first_func(pos, player) -- this is a local function end function yourmod.second_func(pos, player) -- this is a global function end
Visit me: webD97.de | @GitHub | @DeviantArt
Mods: StreetsMod | Vehicles
Featured from my blog: Dockerize the Minetest server
On my own behalf: Chameleon - A PHP image manipulation library built around GD
Mods: StreetsMod | Vehicles
Featured from my blog: Dockerize the Minetest server
On my own behalf: Chameleon - A PHP image manipulation library built around GD
Re: Post your modding questions here
2 Questions
Topic - How do you replace a single node if I have its position stored in a variable?
Reason - Creating goldtouch mod
Topic - How could i make a chat command make a loop to do a function over and over
Reason - to make the ground under you keep turning into gold
*Edit* - Solved
Topic - How do you replace a single node if I have its position stored in a variable?
Reason - Creating goldtouch mod
Topic - How could i make a chat command make a loop to do a function over and over
Reason - to make the ground under you keep turning into gold
*Edit* - Solved
Last edited by yaman on Mon Jul 14, 2014 18:57, edited 1 time in total.
- srifqi
- Member
- Posts: 570
- Joined: Sat Jun 28, 2014 04:31
- GitHub: srifqi
- IRC: srifqi
- In-game: srifqi
- Location: Indonesia
Re: Post your modding questions here
How to create my own map gen?
I see there's many mapgen mod that use singlenode mapgen.
I see there's many mapgen mod that use singlenode mapgen.
Minetest Dev Wiki wrote:singlenode:Intended to be used by mods that perform total mapgen takeovers.
Saya dari Indonesia! · Terjemahkan Minetest! · my mods · My nickname in IPA: /es.rif.qi/
Re: Gracefully replace node upon digging?
I have copied on_dig from builtin/item.lua and set it for my needs, but lag is still there (pushed this code to github). I have found out that even with an empty function passed to on_dig, minetest client is removing node then setting it back instead of simply doing nothing. Is there anything else I can do to get rid of the lag?prestidigitator wrote:you might need to us on_dig() instead.
-
- Member
- Posts: 647
- Joined: Thu Feb 21, 2013 23:54
Re: Post your modding questions here
As others have said, a table with the name of your mod creates a convenient namespace to place your API. Any functions or variables you want to be "publicly" accessible (part of an outside API usable by other mods and during debugging) should go there. This is the de facto standard for mod APIs.paramat wrote:I've been meaning to ask a question for perhaps a year, i'm in the habit of adding 'modname = {}' to a mod's init.lua file, but i still don't know why this is done, which is why i title that with the comment 'Stuff' in my code. What is the purpose and (when) is it essential?
EVERY top-level variable or function you use in your mod which does NOT go in that table should be local! Otherwise it pollutes the global namespace, which is a Bad Thing. Note that in Lua the syntax:
Code: Select all
function mytable.myfunc(...) ... end
Code: Select all
mytable.myfunc = function(...) ... end
Who is online
Users browsing this forum: No registered users and 4 guests