Post your modding questions here

Locked
User avatar
RHR
Member
Posts: 215
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Post your modding questions here

by RHR » Post

Is it possible to override "minetest.register_ore" with a mod? I want to change the height_min and height_max of the minerals in minetest_game default without changing the original mod.

User avatar
Hybrid Dog
Member
Posts: 2835
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: Post your modding questions here

by Hybrid Dog » Post

RHR wrote:Is it possible to override "minetest.register_ore" with a mod? I want to change the height_min and height_max of the minerals in minetest_game default without changing the original mod.
l guess yes. But you can hardly let your mod become loaded before default, and overriding minetest.register_ore after it was used for default doesn't change the ore definitions.
But there's a table called minetest.registered_ores … which is just a table of copies l think.

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

User avatar
TenPlus1
Member
Posts: 3722
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: Post your modding questions here

by TenPlus1 » Post

Minetest 0.4.11 added 3 new commands to the mix which can clear previous biomes, decoration and ores from a world and let you set your own...

minetest.clear_registered_biomes()
minetest.clear_registered_decorations()
minetest.clear_registered_ores()

User avatar
maikerumine
Member
Posts: 1420
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: Post your modding questions here

by maikerumine » Post

TenPlus1 wrote:Minetest 0.4.11 added 3 new commands to the mix which can clear previous biomes, decoration and ores from a world and let you set your own...

minetest.clear_registered_biomes()
minetest.clear_registered_decorations()
minetest.clear_registered_ores()
+1000!

Great feature, Ten!
Talamh Survival Minetest-->viewtopic.php?f=10&t=12959

User avatar
Hybrid Dog
Member
Posts: 2835
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: Post your modding questions here

by Hybrid Dog » Post

TenPlus1 wrote:Minetest 0.4.11 added 3 new commands to the mix which can clear previous biomes, decoration and ores from a world and let you set your own...

minetest.clear_registered_biomes()
minetest.clear_registered_decorations()
minetest.clear_registered_ores()
… but doesn't let you specifically change the default ores.

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

TeTpaAka
Member
Posts: 141
Joined: Sat Dec 28, 2013 21:54

Re: Post your modding questions here

by TeTpaAka » Post

Hybrid Dog wrote:… but doesn't let you specifically change the default ores.
But you could copy the list of registered ores, clear the ores and then reregister the modified ores. It is a little complicated, but it could work.

User avatar
Hybrid Dog
Member
Posts: 2835
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: Post your modding questions here

by Hybrid Dog » Post

TeTpaAka wrote:
Hybrid Dog wrote:… but doesn't let you specifically change the default ores.
But you could copy the list of registered ores, clear the ores and then reregister the modified ores. It is a little complicated, but it could work.
Does it work for abms, too?

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

User avatar
Napiophelios
Member
Posts: 1035
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: Post your modding questions here

by Napiophelios » Post

I am modifying my creative inventory's formspec and was curious if there was any way
to have the character.png preview image change when I select a different skin?
Last edited by Napiophelios on Sun Mar 15, 2015 20:27, edited 1 time in total.

User avatar
Hybrid Dog
Member
Posts: 2835
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: Post your modding questions here

by Hybrid Dog » Post

Napiophelios wrote:I am modifying my creative inventory's formspec and was curious if there was any way
to have the character.png preview image change when I select a different skin?

Image
you could change the texture file name in the formspec before it appears

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

User avatar
Fox
New member
Posts: 7
Joined: Mon Jan 26, 2015 00:36

Re: Post your modding questions here

by Fox » Post

Hybrid Dog wrote:
Fox wrote:
Hybrid Dog wrote:l tried to find "legacy_mineral" (with grep -rl) in other files but it's only in ./games/minimal/mods/default/init.lua and ./games/minetest_game/mods/default/nodes.lua. Maybe it's used for decoration.
Hello Hybrd Dog,

Yes, I couldn't find it anywhere else either. Not a mention in lua_api.txt. I didn't know if it was maybe an outdated property, something like decoration as you said, or what. I don't seem to see it in the other mods I have either, so maybe it's something I can ignore like everyone else seems to be doing. xD That it doesn't do anything special I might want, maybe even just does nothing.

Just can't help but wonder though.
found it: viewtopic.php?p=46658#p46658
l need to remove it from my mod…

Heya Hybrid Dog,

I'm not sure if that's included there, but I guess I'll just ignore that legacy_mineral exists, haha. Everyone else seems to be. Just let that curiosity go.

Thanks for the help. :)



I'm going to repost my unanswered question from a month ago, for anyone who can help me out.
Fox wrote:Hello all,

Topic: Understanding some bits of tool capabilities?

Reason: I'd just like to understand some parts so I can know what's going on when I make my own tools.

More Info: Let's take the default stone pickaxe.

Code: Select all

minetest.register_tool("default:pick_stone", {
	description = "Stone Pickaxe",
	inventory_image = "default_tool_stonepick.png",
	tool_capabilities = {
		full_punch_interval = 1.3,
		max_drop_level=0,
		groupcaps={
			cracky = {times={[2]=2.0, [3]=1.20}, uses=20, maxlevel=1},
		},
		damage_groups = {fleshy=3},
	},
})
I understand that groupcaps handles what blocks can actually be affected by the tool and how so. I get that uses is tied to the damage inflicted on the tool with use. It's the times and maxlevel part I'm not sure I grasp.

I think the number with fleshy might work similarly?

If someone could help clear up these things, it'd be much appreciated. :)
Thanks for the read.

User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

Re: Post your modding questions here

by HeroOfTheWinds » Post

@Fox:

times refers to how long it takes to break a node of the given level for the given group, in seconds. A block with the group cracky=2 would take 2.0 seconds to dig with the tool posted above.

uses is the durability of the tool. It says how many nodes of the hardest strength can be dug with the tool. Lesser nodes detract less from uses. So, with that tool, you could break 20 level 1 nodes (although it somewhat can't, as 1 has no times value), since maxlevel = 1. You could also break 60 level 2 nodes, or 180 level 3 nodes. It's powers of three between values, if I remember correctly.

maxlevel is the "hardest" node you can break of the given group with the tool. This is an inverse relationship; 1 is highest, 3 is lowest. default:stone is level 3, but default:obsidian is level 1.

damage_groups are similar, but I think they actually are the reverse of above... 1 is weak, 10 is strong.

full_punch_interval is the time between swings at full power. This really only applies to weapons. If you just rapid click, your hits are weak and may not even do damage. But if you wait as long as full_punch_interval between clicks, you will do the most damage you can.

Hope this helps!
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

Re: Post your modding questions here

by Chinchow » Post

How would one go about removing a hud during gameplay?
EDIT: Never mind, it took me awhile, but I figured it out.

User avatar
Kilarin
Member
Posts: 896
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: Post your modding questions here

by Kilarin » Post

Greetings and Salutations!
I'm working on a game where I would like to have pvp work in one part of the world, but be disabled in another.
I could simply instantly heal characters whenever they are hurt in the non-pvp area, BUT, I'm not certain how to detect if the damage came from another player or not. If I heal ANY damage, then mobs, falling, lava, drowning, etc. now become pointless.

I found this thread: viewtopic.php?id=8901
asking for something similar, but it did not get an answer to the problem.

So is it possible to disable pvp (but not ALL forms of damage) in one region of the world and not in another?

Thanks in advance for your help

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your modding questions here

by paramat » Post

TeTpaAka wrote:But you could copy the list of registered ores, clear the ores and then reregister the modified ores. It is a little complicated, but it could work.
Yes that works.
Write a mod that depends on (and therefore runs after) default.
First lines should be any combination of 'clear biomes / decorations / ores'.
Then define your own versions of the categories you just cleared.

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your modding questions here

by paramat » Post

Krock wrote:
Kilarin wrote:

Code: Select all

             --local vi = area:index(x0, y, z) -- This accesses the node at a given position
             for x = x0, x1 do -- for each node do
                local vi = area:index(x, y, z) -- This accesses the node at a given position
Now works!!! thank you Hero and TeTpaAka!
It's supposed to be used as an array.

Code: Select all

	local vi = area:index(x0, y, z) -- This accesses the node at a given position
	for x = x0, x1 do -- for each node do
		-- Codes..
		vi = vi + 1
	end
^ Correct, HOTWinds' first example was missing the vi = vi + 1.
Kilarin, this method works faster because you don't calculate the LVM index for every node, only for the first node in each x row, hence (x0, y, z). Then, the vi = vi + 1 increments the index along the x row of nodes.
This can be done only because a LVM index always increments by 1 in the positive x direction (the y and z directions are much more complex increments).
Calculating the index for every node works but is slower and unneccesary.

drkwv
Member
Posts: 102
Joined: Thu Jun 28, 2012 13:48
GitHub: aa6

Re: Post your modding questions here

by drkwv » Post

Is it possible to make block "fall" like sand but in another direction for some time?

User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

Re: Post your modding questions here

by 12Me21 » Post

hmm, you could have it check if there is air in the direction that it would fall, and move the block to the side if there is, maybe look at the code for movestones. (in mesecons)

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

Re: Post your modding questions here

by rubenwardy » Post

drkwv wrote:Is it possible to make block "fall" like sand but in another direction for some time?
Use the group falling = 1
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

Re: Post your modding questions here

by 12Me21 » Post

rubenwardy wrote:
drkwv wrote:Is it possible to make block "fall" like sand but in another direction for some time?
Use the group falling = 1
will that work for falling in other directions though?

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Post your modding questions here

by Krock » Post

12Me21 wrote:will that work for falling in other directions though?
Nope, only downwards.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

Re: Post your modding questions here

by HeroOfTheWinds » Post

Check the code in falling.lua. Or better yet, look at the related file in my Caverealms mod. Just adjust a few of the velocity parameters, and you can change the direction of movement.
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

Re: Post your modding questions here

by Chinchow » Post

Is it at all possible to change the max player hp?

TeTpaAka
Member
Posts: 141
Joined: Sat Dec 28, 2013 21:54

Re: Post your modding questions here

by TeTpaAka » Post

Chinchow wrote:Is it at all possible to change the max player hp?
Currently, sadly no. See this.

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Post your modding questions here

by Krock » Post

Chinchow wrote:Is it at all possible to change the max player hp?
Don't be sad. It already has been added to the 0.5.0 roadmap.
https://github.com/minetest/minetest/issues/2370
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Hybrid Dog
Member
Posts: 2835
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: Post your modding questions here

by Hybrid Dog » Post

but there's a mod that adds a heart staff with which you can increase the player hp

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

Locked

Who is online

Users browsing this forum: No registered users and 11 guests