[Reality] Teh Actions Tehy Aren't Ah Actin'

reality@twistedmatrix.com reality@twistedmatrix.com
Sun, 30 Jun 2002 00:35:04 -0400


--2fHTh5uZTiUOsy+g
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

  So, I'm trying to rewrite SOpera's existing sentence-based code to use
glyph's new and improved, super versatile (highly complex, at least for my
tiny brain) Action system, and I'm having some problems getting out of the
gate.  If someone (Heh, who am I kidding) could point out what I'm doing
wrong here, it'd be great.  SOpera's complete source is available from
zaibach's CVS (module name "SOpera"), or will be shortly.  All the new
action code is in vending.py.  A general overview of my understanding of
actions and the specifics I've tried to implement follows.

  First off, the goal.  Two objects are involved (maybe I should have tried
to walk before running.. oh well).  A coin and a vending machine.  From what
I understand, then, an Insert class is derived from a ToolAction.  Two
interfaces are then defined, IInsertActor and IInsertTarget, that provide
("dictate"?  "document"?  "suggest"?) the methods actorActionInsert(self,
target) and actorTargetInsert(self, tool) respectively.  Next, a subclass of
Subparser is created and given a parse_insert method.  The parse_insert
method snarfs up text such as "insert quarter into vending machine" and
decides that "quarter" is the Coin instance I'm holding and "vending
machine" is the VendingMachine instance sitting in the room with me.  It
creates a list containing an Insert instance with the two found instances
(or an empty list if something goes wrong).  Next, the Coin class is made to
__implements__ IInsertTarget and given an implementation for the appropriate
interface method.

  Now, all that said, I can't seem to stop getting DispatchFailed
exceptions.  I think I've made some progress since beginning this email,
though ;)  I think I'm probably using some part of the Target/Tool Actions
wrong, or implementing the wrong methods in the wrong places, but I can't
quite tell what should be right.

  I can send a traceback to the list, or instructions for reproducing the
behavior in-game if anyone thinks that would be useful.

  Jp

--=20
Elitism: It's lonely at the top, but it's comforting to look down upon
everyone at the bottom.
--
 10:06pm up 39 days, 22:50, 2 users, load average: 0.01, 0.02, 0.00

--2fHTh5uZTiUOsy+g
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9Hop3edcO2BJA+4YRAgbVAJ9wt4g5MUp/r3e2ZKZD9wxJyKtA/gCgpApN
yY7DTHv9o8eHapGUFXYzDNk=
=cC5k
-----END PGP SIGNATURE-----

--2fHTh5uZTiUOsy+g--