home *** CD-ROM | disk | FTP | other *** search
/ PC Action 1997 January / PCA0197.ISO / demos / ambe / demo.exe / demo.dxr / 00006.ls < prev    next >
Encoding:
Text File  |  1996-10-18  |  3.5 KB  |  124 lines

  1. on enterFrame
  2.   global gAmberPath, gSavePath, gProjectorPath, fastLocationData, gCPU, gCDtry, testData, gMaxCDtries, killMe
  3.   if killMe = 1 then
  4.     exit
  5.   end if
  6.   set gMaxCDtries to 4
  7.   if voidp(gCDtry) then
  8.     set gCDtry to 1
  9.   end if
  10.   if gCPU = #PC then
  11.     openXLib("FileIO.x32")
  12.     set buildTest to new(xtra("FileIO"))
  13.     if not objectp(buildTest) then
  14.       alert("Sorry, couldn't create FileIO object (Has the game program been moved from its folder?)")
  15.       quit()
  16.     end if
  17.     openFile(buildTest, the pathName & "building.txt", 1)
  18.     if 1 then
  19.       set buildTest to 0
  20.       set gAmberPath to the pathName
  21.     else
  22.       set buildTest to 0
  23.       if gCDtry <= gMaxCDtries then
  24.         set cdLetter to GetCDletter("amber_jb.", 1)
  25.         if stringp(cdLetter) then
  26.           set gAmberPath to char 1 to 2 of cdLetter & "\"
  27.           put "gAmberPath = "
  28.           put gAmberPath
  29.         else
  30.           put cdLetter
  31.           if gCDtry < gMaxCDtries then
  32.             alert("Please insert the " & QUOTE & "AMBER: Journeys Beyond, Disc B" & QUOTE & " CD into any drive")
  33.           else
  34.             alert("Sorry, the CD doesn't seem to be mounted")
  35.           end if
  36.         end if
  37.       end if
  38.       if gCDtry = gMaxCDtries then
  39.         put "gAmberPath =" & gAmberPath
  40.         if voidp(gAmberPath) then
  41.           put "<#PC> OK, now I'd really quit.."
  42.           delay(120)
  43.           put "quitting now?"
  44.           quit()
  45.           set killMe to 1
  46.           put "Hm.. should've quit by now.."
  47.         end if
  48.       end if
  49.     end if
  50.   else
  51.   end if
  52.   set gCDtry to gCDtry + 1
  53.   set gProjectorPath to the pathName
  54.   if stringp(gAmberPath) then
  55.     set oldDelim to the itemDelimiter
  56.     if gCPU = #Mac then
  57.       set the itemDelimiter to ":"
  58.     end if
  59.     if gCPU = #PC then
  60.       set the itemDelimiter to "\"
  61.     end if
  62.     set buildFlag to 0
  63.     if gCPU = #PC then
  64.       set buildTest to new(xtra("FileIO"))
  65.       if not objectp(buildTest) then
  66.         alert("Sorry, couldn't create FileIO object (Has the game program been moved from its folder?)")
  67.         quit()
  68.       end if
  69.       openFile(buildTest, the pathName & "building.txt", 1)
  70.       if error(buildTest, status(buildTest)) = "OK" then
  71.         closefile(buildTest)
  72.         set buildFlag to 1
  73.       end if
  74.       set buildTest to 0
  75.     else
  76.       if item 1 of gProjectorPath <> "Jumbo" then
  77.         set buildFlag to 1
  78.       end if
  79.     end if
  80.     if buildFlag = 0 then
  81.       if item 1 of gProjectorPath = item 1 of gAmberPath then
  82.       end if
  83.     end if
  84.     set the itemDelimiter to oldDelim
  85.   end if
  86.   if gCPU = #PC then
  87.     set gSavePath to the pathName & "SAVEDATA\"
  88.   else
  89.     set gSavePath to the pathName & "saved games:"
  90.   end if
  91.   put "gSavePath = " & gSavePath
  92.   set fastLocationData to 1
  93. end
  94.  
  95. on exitFrame
  96.   global gAmberPath, gMaxCDtries, gCDtry, gCPU, gProjectorPath
  97.   if voidp(gAmberPath) then
  98.     if gCDtry <= gMaxCDtries then
  99.       if integerp(gCDtry) then
  100.         go(the frame)
  101.       end if
  102.       return 
  103.       put "ΓÇó You shouldn't see this!"
  104.     else
  105.       exit
  106.     end if
  107.   end if
  108.   put "old searchPath = "
  109.   put the searchPath
  110.   append(the searchPath, gAmberPath)
  111.   if gCPU = #PC then
  112.     set tempSoundPath to gProjectorPath & "GAMEDATA\"
  113.     set logoPath to gAmberPath & "ROXY\MOVIES\"
  114.   else
  115.     set tempSoundPath to gProjectorPath & "sounds etc.:"
  116.     set logoPath to gAmberPath & "ROXY:movies:"
  117.   end if
  118.   append(the searchPath, tempSoundPath)
  119.   append(the searchPath, logoPath)
  120.   put "new searchPath (going to HUB) = "
  121.   put the searchPath
  122.   go(1, "AMBERHUB")
  123. end
  124.