home *** CD-ROM | disk | FTP | other *** search
/ Knowledge Land / KNOWLEDGELA.ISO / pc / support / cmn / start.ace < prev    next >
Encoding:
Text File  |  1996-10-07  |  15.8 KB  |  497 lines

  1. [==========================================================================
  2.     START.ACE
  3.     ---------
  4.  
  5.     The application entry point.
  6. ==========================================================================]
  7.  
  8. Set the window title to "KnowledgeLand".
  9.  
  10. If platform is alphabetically equal to "Mac",
  11.     If the volume "KnowledgeLand" is mounted,
  12.         Do nothing.
  13.     Otherwise,
  14.         Make scr.  Set it to a screen.
  15.         In it,
  16.             Make a stringbox of "Please insert the KnowledgeLand CD and try again." from 200,100 to 440,380.
  17.             When keyed,
  18.                 End this program.
  19.             When downclicked,
  20.                 End this program.
  21.         Display it.
  22.  
  23. If platform is alphabetically equal to "Mac",
  24.     Set the sound channel mode to mono.
  25. Otherwise,
  26.     Set the sound channel mode to mono.
  27.     Set the sound channel mode to stereo.
  28.  
  29. [==========================================================================
  30.    FRAMEWRK.ACE
  31.    ------------
  32.  
  33.    This file activates a general application framework that facilitates
  34.    synchronous event handling, dynamic and persistent handling of user
  35.    interface controls, and a modularized code placement scheme.
  36. ==========================================================================]
  37.  
  38. Refer to LIB\FRAMEWRK.ACE.
  39.  
  40. // INI file initialization
  41. Initialize with section "land".
  42.  
  43. If platform is "Mac",
  44.     // Mac initialization
  45.     Set CD root to volume currentInisection's cdRoot.
  46.  
  47. Make ah.  Set it to fooCDRoot.
  48. Append "\\DEMO" to ah.
  49. Set currentIniSection's alternateHome to ah.
  50.  
  51. // Prepare directory preloading
  52. Don't preload the $ProductCDRoot\FMAV0011 directory.
  53. Don't preload the $ProductCDRoot\FMR01ENG\AMBIENCE directory.
  54. Don't preload the $ProductCDRoot\FMR01ENG\NARRATE directory.
  55. Don't preload the $ProductCDRoot\FMR01ENG\CARDS\LARGE directory.
  56. Don't preload the $ProductCDRoot\FMR01ENG\CARDS\MEDIUM directory.
  57. Don't preload the $ProductCDRoot\FMR01ENG\CARDS\TEXT directory.
  58. Don't preload the $ProductCDRoot\FMR01ENG\COMMON directory.
  59. Don't preload the $ProductCDRoot\FMR01ENG\DIALOG directory.
  60. Don't preload the $ProductCDRoot\FMR01ENG\MOVIE directory.
  61.  
  62. // Initialize text-to-speech
  63. In system,
  64.     Make TTS.  Set it to currentInisection's TTS.
  65.     If TTS is "yes",
  66.         Record that system is TTSEnabled.
  67.         Record that system is TTS.
  68.         Initialize the text to speech code.
  69.     Otherwise,
  70.         Record that system is not TTSEnabled.
  71.         Record that system is not TTS.
  72.  
  73. If system is TTS,
  74.     Record that system is not ambience.
  75. Otherwise,
  76.     Record that system is ambience.
  77.  
  78. If currentInisection's voiceOver is "yes",
  79.     Record that system is voiceActive.
  80. Otherwise,
  81.     Record that system is not voiceActive.
  82.  
  83. // Inititalize the spellchecker
  84. Refer to COM\SPELL.ACE.
  85. Initialize spellcheck.
  86.  
  87. // Initialize run-time resource path
  88. Change CD resource bale to "R01".
  89.  
  90. // Initialize run-time data path
  91. Change HD data bale to "D01".
  92. Record that system is ReadingDataFromHD.
  93.  
  94. // Set default cursor
  95. Set cursorBitmap to the CD resource "CMP\\C_NW.CMP".
  96.  
  97. // Set up the application screen
  98. Refer to COM\FMSCREEN.ACE.
  99. Set mainScreen to a fatmanScreen.
  100. Put up mainScreen.
  101.  
  102. // Set a default state.
  103. Record that system is not loggedIn.
  104.  
  105. // Create global object to represent the user
  106. Refer to COM\USER.ACE.
  107. In system,
  108.     Make TheUser.
  109.  
  110. If currentIniSection's firstTime is "no",
  111.     Record that system is not firstTime.
  112. Otherwise,
  113.     Record that system is firstTime.
  114.     Set currentInisection's firstTime to "no".
  115.  
  116. // DUMMY
  117. // Create a dummy user for testing
  118. If FirstModule != "intro" AND FirstModule != "login",
  119.     Set system's TheUser to a UserData of "DUMMYUSR.DAT".
  120.  
  121. //
  122. // Set up the master kCard deck(s)
  123. //
  124. In system,
  125.     Make masterDeck. Set it to an array of the data "CARD0000.DAT".
  126.  
  127. [==========================================================================
  128. Code related to module switching.
  129. ==========================================================================]
  130. // Set up module stack
  131. In system,
  132.     Make ModuleStack.
  133.  
  134. // Module entry/exit functions
  135. To enter module a string 's' from module a string 't',
  136.     Add t to ModuleStack.
  137.     Enter module s.
  138.  
  139. To return to previous module,
  140.     Make n.  Set it to the number of strings in moduleStack.
  141.     If n > 0,
  142.         Make m.  Set it to moduleStack's string # n.
  143.         Detach moduleStack's string # n.
  144.         Enter module m.
  145.  
  146. To clear module stack,
  147.     While the number of strings in moduleStack > 0,
  148.         Detach moduleStack's string.
  149.  
  150. To show mempool use,
  151.     If currentinisection's foo is "yes",
  152.         Make s.  Set it to "Mempool used:  ".
  153.         Print the number of mempool bytes used to s.
  154.         Append "   Mempool unused:  " to s.
  155.         Print the number of unused mempool bytes to s.
  156.         Print s.
  157.  
  158. Record that system is not tracing.
  159. To begin trace,
  160.     If currentIniSection's trace is "yes",
  161.         Record that system is tracing.
  162.         Turn tracing on.
  163.  
  164. To end trace,
  165.     If currentIniSection's trace is "yes",
  166.         Record that system is not tracing.
  167.         Turn tracing off.
  168.  
  169. To pause trace,
  170.     If system is tracing,
  171.         Turn tracing off.
  172.  
  173. To resume trace,
  174.     If system is tracing,
  175.         turn tracing on.
  176.  
  177.  
  178. To clean up after modules,
  179.     Make t0.  Set it to now.
  180.     While the number of modules in mainScreen > 0,
  181.         If keyfocus exists in mainScreen's module,
  182.             Set mainScreen's module's keyfocus to 0.
  183.         If clientlink exists in mainscreen's module,
  184.             Set mainScreen's module's clientlink to 0.
  185.         If selectedcontrol exists in system,
  186.             Set system's selectedcontrol to 0.
  187.         Set linkscleaned to 0.
  188.         Clean links in mainScreen's module in mainScreen's module.
  189.         //print linkscleaned.
  190.         //Clean links in rooms in mainScreen's module.
  191.         //print linkscleaned.
  192.         //Clean links in system.
  193.         //print linkscleaned.
  194.         Deep detach [with debugging] mainScreen's module.
  195.     // print now - t0.
  196.  
  197. // Module switcher,
  198. To enter module a string 's',
  199.  
  200.     Stop voiceLoop.
  201.     Stop mediaPlayer.
  202.  
  203.     For each module 'm' in mainScreen,
  204.         hide m.
  205.  
  206.     clean up after modules.
  207.  
  208.     If system is indemo,
  209.         Fade mainScreen from black in 1 second.
  210.  
  211.     If s is "hand",
  212.         Activate hand construction interface.
  213.         Do nothing.
  214.     Otherwise if s is "trade",
  215.         Activate trade negotiation interface.
  216.         Do nothing.
  217.     Otherwise if s is "scrapbook",
  218.         Activate scrapbook interface.
  219.         Do nothing.
  220.     Otherwise if s is "login",
  221.         Activate login interface.
  222.         Start voiceLoop.
  223.         Do nothing.
  224.     Otherwise if s is "avatar",
  225.         Activate avatar selector interface.
  226.         Start voiceLoop.
  227.         Do nothing.
  228.     Otherwise if s is "profile",
  229.         Activate profile interface.
  230.         Start voiceLoop.
  231.         Do nothing.
  232.     Otherwise if s is "profiledisplay",
  233.         Activate profile display interface.
  234.         Start voiceLoop.
  235.         Do nothing.
  236.     Otherwise if s is "empty",
  237.         Activate empty screen.
  238.     Otherwise if s is "intro",
  239.         Fade in.
  240.         Enter introduction screen.
  241.     Otherwise if s is "demopk",
  242.         Activate slideShow of "pkslide.dat".
  243.     Otherwise if s is "demo3g",
  244.         Activate slideShow of "3gslide.dat".
  245.     Otherwise if s is "demo4g",
  246.         Activate slideShow of "4gslide.dat".
  247.     Otherwise if s is "twdemo",
  248.         Activate toddler demo.
  249.         Do nothing.
  250.     Otherwise if s is "psdemo",
  251.         Activate preschool demo.
  252.         Do nothing.
  253.     Otherwise if s is "avatarViewer",
  254.         Display avatar viewer with avatar theUser's playerAvatar.
  255.     Otherwise if s is "credits",
  256.         Activate slideShow of "credits.dat".
  257.     Otherwise if s is "map",
  258.         Activate map module.
  259.     Otherwise,
  260.         Activate main navigation interface.  // Default!
  261.  
  262.  
  263.     //Fade in.
  264.     // ...
  265.  
  266. Record that system is not black.
  267. [
  268. // Fade stuffs
  269. To fade out,
  270.     Wait until the next cycle.
  271.  
  272.     //pause trace.
  273.     If system is not black,
  274.         Record that system is black.
  275.         //Hide for fade in mainScreen.
  276.         Fade mainScreen to black in 1 second.
  277.         Wait until the next cycle.
  278.     //resume trace.
  279.  
  280. To fade in,
  281.     //pause trace.
  282.     If system is black,
  283.         Fade mainscreen from black in 1 second.
  284.         Record that system is not black.
  285.     Wait until the next cycle.
  286.     //resume trace.
  287. ]
  288.  
  289. // Exit with cleanup
  290. To exit this program,
  291.     If system is not demoing,
  292.         If system is connected,
  293.             Disconnect from server.
  294.             Record that system is not connected.
  295.     Terminate spellCheck.
  296.     If ttslib exists in system,
  297.         Shutdown the text to speech code.
  298.     End this program.
  299.  
  300. // ?
  301. In system,
  302.     Make program.  Set it to "".
  303.  
  304. To activate empty screen,
  305.  
  306.     In mainScreen,
  307.         Make a module.
  308.         In it,
  309.             Make a rectangle from 0,0 to 640,480.
  310.             In it,
  311.                 When downclicked,
  312.                     Return to previous module.
  313.     Wait until the next cycle.
  314.     Launch "aner.exe ltest.pac".
  315.  
  316.  
  317.  
  318. [==========================================================================
  319. CONTROLS used in the application.
  320. ==========================================================================]
  321. Refer to LIB\CPANEL.ACE.
  322. Refer to LIB\CSTRING.ACE.
  323. Refer to LIB\CPICTURE.ACE.
  324. Refer to LIB\CVIEW.ACE.
  325. Refer to LIB\CVALUE.ACE.
  326. Refer to LIB\CSLIDER.ACE.
  327. Refer to LIB\CSCROLL.ACE.
  328. Refer to LIB\CLISTBOX.ACE.
  329. Refer to LIB\CEDIT.ACE.
  330. Refer to LIB\CDIALOG.ACE.
  331. Refer to LIB\CPASSWD.ACE.
  332. Refer to LIB\CNET.ACE.
  333.  
  334. // Modules
  335. // -------
  336.  
  337. [==========================================================================
  338. To compile a specific module, comment out all the other modules and any
  339. irrelevant controls.  Also, set the 'FIRSTMODULE' field of the KA.INI
  340. file to point to that module.
  341. ==========================================================================]
  342. Refer to MOD\INTRO\INTRO.ACE.
  343. Refer to MOD\MAIN\MAIN.ACE.
  344. Refer to MOD\MAIN\MAP.ACE.
  345. Refer to MOD\LOGIN\LOGIN.ACE.
  346. Refer to MOD\AVATAR\AVTSEL.ACE.
  347. Refer to MOD\PROFILE\PROFILE.ACE.
  348. Refer to MOD\HAND\HAND.ACE.     // Hand construction interface
  349. Refer to MOD\TRADE\TRADE.ACE.   // Trade negotiation interface
  350. Refer to MOD\SCRAP\SCRAP.ACE.   // Scrapbook browsing interface
  351.  
  352. [==========================================================================
  353. Demos
  354. ==========================================================================]
  355. Refer to DEMOS\KG\KG.ACE.
  356. Refer to DEMOS\1G\1G.ACE.
  357. Refer to DEMOS\2G\2G.ACE.
  358. Refer to DEMOS\PSDEMO\PS.ACE.
  359. Refer to DEMOS\TWDEMO\TW.ACE.
  360. Refer to SLIDESHO\SLIDESHO.ACE.
  361.  
  362. Record that system is not demorelative.
  363. Record that system is not indemo.
  364.  
  365. To execute demo a number 'n',
  366.     Kill ambience sound.
  367.     //Fade in.
  368.     If system is connected,
  369.         Send "X" to IP Connection.
  370.     Fade out.
  371.     Make d.  Set it to the current directory.
  372.     If d is a string,
  373.         If n = 1,
  374.             Launch kindergarden.
  375.         If n = 2,
  376.             Launch firstgrade.
  377.         If n = 3,
  378.             Launch secondgrade.
  379.         If n = 4,
  380.             Launch preschool.
  381.         If n = 5,
  382.             Launch toddlers.
  383.     Otherwise,
  384.         Log "Error getting current directory.".
  385.     Wait for 5 seconds.
  386.     Fade in.
  387.     Show things hidden for fade in mainScreen's module.
  388.  
  389. In system,
  390.     Make voiceloop.  Set it to a player of the script:
  391.         Make t0.  Set it to now.
  392.         Make t1.
  393.         Repeat:
  394.             Wait until the next cycle.
  395.             If mediaPlayer is running,
  396.                 stop mediaPlayer.
  397.             If mediaShield exists in mainScreen,
  398.                 Detach mainScreen's mediaShield.
  399.  
  400.             Set t1 to now.
  401.             If t1 - t0 >= 30 seconds,
  402.                 If mediaplayer is not running,
  403.                     If mainScreen's module is a loginModule,
  404.                         play voice over "NARRATE\\SIEXIT.SND".
  405.                     Otherwise,
  406.                         if MainScreen's module is an avatarModule,
  407.                             play voice over "NARRATE\\ASINACT.SND".
  408.                             Wait until mediaplayer is not running.
  409.                             play voice over "NARRATE\\ASCHOO.SND".
  410.                             Wait until mediaplayer is not running.
  411.                             play voice over "NARRATE\\ASDONE.SND".
  412.                     Otherwise,
  413.                         If MainScreen's module is a profileEntryModule,
  414.                             Play voice over "NARRATE\\IDINACT.SND".
  415.                 Set t0 to now.
  416.     .
  417.  
  418. Make helpfile.  Set it to fooCDRoot.
  419. Append "\\KLAND.HLP" to helpfile.
  420. Set the help file to helpfile.
  421.  
  422. Record that system is black.
  423. //
  424. // Enter main navigation module
  425. //
  426. Enter module FirstModule.
  427.  
  428. // $Log: START.ACE $
  429. // Revision 1.54  1996/10/07 03:15:31  Quoc
  430. // Revision 1.53  1996/10/02 13:56:26  Quoc
  431. // Revision 1.51  1996/09/29 04:45:39  Quoc
  432. // Revision 1.49  1996/09/27 09:41:05  Quoc
  433. // Revision 1.48  1996/09/26 12:05:31  Quoc
  434. // Revision 1.47  1996/09/25 01:38:27  Quoc
  435. // Revision 1.46  1996/09/24 17:58:54  Quoc
  436. // Revision 1.45  1996/09/23 05:55:54  Quoc
  437. // Revision 1.44  1996/09/20 08:08:05  Quoc
  438. // Revision 1.43  1996/09/16 11:21:19  Quoc
  439. // Revision 1.42  1996/09/16 09:31:57  Quoc
  440. // Revision 1.41  1996/09/15 23:29:25  SCOTTR
  441. // integrated ace demos for preschool and toddler
  442. // Revision 1.40  1996/09/15 17:03:30  Quoc
  443. // Revision 1.39  1996/09/13 20:50:14  Quoc
  444. // Revision 1.38  1996/09/11 19:05:11  Quoc
  445. // Revision 1.36  1996/09/04 16:10:25  SCOTTR
  446. // Add launch points for SlideShow demos
  447. // Revision 1.35  1996/09/04 19:13:02  Quoc
  448. // Revision 1.34  1996/08/31 14:28:09  Quoc
  449. // Revision 1.33  1996/08/26 09:27:37  Quoc
  450. // Revision 1.32  1996/08/25 20:14:49  Quoc
  451. // Revision 1.31  1996/08/20 21:35:42  SCOTTR
  452. // Sync MasterDeck usage with new kCard format
  453. // Revision 1.30  1996/08/20 22:38:32  Quoc
  454. // Revision 1.29  1996/08/15 15:31:21  Quoc
  455. // Revision 1.28  1996/08/12 13:56:26  Quoc
  456. // Revision 1.27  1996/08/05 18:10:58  Quoc
  457. // Revision 1.26  1996/08/02 20:55:25  Quoc
  458. // Revision 1.25  1996/07/26 18:59:51  Quoc
  459. // Revision 1.24  1996/07/22 22:39:53  Quoc
  460. // Revision 1.23  1996/07/22 08:29:42  Quoc
  461. // Revision 1.22  1996/07/22 01:17:03  Quoc
  462. // Revision 1.21  1996/07/20 01:49:59  Quoc
  463. // Revision 1.20  1996/07/20 01:34:08  Quoc
  464. // Revision 1.19  1996/07/19 23:23:51  Quoc
  465. // Revision 1.18  1996/07/08 10:12:16  Quoc
  466. // Profile sent to server
  467. // Revision 1.17  1996/07/08 02:54:04  Quoc
  468. // Revision 1.16  1996/07/06 05:14:59  Quoc
  469. // Revision 1.15  1996/07/06 00:42:00  Quoc
  470. // Revision 1.14  1996/07/01 16:01:13  Quoc
  471. // Alpha
  472. // Revision 1.13  1996/06/30 19:11:44  SCOTTR
  473. // Another Alpha.
  474. // Set up user environment on login. Fix various bugs exposed by that.
  475. // Revision 1.12  1996/07/01 02:10:07  Quoc
  476. // Revision 1.11  1996/06/24 23:05:05  Quoc
  477. // Revision 1.10  1996/06/22 04:35:54  Quoc
  478. // Pre-pre alpha2
  479. // Revision 1.9  1996/06/12 23:47:25  SCOTTR
  480. // Changes to use named members in control definition arrays.
  481. // Revision 1.8  1996/06/12 14:57:26  Quoc
  482. // Named member data
  483. // Revision 1.7  1996/06/10 16:03:10  SCOTTR
  484. // Add lines to create TheUser object and load it from DAT file
  485. // Revision 1.6  1996/06/06 00:34:35  SCOTTR
  486. // Add Refers and module switches for Trade and Scrapbook
  487. // Revision 1.5  1996/05/31 23:52:55  Quoc
  488. // Revision 1.4  1996/05/30 21:44:28  Quoc
  489. // New module switcher with default to main.
  490. // Revision 1.3  1996/05/30 21:37:31  Quoc
  491. // New, string-based module switcher with first module settable in ini
  492. // file.
  493. // Revision 1.2  1996/05/23 20:40:58  Quoc
  494. // First incorporation of run-time path resolution for data and
  495. // resources.
  496. // Revision 1.1  1996/05/23 19:27:27  Quoc
  497.