herobrine mod

User avatar
xXfrancoXx
Member
 
Posts: 34
Joined: Tue Apr 09, 2013 15:46

herobrine mod

by xXfrancoXx » Sun Apr 14, 2013 03:05

Description:
NPC is a peaceful, but if you hit and if you put many persige persigiran you all

actions:
-walks safflower
-jumps
He is watching you

download:
http://www.mediafire.com/?kkj0v1mbvu94dq2

Image
Last edited by xXfrancoXx on Sun Apr 14, 2013 23:55, edited 1 time in total.
 

clarksallador
Member
 
Posts: 57
Joined: Sun Sep 30, 2012 03:18

by clarksallador » Sun Apr 14, 2013 03:46

Any screenshots?
 

User avatar
xXfrancoXx
Member
 
Posts: 34
Joined: Tue Apr 09, 2013 15:46

by xXfrancoXx » Sun Apr 14, 2013 03:48

clarksallador wrote:Any screenshots?

Nose like putting pictures even take pictures
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sun Apr 14, 2013 10:04

This is in the wrong section of the forum. It should be in "Modding General".
 

User avatar
xXfrancoXx
Member
 
Posts: 34
Joined: Tue Apr 09, 2013 15:46

by xXfrancoXx » Sun Apr 14, 2013 14:33

PilzAdam wrote:This is in the wrong section of the forum. It should be in "Modding General".

esque I have no permission to post to releases mods: (
 

oxenfreedan
Member
 
Posts: 218
Joined: Tue Jan 22, 2013 01:39

by oxenfreedan » Sun Apr 14, 2013 23:29

Cool but I won't download unless screen shots come out!
My Awesome Map please try:
http://forum.minetest.net/viewtopic.php?id=5028
I've played minetest since 0.3.1 came out!
Mostly when on forums I'm using a uniden tablet!
 

User avatar
xXfrancoXx
Member
 
Posts: 34
Joined: Tue Apr 09, 2013 15:46

by xXfrancoXx » Sun Apr 14, 2013 23:56

oxenfreedan wrote:Cool but I won't download unless screen shots come out!

and put an image
 

User avatar
lonely
Member
 
Posts: 58
Joined: Fri Feb 01, 2013 15:30

by lonely » Sun May 12, 2013 08:52

I will use this for a horror map in minetest.
Aperture science:[url]http:forum.minetest.net/viewtopic.php?id=5917[/url]
I v'e got MineCraft now, so goodbye. You can look for me at the minecraft forum. my name there
is Portalfreaky.
 

User avatar
xXfrancoXx
Member
 
Posts: 34
Joined: Tue Apr 09, 2013 15:46

by xXfrancoXx » Fri May 17, 2013 01:34

lonely wrote:I will use this for a horror map in minetest.


okey, pass me the map when I test haci :)
 

User avatar
cornellius
Member
 
Posts: 82
Joined: Sat Dec 01, 2012 05:08

by cornellius » Fri May 24, 2013 12:29

Noo Nooo No More Herobrine No More Herobrine!!!!
All Humans Need Is Forgiveness, God Is The First One Who Forgive All Humans So Humans Must Forgive Other Humans
 

User avatar
xXfrancoXx
Member
 
Posts: 34
Joined: Tue Apr 09, 2013 15:46

by xXfrancoXx » Thu May 30, 2013 06:30

cornellius wrote:Noo Nooo No More Herobrine No More Herobrine!!!!

xd
 

User avatar
lonely
Member
 
Posts: 58
Joined: Fri Feb 01, 2013 15:30

by lonely » Thu May 30, 2013 09:59

xXfrancoXx wrote:
lonely wrote:I will use this for a horror map in minetest.


okey, pass me the map when I test haci :)

oO Coming soon Oo
Aperture science:[url]http:forum.minetest.net/viewtopic.php?id=5917[/url]
I v'e got MineCraft now, so goodbye. You can look for me at the minecraft forum. my name there
is Portalfreaky.
 

User avatar
xXfrancoXx
Member
 
Posts: 34
Joined: Tue Apr 09, 2013 15:46

by xXfrancoXx » Wed Jun 05, 2013 16:38

lonely wrote:
xXfrancoXx wrote:
lonely wrote:I will use this for a horror map in minetest.


okey, pass me the map when I test haci :)

oO Coming soon Oo

okey xd
 

Yuser
Member
 
Posts: 12
Joined: Sat Jun 01, 2013 18:09

by Yuser » Fri Jun 07, 2013 18:32

Then it would be testobrine? herotest? (that sounds like a good guy) I don't know
 

User avatar
xXfrancoXx
Member
 
Posts: 34
Joined: Tue Apr 09, 2013 15:46

by xXfrancoXx » Mon Jun 10, 2013 01:04

Hybrid Dog wrote:
Yuser wrote:Then it would be testobrine? herotest? (that sounds like a good guy) I don't know
maybe hesobsine

what?
 

1704626
Member
 
Posts: 87
Joined: Thu Jan 02, 2014 22:52

by 1704626 » Fri Jan 03, 2014 20:26

why are there no textures
Just Call Me Numbers
 

User avatar
hoodedice
Member
 
Posts: 1372
Joined: Sat Jul 06, 2013 06:33

by hoodedice » Sat Jan 04, 2014 02:17

1704626 wrote:why are there no textures


Whose textures are you talking about?
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build
 

1704626
Member
 
Posts: 87
Joined: Thu Jan 02, 2014 22:52

by 1704626 » Tue Jan 28, 2014 04:37

IS THIS FOR PC PS IM ADDING SOMETHING LIKE THIS TO MY NEW MOD BUT I CAME UP WITH 3 NAMES I CANNOT CHOOSE ICOULD CALL HIM ENIBOREH 1704626 OR HAK WHITCH ONE IS BEST
Just Call Me Numbers
 

1704626
Member
 
Posts: 87
Joined: Thu Jan 02, 2014 22:52

by 1704626 » Sat Mar 22, 2014 21:42

can someone upload a zip file
Just Call Me Numbers
 

User avatar
linushsao
Member
 
Posts: 331
Joined: Mon Jan 27, 2014 12:56
IRC: linushsao
In-game: linus

by linushsao » Mon Mar 24, 2014 08:55

screenshot seems interesting,but..

16:53:26: ERROR[main]: ========== ERROR FROM LUA ===========
16:53:26: ERROR[main]: Failed to load and run script from
16:53:26: ERROR[main]: /home/linus/.minetest/mods/herobrine/init.lua:
16:53:26: ERROR[main]: /usr/share/minetest/builtin/builtin.lua:16: Name npc:npc does not follow naming conventions: "modname:" or ":" prefix required
16:53:26: ERROR[main]: stack traceback:
16:53:26: ERROR[main]: [C]: in function 'errorfct'
16:53:26: ERROR[main]: /usr/share/minetest/builtin/builtin.lua:16: in function 'error'
16:53:26: ERROR[main]: /usr/share/minetest/builtin/misc_register.lua:60: in function 'check_modname_prefix'
16:53:26: ERROR[main]: /usr/share/minetest/builtin/misc_register.lua:82: in function 'register_entity'
16:53:26: ERROR[main]: /home/linus/.minetest/mods/herobrine/init.lua:407: in main chunk
16:53:26: ERROR[main]: ======= END OF ERROR FROM LUA ========
16:53:26: ERROR[main]: Server: Failed to load and run /home/linus/.minetest/mods/herobrine/init.lua
16:53:26: ERROR[main]: ERROR: An unhandled exception occurred: ModError: Failed to load and run /home/linus/.minetest/mods/herobrine/init.lua
Last edited by linushsao on Mon Mar 24, 2014 08:55, edited 1 time in total.
1).My Server:Mars World
2).address:139.59.238.211:30016
3).manual(in processing):http://tinyurl.com/jyjkrgl
4).for my(admin's) role in all my servers,i'll be as the earth/water/fire/wind. i maintain that system,but not manage/touch players directly in game,not own the crafts on planet. i just keep watching the worlds.
 

User avatar
linushsao
Member
 
Posts: 331
Joined: Mon Jan 27, 2014 12:56
IRC: linushsao
In-game: linus

by linushsao » Mon Mar 24, 2014 13:01

linushsao wrote:screenshot seems interesting,but..

16:53:26: ERROR[main]: ========== ERROR FROM LUA ===========
16:53:26: ERROR[main]: Failed to load and run script from
16:53:26: ERROR[main]: /home/linus/.minetest/mods/herobrine/init.lua:
16:53:26: ERROR[main]: /usr/share/minetest/builtin/builtin.lua:16: Name npc:npc does not follow naming conventions: "modname:" or ":" prefix required
....
/home/linus/.minetest/mods/herobrine/init.lua


solved ...just rename the folder to "npc",as the error message. ...
Last edited by linushsao on Mon Mar 24, 2014 14:30, edited 1 time in total.
1).My Server:Mars World
2).address:139.59.238.211:30016
3).manual(in processing):http://tinyurl.com/jyjkrgl
4).for my(admin's) role in all my servers,i'll be as the earth/water/fire/wind. i maintain that system,but not manage/touch players directly in game,not own the crafts on planet. i just keep watching the worlds.
 

User avatar
linushsao
Member
 
Posts: 331
Joined: Mon Jan 27, 2014 12:56
IRC: linushsao
In-game: linus

by linushsao » Mon Mar 24, 2014 13:41

just finish testing this mod,small error about texture. just add folder "textures" in this mod's directory as regular mod's rule, than put all image files into "textures" folder just added.

it will work fine, i try to hit npc,make sure that npc is very angry...XD
Last edited by linushsao on Mon Mar 24, 2014 13:44, edited 1 time in total.
1).My Server:Mars World
2).address:139.59.238.211:30016
3).manual(in processing):http://tinyurl.com/jyjkrgl
4).for my(admin's) role in all my servers,i'll be as the earth/water/fire/wind. i maintain that system,but not manage/touch players directly in game,not own the crafts on planet. i just keep watching the worlds.
 

User avatar
ParaklataChotou
Member
 
Posts: 209
Joined: Sat Jun 18, 2016 17:09
GitHub: paraklatachotou
IRC: CareBearWhoCares
In-game: AutistCortana

Re: herobrine mod

by ParaklataChotou » Thu Sep 29, 2016 23:17

YOU NEED TO GO TO INT.LUA, AND CHANGE THIS NAME in all the lines.
characther.x
for
character.b3d
Here's the debuged code - just copy paste over int.lua:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-- NPC max walk speed
walk_limit = 2

-- Player animation speed
animation_speed = 30

-- Player animation blending
-- Note: This is currently broken due to a bug in Irrlicht, leave at 0
animation_blend = 0

-- Default player appearance
default_model = "character.b3d"
available_npc_textures = {
   texture_1 = {"jordan4ibanez.png", },
   texture_2 = {"zombie.png", },
   texture_3 = {"celeron55.png", },
   texture_4 = {"steve.png", }
}


-- Frame ranges for each player model
function player_get_animations(model)
   if model == "character.b3d" then
      return {
      stand_START = 0,
      stand_END = 79,
      sit_START = 81,
      sit_END = 160,
      lay_START = 162,
      lay_END = 166,
      walk_START = 168,
      walk_END = 187,
      mine_START = 189,
      mine_END = 198,
      walk_mine_START = 200,
      walk_mine_END = 219
      }
   end
end

local player_model = {}
local player_anim = {}
local player_sneak = {}
local ANIM_STAND = 1
local ANIM_SIT = 2
local ANIM_LAY = 3
local ANIM_WALK  = 4
local ANIM_WALK_MINE = 5
local ANIM_MINE = 6

function player_update_visuals(self)
   --local name = get_player_name()

   visual = default_model
   player_anim = 0 -- Animation will be set further below immediately
   --player_sneak[name] = false
   prop = {
      mesh = default_model,
      textures = default_textures,
      textures = available_npc_textures["texture_"..math.random(1,4)],
      visual_size = {x=1, y=1},
   }
   self.object:set_properties(prop)
end

NPC_ENTITY = {
   physical = true,
   collisionbox = {-0.3,-1.0,-0.3, 0.3,0.8,0.3},
   visual = "mesh",
   mesh = "character.b3d",
   textures = {"character.png"},
   player_anim = 0,
   timer = 0,
   turn_timer = 0,
   vec = 0,
   yaw = 0,
   yawwer = 0,
   state = 1,
   jump_timer = 0,
   door_timer = 0,
   attacker = "",
   attacking_timer = 0,
}

NPC_ENTITY.on_activate = function(self)
   player_update_visuals(self)
   self.anim = player_get_animations(visual)
   self.object:set_animation({x=self.anim.stand_START,y=self.anim.stand_END}, animation_speed_mod, animation_blend)
   self.player_anim = ANIM_STAND
   self.object:setacceleration({x=0,y=-10,z=0})
   self.state = 1
end

NPC_ENTITY.on_punch = function(self, puncher)
   for  _,object in ipairs(minetest.env:get_objects_inside_radius(self.object:getpos(), 5)) do
      if not object:is_player() then
         if object:get_luaentity().name == "npc:npc" then
            object:get_luaentity().state = 3
            object:get_luaentity().attacker = puncher:get_player_name()
         end
      end
   end
   if self.state ~= 3 then
      self.state = 3
      self.attacker = puncher:get_player_name()
   end
end

NPC_ENTITY.on_step = function(self, dtime)
   self.timer = self.timer + 0.01
   self.turn_timer = self.turn_timer + 0.01
   self.jump_timer = self.jump_timer + 0.01
   self.door_timer = self.door_timer + 0.01
   self.attacking_timer = self.attacking_timer + 0.01
   
   --collision detection prealpha
   --[[
   for  _,object in ipairs(minetest.env:get_objects_inside_radius(self.object:getpos(), 2)) do
      if object:is_player() then
         compare1 = object:getpos()
         compare2 = self.object:getpos()
         newx = compare2.x - compare1.x
         newz = compare2.z - compare1.z
         print(newx)
         print(newz)
         self.object:setacceleration({x=newx,y=self.object:getacceleration().y,z=newz})
      elseif not object:is_player() then
         if object:get_luaentity().name == "npc:npc" then
            print("moo")
         end
      end
   end
   ]]--
   --set npc to hostile in night, and revert npc back to peaceful in daylight
   if minetest.env:get_timeofday() >= 0 and minetest.env:get_timeofday() < 0.25 and self.state ~= 4 then
      self.state = 4
   elseif minetest.env:get_timeofday() > 0.25 and self.state == 4 then
      self.state = 1
   end
   --if mob is not in attack or hostile mode, set mob to walking or standing
   if self.state < 3 then
      if self.timer > math.random(1,20) then
         self.state = math.random(1,2)
         self.timer = 0
      end
   end
   --STANDING
   if self.state == 1 then
      self.yawwer = true
      for  _,object in ipairs(minetest.env:get_objects_inside_radius(self.object:getpos(), 3)) do
         if object:is_player() then
            self.yawwer = false
            NPC = self.object:getpos()
            PLAYER = object:getpos()
            self.vec = {x=PLAYER.x-NPC.x, y=PLAYER.y-NPC.y, z=PLAYER.z-NPC.z}
            self.yaw = math.atan(self.vec.z/self.vec.x)+math.pi^2
            if PLAYER.x > NPC.x then
               self.yaw = self.yaw + math.pi
            end
            self.yaw = self.yaw - 2
            self.object:setyaw(self.yaw)
         end
      end
      
      if self.turn_timer > math.random(1,4) and yawwer == true then
         self.yaw = 360 * math.random()
         self.object:setyaw(self.yaw)
         self.turn_timer = 0
      end
      self.object:setvelocity({x=0,y=self.object:getvelocity().y,z=0})
      if self.player_anim ~= ANIM_STAND then
         self.anim = player_get_animations(visual)
         self.object:set_animation({x=self.anim.stand_START,y=self.anim.stand_END}, animation_speed_mod, animation_blend)
         self.player_anim = ANIM_STAND
      end
   end
   --WALKING
   if self.state == 2 then
      if self.direction ~= nil then
         self.object:setvelocity({x=self.direction.x,y=self.object:getvelocity().y,z=self.direction.z})
      end
      if self.turn_timer > math.random(1,4) then
         self.yaw = 360 * math.random()
         self.object:setyaw(self.yaw)
         self.turn_timer = 0
         self.direction = {x = math.sin(self.yaw)*-1, y = -10, z = math.cos(self.yaw)}
         --self.object:setvelocity({x=self.direction.x,y=self.object:getvelocity().y,z=direction.z})
         --self.object:setacceleration(self.direction)
      end
      if self.player_anim ~= ANIM_WALK then
         self.anim = player_get_animations(visual)
         self.object:set_animation({x=self.anim.walk_START,y=self.anim.walk_END}, animation_speed_mod, animation_blend)
         self.player_anim = ANIM_WALK
      end
      --open a door [alpha]
      if self.direction ~= nil then
         if self.door_timer > 2 then
            local is_a_door = minetest.env:get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y,z=self.object:getpos().z + self.direction.z}).name
            if is_a_door == "doors:door_wood_t_1" then
               minetest.env:punch_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z})
               self.door_timer = 0
            end
            local is_in_door = minetest.env:get_node(self.object:getpos()).name
            if is_in_door == "doors:door_wood_t_1" then
               minetest.env:punch_node(self.object:getpos())
            end
         end
      end
      --jump
      if self.direction ~= nil then
         if self.jump_timer > 0.3 then
            if minetest.env:get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}).name ~= "air" then
               self.object:setvelocity({x=self.object:getvelocity().x,y=5,z=self.object:getvelocity().z})
               self.jump_timer = 0
            end
         end
      end
   end
   --ATTACKING
   if self.state == 3 then
      if self.attacking_timer > 0.25 then
         for  _,object in ipairs(minetest.env:get_objects_inside_radius(self.object:getpos(), 2)) do
            if object:is_player() then
               if object:get_player_name() == self.attacker then
                  if object:get_hp() > 0 then               
                     object:punch(object, 1.0, {
                        full_punch_interval=1.0,
                        groupcaps={
                           fleshy={times={[1]=1, [2]=1, [3]=1}},
                           snappy={times={[1]=1, [2]=1, [3]=1}},
                        }
                     }, nil)
                     self.attacking_timer = 0
                  elseif object:get_hp() <= 0 then
                     self.state = 1
                     self.attacker = ""
                  end
               end
            end
         end
      end
      for  _,object in ipairs(minetest.env:get_objects_inside_radius(self.object:getpos(), 10)) do
         if object:is_player() then
            if object:get_player_name() == self.attacker then
               if self.player_anim ~= ANIM_WALK then
                  self.anim = player_get_animations(visual)
                  self.object:set_animation({x=self.anim.walk_START,y=self.anim.walk_END}, animation_speed_mod, animation_blend)
                  self.player_anim = ANIM_WALK
               end
               NPC = self.object:getpos()
               PLAYER = object:getpos()
               self.vec = {x=PLAYER.x-NPC.x, y=PLAYER.y-NPC.y, z=PLAYER.z-NPC.z}
               self.yaw = math.atan(self.vec.z/self.vec.x)+math.pi^2
               if PLAYER.x > NPC.x then
                  self.yaw = self.yaw + math.pi
               end
               self.yaw = self.yaw - 2
               self.object:setyaw(self.yaw)
               self.direction = {x = math.sin(self.yaw)*-1, y = 0, z = math.cos(self.yaw)}
               if self.direction ~= nil then
                  self.object:setvelocity({x=self.direction.x*2.5,y=self.object:getvelocity().y,z=self.direction.z*2.5})
               end
               --jump over obstacles
               if self.jump_timer > 0.3 then
                  if minetest.env:get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}).name ~= "air" then
                     self.object:setvelocity({x=self.object:getvelocity().x,y=5,z=self.object:getvelocity().z})
                     self.jump_timer = 0
                  end
               end
               if self.direction ~= nil then
                  if self.door_timer > 2 then
                     local is_a_door = minetest.env:get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y,z=self.object:getpos().z + self.direction.z}).name
                     if is_a_door == "doors:door_wood_t_1" then
                        minetest.env:punch_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z})
                        self.door_timer = 0
                     end
                     local is_in_door = minetest.env:get_node(self.object:getpos()).name
                     if is_in_door == "doors:door_wood_t_1" then
                        minetest.env:punch_node(self.object:getpos())
                     end
                  end
               end
               return
            elseif object:get_player_name() ~= self.attacker then
               self.state = 1
               self.attacker = ""
               return
            end
         elseif not object:is_player() then
            self.state = 1
            self.attacker = ""
         end
      end
   end
   --WANDERING CONSTANTLY AT NIGHT
   if self.state == 4 then
      if self.player_anim ~= ANIM_WALK then
         self.anim = player_get_animations(visual)
         self.object:set_animation({x=self.anim.walk_START,y=self.anim.walk_END}, animation_speed_mod, animation_blend)
         self.player_anim = ANIM_WALK
      end
      if self.attacking_timer > 0.25 then
         for  _,object in ipairs(minetest.env:get_objects_inside_radius(self.object:getpos(), 2)) do
            if object:is_player() then
               if object:get_hp() > 0 then               
                  object:punch(object, 1.0, {
                     full_punch_interval=1.0,
                     groupcaps={
                        fleshy={times={[1]=1, [2]=1, [3]=1}},
                        snappy={times={[1]=1, [2]=1, [3]=1}},
                     }
                  }, nil)
                  self.attacking_timer = 0
               elseif object:get_hp() <= 0 then
                  self.state = 1
                  self.attacker = ""
               end
            end
         end
      end
      for  _,object in ipairs(minetest.env:get_objects_inside_radius(self.object:getpos(), 12)) do
         if object:is_player() then
            if object:get_hp() > 0 then
               NPC = self.object:getpos()
               PLAYER = object:getpos()
               self.vec = {x=PLAYER.x-NPC.x, y=PLAYER.y-NPC.y, z=PLAYER.z-NPC.z}
               self.yaw = math.atan(self.vec.z/self.vec.x)+math.pi^2
               if PLAYER.x > NPC.x then
                  self.yaw = self.yaw + math.pi
               end
               self.yaw = self.yaw - 2
               self.object:setyaw(self.yaw)
               self.direction = {x = math.sin(self.yaw)*-1, y = 0, z = math.cos(self.yaw)}
               if self.direction ~= nil then
                  self.object:setvelocity({x=self.direction.x*2.5,y=self.object:getvelocity().y,z=self.direction.z*2.5})
               end
               --jump over obstacles
               if self.jump_timer > 0.3 then
                  if minetest.env:get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}).name ~= "air" then
                     self.object:setvelocity({x=self.object:getvelocity().x,y=5,z=self.object:getvelocity().z})
                     self.jump_timer = 0
                  end
               end
               if self.direction ~= nil then
                  if self.door_timer > 2 then
                     local is_a_door = minetest.env:get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y,z=self.object:getpos().z + self.direction.z}).name
                     if is_a_door == "doors:door_wood_t_1" then
                        minetest.env:punch_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z})
                        self.door_timer = 0
                     end
                     local is_in_door = minetest.env:get_node(self.object:getpos()).name
                     if is_in_door == "doors:door_wood_t_1" then
                        minetest.env:punch_node(self.object:getpos())
                     end
                  end
               end
            --return
            end
         elseif not object:is_player() then
            self.state = 1
            self.attacker = ""
         end
      end
      if self.direction ~= nil then
         self.object:setvelocity({x=self.direction.x,y=self.object:getvelocity().y,z=self.direction.z})
      end
      if self.turn_timer > math.random(1,4) then
         self.yaw = 360 * math.random()
         self.object:setyaw(self.yaw)
         self.turn_timer = 0
         self.direction = {x = math.sin(self.yaw)*-1, y = -10, z = math.cos(self.yaw)}
      end
      if self.player_anim ~= ANIM_WALK then
         self.anim = player_get_animations(visual)
         self.object:set_animation({x=self.anim.walk_START,y=self.anim.walk_END}, animation_speed_mod, animation_blend)
         self.player_anim = ANIM_WALK
      end
      --open a door [alpha]
      if self.direction ~= nil then
         if self.door_timer > 2 then
            local is_a_door = minetest.env:get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y,z=self.object:getpos().z + self.direction.z}).name
            if is_a_door == "doors:door_wood_t_1" then
               --print("door")
               minetest.env:punch_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z})
               self.door_timer = 0
            end
            local is_in_door = minetest.env:get_node(self.object:getpos()).name
            --print(dump(is_in_door))
            if is_in_door == "doors:door_wood_t_1" then
               minetest.env:punch_node(self.object:getpos())
            end
         end
      end
      --jump
      if self.direction ~= nil then
         if self.jump_timer > 0.3 then
            --print(dump(minetest.env:get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z})))
            if minetest.env:get_node({x=self.object:getpos().x + self.direction.x,y=self.object:getpos().y-1,z=self.object:getpos().z + self.direction.z}).name ~= "air" then
               self.object:setvelocity({x=self.object:getvelocity().x,y=5,z=self.object:getvelocity().z})
               self.jump_timer = 0
            end
         end
      end
   end
end

minetest.register_entity("npc:npc", NPC_ENTITY)

minetest.register_node("npc:spawnegg", {
   description = "spawnegg",
   image = "mobspawnegg.png",
   inventory_image = "mobspawnegg.png",
   wield_image = "mobspawnegg.png",
   paramtype = "light",
   tiles = {"spawnegg.png"},
   is_ground_content = true,
   drawtype = "glasslike",
   groups = {crumbly=3},
   selection_box = {
      type = "fixed",
      fixed = {0,0,0,0,0,0}
   },
   sounds = default.node_sound_dirt_defaults(),
   on_place = function(itemstack, placer, pointed)
      pos = pointed.above
      pos.y = pos.y + 1
      minetest.env:add_entity(pointed.above,"npc:npc")
   end
})
--[[
This causes mobs to cluster together DONTA JLAFGJKAS USE IRT
--use pilzadam's spawning algo
npcs = {}
npcs.spawning_mobs = {}
   function npcs:register_spawn(name, nodes, max_light, min_light, chance, mobs_per_30_block_radius, max_height)
      npcs.spawning_mobs[name] = true
      minetest.register_abm({
      nodenames = nodes,
      neighbors = nodes,
      interval = 30,
      chance = chance,
      action = function(pos, node)
         if not npcs.spawning_mobs[name] then
            return
         end
         pos.y = pos.y+1
         if not minetest.env:get_node_light(pos) then
            return
         end
         if minetest.env:get_node_light(pos) > max_light then
            return
         end
         if minetest.env:get_node_light(pos) < min_light then
            return
         end
         if pos.y > max_height then
            return
         end
         if minetest.env:get_node(pos).name ~= "air" then
            return
         end
         pos.y = pos.y+1
         if minetest.env:get_node(pos).name ~= "air" then
            return
         end

         local count = 0
         for _,obj in pairs(minetest.env:get_objects_inside_radius(pos, 30)) do
            if obj:is_player() then
               return
            elseif obj:get_luaentity() and obj:get_luaentity().name == name then
               count = count+1
            end
         end
         if count > mobs_per_30_block_radius then
            return
         end

         if minetest.setting_getbool("display_mob_spawn") then
            minetest.chat_send_all("[NPCs] Add "..name.." at "..minetest.pos_to_string(pos))
         end
         minetest.env:add_entity(pos, name)
      end
   })
end

npcs:register_spawn("npc:npc", {"default:dirt_with_grass"}, 16, -1, 500, 10, 31000)
]]--
Visit my server: freextress.ddnsking.com 30002 . mobs, npcs, interesting places, pvp.
 

amadin
Member
 
Posts: 471
Joined: Tue Jun 16, 2015 16:23
GitHub: Amadin

Re: herobrine mod

by amadin » Fri Oct 07, 2016 07:58

Maybe somebody can add npc teleporting to player which was deal damage to npc and trying to run away?
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 57 guests

cron