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

  1.  
  2. beginStateMachine()
  3.  
  4.     onEnter(function(msg)
  5.         popupMission();
  6.     end )
  7.  
  8.     onMsg("getText", function(msg)
  9.         -- set mission text
  10.         setMissionText("marharharharar", "das ist die neue game mission text mission");
  11.     end )
  12.  
  13.     onMsg("checkComplete", function(msg)
  14.         --check mission completeness heere
  15.     end )
  16.     
  17.     onMsg("ok", function(msg)
  18.     
  19.     end )
  20.  
  21.     onMsg("enterTrigger1", function(msg)
  22.         setState("_GLOBAL");
  23.         print(" GLOOOOOOOOOBAL ");
  24.     end )
  25.  
  26. ----------------------
  27.     
  28.     onMsg("enterTrigger", function(msg)
  29.         setState("helloWorld0");
  30.         print(" -> HELLOWORLD 0 ");
  31.         popupConversation("Mike: dies ist ein Testgespraech", MIKE);
  32.     end )
  33.     
  34.     
  35.     
  36.     state("helloWorld0")
  37.         onMsg("ok", function(msg)
  38.             setState("helloWorld1");
  39.             print(" -> HELLOWORLD 1 ");
  40.  
  41.             popupConversation("Linda: mein erster Satz den ich jemals sage", LINDA);
  42.         end )
  43.         
  44.     state("helloWorld1")
  45.         onMsg("ok", function(msg)
  46.             setState("helloWorld2");
  47.             print(" -> HELLOWORLD 2 ");
  48.             popupConversation("Mike: wir koennten jetzt ewig so weiter\n quatschen aber das missionscript schickt uns beide gleich weg", MIKE);
  49.         end )
  50.         
  51.     state("helloWorld2")
  52.         onMsg("ok", function(msg)
  53.             print(" -> SACKGASSE ");
  54.             setState("sackgasse");
  55.         end )
  56.  
  57.     state("sackgasse")
  58.         onEnter(function(msg)
  59.         
  60.             local mike = getParent().getCharacter(MIKE);
  61.             local sofa = mike.getObjectsWithTag(2)[1]
  62.             mike.walkSO.walkToActionPoint(sofa.getActionPoint("sit1"));
  63.             
  64.             local elaine = getParent().getCharacter(ELAINE);
  65.             elaine.walkSO.walkToActionPoint(sofa.getActionPoint("sit3"));
  66.             
  67.             --getParent().getCharacter(MIKE).walkSO.walkToActionPoint(
  68.             --    getParent().getCharacter(MIKE).getObjectsWithTag(1)[1].getActionPoint("sit1")
  69.             --);
  70.             
  71.             --getParent().getCharacter(ELAINE).walkSO.walkToActionPoint(
  72.             --    getParent().getCharacter(ELAINE).getObjectsWithTag(1)[1].getActionPoint("sit3")
  73.             --);    
  74.         end )
  75.         
  76.         onMsg("enterTrigger", function(msg)
  77.             print(" ich sagte doch schon: Sackgasse!");
  78.         end )
  79.     
  80. endStateMachine()
  81.  
  82.