Help with entities please!!!

Blehmeh98
Member
 
Posts: 14
Joined: Thu Sep 17, 2015 00:17
GitHub: blehmeh98
In-game: rantor77

Help with entities please!!!

by Blehmeh98 » Thu Sep 17, 2015 00:24

Hello,
I am a newbie at minetest modding (though not a newbie at Lua in general, as I have a good bit of experience with it having used multiple libraries). I cannot seem to make an entity, no matter how hard I try, and there is nowhere that I can find good documentation online to see what I am doing wrong. I have tried looking at other mods to see what strategy they take, but no cigar. I then see other people excelling at making entities and I wonder what I am doing wrong. Is it because I am using duckduckgo instead of google?

Anyways, can you please tell me what in my code is flagging errors? I have done tests by "commenting out" pieces of code and I know for certain that my attempt at registering an entity is wrong somehow. Please and thank you.

Code: Select all
minetest.register_entity("sciencing:pug", {
   hp_max = 6,
   weight = 10,
   physical = false,
   timer=0,
   visual = "sprite",
   visual_size = {x=1, y=1},
   textures = {"sciencing:sciencePug"},
   lastpos={},
   collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
   makes_footstep_sound = false,
       automatic_rotate = false
}
hi.
 

User avatar
benrob0329
Member
 
Posts: 1313
Joined: Thu Aug 06, 2015 22:39
Location: Michigan
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03

Re: Help with entities please!!!

by benrob0329 » Thu Sep 17, 2015 01:39

http://dev.minetest.net/minetest.register_entity

I use DDG as well, I doubt that is the problem, actually its probably better than Google :-P
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA
 

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

Re: Help with entities please!!!

by eduardomezencio » Thu Sep 17, 2015 14:52

The most obvious thing I can see is forgetting to close the parenthesis at the end, but maybe you just forgot to copy it here?
Last edited by eduardomezencio on Tue Sep 22, 2015 22:12, edited 1 time in total.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: Help with entities please!!!

by 4aiman » Thu Sep 17, 2015 15:08

Umm.. why not take some entity that already exists?

Here's some basic entity:
Code: Select all
minetest.register_entity("<mod name>:<entity name>", {
    hp_max = <some value>,
    collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
    textures = {<a texture>},
    visual = <whatever type you want>,
    visual_size = {x=<scale multiplier>,y=<scale multiplier>,z=<scale multiplier>},
    makes_footstep_sound = <true or false>,
})
 

blert2112
Member
 
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

Re: Help with entities please!!!

by blert2112 » Thu Sep 17, 2015 19:38

Just off the top of my head... Have you checked the texture name? You have it listed with a semicolon in it. Is that how you have the actual file name? The texture should just be the file name.
 

Blehmeh98
Member
 
Posts: 14
Joined: Thu Sep 17, 2015 00:17
GitHub: blehmeh98
In-game: rantor77

Re: Help with entities please!!!

by Blehmeh98 » Fri Sep 18, 2015 01:41

blert2112 wrote:Just off the top of my head... Have you checked the texture name? You have it listed with a semicolon in it. Is that how you have the actual file name? The texture should just be the file name.

Ohhh . . . DId not notice that. Thank you! I will try the other errors listed here. I used Ctrl C Ctrl V so I could not have made a mistake copying it.
hi.
 

Blehmeh98
Member
 
Posts: 14
Joined: Thu Sep 17, 2015 00:17
GitHub: blehmeh98
In-game: rantor77

Re: Help with entities please!!!

by Blehmeh98 » Fri Sep 18, 2015 01:46

eduardomezencio got it right. I had done it correctly, but I forgot to add parentheses at the end. Also, blert2112 was right about me writing the texture name wrong, but it chose to create a dummy immage instead of crash the game. Thank you guys! I will release some mods soon so you can see what I am working on!
hi.
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 1 guest