home *** CD-ROM | disk | FTP | other *** search
/ Singles (French) / Singles-FrenchVersion-Win95.iso / data1.cab / Statemachine / questTrouble3b.lua < prev    next >
Text File  |  2004-03-05  |  2KB  |  64 lines

  1. beginStateMachine()
  2.  
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print("questTrouble3b entered");
  6.         setState("initial");
  7.     end )
  8.     
  9.     -- debug mechanism, should be implemented properly such that a reset by questormessage is possible 
  10.     -- make sure that the initial condition wont be triggerd right away, maybe reset all prerequesites in order to prevent that
  11.     onMsg("questreset", function(msg)
  12.         getParent().getParent().getCharacter(MIKE).decRelationshipCondition(ELAINE, REL_TROUBLE,1);
  13.         getParent().getParent().getCharacter(ELAINE).decRelationshipCondition(MIKE, REL_TROUBLE,1);
  14.         setState("initial");
  15.     end ) 
  16. ---------------------------------------------------------------------------------------------------------------------------------------    
  17.     
  18.     state("initial") 
  19.         onMsg("checkCondition", function(msg)
  20.             local mike = getParent().getParent().getCharacter(MIKE);
  21.             local elaine = getParent().getParent().getCharacter(ELAINE);
  22.  
  23.             if ( mike.getRelationshipCondition(ELAINE, REL_TROUBLE) >= 3 )
  24.             then
  25.                 mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "questTrouble3b");
  26.                 setState("talktome");
  27.             end
  28.         end )
  29.         
  30.         
  31.     state("talktome")
  32.         -- assoon as arrived - start dialog
  33.         ----------------        
  34.         onMsg("talking", function(msg)
  35.             if (msg.data == "questTrouble3b") then
  36.                 popupConversation("dialogTrouble3b");
  37.                 setState("donetalktome");
  38.             end
  39.         ----------------
  40.         end )
  41.         
  42.         
  43.     state("donetalktome");
  44.         onMsg("yes", function(msg)
  45.             getParent().getParent().getCharacter(MIKE).cancelCurrentActivity();
  46.             getParent().getParent().getCharacter(ELAINE).cancelCurrentActivity();
  47.             setState("done");
  48.         end )
  49.         
  50. ---------------------------------------------------------------------------------------------------------------------------------------    
  51.  
  52.         
  53.     state("done")
  54.     
  55.     -- sackgasse hier
  56.         
  57.         
  58.         
  59. endStateMachine()
  60.  
  61.  
  62.  
  63.  
  64.