home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 85 / CDMM85_1.ISO / Monopoly Tycoon / MTycoonDemo.exe / data1.cab / scripts / TUTORIAL5 / hub.lua
Encoding:
Text File  |  2001-10-24  |  8.1 KB  |  199 lines

  1. PromptHeading = ID_TUTORIAL_5_OFFSET + 1
  2. g_currentprompt = 0;
  3. g_counter = 0;
  4. Tweaks.numyearsin24hours = 0;
  5.  
  6. -------------------------------------------------------------------------------------------------
  7. -- INITIALISE_Level. Standard level event
  8. -------------------------------------------------------------------------------------------------
  9. function EVENTINITIALISE_Level()
  10.     -- load the building and business file
  11.     C_RunScript("scripts\\maps\\tempmap.lua");
  12.     C_RunScript("scripts\\tutorial1\\initialpref.lua");
  13.  
  14. end;
  15.  
  16. -------------------------------------------------------------------------------------------------
  17. -- Level. Standard level event.
  18. -------------------------------------------------------------------------------------------------
  19. function EVENT_Level()
  20.     -- create an initial prompt
  21.     C_TriggerEvent("BlockCam", 1, PACIFIC_AVENUE);
  22.  
  23.     Interface.DisableAllControls();
  24.     Interface.DisableAll3DPicking();
  25.     Interface.DisableCameraControl();
  26.     -- create the initial prompt
  27.     CreatePrompt(1);
  28. end;
  29.  
  30. function CATCHEVENT_InterfacePromptDismiss(a)
  31.     CreatePrompt(a);
  32. end;
  33.  
  34. function CATCHEVENT_TutorialEvent(a)
  35.  
  36.    if g_currentprompt == 17 then
  37.         Interface.DismissPrompt();
  38.         Interface.DisableControl(TUT_BUILD_ACCEPT);
  39.     end;
  40.  
  41.    if g_currentprompt == 16 then
  42.         Interface.DismissPrompt();
  43.         Interface.DisableControl(TUT_BUILD_CHANGE_DESIGN);
  44.     end;
  45.  
  46.    if g_currentprompt == 15 then
  47.         Interface.DismissPrompt();
  48. --        Interface.DisableControl(TUT_BUILD_QUALITY_LOW);
  49. --        Interface.DisableControl(TUT_BUILD_QUALITY_MED);
  50. --        Interface.DisableControl(TUT_BUILD_QUALITY_HIGH);
  51.     end;
  52.  
  53.  
  54.    if g_currentprompt == 14 then
  55.         Interface.DismissPrompt();
  56.         Interface.DisableControl(TUT_BUILD_CHANGE_FLOOR);
  57.     end;
  58.  
  59.  
  60.    if g_currentprompt == 11 then
  61.         Interface.DismissPrompt();
  62.         Interface.DisableAll3DPicking();
  63.     end;
  64.  
  65.    if g_currentprompt == 10 then
  66.         Interface.DismissPrompt();
  67.         Interface.DisableControl(TUT_BUILD_SELECT_BACK_DRAG_TEXT);
  68.         Interface.DisableControl(TUT_BUILD_SELECT_BACK_DRAG_BUTTON);
  69.         Interface.DisableControl(TUT_BUILD_BACKREGION2);
  70.  
  71.     end;
  72.  
  73.    if g_currentprompt == 8 then
  74.         Interface.DismissPrompt();
  75.         Interface.DisableAll3DPicking();
  76.     end;
  77.  
  78.    if g_currentprompt == 7 then
  79.         Interface.DismissPrompt();
  80.         Interface.DisableControl(TUT_BUILD_SELECT_USE);
  81.     end;
  82.  
  83.    if g_currentprompt == 6 then
  84.         Interface.DismissPrompt();
  85.         Interface.DisableControl(TUT_BUILD_SELECT_TYPE);
  86.     end;
  87.         
  88.     if g_currentprompt == 5 then
  89.         Interface.DismissPrompt();
  90.         Interface.DisableControl(TUT_MPP_GREENBUTTON_3);
  91.     end;
  92.  
  93.     if g_currentprompt == 2 then
  94.         Interface.DismissPrompt();
  95.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
  96.     end;
  97.  
  98.  
  99.     if g_currentprompt == 1 then
  100.         Interface.DismissPrompt();
  101.         Interface.DisableControl(TUT_TOGGLE_VIEW);
  102.     end;
  103.  
  104. end;
  105.  
  106. function CATCHEVENT_Picked3D(a)
  107.  
  108.     if a == 1 and g_currentprompt == 3 then
  109.         Interface.DismissPrompt();
  110.         Interface.DisableAll3DPicking();
  111.     end;
  112.  
  113. end;
  114.  
  115. -- SR - Added new comments to make certain aspects a little clearer, this is not represented in the document but has been discussed with JL
  116.  
  117. -- prompt manager
  118. function CreatePrompt(a)
  119.     g_currentprompt = a;
  120.     body = a+PromptHeading;
  121.  
  122.     if a == 1 then
  123.         Interface.CreateMessage(PromptHeading,body, a+1); --"Okay, let's learn how to build. First you need to find out whether you can build on a block. Click on the 'Compass' icon to goto strategic view...", a+1);
  124.         Interface.EnableControl(TUT_TOGGLE_VIEW);
  125.         Interface.AddArrow( 534, 460 );
  126.     elseif a == 2 then
  127.         Interface.CreateMessage(PromptHeading,body, a+1); --"Now click on the Building Rights button here...", a+1);
  128.         Interface.EnableControl(TUT_AERIAL_INFOBUTTON_3);
  129.         Interface.AddArrow( 100, 52 );
  130.     elseif a == 3 then
  131.         Interface.CreateMessage(PromptHeading,body, a+1); --"For this tutorial we will be building on Pacific avenue, there are no rights for this block so we can build on it...lets go back to Block mode, double click on Pacific avenue...", a+1);
  132.         Interface.PositionPrompt(0,100);
  133.         Interface.AddArrow( 459, 173);
  134.         Interface.EnableBlockPicking(PACIFIC_AVENUE);
  135.     elseif a == 4 then
  136.         Interface.CreatePrompt(PromptHeading,body, a+1); --"You can also find out whether you can build when in Block mode here...", a+1);
  137.         Interface.AddArrow( 188, 104 );
  138.     elseif a == 5 then
  139.         Interface.CreateMessage(PromptHeading,body, a+1); --"Ok lets build a building, click the Build button here...", a+1);
  140.         Interface.EnableControl(TUT_MPP_GREENBUTTON_3);
  141.         Interface.AddArrow( 30, 117 );
  142.     elseif a == 6 then
  143.         Interface.CreateMessage(PromptHeading,body, a+1); --"Now you can choose to build a Retail or Residential building. Lets choose Retail...", a+1);
  144.         Interface.EnableControl(TUT_BUILD_SELECT_TYPE);
  145.         Interface.SetTutorialType(0);        
  146.         Interface.AddArrow( 112, 66 );
  147.     elseif a == 7 then
  148.         Interface.CreateMessage(PromptHeading,body, a+1); --"Now choose the use for your building.", a+1);
  149.         Interface.EnableControl(TUT_BUILD_SELECT_USE);
  150.     elseif a == 8 then
  151.         Interface.CreateMessage(PromptHeading,body, a+1); --"Now you can click and drag the area you want the building to cover. The building must touch at least one pavement and must not overlap any other buildings. When the area is white the store is good to build, when red it is not. Release the button when the area is white. ", a+1);
  152.         Interface.EnableBlockPicking(PACIFIC_AVENUE);
  153.         Interface.PositionPrompt(0,-140);
  154.         Interface.AddArrow( 318, 220 );
  155.     elseif a == 9 then
  156.         Interface.CreatePrompt(PromptHeading,body, a+1); --"You could build this building now. Here is the cost and capacity.", a+1);
  157.         Interface.EnableControl(TUT_BUILD_QUALITY_LOW);
  158.         Interface.EnableControl(TUT_BUILD_QUALITY_MED);
  159.         Interface.EnableControl(TUT_BUILD_QUALITY_HIGH);
  160.         Interface.AddArrow( 155, 240 );
  161.     elseif a == 10 then
  162.         Interface.CreateMessage(PromptHeading,body, a+1); --"If it were too expensive you could re-drag the area you want to cover by clicking back here. Try it. ", a+1);
  163.         Interface.EnableControl(TUT_BUILD_SELECT_BACK_DRAG_TEXT);
  164.         Interface.EnableControl(TUT_BUILD_SELECT_BACK_DRAG_BUTTON);
  165.         Interface.EnableControl(TUT_BUILD_BACKREGION2);
  166.         Interface.AddArrow( 131, 110 );
  167.     elseif a == 11 then
  168.         Interface.CreateMessage(PromptHeading,body, a+1); --"Now you can drag another area.  ", a+1);
  169.         Interface.EnableBlockPicking(PACIFIC_AVENUE);
  170.         Interface.AddArrow( 318, 220 );
  171.     elseif a == 12 then
  172.         Interface.CreatePrompt(PromptHeading,body, a+1); --"Remember that you can also click on this area again to choose another use...", a+1);
  173.         Interface.AddArrow( 129, 80 );
  174.     elseif a == 13 then
  175.         Interface.CreatePrompt(PromptHeading,body, a+1); --"or here to choose the type of building...Lets stick with what we have now and see what else we can change.", a+1);
  176.         Interface.AddArrow( 129, 59 );
  177.     elseif a == 14 then
  178.         Interface.CreatePrompt(PromptHeading,body, a+1);--"On all buildings you can change the number of floors. Some buildings have only one floor level, however if you can choose the number of floors, watch how the price and capacity changes...", a+1);
  179.         Interface.EnableControl(TUT_BUILD_CHANGE_FLOOR);
  180.     
  181.         Interface.AddArrow( 114, 141 );
  182.     elseif a == 15 then
  183.         Interface.CreatePrompt(PromptHeading,body, a+1);--"You can also change the quality of the building. High quality will appeal to the richer citizens, but it will cost more to build - see the price change when you select another quality level. ", a+1);
  184.         Interface.AddArrow( 102, 170 );
  185.     elseif a == 16 then
  186.         Interface.CreatePrompt(PromptHeading,body, a+1);--"Finally, you can choose what your building should look like. Choose one of the styles if you wish... ", a+1);
  187.         Interface.EnableControl(TUT_BUILD_CHANGE_DESIGN);
  188.         Interface.AddArrow( 115, 197 );
  189.     elseif a == 17 then
  190.         Interface.CreateMessage(PromptHeading,body, a+1);--"Now you are ready to build. Check price one last time and hit the Accept button. Lets see how the building is constructed...", a+1);
  191.         Interface.EnableControl(TUT_BUILD_ACCEPT);
  192.         Interface.AddArrow( 100, 265 );
  193.     elseif a == 18 then
  194.         Interface.CreatePrompt(PromptHeading,body, a+1);--"Great. Now you know how to build! ", a+1);
  195.     elseif a == 19 then
  196.         Game.End(true);
  197.     end;
  198. end;
  199.