[Mod] Advanced NPC (WIP) [advanced_npc]

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

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by zorman2000 » Fri Sep 08, 2017 12:59

roboto wrote:I sent you the pull request for the mod.

Thanks! Your PR has been merged. Your contribution is much appreciated!
 

roboto
Member
 
Posts: 62
Joined: Wed Jul 19, 2017 15:21
GitHub: NewbProgrammer101
In-game: akoek

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by roboto » Sat Sep 09, 2017 20:30

I sent you another pull request with a few additions and changes.
I couldn't get blender to at least work with .b3d files so I could create a miner.png file, so I just gave up and got one off the internet.

I also couldn't upload .png files to my fork of your mod. So you could just add this one to your commits.

When I did the pull request, the files are conflicting for an unknown reason. Its a bug, perhaps.
Attachments
miner.png
(91.13 KiB) Not downloaded yet
 

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

roboto
Member
 
Posts: 62
Joined: Wed Jul 19, 2017 15:21
GitHub: NewbProgrammer101
In-game: akoek

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by roboto » Sun Sep 10, 2017 21:17

Ok, I created my own miner.png.

There are some noticeable issues with advanced_npc models.

The collisionbox is in the right place, but the model is out of place:

And the NPCs would sit in a place at noon and stay there all day long. They also sit "inside" other NPCs.
Attachments
screenshot_20170910_103516.png
Bug with model location.
(185.49 KiB) Not downloaded yet
screenshot_20170910_102745.png
Bug of NPCs sitting in same place all day long.
(178.15 KiB) Not downloaded yet
miner.png
Miner.png is here
(1.2 KiB) Not downloaded yet
 

User avatar
kingoscargames
Member
 
Posts: 216
Joined: Fri Jul 28, 2017 12:06
Location: Netherlands
GitHub: kingoscargames
In-game: kingoscargames

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by kingoscargames » Sun Sep 10, 2017 21:33

roboto wrote:
There aqre some noticeable issues with advanced_npc models.

The collisionbox is in the right place, but the model is out of place:

https://forum.minetest.net/viewtopic.php?f=18&t=18144
 

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

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by zorman2000 » Sat Oct 07, 2017 16:21

New update!
Change log Oct. 7, 2017

This is a big update! It has been a while since last update in the forum, but the repo has been quite active.
I actually wanted to make some videos to showcase the major feature, however I have been unable to do so.
I shall soon be able to make these videos which will serve as tutorials for using the new manual spawning functions!

Content updates:
  • Farmer! Finally the farmer occupation has been finished. These cotton farmers will cultivate his/her field during the mornings, take a lunch break after and sell his/her harvest during the afternoon. Unfortunately, farmers only work in custom buildings and manually spawned. Support for mg_villages coming soon.
    • Building type: farm_tiny, farm_full
    • Surrounding building type: field, NPC spawned on any nearby house.
  • Custom egg spawner: Right-click this egg to manually spawn NPCs on your own buildings. You are able to specify:
    • Building type: the building where NPC is spawned
    • Occupation: the occupation the NPC will assume
    • Horizontal search radius: horizontal radius where the NPC will search for usable nodes
    • Vertical search radius: vertical radius where NPC will search for usable nodes
  • Custom workplace marker: Place this node to mark a NPC's workplace. Then, right-click it to configure it. You can specify:
    • Building type: The building type for this workplace.
    • Surrounding workplace: Marks this workplace marker as a surrounding building type
  • New "/restore_area <horizontal_radius> <vertical_radius>" chat command, to reset an area where NPCs has been spawned manually. The parameters should coincide with the spawn's egg params to work properly.
  • New teachings dialogues for the priest occupation (by roboto)
  • Experimental miner (by roboto)

Here is a farmer taking care of her crops:
Image

Note:
This mod has been developed with latest dev version of Minetest, therefore, the model issue in older versions (0.4.16 and older) is expected. To fix it, you can uncomment line 1283 of npc.lua:
Code: Select all
collisionbox = {-0.20,0,-0.20, 0.20,1.8,0.20},
--collisionbox = {-0.20,-1.0,-0.20, 0.20,0.8,0.20},


Technical updates:
  • Fixed bug where many NPCs would sit/lay on the same node at the same time
  • NPCs really own nodes now.
  • And many more, to update later
 

User avatar
BrunoMine
Member
 
Posts: 1046
Joined: Thu Apr 25, 2013 17:29
Location: SP-Brasil
GitHub: BrunoMine

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by BrunoMine » Sat Oct 07, 2017 18:02

zorman2000 wrote:For developers:
Please note that Advanced NPC is planned to be a framework, a mod you can include to make your own NPCs and use the functions provided here. However, the API is heavily undocumented, and is still not friendly enough yet to include anywhere. This will be improved in the future.


Does this mean I can use this to improve the NPCs of my mods? I really liked that and I plan to help with whatever is possible.
 

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

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by zorman2000 » Sat Oct 07, 2017 19:12

BrunoMine wrote:
zorman2000 wrote:For developers:
Please note that Advanced NPC is planned to be a framework, a mod you can include to make your own NPCs and use the functions provided here. However, the API is heavily undocumented, and is still not friendly enough yet to include anywhere. This will be improved in the future.


Does this mean I can use this to improve the NPCs of my mods? I really liked that and I plan to help with whatever is possible.


Yes! You can definetely use it! Right now, the API isn't in a great state, but you should be able to use it as well. The documentation is very poor but you can see the WIP docs here:
https://github.com/hkzorman/advanced_np ... _Dialogues
https://github.com/hkzorman/advanced_np ... _Schedules

Any help is greatly appreciated! I have to rewrite the roadmap, but you can find info in the repo: https://github.com/hkzorman/advanced_npc
 

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

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by zorman2000 » Sat Oct 07, 2017 19:16

I came up with a very rough video demonstrating how to use the manual spawning features and the farmer!
https://www.youtube.com/watch?v=6iBNTnCv-XQ

Around minute 5 is the farmer in action!
 

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

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by zorman2000 » Fri Oct 20, 2017 02:12

New update!
Today's update is not as big as the previous one, however, sometimes, small details really matters. This update tries to polish advanced_npc by introducing small fixes and features.

IMPORTANT
This update breaks compatibility with previous versions! I have added migration code that will update existing NPCs to use the new variables, and shouldn't crash Minetest. This code will be removed at a later point in time.

This new update requires the latest release of mobs_redo in order to work properly.

Change log Oct. 19, 2017
  • Content/feature updates:
    • All male and female skins were fixed. Many errors were corrected, and colors were improved.
    • NPCs now stay sitting or laying when talked to, or on game restarts.
    • NPCs can't be talked to when asleep
    • NPCs will now look back in the same direction they were facing before being talked to.
  • Technical updates:
    • The after_activate(), on_rightclick() and do_custom() functions aren't hard coded anymore into the NPC definition, but are separate functions that can be called in other mob definitions.
 

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

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

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by zorman2000 » Sun Oct 29, 2017 13:46

azekill_DIABLO wrote:That some very interesting chnages. will merge it into voxellar for the 2.2

Thanks azekill! Those are great news. Feel free to reach out to me if you need any help!
 

User avatar
paramat
Developer
 
Posts: 3376
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by paramat » Wed Nov 08, 2017 16:37

Please could you tell me the licenses for the latest skins textures?
Do you have any objection to any of them being used in a skins mod for MTGame?
 

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

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by azekill_DIABLO » Wed Nov 08, 2017 17:29

zorman2000 wrote:
azekill_DIABLO wrote:That some very interesting chnages. will merge it into voxellar for the 2.2

Thanks azekill! Those are great news. Feel free to reach out to me if you need any help!


Sure i will!

paramat wrote:Please could you tell me the licenses for the latest skins textures?
Do you have any objection to any of them being used in a skins mod for MTGame?


Hmm... you're preparing somthing you...
 

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

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by zorman2000 » Mon Nov 13, 2017 19:57

paramat wrote:Please could you tell me the licenses for the latest skins textures?
Do you have any objection to any of them being used in a skins mod for MTGame?


The licenses for all the skins included in this mod (except for the child textures and "npc_male1.png" and "npc_female1.png") should be CC BY-SA. I can update the readme in the mod to reflect this if needed.

As to any objections, I have absolutely no objection. I'm happy my work is included in MTG! Feel free to use them. Only thing I ask is that at least I'm given some credit in the mod readme or something.

Thanks!
 

User avatar
paramat
Developer
 
Posts: 3376
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by paramat » Mon Nov 13, 2017 20:12

Thanks, if used you will of course be credited.
I know that male1 and female1 come from another mod.
 

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

User avatar
BrunoMine
Member
 
Posts: 1046
Joined: Thu Apr 25, 2013 17:29
Location: SP-Brasil
GitHub: BrunoMine
 

User avatar
Codesound
Member
 
Posts: 208
Joined: Thu Jun 09, 2016 14:56

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by Codesound » Wed Jan 10, 2018 10:20

zorman2000 wrote:New update!
Today's update is not as big as the previous one, however, sometimes, small details really matters. This update tries to polish advanced_npc by introducing small fixes and features.

IMPORTANT
This update breaks compatibility with previous versions! I have added migration code that will update existing NPCs to use the new variables, and shouldn't crash Minetest. This code will be removed at a later point in time.

This new update requires the latest release of mobs_redo in order to work properly.

Change log Oct. 19, 2017
  • Content/feature updates:
    • All male and female skins were fixed. Many errors were corrected, and colors were improved.
    • NPCs now stay sitting or laying when talked to, or on game restarts.
    • NPCs can't be talked to when asleep
    • NPCs will now look back in the same direction they were facing before being talked to.
  • Technical updates:
    • The after_activate(), on_rightclick() and do_custom() functions aren't hard coded anymore into the NPC definition, but are separate functions that can be called in other mob definitions.


+1

Thanks for this!!!

R
 

pavz36
New member
 
Posts: 6
Joined: Sat Dec 23, 2017 19:04
In-game: pavz36

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by pavz36 » Wed Mar 07, 2018 18:21

Hello,
when I spawn any NPC, I get an error message and after reload the game, spawned NPC is walking one node bellow ground. Can somebody help?
Attachments
Screenshot from 2018-03-07 19-05-50.png
(622.21 KiB) Not downloaded yet
Screenshot from 2018-03-07 19-07-25.png
(102.21 KiB) Not downloaded yet
 

roboto
Member
 
Posts: 62
Joined: Wed Jul 19, 2017 15:21
GitHub: NewbProgrammer101
In-game: akoek

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by roboto » Wed Mar 07, 2018 23:26

Install Minetest 0.5.0-dev and this issue will go away.
 

pavz36
New member
 
Posts: 6
Joined: Sat Dec 23, 2017 19:04
In-game: pavz36

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by pavz36 » Fri Mar 09, 2018 16:49

Would You recommend 0.5.0 ? From version 0.4.16, can this be done smoothly, without breaking connection with already discovered world and everything created in it? As a programmer, could You give some advice to the beginner how to do it?
 

jimy
Member
 
Posts: 25
Joined: Mon Mar 12, 2012 22:15

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by jimy » Sat Mar 24, 2018 12:08

I got the following error:
Code: Select all
[save_restore] Error: Savefile 'mg_all_villages.data' not found.
[save_restore] Error: Savefile 'mg_generated_map.data' not found.
2018-03-24 13:01:05: WARNING[Main]: Undeclared global variable "moresnow" accessed at /home/jimy/.minetest/mods/mg_villages/nodes.lua:23
[save_restore] Error: Savefile 'mg_villages_all_buildings_list.data' not found.
2018-03-24 13:01:07: ERROR[Main]: ModError: Failed to load and run script from /home/jimy/.minetest/mods/advanced_npc-1.0.0-alpha-1/init.lua:
2018-03-24 13:01:07: ERROR[Main]: ...my/.minetest/mods/advanced_npc-1.0.0-alpha-1/npc.lua:1210: attempt to call method 'register_egg' (a nil value)
2018-03-24 13:01:07: ERROR[Main]: stack traceback:
2018-03-24 13:01:07: ERROR[Main]:       ...my/.minetest/mods/advanced_npc-1.0.0-alpha-1/npc.lua:1210: in main chunk
2018-03-24 13:01:07: ERROR[Main]:       [C]: in function 'dofile'
2018-03-24 13:01:07: ERROR[Main]:       ...y/.minetest/mods/advanced_npc-1.0.0-alpha-1/init.lua:26: in main chunk
2018-03-24 13:01:07: ERROR[Main]: Check debug.txt for details.
Loaded texture: /usr/local/share/minetest/games/minetest_game/


Is there any missing a dependency that should provide regoster_egg() ?
 

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

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by zorman2000 » Sat Mar 24, 2018 22:29

pavz36 wrote:Would You recommend 0.5.0 ? From version 0.4.16, can this be done smoothly, without breaking connection with already discovered world and everything created in it? As a programmer, could You give some advice to the beginner how to do it?


Assuming you are using the latest version of advanced_npc, you can fix this issue by substituting this this line with this one:
Code: Select all
collisionbox = {-0.20,0,-0.20, 0.20,0.8,0.20},


jimy wrote:I got the following error:
...
Is there any missing a dependency that should provide regoster_egg() ?


I'm not entirely sure why you are getting this, but feel free to comment out the line that is throwing this error. That is, go to the file, npc.lua, find the line (it says 1210 from the logs) and then add "--" at the beginning of the line. That egg is not being used anymore, I need to change that as well. Hope it helps.
 

scr267
New member
 
Posts: 7
Joined: Mon Jun 20, 2016 18:28
In-game: scr267

Re: [Mod] Advanced NPC (WIP) [advanced_npc]

by scr267 » Wed Apr 04, 2018 21:20

Hi

I ran into the following error using the current master branch:

2018-04-04 17:05:12: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'advanced_npc' in callback node_on_timer(): Runtime error from mod 'advanced_npc' in callback luaentity_Activate(): /home/someuser/.minetest/mods/advanced_npc/npc.lua:1319: attempt to inde
2018-04-04 17:05:12: ERROR[Main]: field 'actions' (a nil value)
2018-04-04 17:05:12: ERROR[Main]: stack traceback:
2018-04-04 17:05:12: ERROR[Main]: /home/someuser/.minetest/mods/advanced_npc/npc.lua:1319: in function 'after_activate'
2018-04-04 17:05:12: ERROR[Main]: /home/someuser/.minetest/mods/advanced_npc/npc.lua:1658: in function 'after_activate'
2018-04-04 17:05:12: ERROR[Main]: /home/someuser/.minetest/mods/mobs_redo/api.lua:2512: in function </home/someuser/.minetest/mods/mobs_redo/api.lua:2395>
2018-04-04 17:05:12: ERROR[Main]: [C]: in function 'add_entity'
2018-04-04 17:05:12: ERROR[Main]: /home/someuser/.minetest/mods/advanced_npc/spawner.lua:419: in function 'spawn_npc'
2018-04-04 17:05:12: ERROR[Main]: /home/someuser/.minetest/mods/advanced_npc/spawner.lua:364: in function 'spawn_npc_on_plotmarker'
2018-04-04 17:05:12: ERROR[Main]: /home/someuser/.minetest/mods/advanced_npc/spawner.lua:1004: in function </home/someuser/.minetest/mods/advanced_npc/spawner.lua:1002>
2018-04-04 17:05:12: ERROR[Main]: stack traceback:
2018-04-04 17:05:12: ERROR[Main]: [C]: in function 'add_entity'
2018-04-04 17:05:12: ERROR[Main]: /home/someuser/.minetest/mods/advanced_npc/spawner.lua:419: in function 'spawn_npc'
2018-04-04 17:05:12: ERROR[Main]: /home/someuser/.minetest/mods/advanced_npc/spawner.lua:364: in function 'spawn_npc_on_plotmarker'
2018-04-04 17:05:12: ERROR[Main]: /home/someuser/.minetest/mods/advanced_npc/spawner.lua:1004: in function </home/someuser/.minetest/mods/advanced_npc/spawner.lua:1002>


As a temporary measure I've reverted to Tag: 1.0.0-alpha-1 - but it hasn't been long enough to know if it will crash or not yet.

Thanks very much for an amazing mod!

scr267
 

PreviousNext

Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 1 guest