Commit graph

61 commits

Author SHA1 Message Date
Erik Ogenvik
21b6612f76 Use Entity Filters for the Welcome goal. 2015-05-02 00:19:38 +02:00
Yaroslav Taben
05481fb2e5 Renamed filter to entity_filter in python to avoid a conflict
filter name conflicts with built-in filter method and causes
confusion
2014-08-14 17:09:27 -04:00
Yaroslav Taben
705a033b58 Added filter use to plant_seeds and gather goals 2014-08-08 18:22:57 -04:00
Erik Ogenvik
3ecaa1cedc Abort help goal if the target has disappeared. 2013-11-11 13:46:14 +01:00
Erik Ogenvik
a30625b2ad Rename parameter. 2013-09-30 21:29:39 +02:00
Erik Ogenvik
24693565dd Specify range for harvest_resource. 2013-07-26 15:06:35 +02:00
Erik Ogenvik
7c591308f5 Honour spacing when planting.
This is to make sure the seeds aren't planted too closely.
2013-07-26 12:05:39 +02:00
Erik Ogenvik
689afa4732 Remove seed focus if it has disappeared. 2013-07-26 11:23:20 +02:00
Erik Ogenvik
309a65b233 Only spot sources in the area. 2013-07-25 18:34:52 +02:00
Erik Ogenvik
4503b10d99 Remove "roam" from planting.
Movement can be handled by a separate goal.
2013-07-25 17:14:29 +02:00
Erik Ogenvik
89d2d8c060 Only harvest adult plants.
If there's a "sizeAdult" property available; else just try to harvest
them as they are.
2013-07-23 23:17:20 +02:00
Erik Ogenvik
e3d6c5a5ec Improve planting task.
Look for seeds within the area first and foremost before looking for
sources.
2013-07-16 23:18:01 +02:00
Erik Ogenvik
ef68b41a39 Allow range to be specified in plant seed goal. 2013-06-30 14:02:52 +02:00
Erik Ogenvik
432d647029 Only search in area when planting. 2013-06-29 15:47:36 +02:00
Erik Ogenvik
097982eebe Improve plant_seeds goal.
The NPC will now move between the sources and look for seeds.
2013-06-27 21:59:50 +02:00
Erik Ogenvik
194f2e4f63 Make sure we can see what we want to plant. 2013-06-16 00:14:15 +02:00
Erik Ogenvik
34f1544b1a Spelling fixes. 2013-04-05 20:56:55 +02:00
Alistair Riddoch
c2cff84e1f Clean up imports removing deprecated support and obsolete modules. 2009-07-01 14:07:28 +01:00
Alistair Riddoch
531e4f512d Update all scripts to use atlas.Oplist 2009-05-21 16:34:27 +01:00
Alistair Riddoch
6679b1b30f Update all Python scripts to import vector and point from physics 2009-05-20 19:34:01 +01:00
Al Riddoch
f1ffc6ce7f 2009-01-27 Al Riddoch <alriddoch@googlemail.com>
* rulesets/basic/mind/goals/humanoid/mason.py: Fix a potential issue
	  with goals not having full dependencies imported.
2009-01-27 18:17:14 +00:00
Al Riddoch
9776626954 2008-09-18 Al Riddoch <alriddoch@googlemail.com>
* rulesets/basic/mind/goals/animal/domestic.py,
	  rulesets/basic/mind/goals/animal/herd.py,
	  rulesets/basic/mind/goals/common/misc_goal.py,
	  rulesets/basic/mind/goals/common/trigger.py,
	  rulesets/basic/mind/goals/dynamic/add_unique_goal.py,
	  rulesets/basic/mind/goals/humanoid/construction.py,
	  rulesets/basic/mind/goals/humanoid/fire.py,
	  rulesets/basic/mind/goals/humanoid/mason.py,
	  rulesets/basic/mind/goals/humanoid/transaction.py:
	  Add nominal doc strings to some goal classes.
2008-09-18 00:53:14 +00:00
Al Riddoch
e5bee108c9 2008-09-17 Al Riddoch <alriddoch@googlemail.com>
* rulesets/basic/mind/goals/common/common.py,
	  rulesets/basic/mind/goals/common/move.py,
	  rulesets/basic/mind/goals/humanoid/build_home.py,
	  rulesets/basic/mind/goals/humanoid/fire.py,
	  rulesets/basic/mind/goals/humanoid/mason.py,
	  rulesets/basic/mind/goals/humanoid/transaction.py:
	  Clean up the way goals are imported so it makes more sense,
	  and doxygen has an easier time with it.
2008-09-17 17:33:30 +00:00
Al Riddoch
f557abbe13 2007-11-23 Al Riddoch <alriddoch@zepler.org>
* rulesets/Script.h, rulesets/Script.cpp,
	  rulesets/PythonThingScript.h, rulesets/PythonThingScript.cpp,
	  rulesets/PythonMindScript.h, rulesets/PythonMindScript.cpp:
	  Modify the script interface so it now only handles one operation.

	* rulesets/BaseMind.cpp: Pass in the sub operation only for
	  sight and sound of other operations.

	* rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/mind/goals/humanoid/transaction.py: Adapt the mind
	  and goal code so it only requires one operation.
2007-11-23 16:06:52 +00:00
Al Riddoch
127bfd5d92 2007-04-24 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/common/misc_goal.py,
	  rulesets/basic/mind/goals/common/move.py,
	  rulesets/basic/mind/goals/humanoid/construction.py,
	  rulesets/mason/define_world.py: Fix most goals so they no longer
	  require a reference to the owning mind object on initialisation,
	  meaning they are now more stateless.
2007-04-23 23:42:38 +00:00
Al Riddoch
05c29a2070 2007-04-08 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/common/misc_goal.py,
	  rulesets/basic/mind/goals/common/move.py,
	  rulesets/basic/mind/goals/humanoid/construction.py:
	  Re-write goals relating to gathering things off the ground
	  to be clearer, more efficient, and to deal with lists of types.

	* rulesets/mason/define_world.py: Use warrior test to test gathering
	  lists of types.
2007-04-08 22:05:39 +00:00
Al Riddoch
2d5b996346 2005-12-23 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/common/misc_goal.py: Fix a problem where
	  an NPC seller would not count all the coins handed over immediatly.

	* rulesets/basic/mind/goals/humanoid/transaction.py: Add a FIXME about
	  a mis-coding using for loops.
2005-12-23 01:24:53 +00:00
Al Riddoch
4c5776d51a 2005-12-18 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/humanoid/transaction.py: Tell the seller
	  how much the pig they have just sold was worth. Only value each
	  pig rather than continuously re-pricing the same pig.
2005-12-18 03:08:25 +00:00
Al Riddoch
42e765d81b 2005-12-16 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/define_world.py: Fix formatting.

	* rulesets/basic/mind/NPCMind.py: Add structure to store things
	  an NPC has been given.

	* rulesets/basic/mind/goals/humanoid/transaction.py: Add new goal
	  for buying things from a given entity.
2005-12-16 02:33:31 +00:00
Al Riddoch
53ebdc74ed 2005-09-13 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp: Fix a bug where POS was being corrupted
	  whenever velocity was supposed to be set.

	* rulesets/basic/mind/goals/humanoid/mason.py: Convert ID to entity
	  before checking location.

	* rulesets/mason/mind/PigMind.py: Convert ID to entity before
	  passing location to another function.
2005-09-13 01:44:49 +00:00
Al Riddoch
2ea8129440 2005-09-11 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/humanoid/mason.py: Fix self -> me
	  when checking for mind ID.
2005-09-11 18:56:12 +00:00
Al Riddoch
d5637bacef 2005-09-11 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Operation.h, rulesets/Py_Operation.cpp: Remove reference
	  ownership flag, and from and to pointers from the python operation
	  structure.

	* rulesets/Py_Map.cpp, rulesets/Py_Oplist.cpp,
	  rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
	  rulesets/Python_API.cpp: Remove all usage of own, from and to.

	* rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/mind/goals/common/misc_goal.py,
	  rulesets/basic/mind/goals/humanoid/mason.py,
	  rulesets/basic/mind/goals/humanoid/transaction.py,
	  rulesets/mason/world/objects/clothing/Garment.py,
	  rulesets/mason/world/objects/plants/seeds/Acorn.py,
	  rulesets/mason/world/objects/plants/seeds/Apple.py,
	  rulesets/mason/world/objects/plants/seeds/Fircone.py,
	  rulesets/mason/world/objects/tools/Bucksaw.py,
	  rulesets/mason/world/objects/tools/Cleaver.py,
	  rulesets/mason/world/objects/tools/Trowel.py: Modify all scripts
	  so they expect from and to of ops to be an ID string rather than
	  an entity.
2005-09-11 18:51:55 +00:00
Al Riddoch
a02f9e5f55 2005-07-07 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/common/common.py,
	  rulesets/basic/mind/goals/common/misc_goal.py,
	  rulesets/basic/mind/goals/common/move.py,
	  rulesets/basic/mind/goals/humanoid/build_home.py,
	  rulesets/basic/world/probability.py,
	  rulesets/basic/world/objects/plants/Tree.py,
	  rulesets/mason/define_world.py, rulesets/mason/mind/SkelMind.py,
	  rulesets/mason/world/objects/Weather.py,
	  rulesets/mason/world/objects/animals/Deer.py,
	  rulesets/mason/world/objects/animals/Pig.py,
	  rulesets/mason/world/objects/outdoor/Gravestone.py,
	  rulesets/mason/world/objects/plants/seeds/Seed.py,
	  rulesets/mason/world/objects/undead/Skeleton.py,
	  rulesets/werewolf/define_world.py:
	  Switch to importing random and fall back to deprecated whrandom
	  on older python versions.
2005-07-07 01:04:40 +00:00
Al Riddoch
92d96719e0 2005-07-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/humanoid/construction.py:
	  Port plant_seeds goal to use new spot_something mechanism.
2005-07-04 00:23:46 +00:00
Al Riddoch
b40b3982ce 2005-07-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/humanoid/construction.py: Re-work
	  goals to use new movement goals, and fix some bugs. Use
	  right_hand_wield properlly when using tools. Adjust to use
	  new spot_something goal.

	* rulesets/mason/define_world.py: Fix up world initialisation
	  to setup forage now the constructor args have changed.
2005-07-03 23:27:48 +00:00
Al Riddoch
873c352716 2005-07-01 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/humanoid/construction.py: Add a new
	  goal for planting seeds.

	* rulesets/mason/define_world.py: Add a forester NPC that uses
	  the plant_seeds goal to plant acorns.
2005-07-01 00:33:28 +00:00
Al Riddoch
6d127f1a7e 2005-04-24 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/common/misc_goal.py,
	  rulesets/basic/mind/goals/humanoid/construction.py:
	  Make sure Use arguments explicitly have an objtype in the
	  argument.
2005-04-24 23:08:34 +00:00
Al Riddoch
4155ad1240 Remove some obsolete .cvsignore files 2005-01-25 23:56:42 +00:00
Al Riddoch
8e5c27bf80 2004-01-09 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/define_world.py: Use know() for prices rather
	  than the special case code.

	* rulesets/basic/editor.py, rulesets/basic/mind/NPCMind.py:
	  Remove obsolete special case code for handling knowledge of
	  prices. Improve code to express distance to a location so
	  it neglects the vertical distance, and better handles the
	  very close case.

	* rulesets/basic/mind/goals/humanoid/mason.py: Track the character
	  being helped in the help goal, and turn to face them when speaking.

	* rulesets/basic/mind/panlingua/interlinguish.py: Add more support
	  for pronouns, conjugations and whitespace in regex used to match
	  certain sentence structures.
2005-01-09 21:24:57 +00:00
Al Riddoch
03f105d991 2004-12-17 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/define_world.py,
	  rulesets/basic/mind/goals/humanoid/mason.py: Add suggested responses
	  to talk messages from NPCs. Helps the client make it easy
	  for the user to respond.
2004-12-17 01:41:30 +00:00
Al Riddoch
6e10c36111 2004-11-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Clear up the logging wrappers.
	  Add python wrapper for squareDistance which is more efficient
	  in the goal code that distanceTo. Remove some old python functions
	  which serve no purpose. Move distanceTo and squareDistance into
	  their own module.

	* rulesets/basic/mind/NPCMind.py: Remove obsolete import.

	* rulesets/basic/mind/goals/common/misc_goal.py,
	  rulesets/basic/mind/goals/common/move.py,
	  rulesets/basic/mind/goals/humanoid/construction.py: Use the new
	  physics.square_distance where linear distance is required
	  in goals.
2004-11-29 21:32:53 +00:00
Al Riddoch
0e71e6be03 2004-11-18 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/Plant.cpp: Encapsulate the
	  debugging output relating to tool use into the debug macro, so it
	  is no longer printed.

	* rulesets/basic/mind/goals/common/move.py: Re-write a couple
	  of movement goals so they work more reliably.

	* rulesets/basic/mind/goals/humanoid/construction.py: Comment out
	  debugging output.

	* rulesets/mason/define_world.py: More additions to NPC settler test.
2004-11-18 14:48:32 +00:00
Al Riddoch
6b0ddf41ac 2004-11-18 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/common/move.py:
	  Try and make some of the move goals a bit more legible.

	* rulesets/basic/mind/goals/humanoid/construction.py:
	  Fix a bunch of bugs in the resource gathering goals.
	  These now basically work.

	* rulesets/mason/define_world.py: Add knowledge of a test location
	  to the settler NPC testing code.
2004-11-18 01:26:09 +00:00
Al Riddoch
7ed5102c7c 2004-11-17 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/humanoid/construction.py: New currently
	  non-functional goals for construction related tasks.

	* rulesets/mason/define_world.py: Add new test for construction
	  goals.
2004-11-17 18:59:06 +00:00
Al Riddoch
e13826d573 2004-11-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Add notes, and a check to ensure that
	  ops from the mind don't have TO set.

	* rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/mind/goals/common/misc_goal.py,
	  rulesets/basic/mind/goals/humanoid/mason.py: Don't set TO or FROM
	  on goals from the mind.
2004-11-04 17:42:40 +00:00
Al Riddoch
4cc780a559 2004-11-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/Plant.h, rulesets/Plant.cpp: Add handler for chop so
	  we can chop down vegetation.

	* rulesets/basic/world/objects/tools/Axe.py: Modify Axe to comply
	  with new tool use mechanism.

	* rulesets/basic/mind/goals/humanoid/transaction.py,
	  rulesets/basic/mind/goals/common/misc_goal.py,
	  rulesets/mason/define_world.py: Update butcher goals to use tool
	  use mechanism.

	* rulesets/Python_API.cpp: Ensure entities created from Python
	  have an objtype.
2004-11-04 11:39:00 +00:00
Al Riddoch
ee38122cc0 2004-10-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/werewolf/world/objects/tools/Gallows.py: Make sure
	  Point3D module is imported.

	* rulesets/basic/mind/goals/humanoid/transaction.py: Fix a couple
	  of bugs with pig seller code.
2004-10-26 17:18:03 +00:00
Al Riddoch
1eb1d322a2 2004-10-25 Al Riddoch <alriddoch@zepler.org>
* rulesets/werewolf/world/objects/tools/Gallows.py,
	  rulesets/basic/world/objects/tools/Bow.py,
	  rulesets/basic/world/objects/plants/Tree.py,
	  rulesets/basic/world/objects/buildings/House.py,
	  rulesets/basic/mind/goals/humanoid/transaction.py,
	  rulesets/basic/mind/goals/common/misc_goal.py:
	  Fix bugs initialising Location ensuring the second
	  arg is a Point3D, not a Vector3D for position.
	  Fixes pig purchasing.

	* rulesets/basic/mind/goals/humanoid/mason.py:
	  Fix the velocity check for escaping pigs.

	* rulesets/Py_Point3D.cpp: Fix Point3D subtraction operator to
	  allow subtraction of both Point and Vector. Fixes pig merchant
	  goal for keeping pigs.
2004-10-25 01:23:28 +00:00
Al Riddoch
feb7cb032e 2004-10-23 Al Riddoch <alriddoch@zepler.org>
* server/WorldRouter.cpp: Add a note to check the code.

	* rulesets/basic/mind/goals/humanoid/transaction.py: Remove debug
	  output.

	* rulesets/basic/mind/goals/common/move.py: New goal to accompany
	  another person.

	* rulesets/basic/mind/goals/common/misc_goal.py: Use new accompany
	  goal for hirelings.

	* rulesets/Python_API.cpp: Fix distance_to arg checking error
	  message.

	* rulesets/Py_Vector3D.cpp: Add square magnitude and distance checking
	  methods.
2004-10-24 01:38:59 +00:00
Al Riddoch
ce8f62d539 2004-10-11 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp, modules/Location.h: Add new function for
	  usefully calculating the distance vector of another entity.

	* tests/distancetest.cpp: Update test to check new distance
	  function.

	* rulesets/Python_API.cpp: Make the new distance vector function
	  available to python rather than the relative postion function.

	* rulesets/basic/mind/Knowledge.py, rulesets/basic/mind/NPCMind.py:
	  Ensure that Knowledge really does handle arbitrary triples.

	* rulesets/basic/mind/goals/common/misc_goal.py: Add new version
	  of transaction goal for transactions for hirelings.

	* rulesets/basic/mind/goals/humanoid/transaction.py: Complete
	  the implementation of the trigger goal for hirelings.

	* rulesets/mason/define_world.py: Move the mercenaries closer to
	  origin for debugging.
2004-10-11 01:04:27 +00:00