Commit graph

350 commits

Author SHA1 Message Date
Erik Ogenvik
3f3f212c9c Correctly handle serializing Location. 2013-04-13 23:32:44 +02:00
Erik Ogenvik
9beee13a21 Send thoughts as "Thought" op.
Instead of wrapping it in a "Set" op. This is more idiomatic.
2013-04-13 23:25:16 +02:00
Erik Ogenvik
54b8249bd7 Make sure subject is transmitted as string.
Else we risk automatic conversions, which for example will turn tuples
into lists.
2013-04-11 23:04:26 +02:00
Erik Ogenvik
0a3aa68062 Handle the location being incomplete.
This can happen if the entity is in such a state that the location isn't
valid. We should handle it by consider the memory recall operation as
failed, but not as an exception.
2013-04-08 20:17:01 +02:00
Erik Ogenvik
333ae7832f Be more forgiving with goal errors.
Instead of treating a goal error as something which will make the entity
inactive, we instead allow for some errors (namely three currently) to
occur before the goal is deactivated. Any other goals are however
allowed to carry on even though one goal is faulty.
We also expose this through the goal_info query functionality, allowing
for world authors to better debug faulty goals.
2013-04-07 23:20:23 +02:00
Erik Ogenvik
34f1544b1a Spelling fixes. 2013-04-05 20:56:55 +02:00
Erik Ogenvik
4807f7856b Clean up debug code and add docs. 2013-04-05 20:53:46 +02:00
Erik Ogenvik
929f964b7d Allow to query for specific goals.
One can specify both the "subject" and the "goal". If no "goal" is
specified, all goals for the "subject" will be queried. If no "subject"
is specified, all goals will be queried.
2013-04-02 22:32:52 +02:00
Erik Ogenvik
4d982173bb Allow admin client to query goals.
This is done in a way similar to how thoughts are queries. A Get op is
sent, containing a Goal_info op. The mind code is then responsible for
composing data about the goals, which is sent back to the client.
2013-04-01 22:18:40 +02:00
Erik Ogenvik
3697ba8c42 Allow goals to be queried.
This will return a map containing various useful data about the goal.
This is meant to be used for debugging and inspection of goals and
behaviours.
2013-04-01 22:17:58 +02:00
Erik Ogenvik
6420d0afaf Fixed issue with setting multiple goals. 2013-03-31 21:02:13 +02:00
Erik Ogenvik
d227515c43 Improve goal creation.
We'll make sure all new goals are valid before we remove the old ones.
2013-03-31 21:02:13 +02:00
Erik Ogenvik
678f439fb9 Improve settings of goals.
When a goal is set, the supplied 'object' can also be a list of strings
(i.e. a list of goals). All existing goals for the supplied subject will
be deleted. This allows for much better editing capabilities.
2013-03-31 21:02:13 +02:00
Erik Ogenvik
ea1331b601 Store knowledge of goal differently.
Goals are handled differently than other knowledge, so we need to store
it in a separate dict.
2013-03-31 21:02:13 +02:00
Erik Ogenvik
76878899ad Return all goals when asked.
The goal code is a little messy, because we can't rely on looking into
the knowledge map for them, as the knowledge will only keep one goal per
subject.
In order to fix this we instead look for the goals in either "goals" or
"trigger_goals".
2013-03-31 21:02:13 +02:00
Erik Ogenvik
ce242b7307 Avoid NPE. 2013-03-31 21:02:13 +02:00
Erik Ogenvik
86bbfb4a0d Handle goals correctly. 2013-02-10 14:50:54 +01:00
Erik Ogenvik
d9ced4cb6c Perform more proper op handling. 2013-02-10 12:50:45 +01:00
Erik Ogenvik
c077abbd6f Fixed op iteration. 2013-02-10 11:47:46 +01:00
Erik Ogenvik
e6cd3bf643 Allow setting of thoughts. 2013-02-10 11:47:46 +01:00
Erik Ogenvik
f18b0c717b Provide ability to ask entities for their thoughts.
This is meant to be used for authoring. It allows admin clients to
inspect and persist the relevant parts of the minds of any NPC.
2013-02-04 20:15:29 +01:00
Alistair Riddoch
bbd2e722d2 Call client teardown when editor finalizes 2012-07-27 09:44:28 +01:00
Alistair Riddoch
437278b27b Remove curcular references and clean up syntax
Storing references to bound methds of self makes the object contain
circular references, and makes it hard to GC. Storing the unbound
methods removes this problem. I moved from apply() to the modern syntax
to be certain of getting the change right.
2012-07-26 23:28:56 +01:00
Alistair Riddoch
e9108262b4 Merge pull request #3 from erikhjortsberg/list_all_knowledge
List all knowledge
2012-01-06 06:47:59 -08:00
Alistair Riddoch
4ec82e38b5 Merge pull request #2 from erikhjortsberg/improved_speech_parsing
Handle punctuation and upper case intial letter.
2012-01-06 06:47:18 -08:00
Alistair Riddoch
c51802c34f Add test for combat interface 2011-12-02 01:04:39 +00:00
Alistair Riddoch
f8dc3e5e76 Restructure avatar creation to make more sense 2011-12-01 10:27:13 +00:00
Alistair Riddoch
ce22b00058 Clean up the way editor is set up 2011-12-01 10:11:00 +00:00
Alistair Riddoch
4a0eda93e7 Update client related code for changed bindings 2011-11-30 19:27:11 +00:00
Erik Hjortsberg
b5447f2eb9 Added debug function for getting all knowledge. 2011-10-23 16:04:52 -07:00
Erik Hjortsberg
c90b62d52d Handle punctuation and upper case intial letter.
The interlinguish code couldn't handle sentences starting with upper
case letters, and ending in punctuations.
2011-10-23 16:04:52 -07:00
Alistair Riddoch
29fb2c0922 Formatting tweaking 2011-09-14 16:29:56 +01:00
Alistair Riddoch
bf9e7ebbfe Format tweaking 2011-09-14 16:29:41 +01:00
Alistair Riddoch
87406d39ae Fix up comment spelling and formatting 2011-09-14 16:17:16 +01:00
Erik Ogenvik
361e074954 Address the calling entity when responding. 2011-09-02 23:51:07 +02:00
Erik Ogenvik
c4c4199865 Ignore messages addressed to others.
So far we only perform this check for the "list" and "tell" verbs, but
we should probably apply it to most talk ops.
2011-09-02 23:51:06 +02:00
Alistair Riddoch
3b039a7d8b Let's have some variable names that make sense. 2010-12-01 10:06:55 +00:00
Alistair Riddoch
ad0ac2b703 Add a new helper function to simplify client scripts 2010-09-12 15:12:54 +01:00
Alistair Riddoch
8152bd5562 metaserver search kinda works now. 2010-07-31 12:29:26 +01:00
Alistair Riddoch
32941d10f2 Add start of a metaserver query routine in python 2010-07-30 02:04:44 +01:00
Alistair Riddoch
0db259418f Add start of work of metaclient in python. 2010-07-29 02:50:08 +01:00
Amey Parulekar
eab877b245 Corrected bugs in code for detecting presence of hook in fish's inventory 2009-08-03 20:44:40 +05:30
Amey Parulekar
e91e37f004 Amble goal will return if a hook is present inside fish 2009-07-29 00:17:22 +05:30
Amey Parulekar
165055b54e Make school goal return if a hook is present inside fish 2009-07-29 00:15:30 +05:30
Amey Parulekar
f3ede87736 Changed search criteria from type to name in school goal 2009-07-25 00:35:12 +05:30
Amey Parulekar
015c03f4d2 Re-added school and amble goals to interlinguish 2009-07-17 15:24:06 +05:30
Amey Parulekar
c5f8fec6b1 Created a new branch of master and merged all changes into it 2009-07-10 03:15:53 +05:30
Alistair Riddoch
aac6856fa5 Fix check for Point3D in the pig herd goal. 2009-07-07 18:37:12 +01:00
Alistair Riddoch
7a1bc1d3a6 Fix up some goal functionality, but disable it as it currently hogs CPU. 2009-07-07 01:14:10 +01:00
Alistair Riddoch
8533389e8d Update NPCMind to inherit from core wrapper type. 2009-07-01 17:03:24 +01:00