Commit Graph

68 Commits

Author SHA1 Message Date
sys4-fr 97da2dc191 Fix crash when npc close a door
Comment debug messages
2018-03-27 23:29:04 +02:00
sys4-fr dfaa904ba8 Avoid crash when npc don't find alternative place to go 2018-03-25 21:22:19 +02:00
sys4-fr 166db4b5e5 Fix crash 2018-03-25 15:46:58 +02:00
Hector Franqui ec0392096f NPC: After interacting with NPC, original yaw is restored. 2017-10-19 21:47:35 -04:00
Hector Franqui 5bdc3c3c29 NPC: Fix animation state not persistent on interaction/game restart.
Action lock/unlock doesn't perform lock if movement state is sitting or laying.
Right-click interaction can now be disabled in freeze action command.
Upon NPC activation, animation is restored.
2017-10-18 09:05:08 -04:00
Hector Franqui d95c8504ec Places: Add truly owned nodes. NPCs shouldn't override ownership
anymore.
Spawner: Add command "/restore_area" to clear up node ownership & usage in manually spawned places.
"/restore_plotmarkers" now clean up node ownership & usage in mg_villages.
2017-10-07 11:28:38 -04:00
Hector Franqui 8a5e80e2cb Places: Allow finding alternative nodes when nodes are being used.
Add owned and used properties to each owned/shared node.
Actions: Allow to find alternative sittable/bed/furnace node if currently
being used.
Default occupation: Add alternative sitting finding.
NPC: Log cleanup.
2017-10-05 18:53:46 -04:00
Hector Franqui d92b729e19 Fixed bugs related to door positioning, opening/closing, and finding
positions in general.
2017-09-23 10:43:51 -04:00
Hector Franqui 43c69ffee4 Spawner: Add search radius and height to manual spawn egg. 2017-09-21 20:03:01 -04:00
Hector Franqui c94edbc649 Log cleanup. 2017-09-21 13:45:34 -04:00
Hector Franqui cb218fc9f9 Actions: Fix bug with not finding walkable positions around bed. 2017-09-21 13:45:09 -04:00
Hector Franqui 175d07476d Remove workspace.xml 2017-09-18 00:33:24 -04:00
Hector Franqui 2a979ef1fe Actions: Add sounds to dig/place actions. 2017-09-17 12:11:31 -04:00
Hector Franqui db415dee97 Occupations: Change building type format to be more flexible.
Spawner: Huge rework on logic to determine occupations. Warning! Completely incomprehensible code.
Schedule: Improve schedule check enqueue and execution.
Optimize walk_to_pos if used on distances < 3
Huge amounts of log cleanup.
Places: Improve adding shared places.
Improve orthogonal node scanning by using walkables and not one single node.
2017-09-15 14:51:37 -04:00
Hector Franqui 866b25c63c Pathfinder: Fix indentation.
Improve path decorator to avoid jumping NPCs (in Minetest 0.5-dev)
2017-09-13 09:09:08 -04:00
Hector Franqui 70fd62825c Actions: Fix bugs in dig and place actions.
Fix bug in get_pos_argument() function.
Optimize walk_to_pos task and improve usage of access node.
Improve get_direction() by using vector.direction() and vector.round()
2017-09-13 09:06:58 -04:00
Hector Franqui 70c7a3c96f Actions: Add mine animation to dig/place actions.
Fix bug enabling wandering after dig action.
Improved "random" dir functionality for walk_step to avoid getting NPC stuck.
General formatting fixes.
2017-09-12 09:08:44 -04:00
Hector Franqui ce47958144 Actions: Fix bugs and improve dig and place action commands. 2017-09-07 08:51:50 -04:00
Hector Franqui 40ac2a55a1 Actions: Fix bug and add support for using access node. 2017-09-01 14:13:13 -04:00
Hector Franqui e85a8161c3 Change names to match convention. 2017-08-29 18:12:21 -05:00
Hector Franqui df56e44bbd Add workplaces support.
Places:
Workplaces are now usable nodes.
Plotmarkers around a building can be scanned and their information stored into current plotmarker.
Slightly optimize plotmarker search.
Occupations:
Add test "priest" occupation definition.
Fix lots of bugs in initialization code.
Spawner:
Add ability to determine occupation name out of surrounding workplaces.
Assign occupation to spawned NPC using simple algorithm.
Others:
Reduce log noise a bit.
Fix some warnings.
2017-08-29 14:54:57 -04:00
Hector Franqui 59bb430e62 Spawner: Nearby plotmarkers are now scanned for all mg_villages:plotmarkers.
Places: Usable nodes now include workplaces
Small bug fixes.
Relationships: Small bugfix with gift item response.
Occupations: Add work node descriptions.
Experimental "priest" occupation.
2017-08-28 15:43:57 -04:00
Hector Franqui 0ddb30c0f9 Finish implementation to find nearby plotmarkers. 2017-08-27 14:46:48 -04:00
Hector Franqui d347b6fad5 Finish implementation of npc.places.find_plotmarkers.
Small code refactor.
2017-08-27 12:32:04 -04:00
Hector Franqui a4fd06d1c6 Add nearby plotmarkers search 2017-08-27 11:28:40 -04:00
Hector Franqui ad9032ec5b Add scan functions and node definitions for workplaces. (WIP) 2017-08-25 19:48:34 -04:00
Hector Franqui 4c102a70a4 Spawner: Large code refactor to remove dependency on plotmarkers.
Most spawner functions can now be called without giving a plotmarker.
Move scanning functions to places.lua.
Places: Cleanup and add more area-scanning functions.
Schedules: Bugfix where schedules weren't being executed due to wrong
"end" order in the do_custom() function.
Data: Moved random data to "data" folder.
Textures: Add 14 male textures and 10 female textures.
Occupations: Small tweaks to "default_basic" occupation.
2017-08-25 09:31:45 -04:00
Hector Franqui 5a93800e77 Occupations: Add schedule check function, allow enqueuing of schedule check 2017-08-11 12:03:45 -04:00
Hector Franqui e70888c3e5 Fix bug with 'ignore' nodes when some map areas are not fully loaded but NPC try to perform actions on them. 2017-06-27 18:38:28 -04:00
Hector Franqui 3df43ab580 Spawner: Assign sits, furnaces and storage nodes to spawned NPCs.
Small basic schedule change: NPCs now sit from 12-1 on whatever sit they 'own'.
Fixed /restore_plotmarkers not clearing all metadata.
NPC: Attempted to add a fix for the children growing on their own (due to mobs_redo).
2017-06-19 20:54:26 -04:00
Hector Franqui fb549e7f93 Pathfinder: Drop jumper.lua's pathfinder in favor of MarkBu's pathfinder with slight modifications, as the later one supports 3D paths.
Clean up old pathfinder code.
Add path decoration to MarkBu pathfinder's generated paths.
Change actions.lua and places.lua to use the new pathfinder.
Properly modify README.md.
2017-06-17 11:47:51 -04:00
Hector Franqui a91160ecc6 NPC: Cleaned up debugging logs.
Standarized logs to have different levels.
Show by default only INFO, ERROR log messages.
Dialogues: Standarized function for NPC chat messages.
Removed trader.lua and trader_test.lua which are part of old 'mobs_npc' mod.
2017-06-17 09:44:25 -04:00
Hector Franqui bf0f643e3e NPC: Changed general issue with names. Now names are a dedicated variable, not anymore a nametag.
NPC names aren't visible anymore.
Spawner: Added NPC statistics to plotmarkers.
Add statistics-based spawning for a more balanced, family-type spawning of NPCs.
2017-06-17 09:08:29 -04:00
Hector Franqui adeeecd43e Pathfinding (WIP): Use MarkBu's pathfinder mod as the new pathfinder.
Actions: Modify walk_to_pos to use new pathfinding code.
Allow support for giving positions as strings or tables referring to specific places on Places Map.
Spawner: Assign beds to NPCs.
Increase amount of NPCs now being spawned as they are able to reach top floor beds.
Places: Slight overhaul and changes. Add more info to places.
NPC: Hide nametag.
2017-06-14 18:42:36 -04:00
Hector Franqui d4e8744cfb Spawner: Assign entrance door to every NPC spawned.
Increased ABM chance to make NPC spawning less laggy.
Improved building scanning, finally now has correct data for scanning nodes.
Places: Finding entrances is limited now to MTG doors.
2017-05-19 14:36:11 -04:00
Hector Franqui 1d1a56592b Actions: Rewrite API to use executor function + constants of commands.
Re-write NPC add action/task functions, do_custom() to use new actions API.
Spawner: Find building entrances (WIP)
Places: Fix numerous bugs with add/get places functions.
Actions: Fix bugs with sittable task.
2017-05-13 13:17:45 -04:00
Hector Franqui 9b3d458872 Spawner: Part 1: Add initial code to find doors front/behind position.
Detect first floor nodes.
2017-05-05 18:34:16 -04:00
Hector Franqui f4c374314a Actions: Enhance walking reliability by adding a moveto() at the end of every step and just before the next step.
Increase walking speed constants to more normal values.
2017-05-05 09:13:30 -04:00
Zorman2000 55c6146e94 Spawning: Find entrance doors to building. 2017-04-10 22:42:21 -04:00
Zorman2000 7169035783 Merge branch 'master' of https://github.com/hkzorman/advanced_npc 2017-04-08 10:22:10 -04:00
Zorman2000 a667f538f8 Spawner: Find entrance doors (WIP) 2017-04-08 10:21:51 -04:00
Hector Kio bb5cd7e2c6 Add version of Jumper library
As requested by Roland Yonaba.
2017-04-06 19:32:38 -04:00
Hector Kio 5a6113479e Improve initial comment. 2017-04-05 19:18:34 -04:00
Zorman2000 ef973e47cc Pathfinding: Cleaned up pathfinder.lua logs.
Changed init.lua to refer to proper files.
Updated comment about Jumper library in pathfinder.lua
2017-04-04 10:20:19 -04:00
Zorman2000 7f2e1b665a Pathfinding: Cleanup jumper.lua
Add copyright notices to jumper.lua
Remove 'pathfinder2.lua'
2017-04-04 10:11:19 -04:00
Zorman2000 297dd379a6 Pathfinding: Fix for mod security - joining up Jumper library code (WIP) 2017-04-03 21:48:17 -04:00
Zorman2000 afe8dc8f6e Places: Detect building entrances (WIP) 2017-03-27 20:05:18 -04:00
Zorman2000 3649d5bc6a Spawner: Adds ABM for replacement for when LBM fails. 2017-03-18 12:58:36 -04:00
zorman2000 bd6d735170 Actions: Change use sittable and use bed interface to use them as tasks.
Schedules: Allow tasks to be added as well as actions.
2017-03-09 19:41:44 -05:00
tbowan f5968b952d Better fix 2017-02-14 10:32:52 +01:00