Commit graph

350 commits

Author SHA1 Message Date
Al Riddoch
bf316eeb28 2006-04-27 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/terrain.py: Add client script to allow easy
	  setup of some basic terrain types.
2006-04-28 15:46:27 +00:00
Al Riddoch
53879c8ca6 2006-04-25 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/test_python_api.py: More tests of the Python API
	  for Atlas Operations.
2006-04-25 15:00:00 +00:00
Al Riddoch
004774692d 2006-04-21 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/test_python_api.py: Add test script to exercise
	  the server's Python API.
2006-04-21 00:52:50 +00:00
Al Riddoch
a6f2f92374 2006-02-11 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/common/misc_goal.py: Clean up defend
	  goal so it works with new spot_something.

	* rulesets/mason/define_world.py: Add goblins.
2006-02-11 04:09:16 +00:00
Al Riddoch
9600aabab5 2006-01-21 Al Riddoch <alriddoch@zepler.org>
* client/Py_CreatorClient.cpp, rulesets/Py_Map.cpp,
	  rulesets/Py_Operation.cpp, rulesets/Py_Oplist.cpp,
	  rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
	  rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp:
	  Convert functions that take a single argument to use METH_O
	  and avoid calling PyArg_ParseTuple.

	* rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
	  rulesets/basic/mind/goals/common/move.py: Rename
	  unit_vector_to_another_vector to unit_vector_to.
2006-01-22 02:13:52 +00:00
Al Riddoch
f8b54007ac 2006-01-06 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Remove C++ implementation of server.dictlist
	  as its installation was messy, and it serves no purpose being
	  implemented in C++.

	* rulesets/basic/mind/NPCMind.py, rulesets/basic/mind/dictlist.py:
	  Use python dictlist implementation from original Python version
	  of cyphesis.
2006-01-06 21:39:00 +00:00
Al Riddoch
027b481aee 2006-01-05 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_WorldTime.cpp: Extend the type object for python
	  WorldTime to the format used by more recent python versions,
	  adding new and init methods as well as flags, and doc string.

	* rulesets/Python_API.cpp: Refactor the way the server python
	  module and its type server.WorldTime are created to be the
	  preferred way for more recent python versions.

	* rulesets/basic/mind/NPCMind.py: Remove explicit WorldTime
	  member, as there is already one in the C++ base class.
2006-01-05 16:52:52 +00:00
Al Riddoch
dd362305e2 2005-12-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/MemMap.py: Remobe obsolete AI code.
2005-12-26 23:45:52 +00:00
Al Riddoch
a2914a39e3 2005-12-24 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Re-work the keywords handling in Operation()
	  to avoid bugs in the mapping protocol by using Dict functions, and
	  eliminate wasteful double lookup. No longer accept setting FROM
	  in constructor as its never required.

	* rulesets/werewolf/world/objects/characters/Villager.py,
	  rulesets/basic/editor.py: No longer set FROM on operations at
	  construction. It was never necessary.
2005-12-24 02:23:31 +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
7aca1c79bc 2005-12-16 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/NPCMind.py: Remove a return statement so
	  legacy money handling code still works.
2005-12-16 15:37:18 +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
1a246f180a 2005-12-13 Al Riddoch <alriddoch@zepler.org>
* rulesets/BaseMind.cpp: When appearance arrives, check stamp and send
	  looks if necessary.

	* rulesets/basic/mind/NPCMind.py: Remove some debug output.
2005-12-13 18:41:40 +00:00
Al Riddoch
bd887cf571 2005-12-13 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/common/misc_goal.py: Don't set TO
	  on eat ops from goals.
2005-12-13 02:32:04 +00:00
Al Riddoch
e2b83394b0 2005-12-13 Al Riddoch <alriddoch@zepler.org>
* common/const.h: Add a second const for the non-squared default
	  box size for visibility calculations.

	* modules/Location.cpp: Initialise cached box size members with
	  defaults from consts.

	* rulesets/basic/mind/goals/common/move.py: Don't remove focus
	  knowledge about item just because it has been picked up. This
	  fixes eating acorns.

	* rulesets/basic/mind/goals/common/misc_goal.py: Remove focus knowledge
	  when something is eaten.
2005-12-13 01:38:08 +00:00
Al Riddoch
a9e1d4993c 2005-12-05 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/world/objects/Thing.py: Move some functionality
	  from the Thing base class into NPCMind, leaving minimal
	  functionality in the base class making it suitable as an interface
	  for all scripts.
2005-12-05 21:40:45 +00:00
Al Riddoch
77c19a4395 2005-12-05 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_BBox.cpp, rulesets/Py_Optime.cpp,
	  rulesets/Py_Statistics.cpp, rulesets/Py_Thing.cpp: Ensure that
	  setattr returns an exception if the attribute is not a valid one.

	* rulesets/Py_Map.cpp, rulesets/Py_Point3D.cpp,
	  rulesets/Py_Quaternion.cpp, rulesets/Py_World.cpp,
	  rulesets/Py_WorldTime.cpp: Remove setattr, as no attributes can
	  be set on this type.

	* rulesets/Py_Mind.cpp, rulesets/Py_Oplist.cpp,
	  rulesets/Py_Vector3D.cpp: Clean up type structure.

	* rulesets/basic/mind/goals/common/move.py: Remove attempt
	  to set "rotation" attribute on location, as its obsolete
	  and pointless.
2005-12-05 04:01:11 +00:00
Al Riddoch
58cb9f7012 2005-12-01 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/world/objects/Thing.py: Get rid of redundant kw
	  arg to constructor, move op_dict initialisation to cinit()
	  and remove base_init completely as its only required to handle
	  the C++ constructor behavoir which we no longer need.

	* rulesets/basic/mind/NPCMind.py: Get rid of redundant args to
	  to mind, and call cinit to handle connection to C++ core directly
	  now that base_init is gone.
2005-12-01 02:17:06 +00:00
Al Riddoch
15fa406cc5 2005-12-01 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/BaseMind.py: Remove obsolete base mind class,
	  now completely implemented in C++.
2005-12-01 01:29:50 +00:00
Al Riddoch
64851093f1 2005-12-01 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/ExternalMind.py: Remove obsolete external
	  mind class, now completely implemented in C++.
2005-12-01 01:14:45 +00:00
Al Riddoch
ba4a73dfe5 2005-11-30 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/world/objects/Thing.py: Remove self.attributes
	  from the base class for all python scripts.

	* rulesets/mason/world/objects/Weather.py,
	  rulesets/basic/world/objects/plants/Tree.py,
	  rulesets/basic/world/objects/animals/Animal.py,
	  data/basic.xml, data/mason.xml: Don't use set_kw to handle default
	  attributes, and add the to the .xml rules files.

	* rulesets/basic/world/objects/buildings/House.py,
	  rulesets/basic/world/objects/buildings/StoneHouse.py,
	  rulesets/basic/world/objects/tools/Bow.py,
	  rulesets/basic/world/objects/tools/Sword.py,
	  rulesets/mason/world/objects/animals/Deer.py,
	  rulesets/mason/world/objects/animals/Pig.py,
	  rulesets/mason/world/objects/outdoor/Campfire.py,
	  rulesets/mason/world/objects/outdoor/Gravestone.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/plants/seeds/Seed.py,
	  rulesets/mason/world/objects/tools/Cleaver.py,
	  rulesets/mason/world/objects/undead/Skeleton.py,
	  rulesets/werewolf/world/objects/characters/Villager.py,
	  rulesets/werewolf/world/objects/tools/Gallows.py:
	  Don't import set_kw from misc, as its now obsolete and unused.
2005-11-30 22:37:50 +00:00
Al Riddoch
5b5d29ea62 2005-11-23 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/NPCMind.py: Add handling for 'about' knowledge
	  and return it in a way that makes sense to the listener.

	* rulesets/mason/define_world.py: Provide NPCs which lots of
	  information 'about' the world, so they can help players.
2005-11-25 03:21:09 +00:00
Al Riddoch
8c0a05b40b 2005-11-02 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/NPCMind.py: Don't respond to knowledge
	  queries if the character has no knowledge.

	* server/Connection.cpp, rulesets/Creator.cpp, rulesets/Character.cpp:
	  Use flag check to see if operations have FROM set, rather than
	  checking for an empty string.

	* rulesets/Thing.cpp: When handling move ops, avoid lookup of LOC
	  in world unless it has changed.
2005-11-02 02:06:38 +00:00
Al Riddoch
e3806759eb 2005-10-20 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Report a warning when action ops are sent
	  from client or mind code.

	* rulesets/Py_Location.cpp: Allow invalid vectors to be used
	  to set attributes on Location.

	* rulesets/acorn/world/objects/undead/Skeleton.py,
	  rulesets/mason/world/objects/undead/Skeleton.py: Remove action
	  ops replacing them with setting MODE of skeleton to
	  collapsed.

	* rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/mind/goals/common/misc_goal.py: Use Imaginary ops
	  rather than Action for emotes.
2005-10-20 14:34:01 +00:00
Al Riddoch
dc50c8c7f2 2005-10-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/NPCMind.py: Fix face() so that NPC doesn't crash
	  if it turns to face something that is zero distance away.

	* server/EntityFactory.cpp: Improve error reporting when an entity
	  has velocity set at creation, and ensure that the velocity is
	  unset before the entity goes into the world.
2005-10-19 20:44:41 +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
3bb45e6ad0 2005-08-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/common/misc_goal.py: Don't return
	  non-existant ops.

	* rulesets/Thing.cpp: Fix some places where root_operations
	  were being returned.

	* common/inheritance.cpp: Add "affect" operation base class,
	  and fix parents on use and wield.

	* common/custom.cpp: Install atlas factories for custom op
	  types.
2005-08-29 02:28:53 +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
a05e7ff8d3 2005-07-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/common/misc_goal.py: More changes
	  to make goals work with new spot_something.

	* rulesets/basic/mind/goals/common/move.py: Modify hunt pursuit goal
	  to fit with spot_something.
2005-07-04 00:44:57 +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
52b39ec18a 2005-07-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/common/misc_goal.py: Re-work
	  spot_something goal to store the entity spotted in Knowledge
	  rather than it being hacked in as a possession. Re-work many
	  other goals to work with spot_something, eliminating reference
	  to mind from constructors where possible.
2005-07-03 23:24:24 +00:00
Al Riddoch
54b89238c6 2005-07-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/common/move.py: Break down goals for
	  picking up things into separate goals for picking up
	  posessions, and focussed items, and similarly for moving toward
	  items.
2005-07-03 23:17:20 +00:00
Al Riddoch
1a6368d01d 2005-07-03 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/Knowledge.py, rulesets/basic/mind/NPCMind.py:
	  Add new methods to remove knowledge from mind.
2005-07-03 23:08:38 +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
7f61b1d8de 2005-06-30 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/common/misc_goal.py: Remove unnecessary
	  "me" argument from get_knowledge goal.
2005-06-30 00:05:15 +00:00
Al Riddoch
1c2ee9a610 2005-06-30 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/Goal.py: Remove debugging output.
2005-06-29 23:49:07 +00:00
Hagen Moebius
91f6c59708 2005-06-28 Hagen Moebius <hagen.moebius@starschiffchen.de>
* data/basic.xml: Added operations "disperse" and "extinguish".
   Set up "disperse" as the default operation for the pile.
 * rulesets/basic/world/objects/Pile.py: The operation "disperse"
   will call the "extinguish" operation on the target. Maybe it is
   advisable to add an assertion if the target is indeed a fire.
2005-06-28 22:51:49 +00:00
Al Riddoch
018f95b915 2005-06-28 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/goals/common/misc_goal.py: Fix indentation
2005-06-28 16:53:10 +00:00
Kai Blin
e25b4c6f1f 2005-06-25 Kai Blin
* rulesets/basic/mind/goals/common/misc_goal.py: reduced the random
   offset that makes the chicken change position after pecking
2005-06-25 08:40:26 +00:00
Kai Blin
90cb6f0ca3 2005-06-24 Kai Blin <blin@gmx.net>
* rulesets/mason/define_world.py: Add peck as a goal for the chicken,
  and a test_chicken function.

* rulesets/basic/mind/panlingua/interlinguish.py: Add peck verb.

* rulesets/basic/mind/goals/common/misc_goal.py: Add peck goal.
  Chicken will now run around. The actual peck will be added later.
2005-06-24 16:48:46 +00:00
Al Riddoch
3f3c424513 2005-06-23 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/define_world.py: Fix graveyard bbox.
	  Tweak lych's patrol path so he doesn't run into gravestones.

	* rulesets/basic/mind/NPCMind.py: WTF!
2005-06-23 17:01:27 +00:00
Al Riddoch
04a1310ed6 2005-06-23 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp, modules/Location.h, rulesets/Python_API.cpp:
	  Implement a function for determining the horizontal distance
	  between two locations neglecting height difference, as for
	  locations on the terrain it is not relevant.

	* rulesets/basic/mind/goals/common/move.py: Improve the coding of
	  the move_me_to_it goal, so distance determination is more effective.
	  Make distance independant of height.
	  Relax distances at which character is concidered to have arrived at
	  its destination.

	* rulesets/basic/mind/Goal.py: Modify goal so that it understands
	  that a subgoal can be unfulfilled, but still not need to take any
	  action.
2005-06-23 12:46:28 +00:00
Al Riddoch
ff6227f0e7 2005-06-22 Al Riddoch <alriddoch@zepler.org>
* server/WorldRouter.cpp: Fix a problem where entities contained by
	  other entities had their height adjusted incorrectly.

	* rulesets/basic/world/objects/elements/Fire.py: Allow fires to be
	  moved.

	* rulesets/Python_API.cpp: Add constructor for BBox.

	* data/mason.xml: Add a torch. Add burn_speed attributes to a
	  bunch more entity classes.

	* rulesets/mason/world/objects/tools/Torch.py: Script for torch.
2005-06-22 14:56:14 +00:00
James Turner
846f90be15 2005-06-20 James Turner <james@worldforge.org>
* rulesets/basic/mind/panlingua/interlinguish.py: add nouns for
	  various tools that can be sold.
2005-06-20 13:13:04 +00:00
Al Riddoch
f5f68b94b1 2005-06-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/objects/tools/Tinderbox.py: Change strength
	  of initial fire spark to 0.05.

	* common/operations.cpp: Fix nourish op, which got broken when mow
	  was added.

	* data/basic.xml: Add a default bbox for lumber, giving it a more
	  apropriate size.

	* rulesets/Py_World.cpp: Add a compare implementation so that
	` scripts can check entities to see if they are the world.

	* rulesets/basic/world/objects/elements/Fire.py: Tune the
	  changes which occur in fire as it burns.
2005-06-19 16:46:52 +00:00
Al Riddoch
9310b52de3 2005-05-15 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/objects/tools/Rope.py: Correct the syntax
	  of stub functions.

	* rulesets/basic/world/objects/buildings/StoneHouse.py: Fix the import
	  statements.

	* rulesets/basic/world/objects/buildings/House.py: Fix import for
	  physics module.

	* rulesets/basic/mind/goals/common/misc_goal.py: Fix typo in
	  cut_something.

	* server/ScriptFactory.cpp, server/ScriptFactory.h: New factory
	  class for handling python scripts for entities much more
	  efficiently, and provide a means where they can be re-imorted
	  at an apropriate time.

	* server/PersistantThingFactory.h,
	  server/PersistantThingFactory.cpp: Make PersistantThingFactory
	  copy constructor protected, to ensure its not used accidentally.
	  Replace strings for storing python script data with a pointer
	  to a factory for creating scripts.

	* server/EntityFactory.cpp: Use the new ScriptFactory mechnism
	  for creating scripts attached to entities. Improve variable
	  names a little.
2005-05-15 00:54:08 +00:00