Post your modding questions here
Re: Post your modding questions here
How can I use the mod database storage again? I can't find it
Re: Post your modding questions here
local my_data = minetest.get_mod_storage()burli wrote:How can I use the mod database storage again? I can't find it
then use it like it's a `meta`:
my_data:set_string("foo", "bar")
s = my_data:get_string("foo")
https://github.com/minetest/minetest/bl ... .txt#L2700
edit: corrected.
- 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
Just a minor correction: it should be `my_data:blah(...)` (note the colon instead of a period).sofar wrote:local my_data = minetest.get_mod_storage()
then use it like it's a `meta`:
my_data.set_string("foo", "bar")
s = my_data.get_string("foo")
https://github.com/minetest/minetest/bl ... .txt#L2700
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
Re: Post your modding questions here
Thanks, sofar answered this before, but the answer is lost in the noise of this thread
Re: Post your modding questions here
what happens with the drops if I use minetest.dig_node()? For example if I dig grass, what happens with the seeds if they drop? Even if I use the item_drop mod nothing is dropped.
How can I get the drops if I use dig_node() or similar?
How can I get the drops if I use dig_node() or similar?
- Linuxdirk
- Member
- Posts: 3219
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Post your modding questions here
I am currently developing a mod that adds a shit-ton of nodes created from a lot of nodeboxes (not connected nodeboxes just regular ones that visually span over the node edges).
I wonder if it would be more efficient to use meshes instead of nodeboxes. Any real-life experiences with that?
I wonder if it would be more efficient to use meshes instead of nodeboxes. Any real-life experiences with that?
Re: Post your modding questions here
Yes, meshes are more efficient because you can omit surfaces that are never visible, which nodebox nodes can not. So using meshes reduces the complexity of the geometry.Linuxdirk wrote:I am currently developing a mod that adds a shit-ton of nodes created from a lot of nodeboxes (not connected nodeboxes just regular ones that visually span over the node edges).
I wonder if it would be more efficient to use meshes instead of nodeboxes. Any real-life experiences with that?
But, the downside is that you need to do all the UV mapping and geometry construction yourself, which means basic blender skills are required.
- Linuxdirk
- Member
- Posts: 3219
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Post your modding questions here
I want to keep it as simple as possible. So, let's say: If I define a mesh, can I use minetest.registered_nodes[node_name].tiles (whre node_name is whatever node's tiles I want to use) for the mesh's texture definition like I can do with nodeboxes or is there another way to use an already defined node's tiles as mesh textures? (All my nodes will only have 90 degrees angles and no curves or whatsoever.)
Re: Post your modding questions here
Yes, you can easily do that (the stairs mod does this, for instance, for the mesh based stair nodes in minetest_game).Linuxdirk wrote:I want to keep it as simple as possible. So, let's say: If I define a mesh, can I use minetest.registered_nodes[node_name].tiles (whre node_name is whatever node's tiles I want to use) for the mesh's texture definition like I can do with nodeboxes or is there another way to use an already defined node's tiles as mesh textures? (All my nodes will only have 90 degrees angles and no curves or whatsoever.)
But, please note, that you still need to do UV mapping for your mesh.
If you just need a single mesh node (.obj) made, I'll be happy to make it for you - there are a few others that would happily do so as well.
- Linuxdirk
- Member
- Posts: 3219
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Post your modding questions here
There are plenty of meshes I need. I'll convert them from the currently existing nodebox files.sofar wrote:If you just need a single mesh node (.obj) made, I'll be happy to make it for you - there are a few others that would happily do so as well.
NodeBoxEditor can export to .obj, too. According to the wiki .obj files can be used for meshes.
I'll give it a try, thanks.
- rubenwardy
- Moderator
- Posts: 6977
- 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
Note that the exports NBE makes will be just as unoptimised as a plain node box
Re: Post your modding questions here
Is it possible to draw lines or something similar in Minetest?
I need to specify this: Is it possible to draw lines on the map in Lua?
I need to specify this: Is it possible to draw lines on the map in Lua?
- christoferlevich
- Member
- Posts: 325
- Joined: Thu Dec 01, 2016 23:44
- GitHub: ChristoferL
- Location: Athol, Massachusetts
Re: Post your modding questions here
So I know how to make a node hurt people when they step on it (walk= false and damage_per_second =) but how do I make that node heal instead? I tried putting a -number in damage per second but that failed. Is there a 'healing per second' line or something I can use?
edit:
I am trying to register an abm but I don't know how to tell the thing to heal a player. Searching for a list of pissible functions now...
edit:
I am trying to register an abm but I don't know how to tell the thing to heal a player. Searching for a list of pissible functions now...
everything can be a learning experience...
- orwell
- Member
- Posts: 958
- Joined: Wed Jun 24, 2015 18:45
- GitHub: orwell96
- IRC: orwell96_mt
- In-game: orwell
- Location: Raxacoricofallapatorius
Re: Post your modding questions here
Nope. You can't e.g. tell "draw a line from (0,0,0) to (2,2,2)". Although this would be a nice feature... detached rendered objectsburli wrote:Is it possible to draw lines or something similar in Minetest?
I need to specify this: Is it possible to draw lines on the map in Lua?
You can try to use the trick worldedit uses for the area marking: an object whose visual_scale and position is adjusted so that the ends are at the points you want.
- orwell
- Member
- Posts: 958
- Joined: Wed Jun 24, 2015 18:45
- GitHub: orwell96
- IRC: orwell96_mt
- In-game: orwell
- Location: Raxacoricofallapatorius
Re: Post your modding questions here
christoferlevich wrote:So I know how to make a node hurt people when they step on it (walk= false and damage_per_second =) but how do I make that node heal instead? I tried putting a -number in damage per second but that failed. Is there a 'healing per second' line or something I can use?
edit:
I am trying to register an abm but I don't know how to tell the thing to heal a player. Searching for a list of pissible functions now...
Code: Select all
{
nodenames = {"yournode"},
interval = 1.0, -- Operation interval in seconds
chance = 1, -- Chance of trigger per-node per-interval is 1.0 / this
action = function(pos, node, active_object_count, active_object_count_wider)
pos.y=pos.y+1 --node above
local objects=minetest.get_objects_inside_radius(pos, 1)
for _,obj in ipairs(objects) do
if obj:is_player() then
obj:set_hp(obj:get_hp()+1)
end
end
end,
}
- Lone_Wolf
- Member
- Posts: 2578
- Joined: Sun Apr 09, 2017 05:50
- GitHub: LoneWolfHT
- IRC: LandarVargan
- In-game: LandarVargan
Re: Post your modding questions here
Knowing NOTHING about lua yet I would've suggested the player gets a few loaves of bread shoved down his blocky throat...christoferlevich wrote:So I know how to make a node hurt people when they step on it (walk= false and damage_per_second =) but how do I make that node heal instead? I tried putting a -number in damage per second but that failed. Is there a 'healing per second' line or something I can use?
edit:
I am trying to register an abm but I don't know how to tell the thing to heal a player. Searching for a list of pissible functions now...
-
- Member
- Posts: 818
- Joined: Tue Apr 14, 2015 01:59
- GitHub: raymoo
- IRC: Hijiri
- In-game: Raymoo + Clownpiece
Re: Post your modding questions here
ABM for checking player step is needlessly inefficient. You will do the check on all nodes, even ones that are nowhere near the player. Better to do a global step or minetest.after loop where you periodically loop through players and check what they are stepping on.
Every time a mod API is left undocumented, a koala dies.
- christoferlevich
- Member
- Posts: 325
- Joined: Thu Dec 01, 2016 23:44
- GitHub: ChristoferL
- Location: Athol, Massachusetts
Re: Post your modding questions here
Ahhhh - I should formally apologize to anyone who is modding and really knows what they are doing. I always tend to overshoot my abilities and learn in the fixing of mistakes I make (I wish it wasn't so, but I've learned everything in life backwards.) After 48 years, I've grown used to it, but I bet I read like a wacko to more than a few.Byakuren wrote:ABM for checking player step is needlessly inefficient. You will do the check on all nodes, even ones that are nowhere near the player. Better to do a global step or minetest.after loop where you periodically loop through players and check what they are stepping on.
I'd guess by year's end I will be far more competent, but I will tend to ask questions that sound pretty ignorant till then. The good news is I am hooked on Minetest and I am hopeful to help supply some really creative mods to the community, the better news is I am training about 200 kids to play and (hopefully) mod as well.
There is no reason Minetest should not have crushed Minecraft by now in my opinion, short of huge marketing advantages MC has enjoyed.
everything can be a learning experience...
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Re: Post your modding questions here
Wasn't there a stepheight setting once? For players I mean.
Also is anybody aware of the maxlevel thing in tool definition? I mean, I looked into it, and it's horrible, and I don't think anybody is even aware it exists.
Edit: Didn't we have pixel perfect display of items at some point? The pixels are distorted now, and I seem to remember that it worked.
Also is anybody aware of the maxlevel thing in tool definition? I mean, I looked into it, and it's horrible, and I don't think anybody is even aware it exists.
Edit: Didn't we have pixel perfect display of items at some point? The pixels are distorted now, and I seem to remember that it worked.
- orwell
- Member
- Posts: 958
- Joined: Wed Jun 24, 2015 18:45
- GitHub: orwell96
- IRC: orwell96_mt
- In-game: orwell
- Location: Raxacoricofallapatorius
Re: Post your modding questions here
AFAIK this setting is hardcoded, so you can't change it.Casimir wrote:Wasn't there a stepheight setting once? For players I mean.
Also is anybody aware of the maxlevel thing in tool definition? I mean, I looked into it, and it's horrible, and I don't think anybody is even aware it exists.
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
Re: Post your modding questions here
You can't change the step-height like you can for entities but you can alter the player's jump distance and/or the effects of gravity to achieve much the same result.orwell wrote:AFAIK this setting is hardcoded, so you can't change it.Casimir wrote:Wasn't there a stepheight setting once? For players I mean.
Also is anybody aware of the maxlevel thing in tool definition? I mean, I looked into it, and it's horrible, and I don't think anybody is even aware it exists.
Re: Post your modding questions here
Is it possible to roll/pitch entities? I only can find the set_yaw() function
- azekill_DIABLO
- Member
- Posts: 7507
- Joined: Wed Oct 29, 2014 20:05
- GitHub: azekillDIABLO
- In-game: azekill_DIABLO
- Location: OMICRON
- Contact:
Re: Post your modding questions here
i think no. not without an animation
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!
DMs are always open if you want to get in touch!
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
Re: Post your modding questions here
With a rigged model it is possible by setting the root bone position, either directly or by way of key frames like the carts mod, for example.burli wrote:Is it possible to roll/pitch entities? I only can find the set_yaw() function
- christoferlevich
- Member
- Posts: 325
- Joined: Thu Dec 01, 2016 23:44
- GitHub: ChristoferL
- Location: Athol, Massachusetts
Re: Post your modding questions here
I am not sure how to implement the code you shared Orwell, but I am trying... LOL
EDIT - Got it!
EDIT - Got it!
everything can be a learning experience...
Who is online
Users browsing this forum: No registered users and 0 guests