Changeset 320 for trunk/game/scripts


Ignore:
Timestamp:
10/12/09 19:50:53 (10 years ago)
Author:
orlandov
Message:

Ticket #100: Patch by or1andov. Specify dialogue files for NPCs in their XML map instance attribute. fixes[s:trac, t:100]

Location:
trunk/game/scripts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/dialoguegui.py

    r317 r320  
    6464            'pc': pc 
    6565        } 
    66         self.dialogue_engine = DialogueEngine('dialogue/sample.yaml', 
     66        self.dialogue_engine = DialogueEngine(npc.dialogue, 
    6767                                              dialogue_callbacks, state) 
    6868        self.dialogue_gui = pychan.loadXML("gui/dialogue.xml") 
  • trunk/game/scripts/objects/action.py

    r315 r320  
    9595        pc = self.engine.game_state.PC 
    9696        pc.behaviour.agent.act('stand', self.npc.getLocation()) 
    97         self.npc.talk(pc) 
    98         self.engine.view.hud.showDialogue(self.npc) 
     97 
     98        if self.npc.dialogue is not None: 
     99            self.npc.talk(pc) 
     100            self.engine.view.hud.showDialogue(self.npc) 
     101        else: 
     102            self.npc.behaviour.agent.say("Leave me alone!", 1000) 
  • trunk/game/scripts/objects/actors.py

    r315 r320  
    242242         
    243243        self.behaviour = NPCBehaviour(self, agent_layer) 
     244        self.dialogue = kwargs.get('dialogue') 
    244245 
    245246    def getLocation(self): 
Note: See TracChangeset for help on using the changeset viewer.