[Mod] Mobs Redo [1.53] [mobs]

User avatar
Andrey01
Member
Posts: 2444
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [Mod] Mobs Redo [1.34] [mobs]

by Andrey01 » Post

TenPlus1, I am suggesting to you to add these new mobs:
https://drive.google.com/file/d/0B4HNak ... sp=sharing

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Mobs Redo [1.33] [mobs]

by azekill_DIABLO » Post

FreeLikeGNU wrote:
Image
wut?

User avatar
TenPlus1
Member
Posts: 2891
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.34] [mobs]

by TenPlus1 » Post

Andrey01: most of those mobs already come as an addon-mod for mobs redo, no point making this mod any larger than it has to be :)

User avatar
Andrey01
Member
Posts: 2444
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [Mod] Mobs Redo [1.34] [mobs]

by Andrey01 » Post

TenPlus1 wrote:Andrey01: most of those mobs already come as an addon-mod for mobs redo, no point making this mod any larger than it has to be :)
No, SandWorm and Bacteriophage don`t have in other mods for mobs redo because they were removed

User avatar
TenPlus1
Member
Posts: 2891
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.34] [mobs]

by TenPlus1 » Post

Sandworm and Bacteriophage should both me in the nssm mod.

User avatar
TenPlus1
Member
Posts: 2891
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.34] [mobs]

by TenPlus1 » Post

Update:

- New setting added for "dogshoot" attack mode which adds a new timer between shooting and dogfighting.
- Code tweaked, tidied and bugs fixed

User avatar
Andrey01
Member
Posts: 2444
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [Mod] Mobs Redo [1.34] [mobs]

by Andrey01 » Post

TenPlus1 wrote:Sandworm and Bacteriophage should both me in the nssm mod.
Sand Worm and Bacteriophage were removed from NSSM and old versions of these mobs don`t return yet.
Also i suggest you to add huge Black Widow (see to link for download)

zorman2000
Member
Posts: 83
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

Re: [Mod] Mobs Redo [1.34] [mobs]

by zorman2000 » Post

Hi Tenplus1,

I have an issue I'm not entirely sure it's related to mobs_redo, but I think it does. So far, I have been using "mobs:spawn()" an setting "on_spawn" to a rather large funcion that initializes a lot of variables for the mob. These variables reside on the same scope of the rest of the "self" variables, like "self.tamed".

However, I want to create a custom spawner method, and I have been doing so using the following code:

Code: Select all

  if spawned_npc_count < npc_count then
    -- Spawn a NPC
    local npc = minetest.add_entity(pos, "advanced_npc:npc")
    if npc and npc:get_luaentity() then
      spawn(npc, pos)
      -- Check some stuff ...
      return true
    else
        npc:remove()
      return false
    end
Now, this works well when spawned initially. However, if I close the game and restart it, all the variables added in the "spawn(npc, pos)" function get lost! And actually, the ones added by the mobs_redo definition remain (like path, time_of_day, etc.). This didn't happened when I used the "mobs:spawn()" function, no matter how many times I restarted the game.

Any ideas? If you meed to look more at the code you can find it here: https://github.com/hkzorman/advanced_np ... pawner.lua. And sorry if it's not related and maybe a bug in Minetest.

Thanks in advance!

User avatar
TenPlus1
Member
Posts: 2891
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.34] [mobs]

by TenPlus1 » Post

Mobs themselves only save variables beginning with self. and that's it, anything else you add has to be saved either in a file or setting.

User avatar
D00Med
Member
Posts: 943
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [Mod] Mobs Redo [1.34] [mobs]

by D00Med » Post

I tried to make npc's return to a previously set postion.

Code: Select all

		if game_time <= 6000 or game_time >= 18000 and self.home ~= nil then
			if self.home_object == nil then
			self.home_object = minetest.add_entity(self.home, "mobs_npc:dummy")
			end
			self.following = self.home_object
		end
This didn't seem to work at all. How can I make a mob go to a certain position? is there a better way to do this than trying to get it to follow an entity?
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

User avatar
TenPlus1
Member
Posts: 2891
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.34] [mobs]

by TenPlus1 » Post

Sadly mobs aren't that smart but in the api we have a mob variable called self.path.way which contains the pathfinding data for a mob to find and get to the player when attacking, and this could possibly be modified to a HOME position instead if mob has pathfinding enabled :)

User avatar
D00Med
Member
Posts: 943
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [Mod] Mobs Redo [1.34] [mobs]

by D00Med » Post

Oh ok, thanks.
I did have a look at that, but I don't really understand it.
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

zorman2000
Member
Posts: 83
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

Re: [Mod] Mobs Redo [1.34] [mobs]

by zorman2000 » Post

TenPlus1 wrote:Mobs themselves only save variables beginning with self. and that's it, anything else you add has to be saved either in a file or setting.
Yes, I had them all there.
For some reason, it looks like my world was corrupted. I have deleted it and created a new one and it works perfectly.

Thanks!
TenPlus1 wrote:Sadly mobs aren't that smart but in the api we have a mob variable called self.path.way which contains the pathfinding data for a mob to find and get to the player when attacking, and this could possibly be modified to a HOME position instead if mob has pathfinding enabled :)
I also don't understand exactly how this works. Do you specify the ultimate position, or do you have to specify all the positions in the path to the point that you want? What would be the variable that represents the "goal position"?

User avatar
TenPlus1
Member
Posts: 2891
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.34] [mobs]

by TenPlus1 » Post

self.path.way holds the pathfinder table which is a result of the minetest.find_path() function that provides the mob with a list of positions to follow until it reaches the player it wishes to attack... I am looking into a way of overriding this feature so that a home position can be given and it will do the same until the mob/npc returns home, that and keep the api light :)

User avatar
TenPlus1
Member
Posts: 2891
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.34] [mobs]

by TenPlus1 » Post

Update:

Mob pathfinding level 2 has been tweaked so that they can break through walls and build up to get to player (not through hard nodes like obsidian etc)

User avatar
TenPlus1
Member
Posts: 2891
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.34] [mobs]

by TenPlus1 » Post

D00Med, maybe this will help, it's a small routine that sends the mob to a specific position at night time:

Code: Select all

	do_custom = function(self, dtime)

		self.home_timer = (self.home_timer or 0) + dtime
		if self.home_timer < 1 then return end -- every 1 second
		self.home_timer = 0

		if self.time_of_day > 0.2 and self.time_of_day < 0.8 then
			return  -- return if not night time
		end

		local h = {x = 1, y = 8, z = 2} -- destination coords
		local p = self.object:getpos() -- mob position
		local x, y, z = p.x - h.x, p.y - h.y, p.z - h.z
		local dist = math.floor(math.sqrt(x * x + y * y + z * z))

		if dist <= 1 then
			print ("--- home!")
			self.homepath = nil
			self.state = "stand"
			return
		end

		if self.homepath == nil then
			self.homepath = minetest.find_path(h, h, 16, 3, 6, "Dijkstra")
			print ("--- finding route", self.homepath, dist)
		end

		if self.homepath then
			print ("--- following path", dist, #self.homepath)

			local np = self.homepath[1] ; if not np then return end

			if math.abs(np.x - p.x) + math.abs(np.z - p.z) < 0.6 then
				table.remove(self.homepath, 1) ; print ("-- removed entry")
			end

			np = {x = np.x, y = np.y, z = np.z}

			local vec = {x = np.x - p.x, z = np.z - p.z}
			local yaw = (math.atan(vec.z / vec.x) + math.pi / 2) - self.rotate

			if np.x > p.x then yaw = yaw + math.pi end

			self.object:setyaw(yaw)
			set_velocity(self, self.walk_velocity)
		end
	end,

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

Re: [Mod] Mobs Redo [1.34] [mobs]

by burli » Post

Can you tell me why mobs jump when they start to follow a path?

User avatar
TenPlus1
Member
Posts: 2891
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.34] [mobs]

by TenPlus1 » Post

They do ? which mod, what's it standing on at the time ?

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

Re: [Mod] Mobs Redo [1.34] [mobs]

by burli » Post

TenPlus1 wrote:They do ? which mod, what's it standing on at the time ?
mobs redo and mobs monsters, relatively new versions. I'm tinker around with the oerkki for a new pathfinder. Every time he starts to follow a path he makes a little hop (not a normal jump)

User avatar
TenPlus1
Member
Posts: 2891
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.34] [mobs]

by TenPlus1 » Post

I think the hops are the pathfinders way of making the mob unstuck if it gets stuck at some point.

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

Re: [Mod] Mobs Redo [1.34] [mobs]

by burli » Post

Mobs jump when attacking, even if jump = false

I think that's a bug

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Mobs Redo [1.34] [mobs]

by azekill_DIABLO » Post

i also seen this.

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

Re: [Mod] Mobs Redo [1.34] [mobs]

by burli » Post

Just to clarify: I don't mean these hops at the beginning​ of the pathfinder, I mean jumping. One mob jumps on a 3 node high wall

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Mobs Redo [1.34] [mobs]

by azekill_DIABLO » Post

oh. I just seen a mod jumping for no reason while tracking and attacking me. that all. And mobs swims weirdly too. they hop,like burli described it, but in water.

zorman2000
Member
Posts: 83
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

Re: [Mod] Mobs Redo [1.34] [mobs]

by zorman2000 » Post

TenPlus1 wrote:D00Med, maybe this will help, it's a small routine that sends the mob to a specific position at night time:
minetest.find_path() seems to always returns nil...

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests