Page 3 of 4

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

PostPosted: Fri Sep 08, 2017 12:59
by zorman2000
roboto wrote:I sent you the pull request for the mod.

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

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

PostPosted: Sat Sep 09, 2017 20:30
by roboto
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.

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

PostPosted: Sun Sep 10, 2017 09:45
by azekill_DIABLO
can't use this texture we don't know who did it and if it's licensed properly!

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

PostPosted: Sun Sep 10, 2017 21:17
by roboto
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.

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

PostPosted: Sun Sep 10, 2017 21:33
by kingoscargames
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

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

PostPosted: Sat Oct 07, 2017 16:21
by zorman2000
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

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

PostPosted: Sat Oct 07, 2017 18:02
by BrunoMine
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.

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

PostPosted: Sat Oct 07, 2017 19:12
by zorman2000
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

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

PostPosted: Sat Oct 07, 2017 19:16
by zorman2000
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!

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

PostPosted: Fri Oct 20, 2017 02:12
by zorman2000
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.

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

PostPosted: Fri Oct 20, 2017 18:18
by azekill_DIABLO
That some very interesting chnages. will merge it into voxellar for the 2.2

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

PostPosted: Sun Oct 29, 2017 13:46
by zorman2000
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!

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

PostPosted: Wed Nov 08, 2017 16:37
by paramat
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?

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

PostPosted: Wed Nov 08, 2017 17:29
by azekill_DIABLO
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...

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

PostPosted: Mon Nov 13, 2017 19:57
by zorman2000
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!

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

PostPosted: Mon Nov 13, 2017 20:12
by paramat
Thanks, if used you will of course be credited.
I know that male1 and female1 come from another mod.

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

PostPosted: Mon Nov 13, 2017 20:22
by zorman2000
Sounds good then, thank you!

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

PostPosted: Tue Jan 09, 2018 14:13
by BrunoMine
Now my sociedades modpack work with this advanced_npc mod.

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

PostPosted: Wed Jan 10, 2018 10:20
by Codesound
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

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

PostPosted: Wed Mar 07, 2018 18:21
by pavz36
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?

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

PostPosted: Wed Mar 07, 2018 23:26
by roboto
Install Minetest 0.5.0-dev and this issue will go away.

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

PostPosted: Fri Mar 09, 2018 16:49
by pavz36
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?

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

PostPosted: Sat Mar 24, 2018 12:08
by jimy
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() ?

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

PostPosted: Sat Mar 24, 2018 22:29
by zorman2000
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.

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

PostPosted: Wed Apr 04, 2018 21:20
by scr267
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