Commit Graph

33 Commits

Author SHA1 Message Date
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
175d07476d Remove workspace.xml 2017-09-18 00:33:24 -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
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
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
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
Zorman2000
55c6146e94 Spawning: Find entrance doors to building. 2017-04-10 22:42:21 -04:00
Zorman2000
a667f538f8 Spawner: Find entrance doors (WIP) 2017-04-08 10:21:51 -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
e3fc7be783 Places: Add correct detection of sittable nodes, including stairs used as benches.
Add staircase detection method, for basic staircases. Ability to detect the bottom, middle and top nodes. Useful for future implementation of being able to use 2nd floors.
2017-01-12 19:40:20 -05:00
zorman2000
641bdd8874 Actions: Fully working 2D pathfinding code, including doors.
Added NPC actions so that it now closes doors after opening them.
Fixed rotations for opening/closing doors and for reaching the goal point.
Added full support to cottages mod gates and half doors.
WIP: Support for cottages beds and sleeping mats.
2017-01-09 11:34:38 -05:00
zorman2000
554fde4643 Adds pathfinding library Jumper by Ronald Yonaba. This includes an implementation of the A* pathfinding algorithm which makes NPC now always get to their goal node.
Pathfinding: Adds functions that allows to map the Minetest 3D map to a 2D array to use by the pathfinding algorithm.
Actions: Use new code for find_path function. Improves door opening while walking on paths, and also now close them. Cottages fence gates and doors are also now supported in addition to the default doors and gates.
Changes to the Readme and the License.
2017-01-06 07:57:42 -05:00
zorman2000
80b7eb6ec9 Actions: Added action to use a bed (from the default beds mod). 2016-12-29 21:34:41 -05:00
zorman2000
d78fee695e Actions: added experimental, still WIP path-finding code in Lua 2016-12-28 22:10:06 -05:00
zorman2000
646b422082 Actions: Added some fundamental movement actions.
Places: Added functions for adding and getting places, and for finding places of specific types. Added beds, chairs and chest as places.
NPC: Added places map and action queue.
2016-12-18 12:32:39 -05:00