[Modpack] NPC Framework [minetest-npcf] [WIP]

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

[Modpack] NPC Framework [minetest-npcf] [WIP]

by stu » Post

This mod adds some, hopefully useful, non-player characters to the minetest game.
The mod also provides a framework for others to create and manage their own custom NPCs.

Features currently include overhead name tags, formspec handling, ownership and management,
file based backups and automatic duplicate entity removal. (experimental)

These NPC's are not craftable although by default will be available in the creative menu.
Servers would be encouraged to override this default and allocate the NPCs on /give basis.

I was waiting for minetest 0.4.8 to release this, however, it is getting so big now
that I felt It should be posted so that others can help me debug.

Screenshot:
Image

Modpack Version: 0.1.0 (pre-release)*

Minetest Version: 0.4.8 (current-dev)

Depends: default

License Source Code: LGPL

License Textures: WTFPL

Download: Version 0.1.0

Browse Code: Github
Spoiler
To spawn NPCs find for the appropriate spwner in the creative inventory. Place the spawner at
position you want your NPC to spawn then right-click and give the NPC a unique name.

Once spawned, try 'sneak' left/right clicking to tweak the NPC's look direction and position.

Example NPCs currently include:

# Info NPC
Image
The Info NPC is a simple information serving character. You could think of them as a
human book providing information about a particular server location, or whatever else you like.
Supports multiple pages of text. 12 lines per page, ~50 chars per line.

# Deco NPC
Image
A purely decorative NPC, can be set to roam freely and/or follow random players it encounters.

# Guard NPC
Image
Protect yourself and your property against other players and mobs. Features 3d weapon and armor.
Can be left to guard a certain area or set to follow their owner.

# Trader NPC
Image
Provides a quantity based exchange system. The owner can set a given number of exchanges.
This would likely be best used in conjunction with one of the physical currency mods.

# Builder NPC
Image
Not really much point to this atm other than it's really fun to watch. By default, they can only
build a basic hut, however this is compatible (or so it seems) with all the schematics included in
Dan Duncombe's instabuild mod. These should be automatically available for selection if you have
the instabuild mod installed.
See README.md for more information.

*Please note that this modpack is still very much a work in progress, expect to find bugs.
Not recommended for well developed worlds or public servers at this time.
Last edited by stu on Mon Oct 21, 2013 22:46, edited 1 time in total.

Nore
Developer
Posts: 501
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Post

Wow, I like that. Would it be possible to make it compatible with mg villages? viewtopic.php?id=7263

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

by stu » Post

Nore wrote:Wow, I like that. Would it be possible to make it compatible with mg villages? viewtopic.php?id=7263
I aim to make this compatible with as many existing mods as possible, if there is anything I can add that will facilitate this then let me know.
Pull requests are also welcomed btw.
Last edited by stu on Sat Sep 28, 2013 18:28, edited 1 time in total.

User avatar
Inocudom
Member
Posts: 3121
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Post

There is the peaceful_npcs mod, but this looks like it could be better. Zeg9's skins mod could go well with this.

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

by stu » Post

Inocudom wrote:There is the peaceful_npcs mod, but this looks like it could be better. Zeg9's skins mod could go well with this.
This is entirely different to the peacefiul npc mod and there is nothing stopping you using both. Zeg9's skins are already supported.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

stu wrote:
Inocudom wrote:There is the peaceful_npcs mod, but this looks like it could be better. Zeg9's skins mod could go well with this.
This is entirely different to the peacefiul npc mod and there is nothing stopping you using both. Zeg9's skins are already supported.
yes I agree. My mod is completely different. But maybe I might add dependency to this. If there will be an api that I could build my mobs off of.
Coding;
1X coding
3X debugging
12X tweaking to be just right

Ragnar
Member
Posts: 849
Joined: Thu Oct 25, 2012 15:19
Location: Estonia
Contact:

by Ragnar » Post

hey, could you add a solder (another guard), i have the skin (i made it) Here
Are you saying that I put an abnormal brain into a seven and a half foot long, fifty-four inch wide GORILLA?

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Post

A soldier would be redundant in the long run since a gaurd already exists
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

stu wrote: Features currently include overhead name tags, formspec handling, ownership and management,
file based backups and automatic duplicate entity removal. (experimental)
Very nice and useful features! I hope they will become attractive to server owners. Usually, servers only run simple mobs, and those are not very...satisfying if you want more than something that occasionally tries to kill you. Mobf would be much more suitable but is not used due to some problems.
stu wrote: # Info NPC
The Info NPC is a simple information serving character. You could think of them as a
human book providing information about a particular server location, or whatever else you like.
Supports multiple pages of text. 12 lines per page, ~50 chars per line.
I don't see too much usage for that function yet. For adventure worlds, it would be desirable to have some kind of simple communication form - the option to "talk" to the mob by selecting one of several possible replies to what the mob "says".
stu wrote: # Deco NPC
A purely decorative NPC, can be set to roam freely and/or follow random players it encounters.
Those ought to roam the world and be merged with the info-npc eventually. Good to see that they can already stand, sit, sleep, walk etc. on command. Sitting on furniture suitable for sitting would be even better. I've tried that with an experimental mobf-mob to some degree.
stu wrote: # Guard NPC
Protect yourself and your property against other players and mobs. Features 3d weapon and armor.
Can be left to guard a certain area or set to follow their owner.
For me, this is a less intresting feature. Again, could be used in adventure maps. Some young players may also be fascinated by it.
stu wrote: # Trader NPC
Provides a quantity based exchange system. The owner can set a given number of exchanges.
This would likely be best used in conjunction with one of the physical currency mods.
I wasn't able to figure out how to set up the trader. Also it would be nice to be able to see how possible customers see the formspec. Traders would be more decorative than simple chests.
stu wrote: # Builder NPC
Not really much point to this atm other than it's really fun to watch. By default, it be can only
build a basic hut, however this is compatible (or so it seems) with all the schematics provided by
Dan Duncombe's instabuild mod. These should be automatically available for selection if you have
the instabuild mod installed.
The "fun to watch" part is the intresting one :-) Looks like a modernized version of towntest - with a mob that is 3d and does not walk through walls often. It does work with normal worldedit schematics, so it's not limited to schems from a particular mod. Building can be continued after an interruption - that's good. The formspec for the configurable variant where the mob requires building material is less intuitive and requires more time to decipher than the one from towntest. Perhaps taking the towntest formspec might be a good idea.
What I'd like to really have is a mob that builds the walls/pillars and roof first and does the decoration last. That may however be close to impossible as it would require either moving through walls or finding paths inside the building.
A list of my mods can be found here.

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

I noticed that NPC's are nigh on impossible to spawn correctly (even the testing ones!!); and the Docs don't indicate on spawning, and I'm not happy about going line by line finding out the exact command to spawn a NPC.

/spawnentity npc:deco_npc (or any others) just get instantly despawned because they appear to be a duplicate, which they ARE CERTAINLY NOT.

You really need to make spawning easier, as this looks very promising. However, inability to spawn NPCs will make this not used often as it really should be.

EDIT1: Tried using a /giveme, that fails too, you really REALLY ought to look into spawn eggs or similar.

EDIT2: Just noticed creative menu, will check.

EDIT3: The spawn blocks in the creative menu isn't listed in the docs on GitHub, may wish to correct this.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

You have to use /giveme npcf:builder_npc_spawner and place that node. For other types of mobs, replace builder with info, deco, guard or trade.
A list of my mods can be found here.

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

by stu » Post

Jordach wrote:I noticed that NPC's are nigh on impossible to spawn correctly (even the testing ones!!); and the Docs don't indicate on spawning, and I'm not happy about going line by line finding out the exact command to spawn a NPC.

/spawnentity npc:deco_npc (or any others) just get instantly despawned because they appear to be a duplicate, which they ARE CERTAINLY NOT.

You really need to make spawning easier, as this looks very promising. However, inability to spawn NPCs will make this not used often as it really should be.

EDIT1: Tried using a /giveme, that fails too, you really REALLY ought to look into spawn eggs or similar.

EDIT2: Just noticed creative menu, will check.

EDIT3: The spawn blocks in the creative menu isn't listed in the docs on GitHub, may wish to correct this.
There was a major problem caused by the fact I didn't realise git does not commit empty directories.
The npc_data directory is needed for this to fuction correctly. See the commit history.
REAME.md wrote:These NPC's are not craftable although by default will be available in the creative menu. Servers would be encouraged to override this default and allocate the NPCs on /give basis.
README.md

Note that this will not work well at all with /spawnentity, in fact It did not occur to me that someone might try to use that.
I will look into adding some protection against that possibiltiy.
Last edited by stu on Sun Sep 29, 2013 17:08, edited 1 time in total.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

You could always add a what.text in the data folder so it can be uploaded onto girhub
Coding;
1X coding
3X debugging
12X tweaking to be just right

Nore
Developer
Posts: 501
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Post

Code: Select all

19:20:11: ERROR[main]: ServerError: LuaError: error running function 'on_rightclick': ...n/../mods/minetest-npcf-master/npcf/npcs/builder_npc.lua:93: bad argument #1 to 'find' (string expected, got nil)
EDIT: you have to write self.name instead of name to make it work.
Last edited by Nore on Sun Sep 29, 2013 17:35, edited 1 time in total.

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

by stu » Post

Nore wrote:

Code: Select all

19:20:11: ERROR[main]: ServerError: LuaError: error running function 'on_rightclick': ...n/../mods/minetest-npcf-master/npcf/npcs/builder_npc.lua:93: bad argument #1 to 'find' (string expected, got nil)
EDIT: you have to write self.name instead of name to make it work.
I don't know why that doesn't bug for me although this has now been corrected it shoud in fact be k not self.name
I'm not even sure how that got in there. Thank you for reporting this.

/Sokomine, Thank you for your summary, you make some very good points, although I would like to stress that
the NPCs included are primarily intended as examples. I did think about combining the deco and info NPCs but
decided to leave the info NPC as a simple demonstration.

I also agree about the less than intuitive fromspecs but you are a bit limited and one could say the same about the
the game itself. If you haven't played a generic voxel based sandbox game before you'd be pretty lost imo.
Last edited by stu on Sun Sep 29, 2013 18:32, edited 1 time in total.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

stu wrote:
Nore wrote:

Code: Select all

19:20:11: ERROR[main]: ServerError: LuaError: error running function 'on_rightclick': ...n/../mods/minetest-npcf-master/npcf/npcs/builder_npc.lua:93: bad argument #1 to 'find' (string expected, got nil)
EDIT: you have to write self.name instead of name to make it work.
I don't know why that doesn't bug for me although this has now been corrected it shoud in fact be k not self.name
I'm not even sure how that got in there. Thank you for reporting this.

/Sokomine, Thank you for your summary, you make some very good points, although I would like to stress that
the NPCs included are primarily intended as examples. I did think about combining the deco and info NPCs but
decided to leave the info NPC as a simple demonstration.

I also agree about the less than intuitive fromspecs but you are a bit limited and one could say the same about the
the game itself. If you haven't played a generic voxel based sandbox game before you'd be pretty lost imo.
use a background image like UI and say what goes where. Also can you show a screenshot of the formapec.
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
hoodedice
Member
Posts: 1374
Joined: Sat Jul 06, 2013 06:33
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice
Location: world
Contact:

by hoodedice » Post

Bug: Guard NPC does not swim in (/on/above/whatever) water. Instead, he 'walks' on the sea floor.

Trigger: Right-click, follow, then get into water

Possible fix: Trigger 'jump' in water
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

User avatar
Ikishida
Member
Posts: 107
Joined: Sat Aug 17, 2013 08:02
Location: (secret)

by Ikishida » Post

This is what I've been looking for! thanks man!
When life hands you lemons,throw it back at life saying "I don't need your goddamn lemons!" =D

tinoesroho
Member
Posts: 570
Joined: Fri Feb 17, 2012 21:55
Location: Canada

by tinoesroho » Post

A little feedback from a half-baked user.

The Guard:
Works well. I love having somebody to watch my back. The interface could use some work - give him an inventory of his own, with a weapons slot, armor slots, and maybe the ability to carry a few additional items. A screen with mob targetting buttons would be a plus, as well.

EDIT:
Hrrm. It seems it only likes to work against the simplemobs.
Last edited by tinoesroho on Wed Oct 02, 2013 03:35, edited 1 time in total.
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/

User avatar
hoodedice
Member
Posts: 1374
Joined: Sat Jul 06, 2013 06:33
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice
Location: world
Contact:

by hoodedice » Post

tinoesroho wrote:A little feedback from a half-baked user.

The Guard:
Works well. I love having somebody to watch my back. The interface could use some work - give him an inventory of his own, with a weapons slot, armor slots, and maybe the ability to carry a few additional items. A screen with mob targetting buttons would be a plus, as well.

EDIT:
Hrrm. It seems it only likes to work against the simplemobs.
You can easily add the other-mob detection by right-clicking the dude. And change his weapons. And other stuff.
-------------------------------


(small) Bug: NPCs cannot be removed unless the mod is deactivated

Bug: NPC names are carried over worlds. If you make a new world, the name of an NPC in a prior world cannot be used for another NPC in the new world.
Last edited by hoodedice on Wed Oct 02, 2013 11:42, edited 1 time in total.
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

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

by stu » Post

hoodedice wrote:Bug: Guard NPC does not swim in (/on/above/whatever) water. Instead, he 'walks' on the sea floor.

Trigger: Right-click, follow, then get into water

Possible fix: Trigger 'jump' in water
Have you tried swimming wearing a suit of steel armor? didn't think so, athough I admit that is a bit annoying.
I tried your suggestion, but with the 1 second update timer the result was not so good. I will work on this some more.
tinoesroho wrote:A little feedback from a half-baked user.

The Guard:
Works well. I love having somebody to watch my back. The interface could use some work - give him an inventory of his own, with a weapons slot, armor slots, and maybe the ability to carry a few additional items. A screen with mob targetting buttons would be a plus, as well.
I do plan to do more with the Guard, in particular add visual support for my 3d armor mod. Inventory would only be relevant if the Guard could be killed, currently all the example NPC's are immortal.

I agree that the formspec interface could definitely do with some more work.
tinoesroho wrote: Hrrm. It seems it only likes to work against the simplemobs.
I must admit that I have only ever tested that aspect with simplemobs, however, there is no reason I can see that it should not work with other mobs, be sure to specify the correct entity name eg: mob_orekki:orekki for mobf
hoodedice wrote:(small) Bug: NPCs cannot be removed unless the mod is deactivated
Did you try the server commands /npcf clear <npc_name> and /npcf delete <npc_name> ?
hoodedice wrote: Bug: NPC names are carried over worlds. If you make a new world, the name of an NPC in a prior world cannot be used for another NPC in the new world.
Well that would depend on where you installed the mod. If it were installed in the world's worldmods dir the npc's
would not be carried over to other worlds.

However, this does present something of a problem if you have the mod installed universaly. I might look into somehow storing the npc data under the worldpath rather than the modpath.

Thank you everyone for your feedback so far.
Last edited by stu on Wed Oct 02, 2013 18:31, edited 1 time in total.

User avatar
Ikishida
Member
Posts: 107
Joined: Sat Aug 17, 2013 08:02
Location: (secret)

by Ikishida » Post

uhh...when i put the deco npc it didn't roam it stayed in one place while i had the free roam set on. and then,when i put a builder or a guard or an info or a trader npc,it crashes my game bro...
ima try to re-install the mod but be sure to fix it please.
When life hands you lemons,throw it back at life saying "I don't need your goddamn lemons!" =D

User avatar
hoodedice
Member
Posts: 1374
Joined: Sat Jul 06, 2013 06:33
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice
Location: world
Contact:

by hoodedice » Post

Ikishida wrote:uhh...when i put the deco npc it didn't roam it stayed in one place while i had the free roam set on. and then,when i put a builder or a guard or an info or a trader npc,it crashes my game bro...
ima try to re-install the mod but be sure to fix it please.
Are you using the latest git version of Minetest? That happened to me when I used 0.4.7 stable.
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

User avatar
Ikishida
Member
Posts: 107
Joined: Sat Aug 17, 2013 08:02
Location: (secret)

by Ikishida » Post

hoodedice wrote:
Ikishida wrote:uhh...when i put the deco npc it didn't roam it stayed in one place while i had the free roam set on. and then,when i put a builder or a guard or an info or a trader npc,it crashes my game bro...
ima try to re-install the mod but be sure to fix it please.
Are you using the latest git version of Minetest? That happened to me when I used 0.4.7 stable.
uhh...is there already minetest 0.4.8? please link it.
When life hands you lemons,throw it back at life saying "I don't need your goddamn lemons!" =D

User avatar
Topywo
Member
Posts: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Post

Ikishida wrote: uhh...is there already minetest 0.4.8? please link it.
Not yet, but there's a difference between 0.4.7 and the 'latest' from Github. You could see the latest from Github as a 'daily unstable'.

After the official release of the 0.4.7. stable (almost) every day additions/improvements/changes are made for minetest (most in the engine, sometimes the game).

Some mods need to be/are updated to work with the 'latest' version of minetest and don't work anymore in 0.4.7 stable.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests