It means in line 1209 it is asking for the variable "is_protected". The variable is either non existent or is set to nil.thisrandomer wrote:What does it mean when you try to run a mod and it says ServerError: LuaError: error: C:/Minetest\bin\..\mods\mobs/api.lua:1209: attempts to call field 'is_protected' (a nil value) ?
Post your modding questions here
Re: Post your modding questions here
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
A list of my mods can be found here
- Hybrid Dog
- Member
- Posts: 2836
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
Re: Post your modding questions here
l think it rather tries to get this variable from some table because it is called field.
-
- New member
- Posts: 2
- Joined: Sun Oct 11, 2015 16:02
Re: Post your modding questions here
How do I fix this?Don wrote:It means in line 1209 it is asking for the variable "is_protected". The variable is either non existent or is set to nil.thisrandomer wrote:What does it mean when you try to run a mod and it says ServerError: LuaError: error: C:/Minetest\bin\..\mods\mobs/api.lua:1209: attempts to call field 'is_protected' (a nil value) ?
Re: Post your modding questions here
What mobs mod is this from?thisrandomer wrote:How do I fix this?Don wrote:It means in line 1209 it is asking for the variable "is_protected". The variable is either non existent or is set to nil.thisrandomer wrote:What does it mean when you try to run a mod and it says ServerError: LuaError: error: C:/Minetest\bin\..\mods\mobs/api.lua:1209: attempts to call field 'is_protected' (a nil value) ?
Did you make any changes to the mod?
I am just guessing but the is_protected thing is from this.
http://dev.minetest.net/minetest.is_protected
You can look at that to see if it helps. If not please post the block of code at line 1209.
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
A list of my mods can be found here
- BrunoMine
- Member
- Posts: 1082
- Joined: Thu Apr 25, 2013 17:29
- GitHub: BrunoMine
- Location: SP-Brasil
- Contact:
keeping an item used in the craft?
I want to keep an item used in the creation of another item revenue.
please. how can I do it?
please. how can I do it?
Re: Post your modding questions here
How is one expected to get the collisionbox or visual_size, and other useful properties, of an entity whose name is "_builtin:item"?
I would also appreciate it if someone could answer this post by Ferk from last month which seems to have been ignored.
I would also appreciate it if someone could answer this post by Ferk from last month which seems to have been ignored.
- rubenwardy
- Moderator
- Posts: 6978
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
Re: keeping an item used in the craft?
See replacements.BrunoMine wrote:I want to keep an item used in the creation of another item revenue.
please. how can I do it?
http://rubenwardy.com/minetest_modding_ ... aft-shaped
https://github.com/rubenwardy/food/blob ... t.lua#L128
-
- Member
- Posts: 16
- Joined: Thu Oct 08, 2015 20:36
- GitHub: n0taD1m3
- IRC: Uhm
- In-game: TekWaffle
Re: Post your modding questions here
I don't know if this has been asked but how do you add randomly generated structures, that are created in World Edit
Stay Toast
つಠ益ಠ༽つ # (ʘ言ʘ╬) -"WAFFLE!"
╰〳 ಠ 益 ಠೃ 〵╯ RAISE YOUR DONGERS
つಠ益ಠ༽つ # (ʘ言ʘ╬) -"WAFFLE!"
╰〳 ಠ 益 ಠೃ 〵╯ RAISE YOUR DONGERS
Re: Post your modding questions here
Is there any kind of tutorial for starting out with World Edit?
Re: Post your modding questions here
In the mod folder there is a file that explains the commands. I think it's called chatcommands.txtIrish wrote:Is there any kind of tutorial for starting out with World Edit?
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
A list of my mods can be found here
-
- Member
- Posts: 16
- Joined: Thu Oct 08, 2015 20:36
- GitHub: n0taD1m3
- IRC: Uhm
- In-game: TekWaffle
Re: Post your modding questions here
Could someone please answer this?T3kW4ffl3 wrote:I don't know if this has been asked but how do you add randomly generated structures, that are created in World Edit
Stay Toast
つಠ益ಠ༽つ # (ʘ言ʘ╬) -"WAFFLE!"
╰〳 ಠ 益 ಠೃ 〵╯ RAISE YOUR DONGERS
つಠ益ಠ༽つ # (ʘ言ʘ╬) -"WAFFLE!"
╰〳 ಠ 益 ಠೃ 〵╯ RAISE YOUR DONGERS
Re: Post your modding questions here
All I can suggest is look at villages modT3kW4ffl3 wrote:Could someone please answer this?T3kW4ffl3 wrote:I don't know if this has been asked but how do you add randomly generated structures, that are created in World Edit
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
A list of my mods can be found here
-
- Member
- Posts: 16
- Joined: Thu Oct 08, 2015 20:36
- GitHub: n0taD1m3
- IRC: Uhm
- In-game: TekWaffle
Re: Post your modding questions here
Thank you @Don
Stay Toast
つಠ益ಠ༽つ # (ʘ言ʘ╬) -"WAFFLE!"
╰〳 ಠ 益 ಠೃ 〵╯ RAISE YOUR DONGERS
つಠ益ಠ༽つ # (ʘ言ʘ╬) -"WAFFLE!"
╰〳 ಠ 益 ಠೃ 〵╯ RAISE YOUR DONGERS
- iangp
- Member
- Posts: 114
- Joined: Sat May 31, 2014 19:26
- GitHub: 14NGiestas
- IRC: iangp
- In-game: iangp
- Location: Brasil - ES
Re: Post your modding questions here
Some one know if I can place nodes directly at Sqlite3 data base?
I want understand how to do it
The table look like these:
<pos,data>
pos -> a strange integer
data -> a blob of data
I want work with a bunch of nodes (Another MT-MC map converter... for getting all nodes of the MC map [this part it's done, conversion algorithm for MT it's done, now I'm adding the data to conversion table], I'm using the pymclevel...)
It's very slow use lua for place nodes so... I want use python sqlite3 connector
I want understand how to do it
The table look like these:
<pos,data>
pos -> a strange integer
data -> a blob of data
I want work with a bunch of nodes (Another MT-MC map converter... for getting all nodes of the MC map [this part it's done, conversion algorithm for MT it's done, now I'm adding the data to conversion table], I'm using the pymclevel...)
It's very slow use lua for place nodes so... I want use python sqlite3 connector
God's not dead, He's surely alive!
エル プサイ コングルー
My mods (WIP):
エル プサイ コングルー
My mods (WIP):
- Time Travel: viewtopic.php?f=9&t=13672
- Star wars: viewtopic.php?f=9&t=10086
- Pythonic speaker: viewtopic.php?f=9&t=13381
- Hybrid Dog
- Member
- Posts: 2836
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
Re: Post your modding questions here
maybe you can find some informations about it there
https://github.com/minetest/minetest/tree/master/src
https://github.com/minetest/minetest/tree/master/src
- iangp
- Member
- Posts: 114
- Joined: Sat May 31, 2014 19:26
- GitHub: 14NGiestas
- IRC: iangp
- In-game: iangp
- Location: Brasil - ES
Re: Post your modding questions here
Jeez O_ô
the source code in C++ (I'm not a C programmer, It's a uggly thing, but powerful)...
thanks HybridDog...
if the python access the database directly the conversion could be more faster...
someday I'll study the code...
but now python it is creating a '.csv' file but it's very slow...
and lua mod access the csv and place the nodes...
I already test with a single wall of blocks and looks tasty ^_^
the source code in C++ (I'm not a C programmer, It's a uggly thing, but powerful)...
thanks HybridDog...
if the python access the database directly the conversion could be more faster...
someday I'll study the code...
but now python it is creating a '.csv' file but it's very slow...
and lua mod access the csv and place the nodes...
I already test with a single wall of blocks and looks tasty ^_^
God's not dead, He's surely alive!
エル プサイ コングルー
My mods (WIP):
エル プサイ コングルー
My mods (WIP):
- Time Travel: viewtopic.php?f=9&t=13672
- Star wars: viewtopic.php?f=9&t=10086
- Pythonic speaker: viewtopic.php?f=9&t=13381
- iangp
- Member
- Posts: 114
- Joined: Sat May 31, 2014 19:26
- GitHub: 14NGiestas
- IRC: iangp
- In-game: iangp
- Location: Brasil - ES
Re: Post your modding questions here
God's not dead, He's surely alive!
エル プサイ コングルー
My mods (WIP):
エル プサイ コングルー
My mods (WIP):
- Time Travel: viewtopic.php?f=9&t=13672
- Star wars: viewtopic.php?f=9&t=10086
- Pythonic speaker: viewtopic.php?f=9&t=13381
- 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
I just see a grey circle with a horizontal bar across it ^
I suggest pasteboard.co or imgcru.sh
I suggest pasteboard.co or imgcru.sh
- iangp
- Member
- Posts: 114
- Joined: Sat May 31, 2014 19:26
- GitHub: 14NGiestas
- IRC: iangp
- In-game: iangp
- Location: Brasil - ES
Re: Post your modding questions here
https://goo.gl/photos/rN2BDaEEN5cJncVK9rubenwardy wrote:I just see a grey circle with a horizontal bar across it ^
I suggest pasteboard.co or imgcru.sh
https://goo.gl/photos/EX2KDCax5R4NC3oP6
God's not dead, He's surely alive!
エル プサイ コングルー
My mods (WIP):
エル プサイ コングルー
My mods (WIP):
- Time Travel: viewtopic.php?f=9&t=13672
- Star wars: viewtopic.php?f=9&t=10086
- Pythonic speaker: viewtopic.php?f=9&t=13381
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: Post your modding questions here
My mg_villages mod does that. I havn't officially released it yet because I need to write a lot of documentation about it, but it ought to be easy enough to just use it. I've even created some example village types that show how to add your own houses.T3kW4ffl3 wrote: I don't know if this has been asked but how do you add randomly generated structures, that are created in World Edit
A list of my mods can be found here.
- iangp
- Member
- Posts: 114
- Joined: Sat May 31, 2014 19:26
- GitHub: 14NGiestas
- IRC: iangp
- In-game: iangp
- Location: Brasil - ES
Re: Post your modding questions here
I found the position algorithm!Hybrid Dog wrote:maybe you can find some informations about it there
https://github.com/minetest/minetest/tree/master/src
It seems easy to implement...
I think i'm on the right way
Code: Select all
#include "database.h"
#include "irrlichttypes.h"
/****************
* Black magic! *
****************
* The position hashing is very messed up.
* It's a lot more complicated than it looks.
*/
static inline s16 unsigned_to_signed(u16 i, u16 max_positive)
{
if (i < max_positive) {
return i;
} else {
return i - (max_positive * 2);
}
}
// Modulo of a negative number does not work consistently in C
static inline s64 pythonmodulo(s64 i, s16 mod)
{
if (i >= 0) {
return i % mod;
}
return mod - ((-i) % mod);
}
s64 Database::getBlockAsInteger(const v3s16 &pos)
{
return (u64) pos.Z * 0x1000000 +
(u64) pos.Y * 0x1000 +
(u64) pos.X;
}
v3s16 Database::getIntegerAsBlock()
{
v3s16 pos;
pos.X = unsigned_to_signed(pythonmodulo(i, 4096), 2048);
i = (i - pos.X) / 4096;
pos.Y = unsigned_to_signed(pythonmodulo(i, 4096), 2048);
i = (i - pos.Y) / 4096;
pos.Z = unsigned_to_signed(pythonmodulo(i, 4096), 2048);
return pos;
}
God's not dead, He's surely alive!
エル プサイ コングルー
My mods (WIP):
エル プサイ コングルー
My mods (WIP):
- Time Travel: viewtopic.php?f=9&t=13672
- Star wars: viewtopic.php?f=9&t=10086
- Pythonic speaker: viewtopic.php?f=9&t=13381
Re: Post your modding questions here
How does that whole animation stuff work?
I am planning on making some mods which add different categories of animal mobs (like farm animals), and so far I've been understanding a lot by examining PilzAdams Simple Mobs and the answer to my last question from 4aiman (thanks again mate!), but set_animation and the animation table are still a big riddle to me.
Any in depth explanation of that stuff would be greatly appreciated (and I guess not only by me).
I am planning on making some mods which add different categories of animal mobs (like farm animals), and so far I've been understanding a lot by examining PilzAdams Simple Mobs and the answer to my last question from 4aiman (thanks again mate!), but set_animation and the animation table are still a big riddle to me.
Any in depth explanation of that stuff would be greatly appreciated (and I guess not only by me).
Re: Post your modding questions here
I analysed @PilzAdam's Simple Mobs and can answer your question for the sheep. Perhaps this is what you're looking for (but there are probably other ways to do animation in Minetest).[color=#1781B7]Merlin[/color] wrote:How does that whole animation stuff work?
I am planning on making some mods which add different categories of animal mobs (like farm animals), and so far I've been understanding a lot by examining PilzAdams Simple Mobs and the answer to my last question from 4aiman (thanks again mate!), but set_animation and the animation table are still a big riddle to me.
Any in depth explanation of that stuff would be greatly appreciated (and I guess not only by me).
@PilzAdam used a DirectX .x file to specify the sheep's shape, appearance and animation using an armature or kinematic chain model. The position and orientation of the sheep is given by six coordinates (x, y, z, pitch, yaw, roll). Parts of the sheep like the head and legs are attached to the main body. Each part has its own 6 position/rotation coordinates that are relative to the position of the main body. Armature parts are sometimes called "bones" because the whole model is like a skeleton with many moving parts attached to each other. But bones don't have to move on a single fixed joint, they can move in any way permitted by the 6 coordinates. They can even change in size during animation.
There is no calculation of physics within the individual parts of the sheep. The whole thing has velocity and acceleration, and it collides with something (ground, wall, etc.) and stops moving in that direction when it collides; but there is no separate collision of individual parts of the sheep. When the sheep stops, the legs and head stop with it.
In mobs_sheep.x, the main body of the sheep is Armature_Root, the legs are Armature_Bone_001, Armature_Bone_002, Armature_Bone_003 and Armature_RR_leg, and the head is Armature_Head. The first thing we see is a bunch of matrices giving the relative size and orientation (rotation) of each of the bones in the start position.
Next is the skin. This is a mesh (a table of polygons, in this case "quads" which are four-sided polygons) starting with the line that says "Mesh { //Cube_000 Mesh". First there are 500 sets of 3D coordinates, which are the vertices (corners) of the polygons. Then we have 125 polygons, each given as something like "4;24;25;26;27;," which means a quad that uses vertices 24 through 27 as its four corners. Then we have "mesh normals", which are vectors telling what direction each vertex should be considered to be pointing, these are used in calculating lighting and reflection of light off of the surface. Then we have a MeshMaterialList which isn't really being used, because this object uses a texture (PNG file) instead. Then we have the MeshTextureCoords table, which tells where each vertex gets its colour given as a 2-dimensional coordinate within the PNG file (which goes from 0.00 to 1.00 in both directions X and Y)
When the parts of an armature move, different parts of the skin will follow different bones as they move. Some parts of the skin can be told to follow multiple bones with fractional amounts, called "skin weights". These are given in the SkinWeights tables in mobs_sheep.x, with entries for each vertex (500 vertices total, with a table for each of the 6 parts of the sheep). All the skin weights are 1.00, that means that each piece of the sheep moves by itself and there is no partial movement of the skin near the joints.
Finally we have the animation. Each of the 6 pieces has a set of animation frames, called AnimationKey, that is given in three parts: position, rotation, and scale. Each AnimationKey has 165 frames.
The AnimationKey tables are fairly boring, almost every line of data is identical. But go down to "Animation { {Armature_RR_leg} AnimationKey {" and skip down to the "Rotation" section and eventually you'll see this:
Code: Select all
80;4; -0.000000, 1.000000, 0.000000,-0.000000;;,
81;4; -0.023017, 0.996971,-0.000000,-0.000000;;,
82;4; -0.087830, 0.988440,-0.000000,-0.000000;;,
83;4; -0.171026, 0.977486,-0.000000,-0.000000;;,
84;4; -0.235816, 0.968955,-0.000000,-0.000000;;,
85;4; -0.258819, 0.965926,-0.000000,-0.000000;;,
[more lines here]
99;4; 0.023017, 0.996971, 0.000000,-0.000000;;,
100;4; -0.000000, 1.000000, 0.000000,-0.000000;;,
That's all we find in mobs_sheep.x, but there is one more important part in how the animation is specified.
In init.lua, or in sheep.lua if your mod has the animals in separate init files, the sheep's animations are specified like this:
Code: Select all
animation = {
speed_normal = 15,
stand_start = 0,
stand_end = 80,
walk_start = 81,
walk_end = 100,
},
Notice that when the sheep is standing, it uses animation frames 0 through 80. These frames don't move the legs at all, but the head moves a little during frames 1-58 (look for "1;4; 0.000000, 0.000000, 0.706989, 0.707223;;,"). Also, frames 101 through 164 aren't being used at all.
We don't know what tools @PilzAdam used to create this, but Blender exports to DirectX and appears to be able to create this type of model. Here is a link to the Armatures section of the Blender online documentation: Armatures. There are a lot of very complex things you can do in Blender models, but Minetest will only support the ones that are directly provided by Irrlicht.
There is a page on the Minetest wiki about this: Using Blender
As I mentioned at the start, there are other ways to get models into MineTest. For example, my portalgun mod originally by @UjEdwin uses "Alias Wavefront OBJ files" that were made in SketchUp. This page describes the texture and mesh file formats supported by Irrlicht.
Last edited by mrob27 on Sun Oct 18, 2015 00:42, edited 2 times in total.
Re: Post your modding questions here
Now, thank YOU!
Your explanation is amazing! Thanks (again) for taking the time to write this.
Animation was/is nearly the last riddle on my list to be able to create my mobs.
You helped me loads, I'll go looking for some tutorials on making such models.
Your explanation is amazing! Thanks (again) for taking the time to write this.
Animation was/is nearly the last riddle on my list to be able to create my mobs.
You helped me loads, I'll go looking for some tutorials on making such models.
Re: Post your modding questions here
I am trying to learn how to save a simple table and then read from it. Can someone point me to the right info to learn it?
All I want to do is have a table like this
It needs to save strings and numbers. When I have tried I always get an error of expected string, got nil
All I want to do is have a table like this
Code: Select all
mytable = {
item1 = "something",
item2 = "something",
item3 = 4
}
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
A list of my mods can be found here
Who is online
Users browsing this forum: No registered users and 7 guests