Calling "is_valid" checks whether the goal actually can be fulfilled.
If it can't be, False is returned.
By default all Goals return True unless a "validity" function is supplied
in the constructor.
For now we only use it for checking whether movement goals can be reached.
If the character wants to travel too far, we shouldn't try to map the whole
path straight away. Instead we'll cut down on the lenght, and increase the
acceptable radius.
This works since the AI will issue a new destination on its next Tick.
Authoring clients can send a Think op, wrapping a Get op with a "path"
attribute to get information about the path. The mind code will then
send back a list of points for the path.
This goal will move a character close to something, and then keep the
character within a certain distance of this thing.
This is useful when you want the character to get close to something,
but then search for something else within the vicinity.
Also forget these after a while.
This makes sure that this goal doesn't result in the character getting
stuck on one thing. If used with the clear_focus goal the character can
instead move on to other things, and then return to the same thing after
a while after it's "forgotten".
This makes the NPC wander aimlessly within a specified series of
location. This is often more suitable than "wander", as that goal will
make the NPC wander over the whole map, which often isn't what you want.
The NPC will now wander randomly. However, this isn't completely
natural. The change in direction is too erratic. And the goal should be
expanded to stay within a certain area.
* 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.
* data/devices.xml: Add a second type of operation to the example
device.
* rulesets/Character.cpp: Sort out the fixme so non-default actions
can be specified when actuating devices.
* rulesets/basic/mind/goals/common/misc_goal.py: Clean up the
actuation testing goal.
* rulesets/basic/mind/goals/common/misc_goal.py: Make the checking
for a list simpler. Add a test goal for exercising the device
activation interface.
* rulesets/mason/define_world.py: Add client test method to try
out the activation goal.
* rulesets/Python_API.cpp: Remove the server_python flag used to
allow scripts to run unmodified on the obsolete python prototype.
* rulesets/basic/mind/NPCMind.py,
rulesets/basic/mind/goals/animal/herd.py,
rulesets/basic/mind/goals/common/common.py,
rulesets/basic/mind/goals/common/move.py,
rulesets/mason/world/objects/buildings/House.py: Remove support
for running these scripts on the obsolete python prototype.
* rulesets/basic/mind/goals/common/trigger.py: Generic common trigger
goals, starting with a trigger base chase goal.
* rulesets/basic/mind/goals/animal/domestic.py: Trigger goals specific
to domesticated animals, starting with goals for pig herding.
* rulesets/basic/mind/goals/__init__.py: Add the two new files of
trigger goals.
* rulesets/mason/mind/PigMind.py, rulesets/mason/mind/SkelMind.py,
rulesets/mason/mind/WolfMind.py, rulesets/mason/mind/__init__.py:
Remove special mind classes for pig, skeleton and wolf, as it
should be possible to do it more cleanly with trigger goals.
* rulesets/mason/define_world.py: Add trigger goals for pig and
skeleton to replace the behavior that used to be in special purpose
mind classes.
* 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.