Advertisement
Guest User

error?

a guest
Jan 21st, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1.  
  2.  
  3. minetest.register_entity("better_minetest_test:testentity",
  4. {
  5. hp_max = 100,
  6. physical = true,
  7. weight = 5,
  8. collisionbox = {-0.35,0.0,-0.35, 0.35,1.8,0.35},
  9. visual = "mesh",
  10. visual_size = {x=1, y=1},
  11. mesh = "better_minetest_creeper.obj",
  12. textures = {"better_minetest_creeper.png"},
  13. colors = {},
  14. is_visible = true,
  15. makes_footstep_sound = true,
  16. automatic_rotate = false,
  17. stepheight = 0,
  18. automatic_face_movement_dir = false,
  19. armor_groups = {immortal=1},
  20. animation = {
  21. --[[stand_START = 0,
  22. stand_END = 79,
  23. sit_START = 81,
  24. sit_END = 160,
  25. lay_START = 162,
  26. lay_END = 166,
  27. walk_START = 168,
  28. walk_END = 187,
  29. mine_START = 189,
  30. mine_END = 198,
  31. run_START = 221,
  32. run_END = 240,]]
  33. },
  34. --animation_speed = 12,
  35. decription = "Test NPC",
  36. show_nametag = true,
  37. inventory_image = "npcf_inv_top.png",
  38. nametag_color = "white",
  39. metadata = {
  40. free_roaming = "false",
  41. follow_players = "false",
  42. anim_stop = "Stand",
  43. },
  44. var = {
  45. speed = 1,
  46. avoid_dir = 1,
  47. last_pos = {x=0,y=0,z=0},
  48. target = nil,
  49. },
  50. --[[initial_properties {
  51. hp_max = 200,
  52. hp = 200
  53. },]]
  54. on_activate = function(self, data)
  55. --this is called when the entity is spawned, and loaded in!
  56. --the data, is the serialized data! deserialize before use
  57. print("activate?")
  58. end,
  59. on_step = function(self, dtime)
  60.  
  61. end,
  62. on_punch = function(self, puncher, time_from_last_punch,
  63. tool_capibilities, dir)
  64.  
  65. end,
  66. on_rightclick = function(self, clicker)
  67. --self.object:remove()
  68. print("setting bone position?!")
  69. self.object:set_bone_position("head", {x=math.random(1000), y=math.random(1000), z=math.random(1000)}, {x=math.random(1000), y=math.random(1000), z=math.random(1000)})
  70. print(tostring(self))
  71.  
  72. for i, v in pairs(self) do
  73. print("self["..i.."] = ", v)
  74. end
  75. end,
  76. on_staticdata = function(self)
  77. print("static data?")--this is used to serialize the data! must return serialized string!
  78. end,
  79. on_step = function(self, dtime)
  80. --print("self: "..tostring(self))
  81. --print("self.object: "..tostring(self.object))
  82. end
  83. }
  84. )
  85.  
  86.  
  87.  
  88. minetest.register_abm(
  89. {
  90. nodenames = {
  91. "testmod:decowood"
  92. },
  93. interval = 2,
  94. chance = 10,
  95. action = function(pos)
  96. pos.y = pos.y+1
  97. minetest.add_entity(pos, "better_minetest_test:testentity")
  98. end
  99. }
  100. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement