[Mod] Goblins [goblins] [WIP]

User avatar
duane
Member
Posts: 1641
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Tunneling

by duane » Post

I put together some code for more rational tunneling in this fork. It does require changes to the mobs redo api, including a new callback.

Here's a screenshot of some of them starting to dig.
+ Spoiler
A problem that occurs is that none of the other goblins are going to follow the diggers down those narrow tunnels.
Believe in people and you don't need to believe anything else.

User avatar
FreeLikeGNU
Member
Posts: 226
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Post

TenPlus1 wrote:Updated Goblins redo to use original search & replace code within do_custom, should work same as original now :) Mobs Redo mod updated also with some new additions to help...

viewtopic.php?f=9&t=13004&p=189917#p189917
This is great! Working much better, however, I did have to remove the vector.round helper from lines 39-41 to get the goblins to find nodes as before. Does the vector helper orient the coords relative to the object.self instead of the world? If so, that is really cool and we can make sure that goblins are not digging behind themselves. For now, it is disabled and git repo updated!
https://github.com/FreeLikeGNU/goblins
duane wrote:I put together some code for more rational tunneling in this fork. It does require changes to the mobs redo api, including a new callback.

Here's a screenshot of some of them starting to dig.
+ Spoiler
A problem that occurs is that none of the other goblins are going to follow the diggers down those narrow tunnels.
Wow again! I'm going to try your new digger ASAP, it looks really cool. I'm not sure the other gobs need to follow the digger, they will probably discover dug areas from wandering about before too long...

User avatar
Nathan.S
Member
Posts: 1034
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: [WIP] Goblins [mobs_goblins]

by Nathan.S » Post

I'm trying out, what I believe is the latest update, and I keep getting this error spamming the chat.
ERROR[server]:Map::setNode(): Not allowing to place CONTENT_IGNORE while trying to replace "default:mossycobble"

I don't find any errors in the debug file though. I did notice that it seems every Goblin related function is printed out, resulting in an extremely lengthy debug.txt. 15 or 20 minutes of running around resulted in 33,000 lines, most of them being related to the Goblins digging and their locations.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Napiophelios
Member
Posts: 1019
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [WIP] Goblins [mobs_goblins]

by Napiophelios » Post

Any time I have gotten that error was when a mod calls to place a node that I dont have;
its usually happens because I misspelled something

edit: line 297 and line 651 he misspelled "default:dessert_stone" is supposed to be "default:desert_stone"

see if that helps

edit2:
or it could be line 768 using "group:stone"

User avatar
FreeLikeGNU
Member
Posts: 226
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Post

Napiophelios wrote:Any time I have gotten that error was when a mod calls to place a node that I dont have;
its usually happens because I misspelled something

edit: line 297 and line 651 he misspelled "default:dessert_stone" is supposed to be "default:desert_stone"

see if that helps

edit2:
or it could be line 768 using "group:stone"
I fixed the dessert typo, doh. Group stone includes all stone types.

By the way, some goblin traps are now extra nasty... be careful!

User avatar
duane
Member
Posts: 1641
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: [WIP] Goblins [mobs_goblins]

by duane » Post

FreeLikeGNU wrote:By the way, some goblin traps are now extra nasty... be careful!
You know the king must have TNT. He must!
Believe in people and you don't need to believe anything else.

User avatar
FreeLikeGNU
Member
Posts: 226
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Post

duane wrote:
FreeLikeGNU wrote:By the way, some goblin traps are now extra nasty... be careful!
You know the king must have TNT. He must!
Yeah the king will need to have some special tricks. I still need a solution for him to replace mese nodes with chests with loot that can be somewhat random (and possibly nasty surprises too), I'm getting familiar with abm functions so I don't think it is too far off..

Apologies for the rapid changes to this mod, one of the reasons for it being in the WIP state and debug message spam (you can disable, if you like). It's my first MT mod and I'm learning something new every time I play with it. I really appreciate the feedback and help so far, thank you!

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

Re: [WIP] Goblins [mobs_goblins]

by TenPlus1 » Post

FreeLikeGNU: check out Blockmen's Pyramids mod, it has a function that can fill a chest with treasure that you may be able to adapt for Goblins...

also... is the mobs redo version working for you now ?

User avatar
FreeLikeGNU
Member
Posts: 226
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Post

TenPlus1 wrote:FreeLikeGNU: check out Blockmen's Pyramids mod, it has a function that can fill a chest with treasure that you may be able to adapt for Goblins...

also... is the mobs redo version working for you now ?
TenPlus1, it's working quite well now! I'm thinking about a way to check if redo is active, and if so use that, or use your api, but included with my mod as standalone.
In other words, remove mobs_goblins repo and keep an updated copy of your current api in goblins and make that the one repo to be maintained. That way if folks already have redo (and made their own changes to it), then goblins will use that. Folks that do not have/want the whole redo can still use goblins as standalone.

edit (fix typo)

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [WIP] Goblins [mobs_goblins]

by Don » Post

I started working on a treasure mod. The chests are nodes and when you break them they drop random items. You might get a few ideas. Just know that it is a wip.
https://github.com/DonBatman/mytreasure
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

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

Re: [WIP] Goblins [mobs_goblins]

by TenPlus1 » Post

FreeLikeGNU: Glad it's working ok... My only concern was that Mobs Redo has it's own api which is updated quite a bit and the one included in your Goblins mod may end up running an older version with your code included, which is why I recommended using the main API instead and putting your goblin specific code inside the mob definition itself to keep the api clean... This way the two wouldn't clash and cause errors...

Other than that, I love the Goblins mod and end up with loads of the little guys running around underground stealing my torches and setting up traps around me...

User avatar
duane
Member
Posts: 1641
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: [WIP] Goblins [mobs_goblins]

by duane » Post

FreeLikeGNU wrote:By the way, some goblin traps are now extra nasty... be careful!
Thaat's not a trap. This is a trap...

Code: Select all

minetest.register_abm({
	nodenames = {"mobs_goblins:stone_with_diamond_trap"},
	interval = 1,
	chance = 1,
	action = function(pos, node, active_object_count, active_object_count_wider)
		for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 3)) do
			if object:is_player() then
				minetest.set_node(pos, {name="tnt:tnt_burning"})
				minetest.get_node_timer(pos):start(5)
				minetest.sound_play("default_dig_crumbly", {pos = pos, gain = 0.5, max_hear_distance = 10})
			end
		end
	end})
+ Spoiler
These would give you more variety.

Code: Select all

minetest.register_abm({
	nodenames = {"mobs_goblins:stone_with_coal_trap"},
	interval = 1,
	chance = 1,
	action = function(pos, node, active_object_count, active_object_count_wider)
		for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 2)) do
			if object:is_player() then
				minetest.set_node(pos, {name="fire:basic_flame"})
				if object:get_hp() > 0 then
					object:set_hp(object:get_hp()-2)
				end
			end
		end
	end
})

Code: Select all

minetest.register_abm({
	nodenames = {"mobs_goblins:stone_with_gold_trap"},
	interval = 1,
	chance = 1,
	action = function(pos, node, active_object_count, active_object_count_wider)
		for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 2)) do
			if object:is_player() then
				minetest.set_node(pos, {name="default:lava_source"})
				if object:get_hp() > 0 then
					object:set_hp(object:get_hp()-2)
					minetest.sound_play("default_dig_crumbly", {pos = pos, gain = 0.5, max_hear_distance = 10})
				 end
			end
		end
	end})
Last edited by duane on Tue Sep 08, 2015 20:28, edited 1 time in total.
Believe in people and you don't need to believe anything else.

User avatar
FreeLikeGNU
Member
Posts: 226
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Post

TenPlus1 wrote:FreeLikeGNU: Glad it's working ok... My only concern was that Mobs Redo has it's own api which is updated quite a bit and the one included in your Goblins mod may end up running an older version with your code included, which is why I recommended using the main API instead and putting your goblin specific code inside the mob definition itself to keep the api clean... This way the two wouldn't clash and cause errors...

Other than that, I love the Goblins mod and end up with loads of the little guys running around underground stealing my torches and setting up traps around me...
Glad you are enjoying the goblins! Have you considered moving the content (models, defs, sounds, etc) from Mobs Redo so that it is separate from the API as the goblins, water, air and other mobs are?

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

Re: [WIP] Goblins [mobs_goblins]

by TenPlus1 » Post

I did that at one point, had a separate api with mobs you could enable and disable, but players wanted a simple pack to install that gives a basic set to the game, default animals and monsters... but it's easy to disable a mob from within the init.lua for those that want it...

User avatar
FreeLikeGNU
Member
Posts: 226
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Post

TenPlus1: I guess what I'd like is for the goblins to work standalone or with the mobs redo if its installed. Maybe I can have the init check for the api.lua in the goblins folder and, if its been deleted by the user, to use mobs redo api.lua instead?
I really like your API and what you've done with goblins, I'd rather not maintain two repos for goblins. I think your version is the way going forward. It's not a big deal for me to update a file in my repo as you update your API.

User avatar
FreeLikeGNU
Member
Posts: 226
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Post

Duane, those are some wicked traps!

User avatar
everamzah
Member
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: [WIP] Goblins [mobs_goblins]

by everamzah » Post

I'm adding it right to the mobs mod directory. Works pretty good with zombies, I don't know. Thanks for them!! Hope you add the super wicked traps.

User avatar
duane
Member
Posts: 1641
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

re: Traps

by duane » Post

Check here for molten gold for the gold trap and lightning effects for the copper trap. And I think I've finally got the little beggars to tunnel properly.
+ Spoiler
+ Spoiler
+ Spoiler
+ Spoiler
Believe in people and you don't need to believe anything else.

User avatar
FreeLikeGNU
Member
Posts: 226
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Post

Added duane's traps (with some further modifications ;-) to standalone and redo goblins. Tinkering with traps may be painful.

Edit: i really should learn git better, merging in parts of duane's fork rather than copy-paste :p
Last edited by FreeLikeGNU on Wed Sep 09, 2015 14:39, edited 1 time in total.

User avatar
everamzah
Member
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: [WIP] Goblins [mobs_goblins]

by everamzah » Post

Molten gold liquid? Yay, can't wait to try. \o/

User avatar
duane
Member
Posts: 1641
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: [WIP] Goblins [mobs_goblins]

by duane » Post

FreeLikeGNU wrote:i really should learn git better, merging in parts of duane's fork rather than copy-paste :p
That's my fault. I just meant to throw some extra code into that fork for you to look at, but I ended up including all my own personal tweaks. I wouldn't even attempt to merge it with anything as it is.

On a brighter note, I went in this morning and corrected a LOT of logic errors in the tunneling code, and (thanks to tenplus1) I got it working with stock mobs redo. The do_custom function is amazingly versatile if you know how to use it. You should be able to just paste it in for any "dungeon-building" creature.

I've intentionally stuck with letting the creatures make only one change per "walk", which required altering the search/replace that tenplus1 put in to not use a replace chance. It's unnecessary when the mobs can only do one thing at a time, and they were occasionally changing whole swaths of nodes instantly as it was.

They're making a barge-load of tunnels, rooms, and such now -- probably more than some would prefer, but I like it.

Let me say again, that this mod is excellent, bordering on genius. Letting mobs make significant alterations to the environment is a quantum leap over what I've seen in the game so far.
Believe in people and you don't need to believe anything else.

User avatar
duane
Member
Posts: 1641
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: [WIP] Goblins [mobs_goblins]

by duane » Post

everamzah wrote:Molten gold liquid? Yay, can't wait to try. \o/
Don't get too excited. You can't make a gold generator. : )

We do need to decide what happens when you quench a molten gold flowing block. I'm not for making it gold ore.
Believe in people and you don't need to believe anything else.

User avatar
duane
Member
Posts: 1641
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: [WIP] Goblins [mobs_goblins]

by duane » Post

Ferk wrote:I think that as a WIP mod that's fine, but maybe the goblins should be less common and a bit more concentrated in particular areas. So that it's more of a discovery to manage to find a den of goblins. You still could get some solitary goblin explorer that starts messing up your cave, but it shouldn't be as frequent as in the WIP version of the mod.
I'm starting to think that we ought to slightly reduce the spawn rates for most of the goblins except the cobbler (and maybe the digger) on stone/ores, and include mossycobble in their spawn nodes. That would tend to keep them together, and more importantly they wouldn't starve themselves out by replacing the ores they spawned on. I hate to see abandoned lairs.

Edit: Yep, I did that and it works a lot better. The lairs aren't quite as empty.
Believe in people and you don't need to believe anything else.

User avatar
FreeLikeGNU
Member
Posts: 226
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Post

Duane, I merged your pull request for standalone, though something in me thinks this digging code is more for the likes of dwarves than goblins...

User avatar
duane
Member
Posts: 1641
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: [WIP] Goblins [mobs_goblins]

by duane » Post

FreeLikeGNU wrote:Duane, I merged your pull request for standalone, though something in me thinks this digging code is more for the likes of dwarves than goblins...
Do I hear another mod announcement?

You could always make it optional (or throw it out). The random node replacement was annoying to me, and I really wanted to see them dig into other caves. They hit a lava cave the other day, and I was amazed at how long the little devils can survive in molten rock.
Believe in people and you don't need to believe anything else.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests