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

  1. beginStateMachine()
  2.     
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print("questTrouble1b 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.         setState("initial");
  14.     end ) 
  15. ---------------------------------------------------------------------------------------------------------------------------------------    
  16.     
  17.     state("initial") 
  18.         onMsg("checkCondition", function(msg)
  19.             local mike = getParent().getParent().getCharacter(MIKE);
  20.             local elaine = getParent().getParent().getCharacter(ELAINE);
  21.  
  22.             if ( mike.getRelationshipCondition(ELAINE, REL_TROUBLE) >= 1)
  23.             then
  24.                 mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "questTrouble1b");
  25.                 setState("talktome");
  26.             end
  27.         end )
  28.         
  29.         
  30.     state("talktome")
  31.         -- assoon as arrived - start dialog
  32.         ----------------        
  33.         onMsg("talking", function(msg)
  34.             if ( msg.data == "questTrouble1b") then
  35.                 popupConversation("dialogTrouble1b");
  36.                 setState("donetalktome");
  37.             end
  38.         end )
  39.         
  40.     state("donetalktome")        
  41.         onMsg("yes", function(msg)
  42.             getParent().getParent().getCharacter(MIKE).cancelCurrentActivity();
  43.             getParent().getParent().getCharacter(ELAINE).cancelCurrentActivity();
  44.             
  45.             setState("done");        
  46.         end )
  47. ---------------------------------------------------------------------------------------------------------------------------------------    
  48.  
  49.         
  50.     state("done")
  51.     
  52.     -- sackgasse hier
  53.         
  54.         
  55.         
  56. endStateMachine()
  57.  
  58.  
  59.  
  60.  
  61.