Commit graph

39 commits

Author SHA1 Message Date
Alistair Riddoch
c2cff84e1f Clean up imports removing deprecated support and obsolete modules. 2009-07-01 14:07:28 +01:00
Alistair Riddoch
b15673187f Convert all current entity scripts to use server base classes. 2009-07-01 02:08:43 +01:00
Alistair Riddoch
531e4f512d Update all scripts to use atlas.Oplist 2009-05-21 16:34:27 +01:00
Alistair Riddoch
8a1a9b0c75 Update script to import BBox from physics 2009-05-20 20:02:22 +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
47d30d418b 2008-01-05 Al Riddoch <alriddoch@googlemail.com>
* rulesets/acorn/world/objects/animals/Deer.py,
	  rulesets/acorn/world/objects/animals/Pig.py,
	  rulesets/acorn/world/objects/outdoor/Campfire.py,
	  rulesets/acorn/world/objects/plants/Tree.py,
	  rulesets/acorn/world/objects/tools/Cleaver.py,
	  rulesets/basic/world/objects/plants/Tree.py,
	  rulesets/mason/world/objects/animals/Deer.py,
	  rulesets/mason/world/objects/animals/Pig.py,
	  rulesets/mason/world/objects/clothing/Garment.py,
	  rulesets/mason/world/objects/elements/Fire.py,
	  rulesets/mason/world/objects/outdoor/Campfire.py,
	  rulesets/mason/world/objects/tools/Bow.py,
	  rulesets/mason/world/objects/tools/Bucksaw.py,
	  rulesets/mason/world/objects/tools/Cleaver.py,
	  rulesets/mason/world/objects/tools/Sword.py,
	  rulesets/mason/world/objects/tools/Tinderbox.py,
	  rulesets/mason/world/objects/tools/Torch.py,
	  rulesets/mason/world/objects/tools/Trowel.py,
	  rulesets/mason/world/tasks/Bisect.py,
	  rulesets/mason/world/tasks/Combat.py,
	  rulesets/mason/world/tasks/Cultivate.py,
	  rulesets/mason/world/tasks/Delve.py,
	  rulesets/mason/world/tasks/Dig.py,
	  rulesets/mason/world/tasks/Logging.py,
	  rulesets/mason/world/tasks/Raise.py,
	  rulesets/mason/world/tasks/Ram.py,
	  rulesets/mason/world/tasks/Reap.py,
	  rulesets/mason/world/tasks/Sharpen.py,
	  rulesets/mason/world/tasks/Slaughter.py,
	  rulesets/mason/world/tasks/Slice.py,
	  rulesets/mason/world/tasks/Trailblaze.py,
	  rulesets/werewolf/world/objects/tools/Gallows.py:
	  Remove code that accesses the world attribute on Entity,
	  replacing where necessary with server.world.
2008-01-05 00:40:32 +00:00
Al Riddoch
ddfed59ec8 2007-06-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_API.cpp: Remove the messy import hooks that make
	  inherited rulesets work, but screw up module reloading.

	* rulesets/acorn/mind/SkelMind.py,
	  rulesets/acorn/world/objects/Weather.py,
	  rulesets/acorn/world/objects/animals/Crab.py,
	  rulesets/acorn/world/objects/animals/Deer.py,
	  rulesets/acorn/world/objects/animals/Pig.py,
	  rulesets/acorn/world/objects/animals/Squirrel.py,
	  rulesets/acorn/world/objects/animals/Wolf.py,
	  rulesets/acorn/world/objects/buildings/FarmHouse1.py,
	  rulesets/acorn/world/objects/buildings/FarmHouse2.py,
	  rulesets/acorn/world/objects/buildings/FarmHouse3.py,
	  rulesets/acorn/world/objects/buildings/FarmStand.py,
	  rulesets/acorn/world/objects/buildings/FishShop.py,
	  rulesets/acorn/world/objects/buildings/House1.py,
	  rulesets/acorn/world/objects/buildings/House2.py,
	  rulesets/acorn/world/objects/buildings/House3.py,
	  rulesets/acorn/world/objects/buildings/House4.py,
	  rulesets/acorn/world/objects/buildings/House5.py,
	  rulesets/acorn/world/objects/buildings/Inn1.py,
	  rulesets/acorn/world/objects/buildings/Inn2.py,
	  rulesets/acorn/world/objects/buildings/ItemShop.py,
	  rulesets/acorn/world/objects/buildings/Mansion.py,
	  rulesets/acorn/world/objects/buildings/MetalShop.py,
	  rulesets/acorn/world/objects/buildings/Ruin.py,
	  rulesets/acorn/world/objects/buildings/Shack.py,
	  rulesets/acorn/world/objects/buildings/Stall.py,
	  rulesets/acorn/world/objects/buildings/Sty.py,
	  rulesets/acorn/world/objects/buildings/VacantShop1e.py,
	  rulesets/acorn/world/objects/buildings/VacantShop1w.py,
	  rulesets/acorn/world/objects/buildings/VacantShop2.py,
	  rulesets/acorn/world/objects/outdoor/Campfire.py,
	  rulesets/acorn/world/objects/plants/Tree.py,
	  rulesets/acorn/world/objects/plants/seeds/Acorn.py,
	  rulesets/acorn/world/objects/plants/seeds/Apple.py,
	  rulesets/acorn/world/objects/plants/seeds/Seed.py,
	  rulesets/acorn/world/objects/tools/Cleaver.py,
	  rulesets/acorn/world/objects/undead/Arm.py,
	  rulesets/acorn/world/objects/undead/Pelvis.py,
	  rulesets/acorn/world/objects/undead/Ribcage.py,
	  rulesets/acorn/world/objects/undead/Shin.py,
	  rulesets/acorn/world/objects/undead/Skull.py,
	  rulesets/acorn/world/objects/undead/Thigh.py,
	  rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/world/objects/Pile.py,
	  rulesets/basic/world/objects/animals/Animal.py,
	  rulesets/basic/world/objects/buildings/House.py,
	  rulesets/basic/world/objects/buildings/StoneHouse.py,
	  rulesets/basic/world/objects/elements/Fire.py,
	  rulesets/basic/world/objects/plants/Tree.py,
	  rulesets/basic/world/objects/tools/Axe.py,
	  rulesets/basic/world/objects/tools/Bow.py,
	  rulesets/basic/world/objects/tools/Pickaxe.py,
	  rulesets/basic/world/objects/tools/Scythe.py,
	  rulesets/basic/world/objects/tools/Shovel.py,
	  rulesets/basic/world/objects/tools/Sword.py,
	  rulesets/mason/world/objects/Pile.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/buildings/House.py,
	  rulesets/mason/world/objects/buildings/House3.py,
	  rulesets/mason/world/objects/buildings/StoneHouse.py,
	  rulesets/mason/world/objects/clothing/Garment.py,
	  rulesets/mason/world/objects/elements/Fire.py,
	  rulesets/mason/world/objects/outdoor/Campfire.py,
	  rulesets/mason/world/objects/outdoor/Gravestone.py,
	  rulesets/mason/world/objects/plants/Fir.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/Axe.py,
	  rulesets/mason/world/objects/tools/Bow.py,
	  rulesets/mason/world/objects/tools/Bucksaw.py,
	  rulesets/mason/world/objects/tools/Cleaver.py,
	  rulesets/mason/world/objects/tools/Pickaxe.py,
	  rulesets/mason/world/objects/tools/Rope.py,
	  rulesets/mason/world/objects/tools/Scythe.py,
	  rulesets/mason/world/objects/tools/Shovel.py,
	  rulesets/mason/world/objects/tools/Sword.py,
	  rulesets/mason/world/objects/tools/Tinderbox.py,
	  rulesets/mason/world/objects/tools/Torch.py,
	  rulesets/mason/world/objects/tools/Trowel.py,
	  rulesets/mason/world/objects/undead/Skeleton.py,
	  rulesets/mason/world/tasks/Bisect.py,
	  rulesets/mason/world/tasks/Combat.py,
	  rulesets/mason/world/tasks/Logging.py,
	  rulesets/mason/world/tasks/Raise.py,
	  rulesets/mason/world/tasks/Ram.py,
	  rulesets/mason/world/tasks/Sharpen.py,
	  rulesets/mason/world/tasks/Slice.py,
	  rulesets/mason/define_world.py:
	  Convert rulesets over to inheriting from the Thing class in
	  the new non ruleset specific location.

	* rulesets/basic/mind/goals/animal/domestic.py: Add file missing from
	  previous commit.
2007-06-19 12:36:42 +00:00
Al Riddoch
c1e3c25519 2007-06-12 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/objects/tools/Bucksaw.py: Add an error message
	  if this code gets called, as it should no longer be.
2007-06-12 18:57:53 +00:00
Al Riddoch
4bb04449dd 2007-06-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/tasks/Logging.py: Implement logging entirely
	  in the task, instead of relying on functionality in the plant
	  class.

	* rulesets/Py_Quaternion.cpp: Implement rotation method as in the
	  the wfmath class, as required for Logging.

	* rulesets/Plant.cpp: Add an error message if the old plant
	  functionality gets called.

	* rulesets/basic/world/objects/tools/Axe.py: Add an error message
	  noting that this method should not be called.
2007-06-04 08:30:27 +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
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
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
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
95dc4bd53f 2005-05-24 Al Riddoch <alriddoch@zepler.org>
* data/mason.xml, rulesets/mason/world/objects/tools/Bucksaw.py:
	  New bucksaw for cutting up logs.

	* rulesets/mason/world/objects/tools/Trowel.py: Correct the comments.
2005-05-24 23:19:13 +00:00
Al Riddoch
6264b84c29 2005-05-17 Al Riddoch <alriddoch@zepler.org>
* data/mason.xml, rulesets/mason/world/objects/tools/Tinderbox.py:
	  Tinderbox for starting fires.

	* common/custom.cpp: Ignite operation for tinderbox.
2005-05-17 00:53:13 +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
Al Riddoch
da5b9c4551 2005-05-14 Al Riddoch <alriddoch@zepler.org>
* tools/AdminClient.cpp, tools/AdminClient.h, tools/cyaddrules.cpp:
	  New tool to load new rules into a running server.

	* data/mason.xml, rulesets/mason/world/objects/tools/Rope.py:
	  Experimental type for a rope.

	* man/cyclient.sgml, man/cycmd.sgml, man/cyphesis-tools.sgml,
	  man/cyphesis.sgml: Add SEE ALSO sections to the man pages.

	* rulesets/Python_API.cpp: Clean up variable names.

	* server/Admin.cpp: Send an info response when types are
	  installed from the client.

	* tools/cyloadrules.cpp: Correct copyright dates.
2005-05-13 23:25:32 +00:00
Al Riddoch
3e0894d9bd 2005-05-12 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/objects/tools/Trowel.py, data/mason.xml:
	  Add a rule for a trowel for planting seeds. Add a rule for spider
	  model.

	* common/custom.cpp: Add custom ops for "sow" and "germinate" for
	  handling seeds.
2005-05-12 18:10:06 +00:00
Al Riddoch
ccb6388908 2005-05-06 Al Riddoch <alriddoch@zepler.org>
* common/Dig.h, common/Mow.h, common/custom.cpp, common/operations.cpp:
	  Add new Dig and Mow operations, for handling resource gathering.

	* rulesets/basic/world/objects/tools/Shovel.py,
	  rulesets/basic/world/objects/tools/Scythe.py,
	  data/basic.xml: Add new scythe and shovel for gathering resources
	  from the terrain.

	* rulesets/basic/world/objects/tools/Pickaxe.py,
	  common/Delve.h: Fix the comments.

	* rulesets/World.cpp, rulesets/World.h: Move code for determining
	  terrain surface type into a method of its own. Implement handlers
	  for Dig and Mow ops.
2005-05-06 01:41:17 +00:00
Al Riddoch
7ba24a29d9 2005-04-21 Al Riddoch <alriddoch@zepler.org>
* common/custom.cpp, common/Delve.h,
	  common/operations.cpp, common/operations.h:
	  Add new delve operation for digging with a pickaxe.

	* data/basic.xml, rulesets/basic/world/objects/tools/Pickaxe.py:
	  Add new pickaxe entity which emits a Delve operation when
	  used.

	* rulesets/Character.cpp: Fix a bug where a segfault occured
	  if an operation was requested by a tool that was unknown to
	  to the core server code. Instead an error message is emitted.

	* rulesets/World.cpp: Subscribe world terrain to delve ops.
2005-04-22 00:29:10 +00:00
Al Riddoch
edc9d66023 2005-04-10 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Operation.cpp, rulesets/Py_Optime.cpp,
	  rulesets/Py_Optime.h rulesets/Python_API.cpp:
	  Remove the Optime class from the API and force scripts to use
	  setFutureSeconds() to modify operation dispatch time.

	* rulesets/acorn/world/objects/Weather.py,
	  rulesets/acorn/world/objects/plants/Tree.py,
	  rulesets/acorn/world/objects/plants/seeds/Acorn.py,
	  rulesets/acorn/world/objects/plants/seeds/Apple.py,
	  rulesets/acorn/world/objects/plants/seeds/Seed.py,
	  rulesets/basic/mind/NPCMind.py,
	  rulesets/basic/mind/goals/common/move.py,
	  rulesets/basic/world/objects/animals/Animal.py,
	  rulesets/basic/world/objects/buildings/House.py,
	  rulesets/basic/world/objects/elements/Fire.py,
	  rulesets/basic/world/objects/plants/Tree.py,
	  rulesets/basic/world/objects/tools/Bow.py,
	  rulesets/mason/world/objects/Weather.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:
	  Fix up all the python scripts to use setFutureSeconds on
	  ops instead of time.sadd.
2005-04-11 00:54:15 +00:00
Al Riddoch
bda38097f0 2005-01-25 Al Riddoch <alriddoch@zepler.org>
* data/basic.xml: Clean out a load of obsolete classes and scripts.

	* 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/plants/seeds/Seed.py,
	  rulesets/mason/world/objects/undead/Skeleton.py:
	  Remove obsolete constructors, and don't inherit from
	  obsolete scripts.
2005-01-25 23:22:30 +00:00
Al Riddoch
fb80cb3c42 2005-01-24 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/objects/tools/Cleaver.py,
	  rulesets/mason/world/objects/animals/Deer.py,
	  rulesets/basic/world/objects/tools/Axe.py:
	  Remove obsolete commented out code, and useless constructors
	  from some scripts.

	* data/mason.xml: Remove obsolete scripts for some entities
	  which don't do anything.
2005-01-24 17:18:08 +00:00
Al Riddoch
0e8f2d1c27 2004-11-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/objects/tools/Cleaver.py: Scrub some debug
	  output.
2004-11-19 02:01:04 +00:00
Al Riddoch
45eba48bf6 2004-11-13 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/world/objects/tools/Axe.py,
	  rulesets/Plant.cpp: Make trees rotate 90 degress when they are
	  chopped, simulating being cut down.
2004-11-13 16:42:55 +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
8424723b7a 2004-11-02 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.cpp, rulesets/Entity.h: Add has() method
	  to query if an entity has an attribute with a given name.

	* rulesets/Character.cpp, rulesets/Character.h: Implement tool
	  wield and use operations.

	* data/mason.xml: Add operations list to the cleaver.

	* rulesets/mason/world/objects/tools/Cleaver.py: Simplify the chop
	  operation the cleaver expects to get from its user.

	* tools/cyloadrules.cpp: Remove some commented out cruft and
	  debugging output.
2004-11-03 15:28:10 +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
b89504d49c 2002-08-30 Al Riddoch <alriddoch@zepler.org>
* common/globals.cpp: Only persist this sessions command line
	  options if the user is overriding the installation directory.

	* cyphesis.vconf, client/Py_CreatorClient.cpp,
	  client/Py_CreatorClient.h, client/client.cpp:
	  Add client functionality to allow diferent scripts to be run to
	  perform different functions on the server.

	* client/CharacterClient.cpp: Add debug option.

	* rulesets/Character.h: Make mind operation functions virtual,
	  so they can be overridden.

	* common/BaseWorld.h, server/WorldRouter.cpp,
	  server/WorldRouter.h: Add server functions to search for
	  entities by name or type.

	* rulesets/Creator.h, rulesets/Creator.cpp: Allow creator to
	  specify a look without an id to search for entities with
	  a given name or type.

	* client/CreatorClient.cpp, client/CreatorClient.h,
	  client/ObserverClient.cpp, client/ObserverClient.h,
	  client/Py_CreatorClient.cpp, rulesets/basic/editor.py,
	  rulesets/mason/define_world.py:
	  Add support for looking for entities in the world by name or
	  type from client script, so client scripts can modify existing
	  world.

	* rulesets/Entity.cpp, rulesets/Movement.cpp,
	  rulesets/Py_Object.cpp, rulesets/Py_Operation.cpp,
	  rulesets/Py_Oplist.cpp, rulesets/Python_API.cpp,
	  rulesets/Stackable.cpp, rulesets/Thing.cpp,
	  rulesets/World.cpp, server/Account.cpp,
	  server/CommServer.cpp, server/Connection.cpp,
	  server/Player.cpp, server/ServerRouting.cpp,
	  server/server.cpp, tools/cycmd.cpp,
	  tools/cywatchdog.cpp: Code formatting cleanups.

	* rulesets/basic/world/objects/tools/Bow.py: Fix up bow so it now
	  fires correctly.
2002-08-30 13:48:39 +00:00
Al Riddoch
e4b05c4b8f 2002-06-08 Al Riddoch <alriddoch@zepler.org>
* common/const.h: Increase the sight range.

	* server/WorldRouter.cpp: Put in some warnings, as I want to
	  know when ops are getting broadcast.

	* server/server.cpp: Ensure stdout is not used when in daemon mode.

	* tools/cydbload.cpp: Rename the daftly named class WorldBase
	  to WorldAccessor.

	* mason.xml, cyphesis.vconf: Stop using the Acorn ruleset in Mason,
	  as it contains strange stuff, and remove the playable farmer
	  class from basic. Now games themselves define the only
	  playable types, and mason contains its own copies of classes
	  it has in common with acorn.
2002-06-08 00:56:25 +00:00
Al Riddoch
716cb0f8de 2002-04-25 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.cpp, rulesets/Entity.h, rulesets/Character.cpp,
	  rulesets/Character.h, rulesets/Thing.cpp, rulesets/Food.cpp:
	  Renamed weight member as mass, and use this name in Atlas,
	  as this is a better convention, and has already been adopted in
	  stage.

	* Switched python code to using mass instead of weight, as it is
	  a more accurate term.

	* common/globals.cpp, common/globals.h, tools/cyloadrules.cpp:
	  Put admin modifiable config in etc instead of share directory.

	* Don't build cycmd if readline is not available. Untested, and
	  probably nasty.
2002-04-26 08:08:48 +00:00
Al Riddoch
0572ab631b * Renamed Operataion method names throughout so they no longer
all have the name Operation but are now called MoveOperation,
	  according to the type of operation they handle.

	* modules/DateTime.cpp, modules/DataTime.h: Filled in functionality,
	  allowing initialisation and updating from a time values in seconds.

	* modules/Location.h: Modified collision detection code so no
	  checking is done between two moving objects.

	* rulesets/BaseMind.h, rulesets/BaseMind.cpp, rulesets/Entity.h,
	  rulesets/Entity.cpp: Removed virtual getMap() method and replaced
	  with a fixed method in BaseMind only. Added time member veriable
	  to BaseMind so each mind keeps track of time by itself.

	* rulesets/Python_API.h, rulesets/Py_Mind.cpp, rulesets/Py_Mind.h:
	  Added specific python interface for mind objects, because if
	  increasing differences in the way this must be handled.

	* rulesets/Character.h, rulesets/Character.cpp: Added isAlive flag
	  which is cleared if the character is dead. If this flag is cleared,
	  operations are no longer sent to the mind.

	* rulesets/Movement.h, rulesets/Movement.cpp, rulesets/Pedestrian.h,
	  rulesets/Pedestrian.cpp: Cleaned up the code, made members more
	  distinctive, and make interface more general.

	* rulesets/Py_Thing.cpp: Removed features used to support mind.

	* rulesets/Py_WorldTime.cpp: Added support for comparison of
	  time with strings, to establish whether it matches descriptions
	  of time.

	* rulesets/Python_API.cpp: Modified creating of scripts so mind
	  scripts use a slightly different interface from entity scripts,
	  to support the fact that a mind handles its own timekeeping,
	  has a memory map, and has no access to the world.

	* server/WorldTime.cpp, server/WorldTime.h: Brought WorldTime into
	  the build. Used to track details of the time. Added support for
	  checking time descriptions such as "midday", "summer" against
	  DateTime.

Al Riddoch  <alriddoch@zepler.org>
2001-05-28 14:58:24 +00:00
Al Riddoch
35d78b27a2 * Implemented beginnings of ranges code:
* modules/Location.h: Added inRange() method which can be used
	  to check whether location, including bounding box, is within
	  given range of a given location. Changed parent member
	  variable to ref to fit with Atlas spec. Changed all code
	  related to using the term ref instead of parent so
	  that there is no confusion between ref for coordinates
          and parent in the Atlas hierarchy.

        * rulesets/Thing.cpp: Added code to move operation to check
          what entities come into and out of range when entity moves.
          Appearance and Disappearance operations are sent to the
          moving entity with a list of the relevant entities as their
          argument.

        * server/WorldRouter.h/cpp: Added overloaded Look operation
          handler which applies range constraints to the contains
          attribute before returning.

        * common/BaseEntity.h, rulesets/Thing.h, rulesets/Character.h:
          Added handling of Appearance and Disappearance operations.

        * server/WorldRouter.cpp: Added primitive check to broadcast
          operations to avoid delivering broadcast operation to
          entities out of range.

        * Removed world.get_object() use from server python code, as
          its use is not required.

        * server/WorldRouter.h: Implemented fetching of floating point time
          from the OS so movement is much smoother.

Al
2001-02-19 06:13:31 +00:00
Al Riddoch
f9e8d1c832 * Fixed inheritance bug in BaseMind::operation()
* Tweaked the way Look operations are handled when sent from mind, so
	  an argument is not required if to is set.

	* Made some performance enhancements.

	* Implemented nourish operation.

	* Modifed move_me() goal so it sets face direction.

	* Fixed memory leak in MemMap.

	* Implemented fully deleting of entities.

	* Cleaned up and tweaked python scripts so eating acorns now works.

	* Implemented hooks in MemMap for python scripts.


This is the work I got done over the Christmas break. Acorn now works
with a couple of minor glitches.

Al
2000-12-30 23:16:57 +00:00
Al Riddoch
defe46b91e * Set up rulesets processing so that everything is handled dynamically
from config files. Global ruleset should indicate top level ruleset
	  which can depend on a list of other rulesets.

	* Sorted out installation directories. Cyphesis will now need to be
	  installed before it can be run.

	* Cleaned up a load more python scripts for more Acorn stuff.

	* Added getting x y and z from Vector3D.

	* Made acorn the default ruleset.

Al
2000-12-13 12:10:48 +00:00
Al Riddoch
faf8b6dbca * Fixed so that we are no longer sending broadcast look ops, which
clag the server up and are not correct behavoir.

	* Minor fixes/python tweaks.

	* Slight change to ordering of ops in the queue, so more recently
	  created ops with the same time stamp come of the queue after
	  older ops.

	* Implemented contains attribute so newly created objects are added
	  to their parents contains list, and when objects are move, they are
	  transfered from old parents to new parents contains list.


Lots more stuff is now happening in the world, though I can't see what it is
because things don't show up in uclient now that broadcast Look doesn't
work. It is also clear that I need to seriously attack the memory leak situation
now.

Al
2000-12-07 20:38:20 +00:00
Al Riddoch
d1f2e912a0 * Added handling for removing connections.
* Removed some unused code.

	* Tweaked some python scripts so they import correctly.

	* Added in_game flag to BaseEntity so it is possible to tell
	  if an object is in game.

	* Increased the number of operations handled by Message()

	* Added handling for initialisation of location.parent using me
	  in mind code.

	* Added is_object_delete() functionality to python interface to world
	  object.

	* Added handling for converting Tuple into Message::Object, and then
	  ensured that non-basic python types don't get stored as attributes
	  of a Message::Object.

Many more improvements to goal behavoir. Guard now patrols correctly,
and butcher tries to by a cleaver, because he fails to notice he already
has one.

Al
2000-12-07 12:14:35 +00:00
Al Riddoch
e6d6f7ef0d * Added new common namespace to prevent collision with math function
log.

	* Added in lots of deletes to sort memory leaks.

	* More python tweaks.

	* Implemented status attributes of thing.

	* Re-wrote some code which needlessly creates objects in the
	  free store.

Very nearly all works now.

TODO:
Tidy some of the rest of the leak handling, including all of the stuff
to deal with connections going down.

Sort out how mind gets its attributes set and updated.

Sort out iritating python error in init of Vector3D

delete oplists in OplistObjects. The pointers are never passed back.

Al
2000-12-05 14:26:04 +00:00
Al Riddoch
21b18875f6 * Started working on sorting out memory leaks.
* Implemented python function to deal with not being able to check
	  type of python objects implemented in C.

	* Added method to thing for extracting location data from a
	  Message::Object

	* More work on python references to improve leakage.

	* Added flag so that python Operation object can own
	  the operation they point to, and thus delete it in dealloc().

	* Implemented find_by_location() and find_by_type() as required in
	  MemMap, and corresponding python interface.

	* Put in temporary work around to deal with the fact that a mind
	  does not know its name. Currently the mind is not able to
	  discover any of its bodies attributes, and I am not sure how
	  to solve this.

	* Fixed Location and Vector3D so they use operator bool() to detect
	  whether they are set.

	* Fixed bugs in getting parent from Location in python which caused
	  segfaults.

	* Imported all the basic ruleset entity python scripts.


Goals now work to some extent, though nothing moves around still. The main
priority is to work out how minds inherit the attributes of their
bodies, and keep them up to date. aloril?

Al
2000-12-04 20:08:21 +00:00