home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 85 / CDMM85_1.ISO / Monopoly Tycoon / MTycoonDemo.exe / data1.cab / scripts / TUTORIAL3 / hub.lua < prev    next >
Encoding:
Text File  |  2001-10-24  |  9.5 KB  |  230 lines

  1. PromptHeading = ID_TUTORIAL_3_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. end;
  14.  
  15. -------------------------------------------------------------------------------------------------
  16. -- Level. Standard level event.
  17. -------------------------------------------------------------------------------------------------
  18. function EVENT_Level()
  19.     -- create an initial prompt
  20.     C_TriggerEvent("BlockCam", 1, PACIFIC_AVENUE);
  21.     -- Game.Unpause();
  22.     Interface.DisableAllControls();
  23.     Interface.DisableAll3DPicking();
  24.     Interface.DisableCameraControl();
  25.     -- create the initial prompt
  26.     CreatePrompt(1);
  27. end;
  28.  
  29. function CATCHEVENT_InterfacePromptDismiss(a)
  30.     CreatePrompt(a);
  31. end;
  32.  
  33. function CATCHEVENT_TutorialEvent(a)
  34.  
  35.     if g_currentprompt == 15 then
  36.         Interface.DismissPrompt();
  37.         Interface.DisableAll3DPicking();
  38.     end;
  39.  
  40.     if g_currentprompt == 14 then
  41.         Interface.DismissPrompt();
  42.         Interface.DisableControl(TUT_AERIAL_BUTTON_4);
  43.     end;
  44.  
  45.     if g_currentprompt == 13 then
  46.         Interface.DismissPrompt();
  47.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
  48.     end;
  49.  
  50.     if a ~= TUT_AERIAL_INFOBUTTON_2 then
  51.     if g_currentprompt == 12 then
  52.         Interface.DismissPrompt();
  53. --        Interface.DisableControl(TUT_AERIAL_BUSINESS_LOCATOR);
  54.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
  55.     end;
  56.     end;
  57.  
  58.     if g_currentprompt == 11 then
  59.        Interface.DismissPrompt();
  60.         Interface.DisableControl(TUT_MPP_INFOBUTTON_2);
  61.     end;
  62.  
  63.     if g_currentprompt == 10 then
  64.        Interface.DismissPrompt();
  65.         Interface.DisableControl(TUT_TOGGLE_VIEW);
  66.     end;
  67.  
  68.     if a == TUT_HYPERLINK then
  69.       if g_currentprompt == 9 then
  70.           Interface.DismissPrompt();
  71.           Interface.DisableControl(TUT_AERIAL_LOCATOR_LISTMYBUSINESS);
  72.         end;
  73.     end;
  74.  
  75.     if g_currentprompt == 8 then
  76.        Interface.DismissPrompt();
  77.         Interface.DisableControl(TUT_MPP_GREENBUTTON_3);
  78.     end;
  79.  
  80.     if a ~= TUT_AERIAL_INFOBUTTON_1 and
  81.        a ~= TUT_AERIAL_INFOBUTTON_2 and
  82.         a ~= TUT_AERIAL_INFOBUTTON_3 and
  83.         a ~= TUT_AERIAL_INFOBUTTON_4 and
  84.         a ~= TUT_AERIAL_INFOBUTTON_5 and
  85.         a ~= TUT_AERIAL_INFOBUTTON_6 then
  86.         if g_currentprompt == 7 then
  87.             Interface.DismissPrompt();
  88.             Interface.DisableControl(TUT_AERIAL_INFOBUTTON_1);
  89.             Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
  90.             Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
  91.             Interface.DisableControl(TUT_AERIAL_INFOBUTTON_4);
  92.             Interface.DisableControl(TUT_AERIAL_INFOBUTTON_5);
  93.             Interface.DisableControl(TUT_AERIAL_INFOBUTTON_6);
  94.         end;
  95.     end;
  96.  
  97.     if g_currentprompt == 6 then
  98.         Interface.DismissPrompt();
  99.         Interface.DisableControl(TUT_AERIAL_BUTTON_2);
  100.     end;
  101.  
  102.     if a ~= TUT_AERIAL_INFOBUTTON_1 and
  103.        a ~= TUT_AERIAL_INFOBUTTON_2 and
  104.         a ~= TUT_AERIAL_INFOBUTTON_3 and
  105.         a ~= TUT_AERIAL_INFOBUTTON_4 then
  106.         if g_currentprompt == 5 then
  107.                 Interface.DismissPrompt();
  108.                 Interface.DisableControl(TUT_AERIAL_INFOBUTTON_1);
  109.                 Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
  110.                 Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
  111.                 Interface.DisableControl(TUT_AERIAL_INFOBUTTON_4);
  112.             end;
  113.     end;
  114.  
  115.     if g_currentprompt == 1 then
  116.         Interface.DismissPrompt();
  117.         Interface.DisableControl(TUT_TOGGLE_VIEW);
  118.     end;
  119.  
  120. end;
  121.  
  122. function CATCHEVENT_Picked3D(a)
  123.  
  124.     if a == 0 and g_currentprompt == 15 then
  125.         Interface.DismissPrompt();
  126.         Interface.DisableAll3DPicking();
  127.     end;
  128.  
  129. end;
  130.  
  131. -- prompt manager
  132. function CreatePrompt(a)
  133.     g_currentprompt = a;
  134.     body = PromptHeading + a;
  135.     if a == 1 then
  136.         Interface.CreateMessage(PromptHeading,body, a+1); --"Let's look in detail at the Strategic View. To do this, click on the 'Compass Button'.", a+1);
  137.         Interface.EnableControl(TUT_TOGGLE_VIEW);
  138.         Interface.AddArrow( 534, 460 );
  139.     elseif a == 2 then
  140.         Interface.CreatePrompt(PromptHeading,body, a+1); --"In the Strategic View you can see the whole city. There is a lot of information to be gleaned from this view.", a+1);
  141.         Interface.DisableAllControls();
  142.         Interface.EnableControl(TUT_PROMPT_1);
  143.         Interface.PositionPrompt(0,150);
  144.     elseif a == 3 then
  145.         Interface.CreatePrompt(PromptHeading,body, a+1); --"First, notice the dots moving around the blocks? They are people. By tracking these you can easily see which areas of the city are busy. ", a+1);
  146.     elseif a == 4 then
  147.         Interface.CreatePrompt(PromptHeading,body, a+1); --"The default mode for this panel is 'City Info'. Here you can see a breakdown of the current population of Monopoly City.", a+1);
  148.         Interface.AddArrow( 107, 154 );
  149.     elseif a == 5 then
  150.         Interface.CreatePrompt(PromptHeading,body, a+1); --"These green buttons give you access to other pieces of information; Block Prestige, Building Rights and Block Ownership. Click on them to have a look. ", a+1);
  151.         Interface.AddArrow( 83, 50 );
  152.         Interface.EnableControl(TUT_AERIAL_INFOBUTTON_1);
  153.         Interface.EnableControl(TUT_AERIAL_INFOBUTTON_2);
  154.         Interface.EnableControl(TUT_AERIAL_INFOBUTTON_3);
  155.         Interface.EnableControl(TUT_AERIAL_INFOBUTTON_4);
  156.     elseif a == 6 then
  157.         Interface.CreateMessage(PromptHeading,body, a+1); --"Click on the Player Information button. ", a+1);
  158.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_1);
  159.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
  160.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
  161.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_4);
  162.         Interface.EnableControl(TUT_AERIAL_BUTTON_2);
  163.         Interface.AddArrow( 30, 92);
  164.     elseif a == 7 then
  165.         Interface.CreatePrompt(PromptHeading,body, a+1); --"The panel now displays your top line Financial Information. You can see the other player's finances by clicking on the tokens here. Try it now.", a+1);
  166.         Interface.AddArrow( 81, 51);
  167.         Interface.EnableControl(TUT_AERIAL_INFOBUTTON_1);
  168.         Interface.EnableControl(TUT_AERIAL_INFOBUTTON_2);
  169.         Interface.EnableControl(TUT_AERIAL_INFOBUTTON_3);
  170.         Interface.EnableControl(TUT_AERIAL_INFOBUTTON_4);
  171.         Interface.EnableControl(TUT_AERIAL_INFOBUTTON_5);
  172.         Interface.EnableControl(TUT_AERIAL_INFOBUTTON_6);
  173.     elseif a == 8 then
  174.         Interface.CreateMessage(PromptHeading,body, a+1); --"Good. Now let's look the locator. Click the button...", a+1);
  175.         Interface.EnableControl(TUT_AERIAL_BUTTON_3);
  176.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_1);
  177.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
  178.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
  179.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_4);
  180.         Interface.AddArrow( 30, 115);
  181.     elseif a == 9 then
  182.         Interface.CreateMessage(PromptHeading,body, a+1); --"All of your businesses are listed here. If you click on one it will be selected and the camera will take you to it. Try it now. ", a+1);
  183.         Interface.AddArrow( 98, 120 );
  184.         Interface.DisableAllControls();
  185.         Interface.EnableControlAndChildren(TUT_AERIAL_LOCATOR_LISTMYBUSINESS);
  186.         Interface.EnableControl(TUT_PROMPT_1);
  187.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
  188.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
  189.     elseif a == 10 then
  190.         Interface.CreateMessage(PromptHeading,body, a+1); --"Cool. Let's go back to the Strategic view. Click the Compass Button.", a+1);
  191.         Interface.EnableControl(TUT_TOGGLE_VIEW);
  192.         Interface.AddArrow( 534, 460);
  193.     elseif a == 11 then
  194.         Interface.CreateMessage(PromptHeading,body, a+1); --"You can also locate certain business types. Click the Business Locator button. ", a+1);
  195.         Interface.DisableAllControls();
  196.         Interface.EnableControl(TUT_PROMPT_1);
  197.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_1);
  198.         Interface.EnableControl(TUT_AERIAL_INFOBUTTON_2);
  199.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_3);
  200.         Interface.AddArrow( 70, 52);
  201.     elseif a == 12 then
  202.         Interface.CreatePrompt(PromptHeading,body, a+1); --"Choose the business type that you want to see and click on it. All instances of the selected business type are show by a hi-light.", a+1);
  203.         Interface.EnableControl(TUT_AERIAL_BUSINESS_LOCATOR);
  204.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
  205.         Interface.AddArrow( 107, 154);
  206.     elseif a == 13 then
  207.         Interface.CreateMessage(PromptHeading,body, a+1); --"You can also locate where certain commodities are stocked using the Commodity Locator in the same way.", a+1);
  208.         Interface.EnableControl(TUT_AERIAL_INFOBUTTON_3);
  209.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_1);
  210.         Interface.DisableControl(TUT_AERIAL_INFOBUTTON_2);
  211.         Interface.AddArrow( 107, 52);
  212.     elseif a == 14 then
  213.         Interface.CreateMessage(PromptHeading,body, a+1); --"Finally, you can poll the citizens to find out what commodities they need. Select the Commission Poll button. ", a+1);
  214.         Interface.EnableControl(TUT_AERIAL_BUTTON_4);
  215.         Interface.AddArrow( 30, 145);
  216.     elseif a == 15 then
  217.         Interface.CreateMessage(PromptHeading,body, a+1); --"You will want to poll blocks where citizens are housed, as this is a door-to-door survey. Apartments are hi-lighted to make it easier to see housing locations. Select Illinois Avenue.", a+1);
  218.         Interface.PositionPrompt(0, 150 );
  219.         Interface.AddArrow( 323, 153 );
  220.         Interface.EnableBlockPicking(ILLINOIS_AVENUE);
  221.     elseif a == 16 then
  222.         Interface.CreatePrompt(PromptHeading,body, a+1); --"You can use this data to help you decide which businesses to develop. You now know all you need to use the Strategic View. ", a+1);
  223.         Interface.AddArrow( 107, 154 );
  224.     elseif a == 17 then
  225.         Game.End(true);
  226.     end;
  227. end;
  228.  
  229.  
  230.