comparison objects/action.py @ 2:06145a6ee387

Fixed resource path dependencies issue that caused PARPG to crash on start. * PARPG should now run without issue (system installation not tested). * Utilized FIFE's VFS module to remove path dependencies from most PARPG modules. * The new parpg.vfs module is a singleton with a single global variable, VFS, which is a reference to the global VFS instance. Although a singleton is not ideal it should be replaced once PARPG's core code is refactored. * The parpg.vfs singleton is initialized in the parpg.applicaiton.PARPGApplication class with the absolute path to the data directory via the parpg.settings module and corresponding configuration file. * A new DataPath entry was added to the default system configuration file template under the [parpg] section to support the new parpg.vfs module. * Updated the parpg-assets subrepo to revision 3 to fix some dialog file format issues (for details see commit message for parpg-assets). * Fixed a few bugs in the parpg.dialogueparsers.YAMLDialogueParser class related to exception handling.
author M. George Hansen <technopolitica@gmail.com>
date Mon, 06 Jun 2011 15:56:14 -1000
parents 7a89ea5404b1
children 708a6f651c31
comparison
equal deleted inserted replaced
1:4912a6f97c52 2:06145a6ee387
18 import logging 18 import logging
19 19
20 logger = logging.getLogger('action') 20 logger = logging.getLogger('action')
21 21
22 from parpg.gui import drag_drop_data as data_drag 22 from parpg.gui import drag_drop_data as data_drag
23 from parpg.dialoguecontroller import DialogueController
23 24
24 class NoSuchQuestException(Exception): 25 class NoSuchQuestException(Exception):
25 """NoQuestException is used when there is no active quest with the id""" 26 """NoQuestException is used when there is no active quest with the id"""
26 pass 27 pass
27 28
286 self.npc = npc 287 self.npc = npc
287 288
288 def execute(self): 289 def execute(self):
289 """Talk with the NPC when close enough, otherwise move closer. 290 """Talk with the NPC when close enough, otherwise move closer.
290 @return: None""" 291 @return: None"""
291 from parpg.dialoguecontroller import DialogueController
292
293 player_char = self.model.game_state.player_character 292 player_char = self.model.game_state.player_character
294 npc_coordinates = self.npc.getLocation().getLayerCoordinates() 293 npc_coordinates = self.npc.getLocation().getLayerCoordinates()
295 pc_coordinates = player_char.behaviour.agent.\ 294 pc_coordinates = player_char.behaviour.agent.\
296 getLocation().getLayerCoordinates() 295 getLocation().getLayerCoordinates()
297 296